mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-15 09:43:25 +01:00
* fix(nginx-ui): remove admin user hack, use setup wizard instead The previous install script started nginx-ui for 3 seconds, stopped it, and ran reset-password to create an admin user. This caused: - Race condition: the internal setup wizard could trigger during the brief start window, conflicting with the reset-password approach - Admin users unable to login after the setup wizard fired - Settings lockup due to overloaded app.ini with hardcoded nginx paths that conflict with UI-managed settings Changes: - Remove start/stop/reset-password hack from install script - Simplify app.ini to match upstream defaults (minimal config) - Let users complete the natural setup wizard on first visit - Update JSON: remove default credentials, add setup wizard note - Add setup wizard hint to CT script output The setup wizard properly handles admin account creation and ACME email configuration, which are both needed for full functionality. Ref: ProxmoxVED#1408 * Update nginx-ui.sh
80 lines
1.7 KiB
Bash
80 lines
1.7 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
|
# Author: MickLesk (CanbiZ)
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://nginxui.com
|
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
|
color
|
|
verb_ip6
|
|
catch_errors
|
|
setting_up_container
|
|
network_check
|
|
update_os
|
|
|
|
msg_info "Installing Dependencies"
|
|
$STD apt install -y \
|
|
nginx \
|
|
logrotate
|
|
msg_ok "Installed Dependencies"
|
|
|
|
fetch_and_deploy_gh_release "nginx-ui" "0xJacky/nginx-ui" "prebuild" "latest" "/opt/nginx-ui" "nginx-ui-linux-64.tar.gz"
|
|
|
|
msg_info "Installing Nginx UI"
|
|
cp /opt/nginx-ui/nginx-ui /usr/local/bin/nginx-ui
|
|
chmod +x /usr/local/bin/nginx-ui
|
|
rm -rf /opt/nginx-ui
|
|
msg_ok "Installed Nginx UI"
|
|
|
|
msg_info "Configuring Nginx UI"
|
|
mkdir -p /usr/local/etc/nginx-ui
|
|
cat <<EOF >/usr/local/etc/nginx-ui/app.ini
|
|
[app]
|
|
PageSize = 10
|
|
|
|
[server]
|
|
Host = 0.0.0.0
|
|
Port = 9000
|
|
RunMode = release
|
|
JwtSecret = $(openssl rand -hex 32)
|
|
|
|
[cert]
|
|
HTTPChallengePort = 9180
|
|
|
|
[terminal]
|
|
StartCmd = login
|
|
EOF
|
|
msg_ok "Configured Nginx UI"
|
|
|
|
msg_info "Creating Service"
|
|
cat <<EOF >/etc/systemd/system/nginx-ui.service
|
|
[Unit]
|
|
Description=Another WebUI for Nginx
|
|
Documentation=https://nginxui.com
|
|
After=network.target nginx.service
|
|
|
|
[Service]
|
|
Type=simple
|
|
ExecStart=/usr/local/bin/nginx-ui --config /usr/local/etc/nginx-ui/app.ini
|
|
RuntimeDirectory=nginx-ui
|
|
WorkingDirectory=/var/run/nginx-ui
|
|
Restart=on-failure
|
|
TimeoutStopSec=5
|
|
KillMode=mixed
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
systemctl daemon-reload
|
|
msg_ok "Created Service"
|
|
|
|
msg_info "Starting Service"
|
|
systemctl enable -q --now nginx-ui
|
|
rm -rf /etc/nginx/sites-enabled/default
|
|
msg_ok "Started Service"
|
|
|
|
motd_ssh
|
|
customize
|
|
cleanup_lxc
|