diff --git a/src/scripts/install-wg-ui.sh b/src/scripts/install-wg-ui.sh index 0afdabe..9f4052a 100755 --- a/src/scripts/install-wg-ui.sh +++ b/src/scripts/install-wg-ui.sh @@ -18,7 +18,7 @@ SERVICE_NAME="${SERVICE_NAME:-wgui}" REPO_URL="${REPO_URL:-https://git.tben.me/Moduletrace/wireguard-ui.git}" BRANCH="${BRANCH:-main}" BUN_INSTALL_DIR="${BUN_INSTALL_DIR:-/opt/bun}" -BUN_VERSION="${BUN_VERSION:-1.4.1}" +BUN_VERSION="${BUN_VERSION:-1.3.14}" BUN_BIN="/usr/local/bin/bun" UPDATE=false DEV_MODE=false diff --git a/src/server.ts b/src/server.ts index 285c78c..e689e7b 100644 --- a/src/server.ts +++ b/src/server.ts @@ -32,17 +32,9 @@ const server = Bun.serve({ }); bunext.bunextLog.info(`env: ${process.env.NODE_ENV}`); -bunext.bunextLog.build(`Setting up wireguard ...`); - -execSync(path.join(__dirname, "scripts", "install-wg-ui.sh"), { - stdio: "ignore", - env: { - ...process.env, - SKIP_SERVICE_RESTART: "1", - }, -}); -bunext.bunextLog.success(`Wireguard setup complete!`); +bunext.bunextLog.build(`Syncing WireGuard hosts ...`); await syncWireguardHosts(); +bunext.bunextLog.success(`Wireguard host sync complete!`); bunext.bunextLog.info(`Server running on http://localhost:${server.port} ...`);