Refactor main host setup

This commit is contained in:
2026-09-20 15:37:57 +01:00
parent 3c1d2b61f6
commit 69111e461e
47 changed files with 669 additions and 591 deletions
+4 -12
View File
@@ -1,17 +1,9 @@
import type { BUN_SQLITE_WGUI_VARIABLES } from "@/db/types/db";
import type { BUN_SQLITE_WGUI_HOSTS } from "@/db/types/db";
type Params = {
variables?: BUN_SQLITE_WGUI_VARIABLES[];
host?: BUN_SQLITE_WGUI_HOSTS;
};
export default function checkIfMainHostIsSet({ variables }: Params) {
const is_main_host_set =
Boolean(
variables?.find((v) => v.key == "main_host_wg_ip_address")?.value,
) &&
Boolean(
variables?.find((v) => v.key == "main_host_wg_public_key")?.value,
);
return is_main_host_set;
export default function checkIfMainHostIsSet({ host }: Params) {
return Boolean(host?.wg_ip_address);
}