feature: the VPN, the router, the name server and WebDAV are components switched on the System tab and installed on demand, Caddy from the Ubuntu archive is a dependency and serves every HTTP and HTTPS port, HTTPS is chosen at install, its certificate is of the Servers Issuing CA or self-signed by default, of ACME or of another CA, the issuing CAs are in one tab, a locked account is unlocked again, the name of a CA is fixed once the CA exists, and a run of setup is no longer cut short by a change.
Release / release (push) Failing after 8s

This commit is contained in:
slawek committed 2026-11-24 05:51:27 +01:00
1 parent a649331aa2
commit a7bfabcb89
97 files changed
+4498 -1834

No files matched your search

+13 -12
View File
@@ -1,22 +1,21 @@
import { Alert, Button, Dialog, DialogActions, DialogContent, DialogTitle, FormControlLabel, MenuItem, Stack, Switch, TextField } from '@mui/material'
import { Alert, Button, Dialog, DialogActions, DialogContent, DialogTitle, MenuItem, Stack, TextField, Typography } from '@mui/material'
import { useState, type FormEvent } from 'react'
import { ADDRESS_PATTERN, LISTEN_CHOICES, ZONE_PATTERN, type DnsSettings, type Listen } from './api.ts'
/**
* A dialog that edits the server's dns section: whether the name server runs, the secondary name server of every
* domain, the interfaces it answers on and the TTL, and wan.public_address, the server's public IP the records of the
* sites with Public IP take. The primary name server is the server's FQDN, nameserver, shown and not edited. An enabled
* name server needs a secondary other than the server's FQDN. onSave sends the section and the public address; the
* dialog closes when it succeeds and shows the server's message when it fails.
* A dialog that edits the server's dns section but whether the name server runs, which the System tab switches: the
* secondary name server of every domain, the interfaces it answers on and the TTL, and wan.public_address, the server's
* public IP the records of the sites with Public IP take. The primary name server is the server's FQDN, nameserver,
* shown and not edited. The secondary is optional and is not the server's FQDN. onSave sends the
* settings and the public address; the dialog closes when it succeeds and shows the server's message when it fails.
*/
export default function DnsSettingsDialog(props: {
current: DnsSettings
nameserver: string
publicAddress: string
onSave: (settings: DnsSettings, publicAddress: string) => Promise<void>
onSave: (settings: Omit<DnsSettings, 'enabled'>, publicAddress: string) => Promise<void>
onCancel: () => void
}) {
const [enabled, setEnabled] = useState(props.current.enabled)
const [secondary, setSecondary] = useState(props.current.secondary)
const [publicAddress, setPublicAddress] = useState(props.publicAddress)
const [listen, setListen] = useState<Listen>(props.current.listen)
@@ -24,7 +23,7 @@ export default function DnsSettingsDialog(props: {
const [saving, setSaving] = useState(false)
const [error, setError] = useState<string | null>(null)
const secondaryProblem = secondary === '' ? (enabled ? 'Required while enabled.' : '')
const secondaryProblem = secondary === '' ? ''
: !ZONE_PATTERN.test(secondary) ? 'A DNS name in lower case.'
: secondary === props.nameserver ? 'The secondary is not the server\'s FQDN, the primary.' : ''
const addressProblem = publicAddress === '' || ADDRESS_PATTERN.test(publicAddress) ? '' : 'Not an IP address.'
@@ -39,7 +38,7 @@ export default function DnsSettingsDialog(props: {
setSaving(true)
setError(null)
try {
await props.onSave({ enabled, secondary, listen, ttl: Number(ttl) }, publicAddress)
await props.onSave({ secondary, listen, ttl: Number(ttl) }, publicAddress)
} catch (caught) {
setError((caught as Error).message)
setSaving(false)
@@ -52,7 +51,9 @@ export default function DnsSettingsDialog(props: {
<DialogContent>
<Stack sx={{ gap: 2, pt: 1 }}>
{error && <Alert severity="error" sx={{ whiteSpace: 'pre-line' }}>{error}</Alert>}
<FormControlLabel control={<Switch checked={enabled} onChange={(event) => setEnabled(event.target.checked)} />} label="Enabled" />
<Typography variant="body2" color="text.secondary">
The name server is {props.current.enabled ? 'on' : 'off'}; it is switched on and off on the System tab.
</Typography>
<TextField
label="Primary name server"
value={props.nameserver || '(the server has no FQDN)'}
@@ -65,7 +66,7 @@ export default function DnsSettingsDialog(props: {
autoFocus
autoComplete="off"
error={secondaryProblem !== ''}
helperText={secondaryProblem || 'The second NS of every domain; the addresses it resolves to may transfer the domains.'}
helperText={secondaryProblem || 'Optional: the second NS of every domain; the addresses it resolves to may transfer the domains. Empty: the server is the only name server.'}
onChange={(event) => setSecondary(event.target.value.trim().toLowerCase())}
/>
<TextField