diff --git a/docker-compose.yml b/docker-compose.yml index e32d8cc..b8d3d7a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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= +# KC_DB_USERNAME=keycloak +# KC_DB_PASSWORD= +# KC_HOSTNAME= +# POSTGRES_PASSWORD= + 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: diff --git a/unionflow-mobile-apps/web/index.html b/unionflow-mobile-apps/web/index.html index 39b8e89..ab7cfb4 100644 --- a/unionflow-mobile-apps/web/index.html +++ b/unionflow-mobile-apps/web/index.html @@ -21,7 +21,8 @@ - + + diff --git a/unionflow-server-impl-quarkus/src/main/java/dev/lions/unionflow/server/resource/OrganisationResource.java b/unionflow-server-impl-quarkus/src/main/java/dev/lions/unionflow/server/resource/OrganisationResource.java index 310bb79..1bf5ae7 100644 --- a/unionflow-server-impl-quarkus/src/main/java/dev/lions/unionflow/server/resource/OrganisationResource.java +++ b/unionflow-server-impl-quarkus/src/main/java/dev/lions/unionflow/server/resource/OrganisationResource.java @@ -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")