change to --disable-clients flag

This commit is contained in:
miloschwartz
2025-12-03 14:12:53 -05:00
parent 56cb685813
commit 4af10c8108
2 changed files with 15 additions and 15 deletions

View File

@@ -98,7 +98,7 @@
"siteLocalDescriptionSaas": "Local resources only. No tunneling. Only available on remote nodes.", "siteLocalDescriptionSaas": "Local resources only. No tunneling. Only available on remote nodes.",
"siteSeeAll": "See All Sites", "siteSeeAll": "See All Sites",
"siteTunnelDescription": "Determine how you want to connect to your site", "siteTunnelDescription": "Determine how you want to connect to your site",
"siteNewtCredentials": "Newt Credentials", "siteNewtCredentials": "Credentials",
"siteNewtCredentialsDescription": "This is how Newt will authenticate with the server", "siteNewtCredentialsDescription": "This is how Newt will authenticate with the server",
"siteCredentialsSave": "Save Your Credentials", "siteCredentialsSave": "Save Your Credentials",
"siteCredentialsSaveDescription": "You will only be able to see this once. Make sure to copy it to a secure place.", "siteCredentialsSaveDescription": "You will only be able to see this once. Make sure to copy it to a secure place.",
@@ -607,9 +607,9 @@
"unknownCommand": "Unknown command", "unknownCommand": "Unknown command",
"newtErrorFetchReleases": "Failed to fetch release info: {err}", "newtErrorFetchReleases": "Failed to fetch release info: {err}",
"newtErrorFetchLatest": "Error fetching latest release: {err}", "newtErrorFetchLatest": "Error fetching latest release: {err}",
"newtEndpoint": "Newt Endpoint", "newtEndpoint": "Endpoint",
"newtId": "Newt ID", "newtId": "ID",
"newtSecretKey": "Newt Secret Key", "newtSecretKey": "Secret",
"architecture": "Architecture", "architecture": "Architecture",
"sites": "Sites", "sites": "Sites",
"siteWgAnyClients": "Use any WireGuard client to connect. You will have to address your internal resources using the peer IP.", "siteWgAnyClients": "Use any WireGuard client to connect. You will have to address your internal resources using the peer IP.",
@@ -1445,7 +1445,7 @@
"clientNamePlaceholder": "Client name", "clientNamePlaceholder": "Client name",
"address": "Address", "address": "Address",
"subnetPlaceholder": "Subnet", "subnetPlaceholder": "Subnet",
"addressDescription": "The internal address of the client in the Pangolin network. Must fall within the organization's subnet.", "addressDescription": "The internal address of the client. Must fall within the organization's subnet.",
"selectSites": "Select sites", "selectSites": "Select sites",
"sitesDescription": "The client will have connectivity to the selected sites", "sitesDescription": "The client will have connectivity to the selected sites",
"clientInstallOlm": "Install Olm", "clientInstallOlm": "Install Olm",
@@ -1616,9 +1616,9 @@
"createInternalResourceDialogAliasDescription": "An optional alias for this resource.", "createInternalResourceDialogAliasDescription": "An optional alias for this resource.",
"siteConfiguration": "Configuration", "siteConfiguration": "Configuration",
"siteAcceptClientConnections": "Accept Client Connections", "siteAcceptClientConnections": "Accept Client Connections",
"siteAcceptClientConnectionsDescription": "Allow other devices to connect through this Newt instance as a gateway using clients.", "siteAcceptClientConnectionsDescription": "Allow user devices and clients to access resources on this site. This can be changed later.",
"siteAddress": "Site Address", "siteAddress": "Site Address",
"siteAddressDescription": "The internal address of the site in the Pangolin network. Must fall within the organization's subnet.", "siteAddressDescription": "The internal address of the site. Must fall within the organization's subnet.",
"autoLoginExternalIdp": "Auto Login with External IDP", "autoLoginExternalIdp": "Auto Login with External IDP",
"autoLoginExternalIdpDescription": "Immediately redirect the user to the external IDP for authentication.", "autoLoginExternalIdpDescription": "Immediately redirect the user to the external IDP for authentication.",
"selectIdp": "Select IDP", "selectIdp": "Select IDP",

View File

@@ -199,7 +199,7 @@ export default function Page() {
const [wgConfig, setWgConfig] = useState(""); const [wgConfig, setWgConfig] = useState("");
const [createLoading, setCreateLoading] = useState(false); const [createLoading, setCreateLoading] = useState(false);
const [acceptClients, setAcceptClients] = useState(false); const [acceptClients, setAcceptClients] = useState(true);
const [newtVersion, setNewtVersion] = useState("latest"); const [newtVersion, setNewtVersion] = useState("latest");
const [siteDefaults, setSiteDefaults] = const [siteDefaults, setSiteDefaults] =
@@ -238,11 +238,11 @@ PersistentKeepalive = 5`;
secret: string, secret: string,
endpoint: string, endpoint: string,
version: string, version: string,
acceptClients: boolean = false acceptClients: boolean = true
) => { ) => {
const acceptClientsFlag = acceptClients ? " --accept-clients" : ""; const acceptClientsFlag = !acceptClients ? " --disable-clients" : "";
const acceptClientsEnv = acceptClients const acceptClientsEnv = !acceptClients
? "\n - ACCEPT_CLIENTS=true" ? "\n - DISABLE_CLIENTS=true"
: ""; : "";
const commands = { const commands = {
@@ -296,7 +296,7 @@ ContainerName=newt
Image=docker.io/fosrl/newt Image=docker.io/fosrl/newt
Environment=PANGOLIN_ENDPOINT=${endpoint} Environment=PANGOLIN_ENDPOINT=${endpoint}
Environment=NEWT_ID=${id} Environment=NEWT_ID=${id}
Environment=NEWT_SECRET=${secret}${acceptClients ? "\nEnvironment=ACCEPT_CLIENTS=true" : ""} Environment=NEWT_SECRET=${secret}${!acceptClients ? "\nEnvironment=DISABLE_CLIENTS=true" : ""}
# Secret=newt-secret,type=env,target=NEWT_SECRET # Secret=newt-secret,type=env,target=NEWT_SECRET
[Service] [Service]
@@ -409,7 +409,7 @@ WantedBy=default.target`
copied: false, copied: false,
method: "newt", method: "newt",
clientAddress: "", clientAddress: "",
acceptClients: false, acceptClients: true,
exitNodeId: undefined exitNodeId: undefined
} }
}); });
@@ -996,7 +996,7 @@ WantedBy=default.target`
</div> </div>
<p <p
id="acceptClients-desc" id="acceptClients-desc"
className="text-sm text-muted-foreground mb-4" className="text-sm text-muted-foreground"
> >
{t( {t(
"siteAcceptClientConnectionsDescription" "siteAcceptClientConnectionsDescription"