Skip to content

Commit

Permalink
fix(hostd): address configuration hostname no port
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Dec 19, 2024
1 parent a1f2580 commit b12f645
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/sharp-ears-tell.md
Original file line number Diff line number Diff line change
@@ -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
10 changes: 9 additions & 1 deletion apps/hostd/contexts/config/fields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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<string>) =>
!/^https?:\/\//.test(value || '') ||
'must not start with http:// or https://',
noPort: (value: Maybe<string>) =>
!/:\d+$/.test(value || '') || 'must not include port',
},
},
},
maxContractDuration: {
Expand Down

0 comments on commit b12f645

Please sign in to comment.