ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.
Python astracloudflarecontrol-panelcyberpaneldnsfablehosting-control-panelhosting-panelkimi-k3server-managementserverkitubuntu-web-panelwebserver
feat(extensions): install consent UX with signature badges
Juan Denis0299d334af4f
diff --git a/frontend/src/components/marketplace/ManualInstallModal.jsx b/frontend/src/components/marketplace/ManualInstallModal.jsxindex 50a9c8b3..c454a0d7 100644--- a/frontend/src/components/marketplace/ManualInstallModal.jsx+++ b/frontend/src/components/marketplace/ManualInstallModal.jsx@@ -7,6 +7,7 @@ import {PlugZap,Search,ShieldAlert,+ ShieldCheck,} from 'lucide-react';import api from '../../services/api';import { useToast } from '../../contexts/ToastContext';@@ -52,12 +53,50 @@ const SourceInput = ({</div>);+// Signature verdict badge for the consent card (plan 55). 'verified' means the+// release zip's ed25519 signature checked out against a publisher key pinned+// by this panel; everything else is an honest not-verified treatment.+const SignatureBadge = ({ signature }) => {+ const status = signature?.status || 'unsigned';+ if (status === 'verified') {+ return (+ <Badge variant="success" className="plugin-install-consent__badge">+ <ShieldCheck aria-hidden="true" />+ Signed · {signature.publisher || signature.key_id}+ </Badge>+ );+ }+ if (status === 'untrusted_key') {+ return (+ <Badge variant="warning" className="plugin-install-consent__badge">+ <ShieldAlert aria-hidden="true" />+ Signed · unknown publisher+ </Badge>+ );+ }+ if (status === 'invalid') {+ return (+ <Badge variant="destructive" className="plugin-install-consent__badge">+ <ShieldAlert aria-hidden="true" />+ Signature invalid+ </Badge>+ );+ }+ return (+ <Badge variant="warning" className="plugin-install-consent__badge">+ <ShieldAlert aria-hidden="true" />+ Unsigned+ </Badge>+ );+};+// The consent card shown after a GitHub/zip URL is resolved but before install.// Presents what will be installed and what it wants — the same permissions// presentation as the registry detail modal — so the install is never blind.const PreviewConsent = ({ preview, installing, onInstall, onCancel }) => {const permissions = Array.isArray(preview.permissions) ? preview.permissions : [];const warnings = Array.isArray(preview.warnings) ? preview.warnings : [];+ const sigStatus = preview.signature?.status || 'unsigned';const compat = preview.min_panel_version || preview.max_panel_version? `Panel ${preview.min_panel_version || '*'}–${preview.max_panel_version || '*'}`: null;@@ -74,16 +113,32 @@ const PreviewConsent = ({ preview, installing, onInstall, onCancel }) => {{compat && <span>{compat}</span>}</div></div>- <Badge variant="warning" className="plugin-install-consent__badge">- <ShieldAlert aria-hidden="true" />- GitHub · unverified- </Badge>+ <SignatureBadge signature={preview.signature} /></div>{preview.description && (<p className="plugin-install-consent__desc">{preview.description}</p>)}+ {sigStatus === 'invalid' && (+ <p className="plugin-install-consent__sig-note plugin-install-consent__sig-note--danger">+ {preview.signature?.error || 'The signature does not match this archive.'}+ {' '}The download may have been tampered with — do not install it.+ </p>+ )}+ {sigStatus === 'untrusted_key' && (+ <p className="plugin-install-consent__sig-note">+ This release is signed, but the publisher key is not pinned by this+ panel, so the signature cannot be verified. Treat it as unsigned.+ </p>+ )}+ {sigStatus === 'unsigned' && (+ <p className="plugin-install-consent__sig-note">+ This release carries no publisher signature. It will run with full+ panel privileges — install only if you trust the source.+ </p>+ )}+<div className="plugin-install-consent__section"><p className="plugin-install-consent__label">This extension requests:</p>{permissions.length > 0 ? (@@ -112,9 +167,14 @@ const PreviewConsent = ({ preview, installing, onInstall, onCancel }) => {<Button variant="secondary" onClick={onCancel} disabled={installing}>Back</Button>- <Button onClick={onInstall} disabled={installing}>+ <Button+ onClick={onInstall}+ disabled={installing || sigStatus === 'invalid'}+ variant={sigStatus === 'verified' ? 'default' : 'destructive'}+ ><DownloadCloud aria-hidden="true" />- {installing ? 'Installing...' : 'Install'}+ {installing ? 'Installing...'+ : sigStatus === 'verified' ? 'Install' : 'Install anyway'}</Button></div></div>@@ -161,8 +221,10 @@ const ManualInstallModal = ({ defaultSource = 'url', onClose, onInstalled }) =>const handleInstallFromPreview = async () => {setInstalling(true);try {- // Pin the install to the exact previewed bytes (resolved URL + sha256).- const result = await api.installPlugin(preview.resolved_url, preview.sha256);+ // Pin the install to the exact previewed bytes (resolved URL ++ // sha256) and re-verify the previewed signature against them.+ const result = await api.installPlugin(+ preview.resolved_url, preview.sha256, preview.signature);toast.success(`Extension "${result.display_name}" installed. Restart backend to activate routes.`);onInstalled();} catch (err) {diff --git a/frontend/src/pages/Marketplace.jsx b/frontend/src/pages/Marketplace.jsxindex 37eee3b2..a9796a2e 100644--- a/frontend/src/pages/Marketplace.jsx+++ b/frontend/src/pages/Marketplace.jsx@@ -11,6 +11,7 @@ import {Plug,PlugZap,ServerCog,+ ShieldAlert,ShieldCheck,Sparkles,Star,@@ -87,6 +88,12 @@ const getRegistryCatalogEntry = (entry) => ({firstParty: isFirstParty(entry.author, entry),trust: entry.trust || 'unreviewed',review: entry.review || null,+ // Release-signature state from the index (plan 55): `signed` means the+ // entry carries an ed25519 signature the panel verifies at install;+ // `publisherTrusted` means the named key is pinned by this panel.+ signed: Boolean(entry.signature),+ publisherTrusted: Boolean(entry.publisher_trusted),+ publisherKeyId: entry.publisher_key_id || null,icon: entry.icon || null,logo: entry.logo || null,repo: entry.repo || entry.homepage || null,@@ -128,6 +135,33 @@ const TrustBadge = ({ entry }) => {return null;};+// Release-signature badge (plan 55). Shown on the registry detail modal next+// to TrustBadge: 'signed · verified' means the index pins an ed25519 signature+// whose publisher key this panel trusts (verified cryptographically at+// install); unsigned entries get the honest unsigned treatment.+const SignatureBadge = ({ entry }) => {+ if (entry.source !== 'registry') return null;+ if (entry.signed && entry.publisherTrusted) {+ return (+ <Badge variant="success" title="Release zip is signed; the panel verifies the ed25519 signature at install">+ <ShieldCheck aria-hidden="true" /> Signed+ </Badge>+ );+ }+ if (entry.signed) {+ return (+ <Badge variant="warning" title={`Signed with publisher key '${entry.publisherKeyId}', which this panel does not pin`}>+ <ShieldAlert aria-hidden="true" /> Unknown signer+ </Badge>+ );+ }+ return (+ <Badge variant="outline" title="This release carries no publisher signature">+ Unsigned+ </Badge>+ );+};+const getLocalCatalogEntry = (builtin) => {const manifest = builtin.manifest || {};@@ -198,8 +232,9 @@ const Marketplace = () => {const [detailEntry, setDetailEntry] = useState(null);// Registry entry awaiting risk confirmation — drives the acknowledge-risk// dialog (confirm retries with acknowledge_risk: true). Shape:- // { slug, reason } where reason is 'unreviewed' (proactive gate or 409)- // or 'unverified' (409: entry has no pinned checksum).+ // { slug, reason } where reason is 'unreviewed' (proactive gate or 409),+ // 'unverified' (409: entry has no pinned checksum), or 'untrusted_key'+ // (signed by a publisher key this panel doesn't pin — plan 55).const [riskTarget, setRiskTarget] = useState(null);// Plugin pending uninstall — drives the keep-vs-purge data-policy dialog.const [uninstallTarget, setUninstallTarget] = useState(null);@@ -270,6 +305,10 @@ const Marketplace = () => {// Proactive gate: unreviewed registry entries confirm first// (the backend 409 path above covers the race/stale cases).setRiskTarget({ slug: entry.installKey, reason: 'unreviewed' });+ } else if (entry.signed && !entry.publisherTrusted) {+ // Signed by a publisher key this panel doesn't pin — consent first+ // (plan 55); the backend 409 path is the authoritative backstop.+ setRiskTarget({ slug: entry.installKey, reason: 'untrusted_key' });} else {handleRegistryInstall(entry.installKey);}@@ -550,7 +589,9 @@ const Marketplace = () => {onClose={() => setRiskTarget(null)}title={riskTarget.reason === 'unverified'? 'Install without checksum verification?'- : 'Install unreviewed extension?'}+ : riskTarget.reason === 'untrusted_key'+ ? 'Install with an unverifiable signature?'+ : 'Install unreviewed extension?'}size="sm"footer={<>@@ -566,8 +607,12 @@ const Marketplace = () => {{riskTarget.reason === 'unverified'? 'This extension has no pinned checksum, so the panel '+ 'cannot verify the artifact it would download.'- : 'This is a community extension whose exact code has not '- + 'been reviewed by the ServerKit maintainers.'}+ : riskTarget.reason === 'untrusted_key'+ ? 'This extension is signed, but the publisher key is not '+ + 'pinned by this panel, so the signature cannot be '+ + 'verified. Treat it as unsigned.'+ : 'This is a community extension whose exact code has not '+ + 'been reviewed by the ServerKit maintainers.'}</p><p className="text-muted">It runs with full panel privileges. Only install it if you trust@@ -766,6 +811,7 @@ const ExtensionDetailModal = ({ entry, installing, statusVariant, onClose, onIns<Badge variant="secondary" className="extension-firstparty">by ServerKit</Badge>)}<TrustBadge entry={entry} />+ <SignatureBadge entry={entry} /><Badge variant={sourceBadgeVariant(entry.source)}>{entry.sourceLabel}</Badge><Badge variant="outline">{titleCase(category)}</Badge></div>diff --git a/frontend/src/services/api/plugins.js b/frontend/src/services/api/plugins.jsindex 3f01d545..feae3afa 100644--- a/frontend/src/services/api/plugins.js+++ b/frontend/src/services/api/plugins.js@@ -20,11 +20,19 @@ export async function previewPlugin(url) {}// Install a plugin from a URL. Pass `sha256` (from previewPlugin) to pin the-// install to the exact previewed bytes.-export async function installPlugin(url, sha256 = null) {+// install to the exact previewed bytes, and `signature` (the preview's+// signature object) so the install re-verifies the detached ed25519 signature+// against those pinned bytes.+export async function installPlugin(url, sha256 = null, signature = null) {+ const body = { url };+ if (sha256) body.sha256 = sha256;+ if (signature && signature.signature) {+ body.signature = signature.signature;+ if (signature.key_id) body.publisher_key_id = signature.key_id;+ }return this.request('/plugins/install', {method: 'POST',- body: JSON.stringify(sha256 ? { url, sha256 } : { url }),+ body: JSON.stringify(body),});}diff --git a/frontend/src/styles/pages/_marketplace.scss b/frontend/src/styles/pages/_marketplace.scssindex be447a98..b8e23c5a 100644--- a/frontend/src/styles/pages/_marketplace.scss+++ b/frontend/src/styles/pages/_marketplace.scss@@ -756,6 +756,19 @@line-height: $line-height-normal;}+ // Signature verdict explainer under the description (plan 55): plain for+ // unsigned / unknown-publisher, red when the signature failed to verify.+ &__sig-note {+ margin: 0;+ font-size: $font-size-sm;+ line-height: $line-height-normal;+ color: $text-tertiary;++ &--danger {+ color: $danger;+ }+ }+&__label {margin: 0 0 $space-2;font-size: $font-size-sm;