Add phase 1: Docker setup, auth with invitations and roles
- Django 5.2 + PostgreSQL 17 via docker compose (app + db, volumes, healthcheck on /healthz, test profile running pytest against Postgres) - Custom e-mail user model with user/admin roles - Invitation-only registration with single-use, hashed, expiring links - Admin area: invitations, role changes, deactivation, password reset via one-time link or temporary password (forced change on login) - First admin created from ADMIN_EMAIL/ADMIN_PASSWORD on startup - Login rate limiting per e-mail and IP (DB-backed, worker-safe) - Proxy middleware honouring X-Forwarded-* only from TRUSTED_PROXIES, optional CLIENT_IP_HEADER (e.g. CF-Connecting-IP) - Security headers (CSP, HSTS, Permissions-Policy), secure __Host- cookies - Mobile-first German UI, CLAUDE.md, README, init-env script - 65 tests for auth, permissions, proxy handling and rate limiting Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,185 @@
|
||||
/* Mobile-first base styles. No build step, no framework. */
|
||||
:root {
|
||||
--bg: #faf7f2;
|
||||
--surface: #ffffff;
|
||||
--text: #2a2420;
|
||||
--muted: #74675d;
|
||||
--border: #e6ddd2;
|
||||
--accent: #b4532a;
|
||||
--accent-text: #ffffff;
|
||||
--danger: #b3261e;
|
||||
--ok-bg: #e7f3e8;
|
||||
--ok-text: #1f5130;
|
||||
--warn-bg: #fdf0d9;
|
||||
--warn-text: #6b4a10;
|
||||
--err-bg: #fbe4e2;
|
||||
--err-text: #7d1b15;
|
||||
--radius: 12px;
|
||||
--tap: 44px;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--bg: #1b1816;
|
||||
--surface: #26221f;
|
||||
--text: #efe8e1;
|
||||
--muted: #a99c90;
|
||||
--border: #3a342f;
|
||||
--accent: #e07a4b;
|
||||
--accent-text: #1b1816;
|
||||
--danger: #f08a80;
|
||||
--ok-bg: #1f3325;
|
||||
--ok-text: #b9e3c3;
|
||||
--warn-bg: #3a2f17;
|
||||
--warn-text: #f3d9a2;
|
||||
--err-bg: #3d1f1c;
|
||||
--err-text: #f6c2bc;
|
||||
}
|
||||
}
|
||||
|
||||
*, *::before, *::after { box-sizing: border-box; }
|
||||
|
||||
html { -webkit-text-size-adjust: 100%; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
||||
}
|
||||
|
||||
a { color: var(--accent); }
|
||||
h1 { font-size: 1.6rem; margin: 0.5rem 0 1rem; line-height: 1.2; }
|
||||
h2 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; }
|
||||
.card h2:first-child { margin-top: 0; }
|
||||
|
||||
.topbar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0.5rem 1rem;
|
||||
padding-top: max(0.5rem, env(safe-area-inset-top));
|
||||
background: var(--surface);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.brand { font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--text); }
|
||||
|
||||
.menu { position: relative; }
|
||||
.menu summary {
|
||||
list-style: none;
|
||||
cursor: pointer;
|
||||
min-width: var(--tap);
|
||||
min-height: var(--tap);
|
||||
display: grid;
|
||||
place-items: center;
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
.menu summary::-webkit-details-marker { display: none; }
|
||||
.menu nav {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: calc(100% + 4px);
|
||||
min-width: 220px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: 0 8px 24px rgb(0 0 0 / 0.15);
|
||||
padding: 0.25rem 0;
|
||||
}
|
||||
.menu nav a, .menu nav .linklike {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0.75rem 1rem;
|
||||
text-align: left;
|
||||
color: var(--text);
|
||||
text-decoration: none;
|
||||
}
|
||||
.menu nav form { margin: 0; }
|
||||
|
||||
.container {
|
||||
max-width: 760px;
|
||||
margin: 0 auto;
|
||||
padding: 1rem;
|
||||
padding-bottom: max(2rem, env(safe-area-inset-bottom));
|
||||
}
|
||||
.narrow { max-width: 440px; margin: 0 auto; }
|
||||
|
||||
.card {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.card.inactive { opacity: 0.65; }
|
||||
|
||||
.muted { color: var(--muted); font-size: 0.92rem; }
|
||||
|
||||
.field { margin-bottom: 1rem; }
|
||||
.field label, .card > label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
|
||||
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"],
|
||||
select, textarea {
|
||||
width: 100%;
|
||||
min-height: var(--tap);
|
||||
padding: 0.6rem 0.75rem;
|
||||
font: inherit;
|
||||
color: var(--text);
|
||||
background: var(--bg);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
}
|
||||
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
|
||||
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
|
||||
.help { display: block; color: var(--muted); margin-top: 0.25rem; }
|
||||
.error { display: block; color: var(--danger); margin-top: 0.25rem; }
|
||||
|
||||
.button, button {
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
.button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: var(--tap);
|
||||
padding: 0.5rem 1.1rem;
|
||||
border: 0;
|
||||
border-radius: 999px;
|
||||
background: var(--accent);
|
||||
color: var(--accent-text);
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
}
|
||||
.button.wide { width: 100%; }
|
||||
.button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
|
||||
.button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
|
||||
.button.small { min-height: 36px; padding: 0.3rem 0.9rem; font-size: 0.9rem; margin-top: 0.5rem; }
|
||||
.linklike { background: none; border: 0; padding: 0; color: var(--accent); }
|
||||
|
||||
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
|
||||
.msg { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 0.5rem; }
|
||||
.msg-success, .msg-info { background: var(--ok-bg); color: var(--ok-text); }
|
||||
.msg-warning { background: var(--warn-bg); color: var(--warn-text); }
|
||||
.msg-error { background: var(--err-bg); color: var(--err-text); }
|
||||
|
||||
.list { list-style: none; padding: 0; margin: 0; }
|
||||
.row-head { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
|
||||
.badge {
|
||||
font-size: 0.78rem;
|
||||
padding: 0.1rem 0.55rem;
|
||||
border-radius: 999px;
|
||||
background: var(--accent);
|
||||
color: var(--accent-text);
|
||||
}
|
||||
.badge-muted { background: var(--border); color: var(--text); }
|
||||
|
||||
.actions { margin-top: 0.5rem; }
|
||||
.actions summary { cursor: pointer; color: var(--accent); min-height: var(--tap); display: flex; align-items: center; }
|
||||
.action-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
|
||||
.action-buttons form { margin: 0; }
|
||||
|
||||
.copyrow { display: flex; gap: 0.5rem; margin: 0.5rem 0; }
|
||||
.copyrow input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 0.9rem; }
|
||||
Reference in New Issue
Block a user