vpgen/src/lib/server/opnsense.ts
Yuri Tatishchev edbed6390a
connections page overhaul
# Conflicts:
#	src/lib/opnsense/wg.ts
2024-12-19 22:20:18 -08:00

12 lines
561 B
TypeScript

import { env } from '$env/dynamic/private';
import assert from 'node:assert';
assert(env.OPNSENSE_API_URL, 'OPNSENSE_API_URL is not set');
assert(env.OPNSENSE_API_KEY, 'OPNSENSE_API_KEY is not set');
assert(env.OPNSENSE_API_SECRET, 'OPNSENSE_API_SECRET is not set');
assert(env.OPNSENSE_WG_IFNAME, 'OPNSENSE_WG_IFNAME is not set');
export const opnsenseUrl = env.OPNSENSE_API_URL;
export const opnsenseAuth = `Basic ${Buffer.from(`${env.OPNSENSE_API_KEY}:${env.OPNSENSE_API_SECRET}`).toString('base64')}`
export const opnsenseIfname = env.OPNSENSE_WG_IFNAME;