From 1c9762c2de3d4a038b187265542324a3c00f4989 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Wed, 21 May 2025 14:57:28 +0200 Subject: [PATCH 01/18] Use latest verions of components --- core/docker-compose.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/docker-compose.yml b/core/docker-compose.yml index 385a915..26dbeae 100644 --- a/core/docker-compose.yml +++ b/core/docker-compose.yml @@ -110,7 +110,7 @@ services: hostname: profile.docker mujina-idp: - image: ghcr.io/openconext/mujina/mujina-idp:8.0.12 + image: ghcr.io/openconext/mujina/mujina-idp:latest volumes: - ./:/config networks: @@ -192,7 +192,7 @@ services: - "extras" oidcplaygroundgui: - image: ghcr.io/openconext/openconext-oidc-playground/oidc-playground-gui:3.0.1 + image: ghcr.io/openconext/openconext-oidc-playground/oidc-playground-gui:latest networks: coreconextdev: hostname: oidcplagroundgui.docker @@ -202,7 +202,7 @@ services: - "extras" oidcplaygroundserver: - image: ghcr.io/openconext/openconext-oidc-playground/oidc-playground-server:3.0.1 + image: ghcr.io/openconext/openconext-oidc-playground/oidc-playground-server:latest environment: USE_SYSTEM_CA_CERTS: true volumes: @@ -220,7 +220,7 @@ services: - "extras" teamsgui: - image: ghcr.io/openconext/openconext-teams-ng/teams-gui:9.3.1 + image: ghcr.io/openconext/openconext-teams-ng/teams-gui:latest volumes: - ./:/config environment: @@ -245,7 +245,7 @@ services: - "extras" teamsserver: - image: ghcr.io/openconext/openconext-teams-ng/teams-server:9.3.1 + image: ghcr.io/openconext/openconext-teams-ng/teams-server:latest environment: USE_SYSTEM_CA_CERTS: true volumes: From 7fbbf72150623a0e0e458f11e45241bf8c2683d8 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Wed, 21 May 2025 14:59:32 +0200 Subject: [PATCH 02/18] Switch to different mongo container that Just Works on arm64 Needs some hackery to initialize the replication sets --- core/docker-compose.yml | 65 ++++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/core/docker-compose.yml b/core/docker-compose.yml index 26dbeae..4ccc43b 100644 --- a/core/docker-compose.yml +++ b/core/docker-compose.yml @@ -44,36 +44,49 @@ services: - 3306:3306 mongo: - image: bitnami/mongodb:7.0 + image: mongo:7 environment: - MONGO_INITDB_ROOT_USERNAME: root - MONGO_INITDB_ROOT_PASSWORD: secret - MONGODB_ROOT_PASSWORD: secret - MONGODB_REPLICA_SET_NAME: openconext - MONGODB_REPLICA_SET_MODE: primary - MONGODB_REPLICA_SET_KEY: secretsecret - MONGODB_ADVERTISED_HOSTNAME: mongodb + MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USERNAME:-root} + MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD:-secret} + MONGO_REPLICA_SET_NAME: ${MONGODB_RS_NAME:-openconext} volumes: - ./mongo/:/docker-entrypoint-initdb.d/ - - openconext_mongodb:/bitnami/mongodb + - openconext_mongodb:/data/db healthcheck: - test: ['CMD', 'true'] - # test: - # [ - # "CMD", - # "mongosh", - # "-u", - # "managerw", - # "-p", - # "secret", - # "--eval", - # "db.stats().ok", - # "mongodb://127.0.0.1/manage", - # ] - interval: 10s - timeout: 10s - retries: 3 - start_period: 20s + test: | + # After starting, but before being used, we need to initialize the Mongo replication set + # we abuse the healthcheck for that, because we need to check the health status anyway + mongosh -u $${MONGO_INITDB_ROOT_USERNAME} -p $${MONGO_INITDB_ROOT_PASSWORD} --eval ' + try { + rs.status().ok; + } + catch ({ name, message }) { + print("error:" + name); + print("message:" + message); + if (name=="MongoServerError" && message.includes("no replset config has been received")) { + rs.initiate({ + _id : "${MONGODB_RS_NAME:-openconext}", + members: [ { _id: 0, host: "mongodb:27017" } ] + }); + rs.status().ok; + } + }; + ' + interval: 2s + timeout: 3s + retries: 5 + entrypoint: > + bash -c ' + openssl rand -base64 756 > /keyfile \ + && chown mongodb:mongodb /keyfile \ + && chmod 400 /keyfile \ + && exec docker-entrypoint.sh $$@ + ' + command: | + mongod --bind_ip_all --replSet ${MONGODB_RS_NAME:-openconext} --keyFile /keyfile + restart: always + ports: + - "27017:27017" networks: coreconextdev: hostname: mongodb From b1ee498e9fba66edd7bf6c44436bfb57a56ba278 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Wed, 21 May 2025 15:05:53 +0200 Subject: [PATCH 03/18] adjust health check intervals --- core/docker-compose.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/docker-compose.yml b/core/docker-compose.yml index 4ccc43b..528622c 100644 --- a/core/docker-compose.yml +++ b/core/docker-compose.yml @@ -37,8 +37,9 @@ services: - openconext_mariadb:/var/lib/mysql healthcheck: test: ["CMD", "mysqladmin", "-uroot", "-psecret", "ping", "-h", "localhost"] - timeout: 5s - retries: 10 + interval: 10s + timeout: 3s + retries: 5 hostname: mariadb.docker ports: - 3306:3306 @@ -72,7 +73,7 @@ services: } }; ' - interval: 2s + interval: 10s timeout: 3s retries: 5 entrypoint: > From a31547bd25b31d6d282145de87078614225e8978 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Wed, 21 May 2025 15:10:04 +0200 Subject: [PATCH 04/18] Clarify comment --- core/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/docker-compose.yml b/core/docker-compose.yml index 528622c..3d407e4 100644 --- a/core/docker-compose.yml +++ b/core/docker-compose.yml @@ -55,8 +55,8 @@ services: - openconext_mongodb:/data/db healthcheck: test: | - # After starting, but before being used, we need to initialize the Mongo replication set - # we abuse the healthcheck for that, because we need to check the health status anyway + # Apart form implementing a regular healthcheck, we also use it here to initialize + # the Mongo replication set mongosh -u $${MONGO_INITDB_ROOT_USERNAME} -p $${MONGO_INITDB_ROOT_PASSWORD} --eval ' try { rs.status().ok; From 66ea2199ebf1fdd243e343eb25d9d77507f3e495 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Wed, 21 May 2025 15:10:13 +0200 Subject: [PATCH 05/18] Reuse variable --- core/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/docker-compose.yml b/core/docker-compose.yml index 3d407e4..6f54f53 100644 --- a/core/docker-compose.yml +++ b/core/docker-compose.yml @@ -66,7 +66,7 @@ services: print("message:" + message); if (name=="MongoServerError" && message.includes("no replset config has been received")) { rs.initiate({ - _id : "${MONGODB_RS_NAME:-openconext}", + _id : "${MONGO_REPLICA_SET_NAME}", members: [ { _id: 0, host: "mongodb:27017" } ] }); rs.status().ok; From e87ceb129f84965ebd2cc4d929076978ecc934db Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Thu, 22 May 2025 11:07:16 +0200 Subject: [PATCH 06/18] Fix use of shell variable in dockr-compose --- core/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/docker-compose.yml b/core/docker-compose.yml index 6f54f53..af342c2 100644 --- a/core/docker-compose.yml +++ b/core/docker-compose.yml @@ -66,7 +66,7 @@ services: print("message:" + message); if (name=="MongoServerError" && message.includes("no replset config has been received")) { rs.initiate({ - _id : "${MONGO_REPLICA_SET_NAME}", + _id : "$${MONGO_REPLICA_SET_NAME}", members: [ { _id: 0, host: "mongodb:27017" } ] }); rs.status().ok; @@ -84,7 +84,7 @@ services: && exec docker-entrypoint.sh $$@ ' command: | - mongod --bind_ip_all --replSet ${MONGODB_RS_NAME:-openconext} --keyFile /keyfile + mongod --bind_ip_all --replSet $${MONGO_REPLICA_SET_NAME} --keyFile /keyfile restart: always ports: - "27017:27017" From cec320b32c634105398216474da50c94b517eeae Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Thu, 22 May 2025 11:09:17 +0200 Subject: [PATCH 07/18] typo --- core/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/docker-compose.yml b/core/docker-compose.yml index af342c2..ab383b1 100644 --- a/core/docker-compose.yml +++ b/core/docker-compose.yml @@ -55,7 +55,7 @@ services: - openconext_mongodb:/data/db healthcheck: test: | - # Apart form implementing a regular healthcheck, we also use it here to initialize + # Apart from implementing a regular healthcheck, we also use it here to initialize # the Mongo replication set mongosh -u $${MONGO_INITDB_ROOT_USERNAME} -p $${MONGO_INITDB_ROOT_PASSWORD} --eval ' try { From 3e13a8556202a494bd380f29e9b4d733dc73ec26 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Thu, 22 May 2025 11:10:33 +0200 Subject: [PATCH 08/18] Decrease health check interval --- core/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/docker-compose.yml b/core/docker-compose.yml index ab383b1..e888fe0 100644 --- a/core/docker-compose.yml +++ b/core/docker-compose.yml @@ -73,7 +73,7 @@ services: } }; ' - interval: 10s + interval: 5s timeout: 3s retries: 5 entrypoint: > From 76ce4a718498c5e3840c87a83bb6bbe968970f83 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Thu, 22 May 2025 11:13:03 +0200 Subject: [PATCH 09/18] Add instruction about ipv6 and /etc/hosts --- core/scripts/init.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/scripts/init.sh b/core/scripts/init.sh index 4ea1548..d59ef6f 100755 --- a/core/scripts/init.sh +++ b/core/scripts/init.sh @@ -73,7 +73,10 @@ printf "\n" echo -e "${RED}Please add the following line to your /etc/hosts:${NOCOLOR}${GREEN} \xE2\x9C\x94${NOCOLOR}" printf "\n" -echo "127.0.0.1 engine.dev.openconext.local manage.dev.openconext.local profile.dev.openconext.local engine-api.dev.openconext.local mujina-idp.dev.openconext.local profile.dev.openconext.local connect.dev.openconext.local teams.dev.openconext.local voot.dev.openconext.local" +# we need ipv6 here, because otherwise systems will first query mdns for ipv6 entries for the .local domain +hosts="engine.dev.openconext.local manage.dev.openconext.local profile.dev.openconext.local engine-api.dev.openconext.local mujina-idp.dev.openconext.local profile.dev.openconext.local connect.dev.openconext.local teams.dev.openconext.local voot.dev.openconext.local" +echo "127.0.0.1 $hosts" +echo "::1 $hosts" printf "\n" echo "You can now login. If you want to bring the environment down, use the command below" From ba4ddc1b842857ddfb0239b0bcbcf57d67278e84 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Thu, 22 May 2025 11:28:25 +0200 Subject: [PATCH 10/18] more ipv6 instructions --- core/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core/README.md b/core/README.md index 7b5aa1f..b059c68 100644 --- a/core/README.md +++ b/core/README.md @@ -25,6 +25,7 @@ You will also need to tell your local machine where to find the hosts. Add the following line in your hosts file (/etc/hosts ) ``` 127.0.0.1 engine.dev.openconext.local manage.dev.openconext.local profile.dev.openconext.local engine-api.dev.openconext.local mujina-idp.dev.openconext.local profile.dev.openconext.local connect.dev.openconext.local teams.dev.openconext.local voot.dev.openconext.local pdp.dev.openconext.local invite.dev.openconext.local welcome.dev.openconext.local +::1 engine.dev.openconext.local manage.dev.openconext.local profile.dev.openconext.local engine-api.dev.openconext.local mujina-idp.dev.openconext.local profile.dev.openconext.local connect.dev.openconext.local teams.dev.openconext.local voot.dev.openconext.local pdp.dev.openconext.local invite.dev.openconext.local welcome.dev.openconext.local ``` If all goes wel, you can now login. Please see the section below to find out where you can login. From 8f67e6bf0a3d44e034156bd687be38b6a7ca4787 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Thu, 22 May 2025 11:28:43 +0200 Subject: [PATCH 11/18] whitespace --- .editorconfig | 8 +- core/engine/parameters.yml | 296 ++++++++++++++++++------------------- core/mujina/logback.xml | 11 +- core/pdp/logback.xml | 34 ++--- 4 files changed, 177 insertions(+), 172 deletions(-) diff --git a/.editorconfig b/.editorconfig index 9752871..287a995 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,5 +11,11 @@ insert_final_newline = true max_line_length = 120 [*.{yml,yaml,yml.j2,yaml.j2}] -max_line_length = 120 indent_size = 2 + +[*.xml] +indent_size = 2 + + +[*.sh] +indent_style = tab diff --git a/core/engine/parameters.yml b/core/engine/parameters.yml index 9d0a8b7..c0dda46 100644 --- a/core/engine/parameters.yml +++ b/core/engine/parameters.yml @@ -1,151 +1,151 @@ # This file is auto-generated during the composer install parameters: - secret: secret - domain: dev.openconext.local - hostname: engine.dev.openconext.local - trusted_proxies: - - 192.168.1.1 - - 10.0.0.1 - enabled_languages: - - nl - - en - attribute_definition_file_path: '%kernel.project_dir%/application/configs/attributes.json' - encryption_keys: - default: - publicFile: /config/engine/engineblock.crt - privateFile: /config/engine/engineblock.pem - forbidden_signature_methods: { } - allowed_acs_location_schemes: - - http - - https - metadata_add_requested_attributes: all - php_settings: - memory_limit: 256M - display_errors: '1' - error_reporting: '6135' - date.timezone: Europe/Amsterdam - sendmail_from: 'OpenConext EngineBlock ' - http_client.timeout: 60 - api.users.metadataPush.username: manage - api.users.metadataPush.password: secret - api.users.profile.username: profile - api.users.profile.password: secret - api.users.deprovision.username: lifecycle - api.users.deprovision.password: secret - pdp.host: 'https://pdp.dev.openconext.local' - pdp.username: pdp_admin - pdp.password: secret - pdp.client_id: EngineBlock - pdp.policy_decision_point_path: /pdp/api/decide/policy - attribute_aggregation.base_url: 'https://aa.dev.openconext.local/internal/attribute/aggregation' - attribute_aggregation.username: eb - attribute_aggregation.password: secret - logger.channel: engineblock - logger.fingers_crossed.passthru_level: NOTICE - logger.fingers_crossed.action_level: ERROR - logger.line_format: '[%%datetime%%] %%channel%%.%%level_name%%: %%message%% %%extra%% %%context%%' - database.host: mariadb - database.port: '3306' - database.user: ebrw - database.password: secret - database.dbname: eb - database.test.host: mariadb - database.test.port: '3306' - database.test.user: ebrw - database.test.password: secret - database.test.dbname: eb - engineblock.metadata_push_memory_limit: 256M - minimum_execution_time_on_invalid_received_response: 5000 - addgueststatus_guestqualifier: 'urn:collab:org:dev.openconext.local' - cookie.path: / - cookie.secure: true - cookie.locale.domain: .dev.openconext.local - cookie.locale.expiry: 5184000 - cookie.locale.http_only: false - cookie.locale.secure: true - view_default_title: OpenConext - view_default_header: OpenConext - view_default_logo: /images/logo.png - view_default_logo_width: 96 - view_default_logo_height: 96 - env_name: '' - env_ribbon_color: '' - ui_return_to_sp_link: false - email_request_access_address: help@example.org - monitor_database_health_check_query: 'SELECT uuid FROM user LIMIT 1;' - wayf.cutoff_point_for_showing_unfiltered_idps: 50 - wayf.remember_choice: false - wayf.display_default_idp_banner_on_wayf: true - wayf.default_idp_entity_id: 'https://default-idp.dev.openconext.local' - global.site_notice.show: false - global.site_notice.allowed.tags: '