diff --git a/.changeset/sharp-ears-tell.md b/.changeset/sharp-ears-tell.md new file mode 100644 index 000000000..426b29132 --- /dev/null +++ b/.changeset/sharp-ears-tell.md @@ -0,0 +1,5 @@ +--- +'hostd': minor +--- + +The address configuration setting now expects only the hostname without a port. Closes https://github.com/SiaFoundation/hostd/issues/536 diff --git a/apps/hostd/contexts/config/fields.tsx b/apps/hostd/contexts/config/fields.tsx index b18f219e3..74fd53090 100644 --- a/apps/hostd/contexts/config/fields.tsx +++ b/apps/hostd/contexts/config/fields.tsx @@ -10,6 +10,7 @@ import { } from './types' import { calculateMaxCollateral } from './transform' import { currencyOptions } from '@siafoundation/react-core' +import { Maybe } from '@siafoundation/types' type Categories = 'host' | 'pricing' | 'DNS' | 'bandwidth' | 'RHP3' @@ -46,9 +47,16 @@ export function getFields({ category: 'host', title: 'Address', description: <>The network address of the host., - placeholder: 'my.host.com:9982', + placeholder: 'my.host.com', validation: { required: 'required', + validate: { + noProtocol: (value: Maybe) => + !/^https?:\/\//.test(value || '') || + 'must not start with http:// or https://', + noPort: (value: Maybe) => + !/:\d+$/.test(value || '') || 'must not include port', + }, }, }, maxContractDuration: {