update pwd change

This commit is contained in:
wjqserver 2025-06-22 17:23:41 +08:00
parent b91daad8ad
commit 47b6f4903f
13 changed files with 572 additions and 90 deletions

View file

@ -55,11 +55,10 @@ After=network.target network-online.target
Requires=network-online.target
[Service]
Type=notify
Type=exec
User=root
Group=root
ExecStart=/root/data/caddy/caddydash -c ./config/config.toml
ExecReload=/root/data/caddy/caddydash
WorkingDirectory=/root/data/caddy
TimeoutStopSec=5s
LimitNOFILE=1048576
@ -85,11 +84,10 @@ After=network.target network-online.target
Requires=network-online.target
[Service]
Type=notify
Type=exec
User=root
Group=root
ExecStart=/root/data/caddy/caddydash -c ./config/config.toml
ExecReload=/root/data/caddy/caddydash
WorkingDirectory=/root/data/caddy
TimeoutStopSec=5s
LimitNOFILE=1048576
@ -107,22 +105,6 @@ EOF
echo -e "${green}>${white} $mikublue CaddyDash 用户名: ${username}" $white
echo -e "${green}>${white} $mikublue CaddyDash 密码: ${password}" $white
}
# 选择安装模式
echo -e "${green}>${white} $mikublue 选择安装模式" $white
echo -e "${green}1.${white} $mikublue 不使用环境变量配置用户名密码" $white
echo -e "${green}2.${white} $mikublue 使用环境变量配置用户名密码" $white
read -p "请输入选项 [1/2]: " install_mode
if [[ "$install_mode" == "2" ]]; then
read -p "请输入CaddyDash用户名: " caddydash_username
writeSystemdServiceWithPasswdEnv "$caddydash_username"
else
writeSystemdServiceNoEnv
fi
}
# 显示免责声明
@ -160,7 +142,7 @@ mkdir -p /root/data/caddy/config
echo -e "${green}>${white} $mikublue 下載主程序" $white
input_version="$@" #获取输入的版本号
if [ -z "$input_version" ]; then
VERSION=$(curl -s https://raw.githubusercontent.com/WJQSERVER/caddy/main/Caddy-VERSION)
VERSION=$(curl -s https://raw.githubusercontent.com/WJQSERVER/caddy/main/TEST-VERSION)
else
VERSION=$input_version
fi
@ -179,7 +161,7 @@ echo -e "${green}>${white} $mikublue 是否创建caddydash账户密码" $white
read -p "是否创建caddydash账户密码? [Y/n]" choice
if [[ "$choice" == "" || "$choice" == "Y" || "$choice" == "y" ]]; then
read -p "请输入CaddyDash用户名: " caddydash_username
read -p "请输入CaddyDash密码: " caddydash_password
read -s -p "请输入CaddyDash密码: " caddydash_password
writeSystemdServiceWithPasswdEnv "$caddydash_username" "$caddydash_password"
else
writeSystemdServiceNoEnv