Files
PS_Launcher/server/admin/assets/style.css
j.foucher 92f4fd16e8 Backoffice: PHP admin web UI for licenses, versions, audit
Self-contained admin under /PS_Launcher/admin/ on the same OVH host. No
JS framework, no Composer deps — just PHP 8.3 + sessions + a small CSS.

Auth & infrastructure
---------------------
- admin/lib/Auth.php: session + CSRF helper. Login via password_hash /
  password_verify. session_regenerate_id on successful login.
  config.example.php gains admin_password_hash, generated by:
  php -r "echo password_hash('PWD', PASSWORD_DEFAULT);"
- admin/lib/Layout.php: shared header/footer/nav, formatBytes,
  csrfField helpers.
- admin/.htaccess: noindex / X-Frame-Options DENY / X-Content-Type
  nosniff / blocks lib/*.php from web access.
- admin/assets/style.css: matches launcher's dark theme — same
  Brush.* palette mapped to CSS vars, vivid green/blue/amber status
  pills consistent with the WPF UI.

Pages
-----
- index.php (Dashboard): KPIs (active/expired/revoked licenses, machines
  seen 30d, validations 24h), manifest signature status, last 10
  audit_log entries.
- licenses.php: full CRUD.
  * Émettre: owner, expiration date, max machines, internal notes →
    generates a PRSRV-XXXX-XXXX-XXXX-XXXX key, displays it ONCE in a
    green callout (DB stores the key; the message stays only on this
    request, never shown again).
  * Prolonger (per-row, expandable form), Revoke / Unrevoke,
    Reset machines (frees all slots for that license).
  * Status badge: active / expired / revoked.
- versions.php: edit the manifest from the web.
  * Add a version: number + release date + minLicenseDate + release
    notes Markdown (creates releasenotes/{version}.md). Sets default
    download URL to {base_url}/builds/proserve-{version}.zip.
  * Per-row Méta (edit minLicenseDate / releasedAt), Notes (edit md
    inline), toggle availableForDownload, Delete entry.
  * 🔁 Sync (sign-manifest) button: shells out to
    `php tools/sign-manifest.php` and shows its stdout — recomputes
    sha256/sizeBytes for every uploaded ZIP, bumps `latest`, signs
    Ed25519. Visual indicators on each row: zip presence, hash
    computed yes/no, signature status.
  * Lists orphan ZIPs in builds/ that no manifest entry references.
- audit.php: paginated audit_log viewer (100/page) with event-type
  filter dropdown. JOINs licenses to show owner_name. Color-codes
  events (validate_ok green, expired amber, invalid/revoked red).

Server README rewritten to document the full setup flow:
1. Create MySQL DB, run migrations/001_init.sql
2. Copy config.example.php → config.php, fill db credentials
3. php tools/generate-keypair.php → paste into config.php and into the
   client's Resources/server-pubkey.txt
4. Set admin_password_hash in config.php
5. Login at /PS_Launcher/admin/

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 10:21:52 +02:00

133 lines
4.8 KiB
CSS

:root {
--bg: #1B1B1F;
--bg-card: #26262B;
--bg-elevated: #2C2C32;
--bg-input: #1A1A20;
--border: #37373D;
--text: #F2F2F2;
--text-secondary: #A0A0A8;
--accent: #3B82F6;
--accent-hover: #2563EB;
--installed: #16A34A;
--installed-bg: #0E2A1B;
--busy: #F59E0B;
--busy-bg: #3A2A0E;
--danger: #EF4444;
--danger-bg: #2A1414;
}
* { box-sizing: border-box; }
body {
background: var(--bg); color: var(--text);
font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
font-size: 14px; line-height: 1.5;
margin: 0;
}
nav {
background: #202024; border-bottom: 1px solid var(--border);
padding: 12px 24px; display: flex; gap: 8px; align-items: center;
}
nav .brand { color: #fff; font-weight: 700; margin-right: 16px; }
nav a {
color: var(--text-secondary); text-decoration: none;
padding: 6px 14px; border-radius: 4px; font-size: 13px;
}
nav a:hover { background: var(--bg-elevated); color: var(--text); }
nav a.active { background: var(--bg-elevated); color: var(--text); }
nav .spacer { flex: 1; }
nav a.logout { color: var(--text-secondary); }
main { padding: 24px; max-width: 1200px; margin: 0 auto; }
h1 { margin: 0 0 24px 0; font-size: 26px; font-weight: 600; }
h2 {
margin: 0 0 12px 0; font-size: 12px; font-weight: 700;
color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px;
}
.card {
background: var(--bg-card); border: 1px solid var(--border);
border-radius: 6px; padding: 20px; margin-bottom: 16px;
}
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row .col { flex: 1; min-width: 200px; }
table { width: 100%; border-collapse: collapse; }
th {
text-align: left; color: var(--text-secondary); font-size: 11px;
text-transform: uppercase; letter-spacing: 0.5px;
padding: 10px 8px; border-bottom: 1px solid var(--border);
font-weight: 600;
}
td { padding: 12px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-elevated); }
.btn {
display: inline-block; padding: 8px 16px;
border-radius: 4px; border: none; cursor: pointer;
font-size: 13px; font-family: inherit; text-decoration: none;
font-weight: 500;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: var(--installed); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--bg-elevated); color: var(--text); }
.btn-secondary:hover { background: #3A3A40; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
input[type=text], input[type=password], input[type=date], input[type=datetime-local],
input[type=number], select, textarea {
background: var(--bg-input); color: var(--text);
border: 1px solid var(--border); padding: 8px 10px;
border-radius: 4px; font-family: inherit; font-size: 13px;
width: 100%;
}
input:focus, textarea:focus, select:focus {
outline: none; border-color: var(--accent);
}
label { display: block; margin-bottom: 4px; font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.field { margin-bottom: 16px; }
.field input[type=checkbox] { width: auto; margin-right: 8px; }
.flash { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.flash.error { background: var(--danger-bg); color: #FCA5A5; border: 1px solid var(--danger); }
.flash.success { background: var(--installed-bg); color: #6EE7B7; border: 1px solid var(--installed); }
.badge {
display: inline-block; padding: 2px 8px; border-radius: 10px;
font-size: 11px; font-weight: 600; color: white; line-height: 1.5;
}
.badge-success { background: var(--installed); }
.badge-danger { background: var(--danger); }
.badge-warning { background: var(--busy); }
.badge-secondary { background: var(--bg-elevated); color: var(--text-secondary); }
.muted { color: var(--text-secondary); }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
code {
background: var(--bg-input); padding: 2px 6px; border-radius: 3px;
font-family: 'Cascadia Code', 'Consolas', monospace; font-size: 12px;
color: #C5E1A5;
}
pre {
background: var(--bg-input); padding: 12px; border-radius: 4px;
font-family: 'Cascadia Code', 'Consolas', monospace; font-size: 12px;
overflow: auto; white-space: pre-wrap; word-break: break-all;
}
.kpi { font-size: 36px; font-weight: 700; line-height: 1; }
.kpi-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; font-weight: 600; }
ol, ul { margin: 0; padding-left: 20px; }
li { margin-bottom: 4px; }
details summary { cursor: pointer; padding: 4px 0; }
details[open] { background: var(--bg-elevated); padding: 8px; border-radius: 4px; margin: 4px 0; }
a { color: var(--accent); }
a:hover { text-decoration: underline; }