feat: rebranded from vpn-router to linux-manager.
This commit is contained in:
1 parent
8efe21bfa6
commit
85a1ffa21f
238 files changed
+5010
-3761
No files matched your search
@@ -21,7 +21,7 @@ import TemplateDialog from './TemplateDialog.tsx'
|
||||
import Toolbar from './Toolbar.tsx'
|
||||
import EkuDialog from './EkuDialog.tsx'
|
||||
import PkiSettingsDialog, { PUBLISH_LABELS } from './PkiSettingsDialog.tsx'
|
||||
import { Pairs, Section } from './RouterPanel.tsx'
|
||||
import { Pairs, Section } from './ServerPanel.tsx'
|
||||
import {
|
||||
ApiError, BUNDLE_SHAPE, CA_IMPORTED_SHAPE, CRL_IMPORTED_SHAPE, CSR_SHAPE, ISSUED_SHAPE, PFX_SHAPE, PKI_SETTINGS_SHAPE, PKI_SHAPE, REVOKED_SHAPE,
|
||||
BUILTIN_TEMPLATES, REVOKE_REASONS, request, type Pki, type PkiCertificate, type PkiIssuingCa, type PkiTemplate,
|
||||
@@ -35,8 +35,8 @@ type View = 'root' | 'templates' | 'usages' | 'p2s' | 's2s' | 'issuing'
|
||||
/** The built-in CAs, whose certificates the Issuing CAs tab leaves out. */
|
||||
const BUILTIN_CAS = ['root', 'p2s', 's2s']
|
||||
|
||||
/** The note shown after a change, which the router applies when vpn-router-setup has run again. */
|
||||
const APPLIED = 'The router applies the change in the background.'
|
||||
/** The note shown after a change, which the server applies when linux-manager-setup has run again. */
|
||||
const APPLIED = 'The server applies the change in the background.'
|
||||
|
||||
/** The colour of each state of an issuing CA and of a certificate. */
|
||||
const STATE_COLORS: Record<string, 'success' | 'warning' | 'error' | 'default'> = {
|
||||
@@ -60,15 +60,15 @@ const REASON_LABELS: Record<string, string> = {
|
||||
|
||||
|
||||
/**
|
||||
* The router's PKI in tabs: Root, the root CA with the general settings and the certificates of the issuing CAs;
|
||||
* The server's PKI in tabs: Root, the root CA with the general settings and the certificates of the issuing CAs;
|
||||
* Templates, the certificate templates, which are added, changed, removed and reset there; Extended key usages, the
|
||||
* built-in ones and the custom ones, which are added, changed and removed there; P2S Issuing CA and S2S
|
||||
* Issuing CA, each built-in CA with the certificates it issued; Issuing CAs, the general-purpose CAs, which are added,
|
||||
* changed and removed there, with their certificates, filtered by CA. The warnings, Issue and Settings
|
||||
* are above the tabs. Settings edits the pki section, Issue issues a certificate from a CSR or into a PFX file, a
|
||||
* certificate of another system or of the router is revoked, an issuing CA waiting for the offline root gives its CSR
|
||||
* and takes its signed certificate, and the root takes a CRL signed offline. The root key is managed on the router
|
||||
* with vpn-router-ca only.
|
||||
* certificate of another system or of the server is revoked, an issuing CA waiting for the offline root gives its CSR
|
||||
* and takes its signed certificate, and the root takes a CRL signed offline. The root key is managed on the server
|
||||
* with linux-manager-ca only.
|
||||
*/
|
||||
export default function CertificatesPanel() {
|
||||
const [pki, setPki] = useState<Pki | null>(null)
|
||||
@@ -138,7 +138,7 @@ export default function CertificatesPanel() {
|
||||
}
|
||||
|
||||
/** Writes the templates of pki.templates: the current ones with name set to values, or without it when values is
|
||||
* null, which removes a template of the router's own or brings a built-in one back to its defaults. */
|
||||
* null, which removes a template of the server's own or brings a built-in one back to its defaults. */
|
||||
async function saveTemplate(name: string, values: PkiTemplate | null) {
|
||||
const { [name]: _current, ...others } = pki?.settings.templates ?? {}
|
||||
await request('PUT', '/ca', PKI_SETTINGS_SHAPE, { templates: values === null ? others : { ...others, [name]: values } })
|
||||
@@ -157,7 +157,7 @@ export default function CertificatesPanel() {
|
||||
function removeUsage(name: string) {
|
||||
setConfirm({
|
||||
title: 'Remove extended key usage',
|
||||
message: `Remove extended key usage ${name}? The router refuses while a template gives it; certificates issued with it keep it.`,
|
||||
message: `Remove extended key usage ${name}? The server refuses while a template gives it; certificates issued with it keep it.`,
|
||||
confirmLabel: 'Remove',
|
||||
destructive: true,
|
||||
onCancel: () => setConfirm(null),
|
||||
@@ -177,7 +177,7 @@ export default function CertificatesPanel() {
|
||||
title: builtin ? 'Reset template' : 'Remove template',
|
||||
message: builtin
|
||||
? `Bring template ${name} back to its built-in options? The certificates issued afterwards follow them.`
|
||||
: `Remove template ${name}? The router refuses while an issuing CA issues it; certificates issued with it stay valid.`,
|
||||
: `Remove template ${name}? The server refuses while an issuing CA issues it; certificates issued with it stay valid.`,
|
||||
confirmLabel: builtin ? 'Reset' : 'Remove',
|
||||
destructive: !builtin,
|
||||
onCancel: () => setConfirm(null),
|
||||
@@ -195,7 +195,7 @@ export default function CertificatesPanel() {
|
||||
function removeAuthority(name: string) {
|
||||
setConfirm({
|
||||
title: 'Remove issuing CA',
|
||||
message: `Remove issuing CA ${name}? The router retires it and revokes its certificate on the root CRL; with the root offline, the root CRL is signed offline. Its certificates stay valid until they expire or are revoked.`,
|
||||
message: `Remove issuing CA ${name}? The server retires it and revokes its certificate on the root CRL; with the root offline, the root CRL is signed offline. Its certificates stay valid until they expire or are revoked.`,
|
||||
confirmLabel: 'Remove',
|
||||
destructive: true,
|
||||
onCancel: () => setConfirm(null),
|
||||
@@ -214,7 +214,7 @@ export default function CertificatesPanel() {
|
||||
let reason: string = REVOKE_REASONS[0]
|
||||
setConfirm({
|
||||
title: 'Revoke certificate',
|
||||
message: `Revoke certificate ${certificate.serial} of ${certificate.subject}? The CRL of ${certificate.ca} lists it at once.${certificate.kind === 'router' ? ' The router issues itself a new one.' : ''}`,
|
||||
message: `Revoke certificate ${certificate.serial} of ${certificate.subject}? The CRL of ${certificate.ca} lists it at once.${certificate.kind === 'router' ? ' The server issues itself a new one.' : ''}`,
|
||||
confirmLabel: 'Revoke',
|
||||
destructive: true,
|
||||
children: (
|
||||
@@ -274,7 +274,7 @@ export default function CertificatesPanel() {
|
||||
? pki?.status.authorities.find((item) => item.state === 'active' && item.subject === certificate.subject && item.expires === certificate.expires)
|
||||
: undefined
|
||||
|
||||
/** A table of certificates with their state and, for one of another system or of the router, Revoke; for an active
|
||||
/** A table of certificates with their state and, for one of another system or of the server, Revoke; for an active
|
||||
* issuing CA, the download of its CA bundle. */
|
||||
const certificateTable = (list: PkiCertificate[]) => (
|
||||
<Box sx={{ overflowX: 'auto' }}>
|
||||
@@ -368,7 +368,7 @@ export default function CertificatesPanel() {
|
||||
</Stack>
|
||||
)}
|
||||
</>
|
||||
) : <Typography variant="body2" color="text.secondary">None yet; the router creates it once a platform is chosen.</Typography>}
|
||||
) : <Typography variant="body2" color="text.secondary">None yet; the server creates it once a platform is chosen.</Typography>}
|
||||
</Section>
|
||||
<Section title="Certificates issued">{certificateTable((pki?.certificates ?? []).filter((certificate) => certificate.ca === name))}</Section>
|
||||
</Box>
|
||||
@@ -415,14 +415,14 @@ export default function CertificatesPanel() {
|
||||
['Expires', when(root.expires)],
|
||||
['Key', root.key ? (
|
||||
<Box component="span" sx={{ display: 'inline-flex', alignItems: 'center', gap: 0.5 }}>
|
||||
on the router
|
||||
<Tooltip title="Keeping the root key off the router is recommended: vpn-router-ca root export-key, then vpn-router-ca root remove-key.">
|
||||
<WarningAmber fontSize="small" color="warning" aria-label="The root key is on the router" />
|
||||
on the server
|
||||
<Tooltip title="Keeping the root key off the server is recommended: linux-manager-ca root export-key, then linux-manager-ca root remove-key.">
|
||||
<WarningAmber fontSize="small" color="warning" aria-label="The root key is on the server" />
|
||||
</Tooltip>
|
||||
</Box>
|
||||
) : 'offline'],
|
||||
['CRL valid until', when(root.crl_next_update)],
|
||||
['CRL', root.crl_source === 'uploaded' ? 'uploaded' : root.crl_source === 'signed' ? 'signed by the router' : '-'],
|
||||
['CRL', root.crl_source === 'uploaded' ? 'uploaded' : root.crl_source === 'signed' ? 'signed by the server' : '-'],
|
||||
]}
|
||||
/>
|
||||
<Stack direction="row" sx={{ mt: 1, justifyContent: 'flex-end', gap: 1 }}>
|
||||
@@ -434,7 +434,7 @@ export default function CertificatesPanel() {
|
||||
</Button>
|
||||
</Stack>
|
||||
</>
|
||||
) : <Typography variant="body2" color="text.secondary">None yet; the router creates it once a platform is chosen.</Typography>}
|
||||
) : <Typography variant="body2" color="text.secondary">None yet; the server creates it once a platform is chosen.</Typography>}
|
||||
</Section>
|
||||
<Section title="General">
|
||||
<Pairs
|
||||
@@ -582,7 +582,7 @@ export default function CertificatesPanel() {
|
||||
)}
|
||||
|
||||
{pki && view === 'p2s' && builtinTab('p2s', 'P2S Issuing CA: the VPN server certificate and the users\' certificates')}
|
||||
{pki && view === 's2s' && builtinTab('s2s', 'S2S Issuing CA: the site-to-site certificates of the router and its peers')}
|
||||
{pki && view === 's2s' && builtinTab('s2s', 'S2S Issuing CA: the site-to-site certificates of the server and its peers')}
|
||||
|
||||
{pki && view === 'issuing' && (
|
||||
<Box sx={{ display: 'grid', gap: 2 }}>
|
||||
|
||||
Reference in new issue
Block a user