Fix discrepancies: use WG_CLIENT_PORT instead of WG_PORT for setup fallback

- Fixed setup/2.post.ts to use WG_CLIENT_OVERRIDE_ENV.CLIENT_PORT instead of WG_INTERFACE_OVERRIDE_ENV.PORT
- Fixed sqlite.ts initialSetup to use WG_CLIENT_OVERRIDE_ENV.CLIENT_PORT for consistency
- Corrected unattended-setup.md documentation:
  - Changed INIT_HOST and INIT_PORT from group "1*" to group "2"
  - Clarified INIT_PORT description as "Port clients will connect to (endpoint port)"
  - Updated group numbers: DNS is group 3, CIDR is group 4, Allowed IPs is group 5
  - Fixed warning text: setup requires groups 1 and 2, and use WG_CLIENT_PORT (not WG_PORT)
- Ensures consistency between code behavior and documentation

Co-authored-by: kaaax0815 <32197462+kaaax0815@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-11-17 10:31:11 +00:00
parent 3a52e1321b
commit e192855280
3 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ export default defineSetupEventHandler(2, async ({ event }) => {
// If host and port are already set by environment variables, skip step 4
const host = WG_INITIAL_ENV.HOST ?? WG_CLIENT_OVERRIDE_ENV.HOST;
const port = WG_INITIAL_ENV.PORT ?? WG_INTERFACE_OVERRIDE_ENV.PORT;
const port = WG_INITIAL_ENV.PORT ?? WG_CLIENT_OVERRIDE_ENV.CLIENT_PORT;
const setupDone = host && port;