@@ 250,9 250,9 @@ function generateWgQuickConfParts(iface) {
}
multiLine(peerPart, eattr, 'allowed_ips', 'AllowedIPs')
- multiLine(peerPart, eattr, 'disallowed_ips', 'DisallowedIPs')
- multiLine(peerPart, extras, 'allowed_apps', 'AllowedApps')
- multiLine(peerPart, extras, 'disallowed_apps', 'DisallowedApps')
+ multiLine(peerPart, eattr, 'disallowed_ips', '# DisallowedIPs')
+ multiLine(peerPart, extras, 'allowed_apps', '#')
+ multiLine(peerPart, extras, 'disallowed_apps', '#')
const { hostname, ip, port } = eattr
if (hostname || ip) {
@@ 260,10 260,10 @@ function generateWgQuickConfParts(iface) {
}
addLineIfTruthy(peerPart, eattr, 'keepalive', 'PersistentKeepalive')
- addLineIfTruthy(peerPart, extras, 'socks5_proxy')
- addLineIfTruthy(peerPart, extras, 'socks5_proxy_username')
- addLineIfTruthy(peerPart, extras, 'socks5_proxy_password')
- addLineIfTruthy(peerPart, extras, 'socks5_proxy_all_traffic')
+ addLineIfTruthy(peerPart, extras, 'socks5_proxy', '#')
+ addLineIfTruthy(peerPart, extras, 'socks5_proxy_username', '#')
+ addLineIfTruthy(peerPart, extras, 'socks5_proxy_password', '#')
+ addLineIfTruthy(peerPart, extras, 'socks5_proxy_all_traffic', '#')
if (eattr.available === false) peerPart = peerPart.map((x) => `#${x}`)
peerPart.push('')
@@ 300,7 300,12 @@ function joinLinesFromArray(lines, attr, key, name) {
}
function addLine(lines, value, key, name) {
- lines.push(`${name || upperFirst(camelCase(key))} = ${value}`)
+ const commented = name === '#'
+ if (!name || commented) {
+ name = upperFirst(camelCase(key))
+ if (commented) name = `# ${name}`
+ }
+ lines.push(`${name} = ${value}`)
}
function iptables(upRule, { up, down, v4, v6 }) {