diff --git a/deploy/chart/authhub/values.yaml b/deploy/chart/authhub/values.yaml index 59caf253d5725ae69a3d9d88f55c926ffca18063..d57d9b38754dca45ad3165e5b75277a8d5679148 100644 --- a/deploy/chart/authhub/values.yaml +++ b/deploy/chart/authhub/values.yaml @@ -16,7 +16,7 @@ storage: domain: # AuthHub域名,默认为127.0.0.1 - authhub: 127.0.0.1 + authhub: # 部署AuthHub本地鉴权服务 authhub: diff --git a/deploy/scripts/7-install-authhub/install_authhub.sh b/deploy/scripts/7-install-authhub/install_authhub.sh index 38a87bc877952c07c28274b6caf5f7d96f1e16c5..b01f74fa5cf2482d8a0f03804ccf742a7e105501 100755 --- a/deploy/scripts/7-install-authhub/install_authhub.sh +++ b/deploy/scripts/7-install-authhub/install_authhub.sh @@ -101,12 +101,8 @@ get_authhub_address() { if [[ -z "$authhub_address" ]]; then authhub_address="$default_address" echo -e "${GREEN}使用默认地址:${authhub_address}${NC}" - else - echo -e "${GREEN}输入地址:${authhub_address}${NC}" fi - # 返回用户输入的地址 - echo "$authhub_address" return 0 } @@ -182,7 +178,7 @@ main() { echo -e "\n${GREEN}=========================" echo -e "Authhub 部署完成!" echo -e "查看pod状态:kubectl get pod -n euler-copilot" - echo -e "Authhub登录地址为: https://${authhub_address}:30081" + echo -e "Authhub登录地址为: http://${authhub_address}:30081" echo -e "默认账号密码: administrator/changeme" echo -e "=========================${NC}" } diff --git a/deploy/scripts/8-install-EulerCopilot/install_eulercopilot.sh b/deploy/scripts/8-install-EulerCopilot/install_eulercopilot.sh index a3d08766b953df532f13944067596eb19f13b4d2..7061ae47843fbc2230b15712b7160cf48b2d36a8 100755 --- a/deploy/scripts/8-install-EulerCopilot/install_eulercopilot.sh +++ b/deploy/scripts/8-install-EulerCopilot/install_eulercopilot.sh @@ -82,38 +82,16 @@ get_network_ip() { # 处理域名/主机输入 get_host_input() { # 从环境变量读取或使用默认值 - eulercopilot_host=${EULERCOPILOT_HOST:-"127.0.0.1"} - + eulercopilot_address=${EULERCOPILOT_HOST:-"127.0.0.1"} # 交互模式允许用户输入 if [ -t 0 ]; then # 仅在交互式终端显示提示 - echo -e "${BLUE}请输入 EulerCopilot 的访问IP或域名(默认:$eulercopilot_host):${NC}" - read -p "> " input_euler - [ -n "$input_euler" ] && eulercopilot_host=$input_euler - fi - - # 验证输入格式(支持IP和域名) - local ip_regex='^([0-9]{1,3}\.){3}[0-9]{1,3}$' - local host_regex='^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$' - - if ! [[ $eulercopilot_host =~ $ip_regex ]] && ! [[ $eulercopilot_host =~ $host_regex ]]; then - echo -e "${RED}错误:无效的IP地址或域名格式${NC}" >&2 - exit 1 - fi - - # 如果是IP地址,检查每部分是否在0-255范围内 - if [[ $eulercopilot_host =~ $ip_regex ]]; then - local IFS='.' - read -ra ip_parts <<< "$eulercopilot_host" - for part in "${ip_parts[@]}"; do - if (( part < 0 || part > 255 )); then - echo -e "${RED}错误:IP地址各部分必须在0-255之间${NC}" >&2 - exit 1 - fi - done + echo -e "${BLUE}请输入 EulerCopilot 的访问IP或域名(默认:$eulercopilot_address):${NC}" + read -p "EulerCopilot 地址: " eulercopilot_address + [ -n "$input_euler" ] && eulercopilot_address=$eulercopilot_address fi echo -e "${GREEN}使用配置:" - echo "EulerCopilot的访问地址: $eulercopilot_host" + echo "EulerCopilot的访问地址: $eulercopilot_address" echo -e "${NC}" } @@ -122,9 +100,9 @@ get_client_info_auto() { # 创建临时文件 local temp_file temp_file=$(mktemp) - + # 直接调用Python脚本并传递域名参数 - python3 "${DEPLOY_DIR}/scripts/9-other-script/get_client_id_and_secret.py" "${eulercopilot_host}" > "$temp_file" 2>&1 + python3 "${DEPLOY_DIR}/scripts/9-other-script/get_client_id_and_secret.py" "${eulercopilot_address}" > "$temp_file" 2>&1 # 检查Python脚本执行结果 if [ $? -ne 0 ]; then @@ -256,7 +234,7 @@ modify_yaml() { set_args+=( "--set" "login.client.id=${client_id}" "--set" "login.client.secret=${client_secret}" - "--set" "login.host=${eulercopilot_host}" + "--set" "login.host=${eulercopilot_address}" "--set" "login.authhub_web_nodePort=30081" ) @@ -378,10 +356,10 @@ main() { # 交互式提示优化 if [ -t 0 ]; then echo -e "${YELLOW}是否保留现有的模型配置?${NC}" - echo -e " ${BLUE}Y) 保留现有配置${NC}" - echo -e " ${BLUE}n) 使用默认配置${NC}" + echo -e " ${BLUE}Yy) 保留现有配置${NC}" + echo -e " ${BLUE}Nn) 使用默认配置${NC}" while true; do - read -p "请选择(Y/N): " input_preserve + read -p "请选择(Yy/Nn): " input_preserve case "${input_preserve:-Y}" in [YyNn]) preserve_models=${input_preserve:-Y}; break ;; *) echo -e "${RED}无效输入,请选择Y或n${NC}" ;; @@ -392,7 +370,7 @@ main() { fi echo -e "${BLUE}开始修改YAML配置...${NC}" - modify_yaml "$eulercopilot_host" "$preserve_models" + modify_yaml $host $preserve_models echo -e "${BLUE}开始Helm安装...${NC}" execute_helm_install "$arch" @@ -411,24 +389,23 @@ show_success_message() { local arch=$2 - echo -e "\n${GREEN}==================================================${NC}" - echo -e "${GREEN} EulerCopilot 部署完成! ${NC}" - echo -e "${GREEN}==================================================${NC}" + echo -e "\n${GREEN}==================================================" + echo -e " EulerCopilot 部署完成! " - echo -e "${YELLOW}访问信息:${NC}" - echo -e "EulerCopilot UI: http://${eulercopilot_host}:30080" - echo -e "AuthHub 管理界面: http://${eulercopilot_host}:30081" + echo -e "访问信息:" + echo -e "EulerCopilot UI: http://${eulercopilot_address}:30080" - echo -e "\n${YELLOW}系统信息:${NC}" + echo -e "系统信息:" echo -e "内网IP: ${host}" echo -e "系统架构: $(uname -m) (识别为: ${arch})" echo -e "插件目录: ${PLUGINS_DIR}" echo -e "Chart目录: ${DEPLOY_DIR}/chart/" - echo -e "${BLUE}操作指南:${NC}" + echo -e "操作指南:" echo -e "1. 查看集群状态: kubectl get all -n $NAMESPACE" echo -e "2. 查看实时日志: kubectl logs -n $NAMESPACE -f deployment/$NAMESPACE" echo -e "3. 查看POD状态:kubectl get pods -n $NAMESPACE" + echo -e "==================================================${NC}" } main "$@"