Update hosts form
This commit is contained in:
@@ -14,13 +14,8 @@ import BunSQLite from "@moduletrace/bun-sqlite";
|
||||
import type { TableType, User } from "@/src/types";
|
||||
import grabClientDirnames from "./grab-client-dir-names";
|
||||
|
||||
const {
|
||||
WGUI_LIB_HOSTS_CONFIGS_DIR,
|
||||
WIREGUARD_PRIVATE_KEY_FILE_NAME,
|
||||
WIREGUARD_PUBLIC_KEY_FILE_NAME,
|
||||
WGUI_LIB_HOST_CLIENTS_DIR_NAME,
|
||||
WIREGUARD_CLIENT_CONFIG_FILE_NAME,
|
||||
} = grabDirNames();
|
||||
const { WIREGUARD_PUBLIC_KEY_FILE_NAME, WIREGUARD_CLIENT_CONFIG_FILE_NAME } =
|
||||
grabDirNames();
|
||||
|
||||
type Params = {
|
||||
client: BUN_SQLITE_WGUI_CLIENTS;
|
||||
@@ -135,7 +130,7 @@ export default async function setupWireguardClient({
|
||||
sh += `\n`;
|
||||
sh += `[Peer]\n`;
|
||||
sh += `PublicKey = ${HOST_PUBLIC_KEY}\n`;
|
||||
sh += `Endpoint = ${PUBLIC_IP_ADDRESS}:51820\n`;
|
||||
sh += `Endpoint = ${PUBLIC_IP_ADDRESS}:${host?.listen_port || AppData["DefaultWGListenPort"]}\n`;
|
||||
|
||||
if (client?.allow_all_ips == 1) {
|
||||
sh += `AllowedIPs = 0.0.0.0/0, ::/0\n`;
|
||||
|
||||
Reference in New Issue
Block a user