Refactroring

This commit is contained in:
dahoud
2025-11-29 04:21:41 +00:00
parent 5b831086f1
commit 952141662b
3 changed files with 50 additions and 16 deletions

View File

@@ -1,46 +1,71 @@
version: '3.8'
# IMPORTANT: Pour la production, créez un fichier .env avec les variables suivantes:
# KEYCLOAK_ADMIN_USER=admin
# KEYCLOAK_ADMIN_PASSWORD=<mot_de_passe_securise>
# KC_DB_USERNAME=keycloak
# KC_DB_PASSWORD=<mot_de_passe_securise>
# KC_HOSTNAME=<votre_hostname_production>
# POSTGRES_PASSWORD=<mot_de_passe_securise>
services:
keycloak:
image: quay.io/keycloak/keycloak:23.0.0
container_name: unionflow-keycloak
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin123
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN_USER:-admin}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:?KEYCLOAK_ADMIN_PASSWORD is required}
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://postgres:5432/keycloak
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: keycloak123
KC_HOSTNAME: 192.168.1.11
KC_HOSTNAME_PORT: 8180
KC_HTTP_ENABLED: true
KC_DB_USERNAME: ${KC_DB_USERNAME:-keycloak}
KC_DB_PASSWORD: ${KC_DB_PASSWORD:?KC_DB_PASSWORD is required}
KC_HOSTNAME: ${KC_HOSTNAME:-localhost}
KC_HOSTNAME_PORT: ${KC_HOSTNAME_PORT:-8180}
KC_HTTP_ENABLED: ${KC_HTTP_ENABLED:-false}
KC_HTTPS_ENABLED: ${KC_HTTPS_ENABLED:-true}
KC_HTTP_PORT: 8180
KC_HOSTNAME_STRICT: false
KC_HOSTNAME_STRICT_HTTPS: false
KC_HOSTNAME_STRICT: ${KC_HOSTNAME_STRICT:-true}
KC_HOSTNAME_STRICT_HTTPS: ${KC_HOSTNAME_STRICT_HTTPS:-true}
ports:
- "8180:8180"
- "${KC_HOST_PORT:-8180}:8180"
depends_on:
- postgres
postgres:
condition: service_healthy
command: start --optimized
networks:
- unionflow-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8180/health/ready || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
postgres:
image: postgres:15
container_name: unionflow-postgres
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: keycloak123
POSTGRES_DB: ${POSTGRES_DB:-keycloak}
POSTGRES_USER: ${KC_DB_USERNAME:-keycloak}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
- "${POSTGRES_HOST_PORT:-5432}:5432"
networks:
- unionflow-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${KC_DB_USERNAME:-keycloak} -d ${POSTGRES_DB:-keycloak}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
volumes:
postgres_data:
driver: local
networks:
unionflow-network:

View File

@@ -21,7 +21,8 @@
<meta name="description" content="A new Flutter project.">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Obsolète : apple-mobile-web-app-capable. Remplacé par mobile-web-app-capable -->
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="unionflow_mobile_apps">
<link rel="apple-touch-icon" href="icons/Icon-192.png">

View File

@@ -47,6 +47,7 @@ public class OrganisationResource {
/** Crée une nouvelle organisation */
@POST
@jakarta.annotation.security.PermitAll
@Operation(
summary = "Créer une nouvelle organisation",
description = "Crée une nouvelle organisation dans le système")
@@ -146,6 +147,7 @@ public class OrganisationResource {
/** Récupère une organisation par son ID */
@GET
@Path("/{id}")
@jakarta.annotation.security.PermitAll
@Operation(
summary = "Récupérer une organisation",
description = "Récupère une organisation par son ID")
@@ -182,6 +184,7 @@ public class OrganisationResource {
/** Met à jour une organisation */
@PUT
@Path("/{id}")
@jakarta.annotation.security.PermitAll
@Operation(
summary = "Mettre à jour une organisation",
description = "Met à jour les informations d'une organisation")
@@ -232,6 +235,7 @@ public class OrganisationResource {
/** Supprime une organisation */
@DELETE
@Path("/{id}")
@jakarta.annotation.security.PermitAll
@Operation(
summary = "Supprimer une organisation",
description = "Supprime une organisation (soft delete)")
@@ -270,6 +274,7 @@ public class OrganisationResource {
/** Recherche avancée d'organisations */
@GET
@Path("/recherche")
@jakarta.annotation.security.PermitAll
@Operation(
summary = "Recherche avancée",
description = "Recherche d'organisations avec critères multiples")
@@ -319,6 +324,7 @@ public class OrganisationResource {
/** Active une organisation */
@POST
@Path("/{id}/activer")
@jakarta.annotation.security.PermitAll
@Operation(
summary = "Activer une organisation",
description = "Active une organisation suspendue")
@@ -352,6 +358,7 @@ public class OrganisationResource {
/** Suspend une organisation */
@POST
@Path("/{id}/suspendre")
@jakarta.annotation.security.PermitAll
@Operation(
summary = "Suspendre une organisation",
description = "Suspend une organisation active")
@@ -385,6 +392,7 @@ public class OrganisationResource {
/** Obtient les statistiques des organisations */
@GET
@Path("/statistiques")
@jakarta.annotation.security.PermitAll
@Operation(
summary = "Statistiques des organisations",
description = "Récupère les statistiques globales des organisations")