Dont duplicate interfaces on port change 3.0

This commit is contained in:
2026-08-01 06:31:15 +03:00
parent be3bebeb5b
commit 703ca1b559
10 changed files with 106 additions and 85 deletions
+5 -5
View File
@@ -14,7 +14,7 @@ export const inputSpec = InputSpec.of({
stratumPort: Value.number({
name: i18n('Stratum Port'),
description: i18n(
'TCP port the plaintext stratum server listens on. StartOS also tries to publish the pool on this same port number on your network, so this is normally the port you give your miners — check the Stratum interface after saving, since the OS will pick a different external port if this one is already taken.',
'Network port your miners connect to for plaintext stratum. StartOS publishes the pool on this port; if it is already claimed by another service the OS assigns a different one, so check the Stratum interface after saving. Changing this does not interrupt connected miners.',
),
required: true,
default: defaultStratumPort,
@@ -25,7 +25,7 @@ export const inputSpec = InputSpec.of({
stratumTlsPort: Value.number({
name: i18n('Stratum TLS Port'),
description: i18n(
'TCP port stunnel accepts TLS stratum connections on. Only used when Stratum TLS is enabled below.',
'Network port your miners connect to for TLS stratum. Only used when Stratum TLS is enabled below.',
),
required: true,
default: defaultStratumTlsPort,
@@ -141,9 +141,9 @@ export const config = sdk.Action.withInput(
// the execution function
async ({ effects, input }) => {
// Refuse port choices that cannot bind — all of these processes share one
// network namespace, so a collision would surface as a restart loop after
// saving rather than as an error here.
// Refuse an unusable pair (both stratum ports set to the same number).
// In-container ports are fixed constants, so the user can no longer create
// a bind collision — only an ambiguous external-port request.
const conflict = validatePorts({
stratumPort: input.stratumPort,
stratumTlsPort: input.stratumTlsPort,