Update setupWireguardHost function to grab clients from database
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import type {
|
||||
BUN_SQLITE_WGUI_CLIENTS,
|
||||
BUN_SQLITE_WGUI_HOSTS,
|
||||
BUN_SQLITE_WGUI_VARIABLES,
|
||||
} from "@/db/types/db";
|
||||
import { AppData } from "@/src/data/app-data";
|
||||
import grabDirNames from "@/src/utils/grab-dir-names";
|
||||
import { execSync } from "node:child_process";
|
||||
import path from "node:path";
|
||||
import grabHostNetworkInterface from "./grab-host-network-interface";
|
||||
import type { APIResponseObject } from "@moduletrace/bunext/types";
|
||||
|
||||
const {
|
||||
WGUI_LIB_IP_TABLES_DIR,
|
||||
WIREGUARD_HOST_CONFIG_DIR,
|
||||
WIREGUARD_PRIVATE_KEY_FILE_NAME,
|
||||
WIREGUARD_PUBLIC_KEY_FILE_NAME,
|
||||
} = grabDirNames();
|
||||
|
||||
type Params = {
|
||||
client: BUN_SQLITE_WGUI_CLIENTS;
|
||||
host?: BUN_SQLITE_WGUI_HOSTS;
|
||||
variables?: BUN_SQLITE_WGUI_VARIABLES[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Function to setup a wireguard client. This
|
||||
* function will eventually call the setupWireguardHost
|
||||
* function afterwards to update it
|
||||
* @param param0
|
||||
* @returns
|
||||
*/
|
||||
export default async function setupWireguardClient({
|
||||
client,
|
||||
host,
|
||||
variables,
|
||||
}: Params): Promise<APIResponseObject> {
|
||||
return {
|
||||
success: true,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user