Tidy up the installer
Layout: the file now reads top to bottom as output helpers, constants, functions and the scenario. Functions were scattered between executable code (some defined inside steps), the previous role was computed twice, and the firewall code sat in the middle of a step. The firewall is now a function and a step of its own; installing the awg-ctrl command moved into the services step, so there are still six steps. Fixes: - the shebang was on line 4, after the license comment, so it did nothing; - a reinstall removed /opt/awg-control before the configuration questions, so answering "no" to "Continue?" left the server with no installation; it is now removed only after the confirmation; - with kept data the panel port was asked again with a new random default, which broke bookmarks and the API address even though the secret path was kept; the panel port, login, password and JWT secret now default to the previous values; - UI_PORT, UI_USER, UI_PASS and SERVER_NAME from the environment were overwritten by the prompts; they now skip them, as the README says; - when the user database existed but was not kept, the server name was not asked and silently became "VPN"; - random ports are checked to be free and distinct from each other; - the server IP from ifconfig.me is validated, with a fallback to the source address of the default route; - prompts are all in Russian; a panel with VPN can pick a random node port with "+"; - comments no longer point to docs/node-protocol.md, which is not in the repo; - shellcheck -S warning is clean. An update now gives a secret path to an install that has none and prints the new panel address (UI_PREFIX=off, or an empty UI_PREFIX= in cli.env, keeps it without one). The summary shows whether the panel has a secret path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013bNGYiDst62wH3ZGTRPFLJ
This commit is contained in:
+629
-562
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user