diff --git a/.editorconfig b/.editorconfig index 9752871..566a1a3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,5 +11,15 @@ insert_final_newline = true max_line_length = 120 [*.{yml,yaml,yml.j2,yaml.j2}] -max_line_length = 120 indent_size = 2 + +[*.json] +indent_size = 2 +max_line_length = 180 + +[*.xml] +indent_size = 2 + + +[*.sh] +indent_style = tab diff --git a/core/README.md b/core/README.md index 7b5aa1f..7bb6eb3 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. @@ -69,7 +70,7 @@ Since the OpenConext suite is composed of multiple docker containers, you can us If you want to start all services, you can use extras. A profile can be started by using the --profile argument to the `docker compose up` command. For example: ``` -docker compose up -d --profile extras +docker compose --profile extras up -d ``` # Starting a PHP project in development mode (only lifecycle, profile and engineblock) diff --git a/core/docker-compose.yml b/core/docker-compose.yml index 385a915..a0eefca 100644 --- a/core/docker-compose.yml +++ b/core/docker-compose.yml @@ -37,49 +37,63 @@ 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 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: | + # 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 { + 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 : "$${MONGO_REPLICA_SET_NAME}", + members: [ { _id: 0, host: "mongodb:27017" } ] + }); + rs.status().ok; + } + }; + ' + interval: 5s + 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 $${MONGO_REPLICA_SET_NAME} --keyFile /keyfile + restart: always + ports: + - "27017:27017" networks: coreconextdev: hostname: mongodb engine: - image: ghcr.io/openconext/openconext-engineblock/openconext-engineblock:prod + image: ghcr.io/openconext/openconext-engineblock/openconext-engineblock:6.15.4 volumes: - ./:/config networks: @@ -110,7 +124,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: @@ -119,7 +133,7 @@ services: hostname: mujina.docker managegui: - image: ghcr.io/openconext/openconext-manage/manage-gui:latest + image: ghcr.io/openconext/openconext-manage/manage-gui:9.1 environment: HTTPD_CSP: "" HTTPD_SERVERNAME: "manage.dev.openconext.local" @@ -141,7 +155,7 @@ services: condition: service_healthy manageserver: - image: ghcr.io/openconext/openconext-manage/manage-server:latest + image: ghcr.io/openconext/openconext-manage/manage-server:9.1 environment: USE_SYSTEM_CA_CERTS: true volumes: @@ -192,7 +206,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 +216,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 +234,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 +259,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: @@ -280,7 +294,7 @@ services: - "extras" inviteclient: - image: ghcr.io/openconext/openconext-invite/inviteclient:0.0.23 + image: ghcr.io/openconext/openconext-invite/inviteclient:snapshot volumes: - ./:/config environment: diff --git a/core/engine/parameters.yml b/core/engine/parameters.yml index 9d0a8b7..b0f3b75 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: '