Remove comments

This commit is contained in:
2026-09-28 12:37:24 +01:00
parent 464b814dd1
commit 9b6136c648
3 changed files with 1 additions and 110 deletions
@@ -79,48 +79,6 @@ function chunkPorts({ ports }: { ports: string[] }) {
return chunks;
}
// function acceptLines({
// chain,
// source,
// destination,
// protocol,
// ports,
// }: {
// chain: string;
// source: string;
// destination?: string;
// protocol?: string;
// ports: string[];
// }) {
// const lines: string[] = [];
// const protocols = protocolsForRule({
// protocol,
// has_ports: Boolean(ports[0]),
// });
// const port_chunks = ports[0] ? chunkPorts({ ports }) : [[]];
// for (let p = 0; p < protocols.length; p++) {
// const proto = protocols[p];
// for (let c = 0; c < port_chunks.length; c++) {
// const chunk = port_chunks[c] || [];
// lines.push(
// joinArgs([
// `iptables -A ${chain}`,
// `-s ${source}`,
// destination ? `-d ${destination}` : undefined,
// proto ? `-p ${proto}` : undefined,
// proto ? portMatch({ ports: chunk }) : undefined,
// `-j ACCEPT`,
// ]),
// );
// }
// }
// return lines;
// }
function acceptLines({
forward_chain,
input_chain,
@@ -152,7 +110,6 @@ function acceptLines({
? portMatch({ ports: chunk })
: undefined;
// FORWARD: Forwarded ports / Docker containers / WAN
lines.push(
joinArgs([
`iptables -A ${forward_chain}`,
@@ -163,7 +120,6 @@ function acceptLines({
]),
);
// INPUT: Only allow matching requests bound for THIS interface's host IP
lines.push(
joinArgs([
`iptables -A ${input_chain}`,
@@ -174,28 +130,6 @@ function acceptLines({
`-j ACCEPT`,
]),
);
// // 1. FORWARD chain: Allows routed traffic (including Docker bridges/DNAT)
// lines.push(
// joinArgs([
// `iptables -A ${forward_chain}`,
// `-s ${source}`,
// proto ? `-p ${proto}` : undefined,
// port_match_str,
// `-j ACCEPT`,
// ]),
// );
// // 2. INPUT chain: Allows traffic bound directly for host OS services
// lines.push(
// joinArgs([
// `iptables -A ${input_chain}`,
// `-s ${source}`,
// proto ? `-p ${proto}` : undefined,
// port_match_str,
// `-j ACCEPT`,
// ]),
// );
}
}
@@ -287,27 +221,9 @@ export default function buildHostIptablesScripts({
};
}
// if (rule.rule_type == "all") {
// if (scoped_subnet) {
// accept_lines.push(
// `iptables -A ${forward} -s ${source} -d ${scoped_subnet} -j ACCEPT`,
// `iptables -A ${forward} -s ${source} -o ${target_interface} -j ACCEPT`,
// `iptables -A ${input} -s ${source} -j ACCEPT`,
// );
// } else {
// accept_lines.push(
// `iptables -A ${forward} -s ${source} -j ACCEPT`,
// `iptables -A ${input} -s ${source} -j ACCEPT`,
// );
// }
// continue;
// }
if (rule.rule_type == "all") {
accept_lines.push(
`iptables -A ${forward} -s ${source} -j ACCEPT`,
// `iptables -A ${input} -s ${source} -j ACCEPT`,
scoped_subnet
? `iptables -A ${input} -s ${source} -d ${scoped_subnet} -j ACCEPT`
: `iptables -A ${input} -s ${source} -j ACCEPT`,
@@ -319,6 +235,7 @@ export default function buildHostIptablesScripts({
const destination = normalizeIptablesDestination({
destination: rule.destination,
});
const parsed_ports = parsePortList({ ports: rule.ports });
if (!parsed_ports.success) {
@@ -328,16 +245,6 @@ export default function buildHostIptablesScripts({
};
}
// accept_lines.push(
// ...acceptLines({
// chain: forward,
// source,
// destination,
// protocol: rule.protocol || "any",
// ports: parsed_ports.ports,
// }),
// );
accept_lines.push(
...acceptLines({
forward_chain: forward,
@@ -1,6 +1,5 @@
import type { BUN_SQLITE_WGUI_HOSTS } from "@/db/types/db";
import fetchApi from "@/src/components/twui/utils/fetch/fetchApi";
import type useFormInit from "@/src/hooks/use-form-init";
import type { ApiReqParams } from "@/src/types";
import type { APIResponseObject } from "@moduletrace/bunext/types";
import type { Dispatch, SetStateAction } from "react";
@@ -3,13 +3,9 @@ import Input from "@/src/components/twui/form/Input";
import Stack from "@/src/components/twui/layout/Stack";
import useFormInit from "@/src/hooks/use-form-init";
import { useEffect, useState } from "react";
import fetchApi from "@/src/components/twui/utils/fetch/fetchApi";
import type { ApiReqParams } from "@/src/types";
import type { APIResponseObject } from "@moduletrace/bunext/types";
import Checkbox from "@/src/components/twui/form/Checkbox";
import { twMerge } from "tailwind-merge";
import useStatus from "@/src/components/twui/hooks/useStatus";
import LoadingOverlay from "@/src/components/twui/elements/LoadingOverlay";
import LoadingRectangleBlock from "@/src/components/twui/layout/LoadingRectangleBlock";
import clientFetchIP from "../../(functions)/fetch-ip";
import isLocalIPAddress from "../../../../../../utils/is-local-ip-address";
@@ -50,17 +46,6 @@ export default function AddHostFormPublicIP({
});
}, [form.interface, useLocalIP]);
// if (existing_full?.public_ip_address) {
// return (
// <Input
// defaultValue={existing_full.public_ip_address || "N/A"}
// title="IP Address"
// readOnly
// showLabel
// />
// );
// }
return (
<Stack className={twMerge("w-full gap-2 relative")}>
{loading ? (