feat: change hooks to textareas (#2522)

* hooks are now textareas

* remove newlines in client config
This commit is contained in:
Bernd Storath
2026-03-05 14:52:55 +01:00
committed by GitHub
parent bc4dfd03df
commit 8ea2b635c1
6 changed files with 62 additions and 13 deletions
+7 -1
View File
@@ -1,3 +1,5 @@
// ! Auto Imports are not supported in this file
import type { InterfaceType } from '#db/repositories/interface/types';
/**
@@ -9,6 +11,10 @@ export function template(templ: string, values: Record<string, string>) {
});
}
export function removeNewlines(templ: string) {
return templ.replace(/\r\n|\r|\n/g, ' ');
}
/**
* Available keys:
* - ipv4Cidr: IPv4 CIDR
@@ -18,7 +24,7 @@ export function template(templ: string, values: Record<string, string>) {
* - uiPort: UI port number
*/
export function iptablesTemplate(templ: string, wgInterface: InterfaceType) {
return template(templ, {
return template(removeNewlines(templ), {
ipv4Cidr: wgInterface.ipv4Cidr,
ipv6Cidr: wgInterface.ipv6Cidr,
device: wgInterface.device,