feature: the CA certificates and CRLs are always published over HTTP and HTTPS on the status and Manager ports, the Shell page is an entry of the page menu, and the web interface passes its lint.
Release / release (push) Successful in 26s
Release / release (push) Successful in 26s
This commit is contained in:
1 parent
4b5318c676
commit
0cec95c19b
72 files changed
+910
-861
No files matched your search
@@ -1,12 +1,15 @@
|
||||
import Settings from '@mui/icons-material/Settings'
|
||||
import { Alert, Box, Button, Chip, IconButton, Stack, Tooltip, Typography } from '@mui/material'
|
||||
import { useCallback, useEffect, useState, type ReactNode } from 'react'
|
||||
import AcmeSettingsDialog, { PROVIDER_LABELS } from './AcmeSettingsDialog.tsx'
|
||||
import { when } from './BackupSummary.tsx'
|
||||
import HttpsSettingsDialog, { CERTIFICATE_LABELS } from './HttpsSettingsDialog.tsx'
|
||||
import AcmeSettingsDialog from './AcmeSettingsDialog.tsx'
|
||||
import { PROVIDER_LABELS } from './https.ts'
|
||||
import { when } from './format.ts'
|
||||
import HttpsSettingsDialog from './HttpsSettingsDialog.tsx'
|
||||
import { CERTIFICATE_LABELS } from './https.ts'
|
||||
import ImportDialog from './ImportDialog.tsx'
|
||||
import PfxDialog from './PfxDialog.tsx'
|
||||
import { Pairs, Section, text } from './ServerPanel.tsx'
|
||||
import { Pairs, Section } from './ServerPanel.tsx'
|
||||
import { text } from './format.ts'
|
||||
import { saveFile } from './saveFile.ts'
|
||||
import {
|
||||
DETAILS_SHAPE, HTTPS_CSR_SHAPE, HTTPS_IMPORTED_SHAPE, HTTPS_SETTINGS_SHAPE, request, type HttpsCertificate, type HttpsChange,
|
||||
@@ -31,26 +34,29 @@ export default function ServerCertificatePanel() {
|
||||
const [settings, setSettings] = useState<{ dialog: 'https' | 'acme'; settings: HttpsSettings } | null>(null)
|
||||
const [importing, setImporting] = useState<'certificate' | 'pfx' | null>(null)
|
||||
|
||||
const refresh = useCallback(async () => {
|
||||
setReading(true)
|
||||
try {
|
||||
const [nextDetails, nextHttps] = await Promise.all([
|
||||
request<RouterDetails>('GET', '/config', DETAILS_SHAPE),
|
||||
request<{ certificate?: HttpsCertificate }>('GET', '/https/settings', HTTPS_SETTINGS_SHAPE),
|
||||
])
|
||||
setDetails(nextDetails)
|
||||
setCertificate(nextHttps.certificate ?? null)
|
||||
setError(null)
|
||||
} catch (caught) {
|
||||
setError(`The server did not give its HTTPS settings: ${(caught as Error).message}`)
|
||||
} finally {
|
||||
setReading(false)
|
||||
}
|
||||
/** Reads the server's details and HTTPS certificate; the state changes only once the server answers. */
|
||||
const read = useCallback(async () => {
|
||||
await Promise.all([
|
||||
request<RouterDetails>('GET', '/config', DETAILS_SHAPE),
|
||||
request<{ certificate?: HttpsCertificate }>('GET', '/https/settings', HTTPS_SETTINGS_SHAPE),
|
||||
])
|
||||
.then(([nextDetails, nextHttps]) => {
|
||||
setDetails(nextDetails)
|
||||
setCertificate(nextHttps.certificate ?? null)
|
||||
setError(null)
|
||||
}, (caught) => setError(`The server did not give its HTTPS settings: ${(caught as Error).message}`))
|
||||
.finally(() => setReading(false))
|
||||
}, [])
|
||||
|
||||
/** Reads the details and the certificate again, reading until the server answers. */
|
||||
const refresh = useCallback(() => {
|
||||
setReading(true)
|
||||
return read()
|
||||
}, [read])
|
||||
|
||||
useEffect(() => {
|
||||
void refresh()
|
||||
}, [refresh])
|
||||
void read()
|
||||
}, [read])
|
||||
|
||||
/** Reads the server's https section from /https/settings and opens HttpsSettingsDialog or AcmeSettingsDialog with it. */
|
||||
async function open(dialog: 'https' | 'acme') {
|
||||
|
||||
Reference in new issue
Block a user