Rattrapage pb de gitea

Signed-off-by: Gato <cedric@goutailler-olivier.fr>
This commit is contained in:
2026-06-06 21:01:24 +02:00
parent 86fa4f8519
commit 5ba69d1e16
23 changed files with 832 additions and 730 deletions
+3
View File
@@ -0,0 +1,3 @@
POSTGRES_PASSWORD=changeme
KEYCLOAK_ADMIN=admin
KEYCLOAK_ADMIN_PASSWORD=changeme
+67
View File
@@ -0,0 +1,67 @@
name: keycloak-stack
services:
db:
image: postgres:16-alpine
container_name: keycloak-db
restart: unless-stopped
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
TZ: Europe/Paris
healthcheck:
test: ["CMD-SHELL", "pg_isready -U keycloak -d keycloak"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- ./db_data:/var/lib/postgresql/data
networks:
- keycloak-net
keycloak:
image: quay.io/keycloak/keycloak:26.2
container_name: keycloak
restart: unless-stopped
command: start
depends_on:
db:
condition: service_healthy
environment:
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://db:5432/keycloak
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: ${POSTGRES_PASSWORD}
KC_HOSTNAME: auth.goutailler-olivier.com
KC_HOSTNAME_STRICT: "true"
KC_HTTP_ENABLED: "true"
KC_PROXY_HEADERS: xforwarded
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN:-admin}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD}
TZ: Europe/Paris
KC_SPI_THEME_STATIC_MAX_AGE: "-1"
KC_SPI_THEME_CACHE_THEMES: "false"
KC_SPI_THEME_CACHE_TEMPLATES: "false"
volumes:
- ./themes:/opt/keycloak/themes
networks:
- keycloak-net
- proxy
labels:
- traefik.enable=true
- traefik.http.routers.keycloak.rule=Host(`auth.goutailler-olivier.com`)
- traefik.http.routers.keycloak.entrypoints=websecure
- traefik.http.routers.keycloak.tls.certresolver=le
- traefik.http.services.keycloak.loadbalancer.server.port=8080
- traefik.docker.network=proxy
networks:
keycloak-net:
driver: bridge
proxy:
external: true
name: proxy
@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html lang="${(locale.currentLanguageTag)!'fr'}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bonsai — Réinitialisation du mot de passe</title>
<link rel="stylesheet" href="${url.resourcesPath}/css/login.css">
</head>
<body>
<div class="page">
<div class="card">
<div class="logo">
<svg viewBox="0 0 48 56" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<path d="M14 56 L16 49 L32 49 L34 56 Z" fill="#C05621"/>
<rect x="12" y="45" width="24" height="5" rx="2" fill="#9C4221"/>
<path d="M24 45 C24 39 22 33 20 27 C18 22 19 17 22 13" stroke="#744210" stroke-width="4" stroke-linecap="round"/>
<path d="M21 28 C26 25 31 22 33 18" stroke="#744210" stroke-width="2.5" stroke-linecap="round"/>
<path d="M20 35 C15 32 11 28 10 24" stroke="#744210" stroke-width="2" stroke-linecap="round"/>
<circle cx="10" cy="21" r="9" fill="#276749"/>
<circle cx="34" cy="16" r="10" fill="#276749"/>
<circle cx="22" cy="11" r="11" fill="#2F855A"/>
<circle cx="26" cy="17" r="8" fill="#38A169"/>
<circle cx="18" cy="16" r="6" fill="#48BB78"/>
</svg>
<span class="logo-name">Bonsai</span>
</div>
<h1 class="title">Mot de passe oublié ?</h1>
<p class="subtitle">Saisissez votre email pour recevoir un lien de réinitialisation.</p>
<#if message?has_content>
<div class="alert alert--${message.type}">
${message.summary}
</div>
</#if>
<form action="${url.loginAction}" method="post">
<div class="field">
<label for="username">Email ou nom d'utilisateur</label>
<input
type="text"
id="username"
name="username"
value="${(auth.attemptedUsername!'')}"
autocomplete="username"
autofocus
/>
</div>
<button type="submit" class="btn-primary">Envoyer le lien</button>
</form>
<p class="register-link">
<a href="${url.loginUrl}">← Retour à la connexion</a>
</p>
</div>
</div>
</body>
</html>
+105
View File
@@ -0,0 +1,105 @@
<!DOCTYPE html>
<html lang="${(locale.currentLanguageTag)!'fr'}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bonsai — Connexion</title>
<link rel="stylesheet" href="${url.resourcesPath}/css/login.css">
</head>
<body>
<div class="page">
<div class="card">
<div class="logo">
<svg viewBox="0 0 48 56" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<path d="M14 56 L16 49 L32 49 L34 56 Z" fill="#C05621"/>
<rect x="12" y="45" width="24" height="5" rx="2" fill="#9C4221"/>
<path d="M24 45 C24 39 22 33 20 27 C18 22 19 17 22 13" stroke="#744210" stroke-width="4" stroke-linecap="round"/>
<path d="M21 28 C26 25 31 22 33 18" stroke="#744210" stroke-width="2.5" stroke-linecap="round"/>
<path d="M20 35 C15 32 11 28 10 24" stroke="#744210" stroke-width="2" stroke-linecap="round"/>
<circle cx="10" cy="21" r="9" fill="#276749"/>
<circle cx="34" cy="16" r="10" fill="#276749"/>
<circle cx="22" cy="11" r="11" fill="#2F855A"/>
<circle cx="26" cy="17" r="8" fill="#38A169"/>
<circle cx="18" cy="16" r="6" fill="#48BB78"/>
</svg>
<span class="logo-name">Bonsai</span>
</div>
<h1 class="title">Connexion</h1>
<#if message?has_content>
<div class="alert alert--${message.type}">
${message.summary}
</div>
</#if>
<#if realm.password>
<form action="${url.loginAction}" method="post" novalidate>
<input type="hidden" id="id-hidden-input" name="credentialId"
<#if auth.selectedCredential?has_content>value="${auth.selectedCredential}"</#if>/>
<div class="field">
<label for="username">Email ou nom d'utilisateur</label>
<input
type="text"
id="username"
name="username"
value="${(login.username!'')}"
autocomplete="username"
<#if usernameEditDisabled??>disabled</#if>
autofocus
/>
</div>
<div class="field">
<div class="field-label-row">
<label for="password">Mot de passe</label>
<#if realm.resetPasswordAllowed>
<a href="${url.loginResetCredentialsUrl}" class="forgot-link" tabindex="5">
Mot de passe oublié ?
</a>
</#if>
</div>
<input
type="password"
id="password"
name="password"
autocomplete="current-password"
/>
</div>
<#if realm.rememberMe && !usernameEditDisabled??>
<div class="remember">
<input type="checkbox" id="rememberMe" name="rememberMe"
<#if login.rememberMe??>checked</#if>>
<label for="rememberMe">Se souvenir de moi</label>
</div>
</#if>
<button type="submit" class="btn-primary">Se connecter</button>
</form>
</#if>
<#if social.providers?has_content>
<div class="divider"><span>ou</span></div>
<div class="socials">
<#list social.providers as p>
<a href="${p.loginUrl}" class="btn-social">
Continuer avec ${p.displayName!''}
</a>
</#list>
</div>
</#if>
<#if realm.password && realm.registrationAllowed && !registrationDisabled??>
<p class="register-link">
Pas encore de compte ?
<a href="${url.registrationUrl}">Créer un compte</a>
</p>
</#if>
</div>
</div>
</body>
</html>
@@ -0,0 +1,262 @@
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: system-ui, -apple-system, sans-serif;
font-size: 0.9rem;
color: #111827;
background: #f0fdf4;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
/* ── Page ── */
.page {
width: 100%;
padding: 1.5rem;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
/* ── Card ── */
.card {
background: #ffffff;
border: 1px solid #e5e7eb;
border-radius: 0.75rem;
padding: 2.5rem 2rem;
width: 100%;
max-width: 380px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
display: flex;
flex-direction: column;
gap: 1.25rem;
}
/* ── Logo ── */
.logo {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.4rem;
}
.logo svg {
width: 52px;
height: 60px;
}
.logo-name {
font-size: 1.3rem;
font-weight: 800;
color: #111827;
letter-spacing: -0.02em;
}
/* ── Titles ── */
.title {
font-size: 1.1rem;
font-weight: 700;
color: #111827;
text-align: center;
}
.subtitle {
font-size: 0.85rem;
color: #6b7280;
text-align: center;
line-height: 1.5;
}
/* ── Alert ── */
.alert {
padding: 0.65rem 0.875rem;
border-radius: 0.5rem;
font-size: 0.85rem;
line-height: 1.4;
}
.alert--error {
background: #fef2f2;
color: #dc2626;
border: 1px solid #fecaca;
}
.alert--warning {
background: #fffbeb;
color: #d97706;
border: 1px solid #fde68a;
}
.alert--success {
background: #f0fdf4;
color: #16a34a;
border: 1px solid #bbf7d0;
}
.alert--info {
background: #eff6ff;
color: #2563eb;
border: 1px solid #bfdbfe;
}
/* ── Form fields ── */
.field {
display: flex;
flex-direction: column;
gap: 0.375rem;
}
.field-label-row {
display: flex;
justify-content: space-between;
align-items: baseline;
}
.field label {
font-size: 0.85rem;
font-weight: 500;
color: #374151;
}
.field input {
width: 100%;
padding: 0.55rem 0.75rem;
border: 1px solid #d1d5db;
border-radius: 0.5rem;
font-size: 0.9rem;
color: #111827;
background: #ffffff;
outline: none;
transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
border-color: #2F855A;
box-shadow: 0 0 0 3px rgba(47, 133, 90, 0.15);
}
.field input:disabled {
background: #f3f4f6;
color: #9ca3af;
cursor: not-allowed;
}
.forgot-link {
font-size: 0.78rem;
color: #2F855A;
text-decoration: none;
}
.forgot-link:hover {
text-decoration: underline;
}
/* ── Remember me ── */
.remember {
display: flex;
align-items: center;
gap: 0.5rem;
}
.remember input[type="checkbox"] {
width: 1rem;
height: 1rem;
accent-color: #2F855A;
cursor: pointer;
flex-shrink: 0;
}
.remember label {
font-size: 0.85rem;
color: #374151;
cursor: pointer;
}
/* ── Primary button ── */
.btn-primary {
width: 100%;
padding: 0.6rem;
background: #2F855A;
color: #ffffff;
font-size: 0.9rem;
font-weight: 600;
border: none;
border-radius: 0.5rem;
cursor: pointer;
transition: background 0.15s;
}
.btn-primary:hover {
background: #276749;
}
.btn-primary:active {
background: #1e5236;
}
/* ── Divider ── */
.divider {
display: flex;
align-items: center;
gap: 0.75rem;
color: #9ca3af;
font-size: 0.8rem;
}
.divider::before,
.divider::after {
content: '';
flex: 1;
border-top: 1px solid #e5e7eb;
}
/* ── Social buttons ── */
.socials {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.btn-social {
display: block;
width: 100%;
padding: 0.55rem;
text-align: center;
font-size: 0.875rem;
font-weight: 500;
color: #374151;
background: #ffffff;
border: 1px solid #d1d5db;
border-radius: 0.5rem;
text-decoration: none;
transition: background 0.1s, border-color 0.1s;
}
.btn-social:hover {
background: #f3f4f6;
border-color: #9ca3af;
}
/* ── Register link ── */
.register-link {
text-align: center;
font-size: 0.83rem;
color: #6b7280;
}
.register-link a {
color: #2F855A;
text-decoration: none;
font-weight: 500;
}
.register-link a:hover {
text-decoration: underline;
}
@@ -0,0 +1,2 @@
parent=keycloak
styles=css/login.css