Merkmal personalisierung (Migration 0062) und Hinweisseite /personalisierung
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
46ec2f5151
commit
e72d9da725
2 files changed
+53
-1
No files matched your search
@@ -23,7 +23,7 @@ from cryptography.fernet import Fernet, InvalidToken
|
||||
|
||||
from fastapi import FastAPI, Header, HTTPException, Request
|
||||
from pydantic import BaseModel
|
||||
from fastapi.responses import FileResponse
|
||||
from fastapi.responses import FileResponse, HTMLResponse
|
||||
|
||||
|
||||
LOG_PATH = Path("activation.log")
|
||||
@@ -5822,6 +5822,35 @@ def health():
|
||||
}
|
||||
|
||||
|
||||
# Startseite des Kiosks im Konto "Personalisierung" (ADR-0041, Rolle
|
||||
# personalisierung in ansible-content). Bis das Formular mit Aktivierungscode
|
||||
# steht, nur ein Hinweis. "tuxflotte:abmelden" fängt der Kiosk ab und beendet
|
||||
# die Sitzung.
|
||||
PERSONALISIERUNG_SEITE = """<!doctype html>
|
||||
<html lang="de"><head><meta charset="utf-8">
|
||||
<title>Personalisierung</title>
|
||||
<style>
|
||||
body { font-family: sans-serif; background: #f4f4f4; color: #222;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
height: 100vh; margin: 0; }
|
||||
main { max-width: 34em; text-align: center; }
|
||||
a { display: inline-block; margin: 1em .5em; padding: .7em 1.4em;
|
||||
background: #2a6db0; color: #fff; text-decoration: none; border-radius: 4px; }
|
||||
</style></head><body><main>
|
||||
<h1>Personalisierung</h1>
|
||||
<p>Hier wird bald ein persönliches Konto für dieses Gerät eingerichtet.
|
||||
Dafür brauchst du einen Aktivierungscode von der Verwaltung deiner
|
||||
Einrichtung. Die Einrichtung ist noch nicht freigeschaltet.</p>
|
||||
<a href="tuxflotte:abmelden">Abmelden</a>
|
||||
</main></body></html>
|
||||
"""
|
||||
|
||||
|
||||
@app.get("/personalisierung", response_class=HTMLResponse)
|
||||
def personalisierung_seite():
|
||||
return HTMLResponse(PERSONALISIERUNG_SEITE, headers={"Cache-Control": "no-store"})
|
||||
|
||||
|
||||
@app.post("/api/v1/activate")
|
||||
def activate(payload: ActivationRequest, request: Request):
|
||||
# Enrollment Sessions zuerst versuchen (Auto-Modus-ISOs, siehe
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
BEGIN;
|
||||
|
||||
-- ADR-0041, Ergänzung 14.10.2026: "Personalisierung möglich" als
|
||||
-- Katalogmerkmal, am Workspace vorgegeben und je OE/Gruppe/Gerät
|
||||
-- übersteuerbar. Die Rolle personalisierung richtet nur das Konto
|
||||
-- "Personalisierung" mit Kiosk am Anmeldebildschirm ein; personalisiert wird
|
||||
-- erst mit einem Aktivierungscode je Gerät.
|
||||
--
|
||||
-- Blueprints nur für LightDM-Backends (Mint, Debian). Für Ubuntu/GDM gibt es
|
||||
-- noch keinen Weg, das Merkmal soll dort nicht wählbar erscheinen.
|
||||
|
||||
INSERT INTO merkmale (id, key, name, description, kategorie_id, im_auftragskatalog) VALUES
|
||||
(gen_random_uuid(), 'personalisierung', 'Personalisierung möglich',
|
||||
'Am Anmeldebildschirm steht das Konto „Personalisierung“. Damit kann auf einem einzelnen Gerät mit einem Aktivierungscode der Verwaltung ein persönliches Konto eingerichtet werden. Ohne Code passiert nichts.',
|
||||
(SELECT id FROM kategorien WHERE key = 'konfig-identitaet-netzwerk'), TRUE);
|
||||
|
||||
INSERT INTO blueprints (id, merkmal_id, backend_id, ansible_role)
|
||||
SELECT gen_random_uuid(), m.id, b.id, m.key
|
||||
FROM merkmale m
|
||||
JOIN backends b ON b.key IN ('mint-image', 'debian-image')
|
||||
WHERE m.key = 'personalisierung';
|
||||
|
||||
COMMIT;
|
||||
Reference in new issue
Block a user