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' 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: services:
keycloak: keycloak:
image: quay.io/keycloak/keycloak:23.0.0 image: quay.io/keycloak/keycloak:23.0.0
container_name: unionflow-keycloak container_name: unionflow-keycloak
environment: environment:
KEYCLOAK_ADMIN: admin KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN_USER:-admin}
KEYCLOAK_ADMIN_PASSWORD: admin123 KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:?KEYCLOAK_ADMIN_PASSWORD is required}
KC_DB: postgres KC_DB: postgres
KC_DB_URL: jdbc:postgresql://postgres:5432/keycloak KC_DB_URL: jdbc:postgresql://postgres:5432/keycloak
KC_DB_USERNAME: keycloak KC_DB_USERNAME: ${KC_DB_USERNAME:-keycloak}
KC_DB_PASSWORD: keycloak123 KC_DB_PASSWORD: ${KC_DB_PASSWORD:?KC_DB_PASSWORD is required}
KC_HOSTNAME: 192.168.1.11 KC_HOSTNAME: ${KC_HOSTNAME:-localhost}
KC_HOSTNAME_PORT: 8180 KC_HOSTNAME_PORT: ${KC_HOSTNAME_PORT:-8180}
KC_HTTP_ENABLED: true KC_HTTP_ENABLED: ${KC_HTTP_ENABLED:-false}
KC_HTTPS_ENABLED: ${KC_HTTPS_ENABLED:-true}
KC_HTTP_PORT: 8180 KC_HTTP_PORT: 8180
KC_HOSTNAME_STRICT: false KC_HOSTNAME_STRICT: ${KC_HOSTNAME_STRICT:-true}
KC_HOSTNAME_STRICT_HTTPS: false KC_HOSTNAME_STRICT_HTTPS: ${KC_HOSTNAME_STRICT_HTTPS:-true}
ports: ports:
- "8180:8180" - "${KC_HOST_PORT:-8180}:8180"
depends_on: depends_on:
- postgres postgres:
condition: service_healthy
command: start --optimized command: start --optimized
networks: networks:
- unionflow-network - 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: postgres:
image: postgres:15 image: postgres:15
container_name: unionflow-postgres container_name: unionflow-postgres
environment: environment:
POSTGRES_DB: keycloak POSTGRES_DB: ${POSTGRES_DB:-keycloak}
POSTGRES_USER: keycloak POSTGRES_USER: ${KC_DB_USERNAME:-keycloak}
POSTGRES_PASSWORD: keycloak123 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
volumes: volumes:
- postgres_data:/var/lib/postgresql/data - postgres_data:/var/lib/postgresql/data
ports: ports:
- "5432:5432" - "${POSTGRES_HOST_PORT:-5432}:5432"
networks: networks:
- unionflow-network - 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: volumes:
postgres_data: postgres_data:
driver: local
networks: networks:
unionflow-network: unionflow-network:

View File

@@ -21,7 +21,8 @@
<meta name="description" content="A new Flutter project."> <meta name="description" content="A new Flutter project.">
<!-- iOS meta tags & icons --> <!-- 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-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="unionflow_mobile_apps"> <meta name="apple-mobile-web-app-title" content="unionflow_mobile_apps">
<link rel="apple-touch-icon" href="icons/Icon-192.png"> <link rel="apple-touch-icon" href="icons/Icon-192.png">

View File

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