22 Commits

Author SHA1 Message Date
6c008bb053 refacto: split creation of config files from general update of hydra sp 2024-05-23 10:38:14 +02:00
6ae24ccf81 feat: allow changing hydra oidc internal port (default 8080) 2024-01-10 14:48:51 +01:00
8d3ca8fe91 feat: do not restart hydra-oidc when install_only 2024-01-09 16:35:29 +01:00
bb1c734c2c fix: update ports mapping for hydra-dispatcher and hydra-oidc 2023-12-04 09:23:28 +01:00
554d79b3b7 f/fix_update_sp (#17)
Reviewed-on: #17
Reviewed-by: vfebvre <vfebvre@cadoles.com>
2023-11-28 13:43:13 +01:00
d365d2ec50 fix: update all shibboleth config files when updating shibboleth-sp 2023-11-14 12:30:22 +01:00
9fb1118961 feat(hydra): add variable HYDRA_BCRYPT_COST 2023-11-13 11:12:03 +01:00
daa8612bae cosmetic: move hydra_ttl_refresh_token option 2023-11-13 11:09:48 +01:00
793582e621 Adding a task to update hydra-remote-user only 2023-11-09 09:10:15 +01:00
e6f973805b Update pod Shibboleth SP only 2023-10-26 13:50:32 +02:00
9054f14223 feat: run hydra migrations if specified 2023-10-25 17:55:54 +02:00
547eb73d6c feat: modularize playbook with tags 2023-10-25 15:13:35 +02:00
2b4e669cc3 reactivate Create hydra clients 2023-10-24 08:26:15 +02:00
e88e45ac91 comment create hydra client so as not to replay them 2023-10-19 16:13:19 +02:00
03cc82f26e set correct separator 2023-10-17 08:03:45 +02:00
2f464faff3 feat(hydra): adding tasks to only update hydra-v1. (#15)
Reviewed-on: #15
2023-10-16 16:35:56 +02:00
a8a1632eb6 feat(hydra): adding tasks to only update hydra-v1. 2023-10-16 13:54:11 +02:00
d259417d47 feat(hydra): configurable ttl_refresh_token (#14)
Reviewed-on: #14
2023-10-09 11:15:33 +02:00
8bc50e1533 feat(hydra): configurable ttl_refresh_token
adding new variable to configure ttl_refresh_token

ref mse project : CNOUS/mse#2591
2023-10-09 10:57:30 +02:00
9261bff896 Hydra-update-client: fix creation of json file 2023-08-17 11:37:55 +02:00
19bc989486 Hydra-update-client: use update command instead of deleting/importing client (#13)
Reviewed-on: #13
Reviewed-by: vfebvre <vfebvre@cadoles.com>
2023-08-10 11:35:02 +02:00
571c297741 Hydra-update-client: use update command instead of deleting/importing client 2023-08-09 17:38:39 +02:00
15 changed files with 222 additions and 39 deletions

View File

@ -1,4 +1,6 @@
--- ---
install_only: false
# cadoles-pod repository configuration # cadoles-pod repository configuration
cadoles_pod_debian_repository_url: https://vulcain.cadoles.com cadoles_pod_debian_repository_url: https://vulcain.cadoles.com
cadoles_pod_debian_repository: bullseye-dev cadoles_pod_debian_repository: bullseye-dev
@ -15,7 +17,8 @@ cadoles_pod_hydra_oidc_v1_package_version: '*'
cadoles_pod_hydra_ldap_v1_package_version: '*' cadoles_pod_hydra_ldap_v1_package_version: '*'
# Hydra database configuration # Hydra database configuration
hydra_use_external_database: no hydra_use_external_database: false
hydra_auto_migrate: false
hydra_database_name: hydra hydra_database_name: hydra
hydra_database_user: hydra hydra_database_user: hydra
hydra_database_password: hydra hydra_database_password: hydra
@ -50,6 +53,11 @@ hydra_public_cors_allowed_origins: []
hydra_log_level: warn hydra_log_level: warn
hydra_log_leak_sensitive_values: no hydra_log_leak_sensitive_values: no
# Durée de vie des "refresh_token"
hydra_ttl_refresh_token: "24h"
hydra_bcrypt_cost: 8
# This value should not be changed after first deployment ! # This value should not be changed after first deployment !
hydra_secrets_seed: "{{ inventory_hostname }}" hydra_secrets_seed: "{{ inventory_hostname }}"
@ -61,6 +69,7 @@ hydra_clients:
# Hydra dispatcher configuration # Hydra dispatcher configuration
enable_hydra_dispatcher: true
hydra_dispatcher_cookie_path: "{{ haproxy_hydra_dispatcher_base_path }}" hydra_dispatcher_cookie_path: "{{ haproxy_hydra_dispatcher_base_path }}"
hydra_dispatcher_debug: no hydra_dispatcher_debug: no
hydra_dispatcher_admin_authorized_hosts: hydra_dispatcher_admin_authorized_hosts:
@ -219,6 +228,7 @@ oidc_test_app_public_base_url: "{{ haproxy_public_base_url }}{{ haproxy_oidc_tes
enable_hydra_oidc: no enable_hydra_oidc: no
hydra_oidc_debug: no hydra_oidc_debug: no
hydra_oidc_internal_port: 8080
hydra_oidc_hydra_url_error: hydra_oidc_hydra_url_error:
hydra_oidc_base_url: hydra_oidc_base_url:
hydra_oidc_cookie_path: "{{ haproxy_hydra_oidc_base_path }}" hydra_oidc_cookie_path: "{{ haproxy_hydra_oidc_base_path }}"

View File

@ -4,55 +4,65 @@
name: haproxy name: haproxy
state: restarted state: restarted
become: true become: true
when: not install_only
- name: Restart cadoles-pod-hydra-v1 - name: Restart cadoles-pod-hydra-v1
service: service:
name: cadoles-pod-hydra-v1 name: cadoles-pod-hydra-v1
state: restarted state: restarted
become: true become: true
when: not install_only
- name: Restart cadoles-pod-hydra-dispatcher-v1 - name: Restart cadoles-pod-hydra-dispatcher-v1
service: service:
name: cadoles-pod-hydra-dispatcher-v1 name: cadoles-pod-hydra-dispatcher-v1
state: restarted state: restarted
become: true become: true
when: not install_only
- name: Restart cadoles-pod-hydra-passwordless-v1 - name: Restart cadoles-pod-hydra-passwordless-v1
service: service:
name: cadoles-pod-hydra-passwordless-v1 name: cadoles-pod-hydra-passwordless-v1
state: restarted state: restarted
become: true become: true
when: not install_only
- name: Restart cadoles-pod-hydra-remote-user-v1 - name: Restart cadoles-pod-hydra-remote-user-v1
service: service:
name: cadoles-pod-hydra-remote-user-v1 name: cadoles-pod-hydra-remote-user-v1
state: restarted state: restarted
become: true become: true
when: not install_only
- name: Restart cadoles-pod-shibboleth-sp-v3 - name: Restart cadoles-pod-shibboleth-sp-v3
service: service:
name: cadoles-pod-shibboleth-sp-v3 name: cadoles-pod-shibboleth-sp-v3
state: restarted state: restarted
become: true become: true
when: not install_only
- name: Restart cadoles-pod-hydra-oidc-v1 - name: Restart cadoles-pod-hydra-oidc-v1
service: service:
name: cadoles-pod-hydra-oidc-v1 name: cadoles-pod-hydra-oidc-v1
state: restarted state: restarted
become: true become: true
when: not install_only
- name: Restart cadoles-pod-hydra-ldap-v1 - name: Restart cadoles-pod-hydra-ldap-v1
service: service:
name: cadoles-pod-hydra-ldap-v1 name: cadoles-pod-hydra-ldap-v1
state: restarted state: restarted
become: true become: true
when: not install_only
- name: Restart cadoles-pod-goweb-oidc-v1 - name: Restart cadoles-pod-goweb-oidc-v1
service: service:
name: cadoles-pod-goweb-oidc-v1 name: cadoles-pod-goweb-oidc-v1
state: restarted state: restarted
become: true become: true
when: not install_only
- name: Reload hydra clients - name: Reload hydra clients
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: hydra-reload-clients.yml file: hydra-reload-clients.yml
when: not install_only

View File

@ -86,6 +86,13 @@ properties:
hydra_log_leak_sensitive_values: hydra_log_leak_sensitive_values:
type: boolean type: boolean
hydra_ttl_refresh_token:
type: string
hydra_brypt_cost:
type: number
description: Coût CPU pour calculer des hachages de secret (4-31)
# This value should not be changed after first deployment ! # This value should not be changed after first deployment !
hydra_secrets_seed: hydra_secrets_seed:
type: string type: string

View File

@ -0,0 +1,21 @@
---
# Simple task to update the config files of cadoles-pod-shibboleth-sp only.
- name: Configure cadoles-pod-shibboleth-sp-v3
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
- src: cadoles-pod-shibboleth-sp-v3.conf.j2
dest: /etc/cadoles-pod-shibboleth-sp-v3.conf
mode: u=rw,g=r
- src: shibboleth-attribute-map.inc.xml.j2
dest: /etc/shibboleth/attribute-map.inc.xml
mode: u=rw,g=r,o=r
- src: shibboleth-attribute-policy.inc.xml.j2
dest: /etc/shibboleth/attribute-policy.inc.xml
mode: u=rw,g=r,o=r
notify:
- Restart cadoles-pod-shibboleth-sp-v3
become: true

View File

@ -13,11 +13,21 @@
when: item.client_id == client_id when: item.client_id == client_id
become: true become: true
- name: Delete client - name: Update client
command: podman exec -t cadoles-pod-hydra-v1 /bin/sh -c "hydra clients delete {{ client_id }} --endpoint http://127.0.0.1:4445" command: >
ignore_errors: true podman exec -t cadoles-pod-hydra-v1 /bin/sh -c "hydra clients update '{{ client_id }}'
--endpoint http://127.0.0.1:4445
--name '{{ item.client_name | default(item.client_id) }}'
--secret '{{ item.client_secret | default(lookup('ansible.builtin.password', '/dev/null chars=ascii_lowercase,digits length=32 seed=inventory_hostname')) }}'
--grant-types '{{ ','.join(item.grant_types) if "grant_types" in item else "authorization_code, refresh_token" }}'
--post-logout-callbacks '{{ ','.join(item.post_logout_redirect_uris) if "post_logout_redirect_uris" in item else "" }}'
--callbacks '{{ ','.join(item.redirect_uris) }}'
--response-types '{{ ','.join(item.response_types) if "response_types" in item else "code" }}'
--logo-uri '{{ item.logo_uri if "logo_uri" in item else "" }}'
--scope '{{ ','.join(item.scope) if "scope" in item else "openid profile email webhook" }}'
--token-endpoint-auth-method '{{ item.token_endpoint_auth_method if "token_endpoint_auth_method" in item else "client_secret_post" }}'
"
with_items: "{{ hydra_clients }}"
when: item.client_id == client_id
become: true become: true
- name: Import client
command: podman exec -t cadoles-pod-hydra-v1 /bin/sh -c "hydra clients import /etc/hydra/clients.d/{{ client_id }}.json --endpoint http://127.0.0.1:4445"
become: true

45
tasks/install-hydra.yml Normal file
View File

@ -0,0 +1,45 @@
---
- name: Install Hydra
ansible.builtin.apt:
name:
- cadoles-pod-hydra-v1={{ cadoles_pod_hydra_v1_package_version }}
update_cache: yes
state: present
become: true
- name: Configure Hydra local database
ansible.builtin.include_tasks: hydra-database.yml
when: not hydra_use_external_database
- name: Configure cadoles-pod-hydra-v1
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- src: cadoles-pod-hydra-v1.conf.j2
dest: /etc/cadoles-pod-hydra-v1.conf
notify:
- Restart cadoles-pod-hydra-v1
become: true
- name: Check cadoles-pod-hydra-v1 status
service:
name: cadoles-pod-hydra-v1
state: started
become: true
- name: Migrate Hydra database schema
command: podman exec -it cadoles-pod-hydra-v1 migrate-hydra-schema
become: true
when: hydra_auto_migrate
- name: Create hydra-clients
template:
src: hydra-client.json.j2
dest: "/etc/hydra/clients.d/{{ item.client_id }}.json"
with_items: "{{ hydra_clients }}"
notify:
- Reload hydra clients
become: true

View File

@ -9,24 +9,28 @@
update_cache: yes update_cache: yes
state: present state: present
become: true become: true
tags: [ hydra-only ]
- name: Add LetsEncrypt missing intermediate certificates - name: Add LetsEncrypt missing intermediate certificates
command: "bash -c 'wget -O- --no-check-certificate https://forge.cadoles.com/Cadoles/Jenkins/raw/branch/master/resources/com/cadoles/common/add-letsencrypt-ca.sh | bash'" command: "bash -c 'wget -O- --no-check-certificate https://forge.cadoles.com/Cadoles/Jenkins/raw/branch/master/resources/com/cadoles/common/add-letsencrypt-ca.sh | bash'"
args: args:
creates: /etc/ssl/certs/lets-encrypt-e1.pem.pem creates: /etc/ssl/certs/lets-encrypt-e1.pem.pem
become: true become: true
tags: [ hydra-only ]
- name: Add cadoles-pod debian repository key - name: Add cadoles-pod debian repository key
ansible.builtin.apt_key: ansible.builtin.apt_key:
url: "{{ cadoles_pod_debian_repository_key_url }}" url: "{{ cadoles_pod_debian_repository_key_url }}"
state: present state: present
become: true become: true
tags: [ hydra-only ]
- name: Configure cadoles-pod debian repository - name: Configure cadoles-pod debian repository
ansible.builtin.apt_repository: ansible.builtin.apt_repository:
repo: "deb {{ cadoles_pod_debian_repository_url }} {{ cadoles_pod_debian_repository }} main" repo: "deb {{ cadoles_pod_debian_repository_url }} {{ cadoles_pod_debian_repository }} main"
state: present state: present
become: true become: true
tags: [ hydra-only ]
- name: Ensure sysctl configuration - name: Ensure sysctl configuration
ansible.posix.sysctl: ansible.posix.sysctl:
@ -39,39 +43,30 @@
- name: fs.inotify.max_user_watches - name: fs.inotify.max_user_watches
value: 204800 value: 204800
become: true become: true
tags: [ hydra-only ]
- name: Install core packages - name: Install HAProxy
ansible.builtin.apt: ansible.builtin.apt:
name: name:
- haproxy={{ haproxy_package_version }} - haproxy={{ haproxy_package_version }}
- cadoles-pod-hydra-v1={{ cadoles_pod_hydra_v1_package_version }}
- cadoles-pod-hydra-dispatcher-v1={{ cadoles_pod_hydra_dispatcher_v1_package_version }}
update_cache: yes update_cache: yes
state: present state: present
become: true become: true
tags: [ hydra-only ]
- name: Configure Hydra local database - name: Install Hydra
ansible.builtin.include_tasks: hydra-database.yml include_tasks:
when: not hydra_use_external_database file: ./install-hydra.yml
apply:
tags: [ hydra-only ]
tags: [ hydra-only ]
- name: Create hydra-clients - name: Install hydra-dispatcher
template: ansible.builtin.apt:
src: hydra-client.json.j2 name:
dest: "/etc/hydra/clients.d/{{ item.client_id }}.json" - cadoles-pod-hydra-dispatcher-v1={{ cadoles_pod_hydra_dispatcher_v1_package_version }}
with_items: "{{ hydra_clients }}" update_cache: yes
notify: state: present
- Reload hydra clients
become: true
- name: Configure cadoles-pod-hydra-v1
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- src: cadoles-pod-hydra-v1.conf.j2
dest: /etc/cadoles-pod-hydra-v1.conf
notify:
- Restart cadoles-pod-hydra-v1
become: true become: true
- name: Configure cadoles-pod-hydra-dispatcher-v1 - name: Configure cadoles-pod-hydra-dispatcher-v1
@ -108,11 +103,11 @@
- name: Start OIDC Test app if enabled - name: Start OIDC Test app if enabled
ansible.builtin.include_tasks: start-oidc-test.yml ansible.builtin.include_tasks: start-oidc-test.yml
when: enable_oidc_test_app when: enable_oidc_test_app and not install_only
- name: Stop OIDC Test app if disabled - name: Stop OIDC Test app if disabled
ansible.builtin.include_tasks: stop-oidc-test.yml ansible.builtin.include_tasks: stop-oidc-test.yml
when: not enable_oidc_test_app when: not enable_oidc_test_app and not install_only
- name: Configure HAProxy - name: Configure HAProxy
template: template:
@ -121,4 +116,5 @@
validate: "haproxy -c -f %s" validate: "haproxy -c -f %s"
notify: notify:
- Restart HAProxy - Restart HAProxy
become: true become: true
tags: [ hydra-only ]

View File

@ -0,0 +1,33 @@
---
# Simple task to update the package/container cadoles-pod-hydra-remote-user only.
- name: Install hydra-remote-user package
ansible.builtin.apt:
name:
- cadoles-pod-hydra-remote-user-v1={{ cadoles_pod_hydra_remote_user_v1_package_version }}
update_cache: yes
state: present
become: true
- name: Configure cadoles-pod-hydra-remote-user-v1
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
- src: cadoles-pod-hydra-remote-user-v1.conf.j2
dest: /etc/cadoles-pod-hydra-remote-user-v1.conf
mode: u=rw,g=r
- src: hydra-remote-user.yml.j2
dest: /etc/hydra-remote-user/conf.d/remote-user.yml
mode: u=rw,g=r,o=r
notify:
- Restart cadoles-pod-hydra-remote-user-v1
become: true
- name: Configure cadoles-pod-hydra-remote-user-v1 (2)
ansible.builtin.copy:
src: hydra-remote-user-v1-apache.conf
dest: /etc/hydra-remote-user/apache.conf
notify:
- Restart cadoles-pod-hydra-remote-user-v1
become: true

12
tasks/update-hydra-sp.yml Normal file
View File

@ -0,0 +1,12 @@
---
# Simple task to update the package/container cadoles-pod-shibboleth-sp only.
- name: Install hydra-shibboleth package
ansible.builtin.apt:
name:
- cadoles-pod-shibboleth-sp-v3={{ cadoles_pod_shibboleth_sp_v3_package_version }}
update_cache: yes
state: present
become: true
- name: Configure hydra SP
ansible.builtin.include_tasks: configure-hydra-sp.yml

31
tasks/update-hydra.yml Normal file
View File

@ -0,0 +1,31 @@
---
# Simple task to update the package/container cadoles-pod-hydra only.
- name: Install hydra package
ansible.builtin.apt:
name:
- cadoles-pod-hydra-v1={{ cadoles_pod_hydra_v1_package_version }}
update_cache: yes
state: present
become: true
- name: Configure cadoles-pod-hydra-v1
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
- src: cadoles-pod-hydra-v1.conf.j2
dest: /etc/cadoles-pod-hydra-v1.conf
mode: u=rw,g=r
notify:
- Restart cadoles-pod-hydra-v1
become: true
- name: Create hydra-clients
template:
src: hydra-client.json.j2
dest: "/etc/hydra/clients.d/{{ item.client_id }}.json"
with_items: "{{ hydra_clients }}"
notify:
- Reload hydra clients
become: true

View File

@ -4,7 +4,7 @@ PODMAN_ARGS="\
--replace \ --replace \
--network=slirp4netns:allow_host_loopback=true \ --network=slirp4netns:allow_host_loopback=true \
--tz=local \ --tz=local \
-p 127.0.0.1:3000:80 \ -p 127.0.0.1:3000:8080 \
-e APP_ENV=prod \ -e APP_ENV=prod \
-e 'APP_DEBUG={{ hydra_dispatcher_debug }}' \ -e 'APP_DEBUG={{ hydra_dispatcher_debug }}' \
-e HYDRA_ADMIN_BASE_URL=http://10.0.2.2:4445 \ -e HYDRA_ADMIN_BASE_URL=http://10.0.2.2:4445 \
@ -21,7 +21,8 @@ PODMAN_ARGS="\
-e 'SENTRY_DSN={{ hydra_dispatcher_sentry_dsn }}' \ -e 'SENTRY_DSN={{ hydra_dispatcher_sentry_dsn }}' \
-e 'SENTRY_ENVIRONMENT={{ hydra_dispatcher_sentry_environment }}' \ -e 'SENTRY_ENVIRONMENT={{ hydra_dispatcher_sentry_environment }}' \
-e 'DISABLE_APP_AUTO_SELECT={{ hydra_dispatcher_disable_app_auto_select }}' \ -e 'DISABLE_APP_AUTO_SELECT={{ hydra_dispatcher_disable_app_auto_select }}' \
-v /etc/hydra-dispatcher/conf.d:/var/www/config/hydra \ -e 'PHP_FPM_MEMORY_LIMIT=128m' \
-v /etc/hydra-dispatcher/conf.d:/app/config/hydra \
{% for item in hydra_dispatcher_mounts %} {% for item in hydra_dispatcher_mounts %}
-v {{ item.host }}:{{ item.container }} \ -v {{ item.host }}:{{ item.container }} \
{% endfor %} {% endfor %}

View File

@ -4,7 +4,7 @@ PODMAN_ARGS="\
--replace \ --replace \
--network=slirp4netns:allow_host_loopback=true \ --network=slirp4netns:allow_host_loopback=true \
--tz=local \ --tz=local \
-p 127.0.0.1:3004:80 \ -p 127.0.0.1:3004:{{ hydra_oidc_internal_port | default(8080) }} \
-e APP_ENV=prod \ -e APP_ENV=prod \
-e 'APP_DEBUG={{ hydra_oidc_debug }}' \ -e 'APP_DEBUG={{ hydra_oidc_debug }}' \
-e 'HYDRA_ADMIN_BASE_URL=http://10.0.2.2:3000' \ -e 'HYDRA_ADMIN_BASE_URL=http://10.0.2.2:3000' \

View File

@ -18,11 +18,13 @@ PODMAN_ARGS="\
-e 'HYDRA_URL_POST_LOGOUT={{ hydra_url_post_logout }}' \ -e 'HYDRA_URL_POST_LOGOUT={{ hydra_url_post_logout }}' \
-e 'HYDRA_ALLOW_INSECURE=yes' \ -e 'HYDRA_ALLOW_INSECURE=yes' \
-e 'HYDRA_LEVEL={{ hydra_log_level }}' \ -e 'HYDRA_LEVEL={{ hydra_log_level }}' \
-e 'TTL_REFRESH_TOKEN={{ hydra_ttl_refresh_token }}'\
{% if hydra_public_cors_allowed_origins | default([]) | length > 0 %} {% if hydra_public_cors_allowed_origins | default([]) | length > 0 %}
-e 'SERVE_PUBLIC_CORS_ENABLED=true' \ -e 'SERVE_PUBLIC_CORS_ENABLED=true' \
-e 'SERVE_PUBLIC_CORS_ALLOWED_ORIGINS={{ hydra_public_cors_allowed_origins | join(',') }}' \ -e 'SERVE_PUBLIC_CORS_ALLOWED_ORIGINS={{ hydra_public_cors_allowed_origins | join(',') }}' \
{% endif %} {% endif %}
-e 'HYDRA_SECRETS_SYSTEM={{ lookup('ansible.builtin.password', '/dev/null length=32 seed=hydra_secrets_seed') }}' \ -e 'HYDRA_SECRETS_SYSTEM={{ lookup('ansible.builtin.password', '/dev/null length=32 seed=hydra_secrets_seed') }}' \
-e 'HYDRA_OIDC_SUBJECT_IDENTIFIERS_PAIRWISE_SALT={{ lookup('ansible.builtin.password', '/dev/null length=32 seed=hydra_secrets_seed') }}' \ -e 'HYDRA_OIDC_SUBJECT_IDENTIFIERS_PAIRWISE_SALT={{ lookup('ansible.builtin.password', '/dev/null length=32 seed=hydra_secrets_seed') }}' \
-e 'HYDRA_BCRYPT_COST={{ hydra_bcrypt_cost }}' \
-v /etc/hydra/clients.d:/etc/hydra/clients.d \ -v /etc/hydra/clients.d:/etc/hydra/clients.d \
" "

View File

@ -12,7 +12,7 @@ PODMAN_ARGS="\
-e 'APACHE_FORCE_HTTPS={{ "true" if haproxy_public_base_url.startswith('https') else "false" }}' \ -e 'APACHE_FORCE_HTTPS={{ "true" if haproxy_public_base_url.startswith('https') else "false" }}' \
-e 'SP_HANDLER_BASE_PATH={{ haproxy_hydra_saml_base_path }}' \ -e 'SP_HANDLER_BASE_PATH={{ haproxy_hydra_saml_base_path }}' \
-e 'SP_SESSIONS_REDIRECT_LIMIT=host+allow' \ -e 'SP_SESSIONS_REDIRECT_LIMIT=host+allow' \
-e 'SP_SESSIONS_REDIRECT_ALLOW={{ hydra_saml_allowed_redirects | join(',') }}' \ -e 'SP_SESSIONS_REDIRECT_ALLOW={{ hydra_saml_allowed_redirects | join(' ') }}' \
-e 'SP_INCLUDE_DEFAULT_ATTRIBUTES_MAPPING={{ hydra_saml_include_sp_default_attributes_mapping }}' \ -e 'SP_INCLUDE_DEFAULT_ATTRIBUTES_MAPPING={{ hydra_saml_include_sp_default_attributes_mapping }}' \
-e 'SP_INCLUDE_DEFAULT_ATTRIBUTES_POLICY={{ hydra_saml_include_sp_default_attributes_policy }}' \ -e 'SP_INCLUDE_DEFAULT_ATTRIBUTES_POLICY={{ hydra_saml_include_sp_default_attributes_policy }}' \
-v '/etc/shibboleth/attribute-map.inc.xml:/etc/shibboleth/attribute-map.inc.xml' \ -v '/etc/shibboleth/attribute-map.inc.xml:/etc/shibboleth/attribute-map.inc.xml' \

View File

@ -39,8 +39,9 @@ frontend http-in
mode http mode http
maxconn 2000 maxconn 2000
{% if enable_hydra_dispatcher %}
acl login_dispatcher path_beg -i {{ haproxy_hydra_dispatcher_base_path }} acl login_dispatcher path_beg -i {{ haproxy_hydra_dispatcher_base_path }}
{% endif %}
{% if enable_hydra_passwordless %} {% if enable_hydra_passwordless %}
acl login_passwordless path_beg -i {{ haproxy_hydra_passwordless_base_path }} acl login_passwordless path_beg -i {{ haproxy_hydra_passwordless_base_path }}
{% endif %} {% endif %}
@ -57,7 +58,9 @@ frontend http-in
acl oidc_test path_beg -i {{ haproxy_oidc_test_base_path }} acl oidc_test path_beg -i {{ haproxy_oidc_test_base_path }}
{% endif %} {% endif %}
{% if enable_hydra_dispatcher %}
use_backend hydra_dispatcher if login_dispatcher use_backend hydra_dispatcher if login_dispatcher
{% endif %}
{% if enable_hydra_passwordless %} {% if enable_hydra_passwordless %}
use_backend hydra_passwordless if login_passwordless use_backend hydra_passwordless if login_passwordless
{% endif %} {% endif %}
@ -86,6 +89,7 @@ backend hydra
http-request set-path %[path,regsub(^{{ haproxy_hydra_base_path }},)] http-request set-path %[path,regsub(^{{ haproxy_hydra_base_path }},)]
server hydra 127.0.0.1:4444 check server hydra 127.0.0.1:4444 check
{% if enable_hydra_dispatcher %}
# Backend Hydra Dispatcher # Backend Hydra Dispatcher
backend hydra_dispatcher backend hydra_dispatcher
balance roundrobin balance roundrobin
@ -94,6 +98,7 @@ backend hydra_dispatcher
http-request set-header X-Forwarded-Prefix {{ haproxy_hydra_dispatcher_base_path }} http-request set-header X-Forwarded-Prefix {{ haproxy_hydra_dispatcher_base_path }}
server hydra-login-dispatcher 127.0.0.1:3000 check server hydra-login-dispatcher 127.0.0.1:3000 check
{%- endif %}
{% if enable_hydra_passwordless %} {% if enable_hydra_passwordless %}
# Backend Hydra Passwordless # Backend Hydra Passwordless