Skip to content

Adding Lrs yetanalytics as new stack + others fixes#93

Open
jujusb wants to merge 33 commits into
pumvafrom
lrs-yetanalytics
Open

Adding Lrs yetanalytics as new stack + others fixes#93
jujusb wants to merge 33 commits into
pumvafrom
lrs-yetanalytics

Conversation

@jujusb

@jujusb jujusb commented Jun 3, 2026

Copy link
Copy Markdown
Member

This pull request introduces several improvements and fixes across the SIMVA stack, focusing on better local development workflows, enhanced Keycloak admin user handling, and improved configuration management. The most significant changes are grouped below by theme.

Local Development & Dependency Management:

  • Added a robust local dependency setup for js-tracker in the simva-api container. This includes a new setup-local-deps.js script that builds and installs a local copy of js-tracker if enabled, improving developer experience for local package development. (docker-stacks/07-simva/etc/entrypoint.d/setup-local-deps.js, docker-stacks/07-simva/etc/entrypoint.d/docker-startup-api.sh, docker-stacks/07-simva/docker-compose.dev.yml) [1] [2] [3]
  • Updated volume mounts and build paths for simva-api, simva-front, and simva-trace-allocator services to use simplified directories, and added environment variables to support the new local dependency workflow. (docker-stacks/07-simva/docker-compose.dev.yml)

Keycloak Admin User Handling:

  • Improved admin user creation and login logic to always use a lowercase username, check for the presence of the admin role before assigning, and ensure idempotency. This prevents duplicate admin users and avoids unnecessary role assignments. (docker-stacks/02-keycloak/etc/hooks/helpers.d/keycloak-functions.sh) [1] [2] [3] [4]
  • Added a version check in the Keycloak upgrade script to skip certain steps for newer Keycloak versions. (docker-stacks/02-keycloak/etc/hooks/before-upgrade.d/upgrade.sh)
  • Fixed file path for .migration during purge to ensure correct cleanup. (docker-stacks/02-keycloak/etc/hooks/purge.d/01-remove-data-and-config.sh)

Configuration & Environment Handling:

  • Enhanced LimeSurvey version parsing to correctly strip out suffixes and echo the chosen version, ensuring accurate version checks and configuration. (docker-stacks/07-simva/etc/simva.d/simva-env.sh) [1] [2]
  • Added LRS (Learning Record Store) endpoint and credentials to the environment for the simva-api service. (docker-stacks/07-simva/docker-compose.yml)

Nginx & Traefik Configuration:

  • Updated Nginx template mounting and upstream host file handling to be more explicit and robust, and improved logging for generated configurations. (docker-stacks/01-traefik/docker-compose.dev-lb.yml, docker-stacks/01-traefik/etc/hooks/before-start.d/20-nginx.sh) [1] [2] [3]
  • Improved certificate installation logic to skip generation if the files already exist, reducing unnecessary operations. (docker-stacks/01-traefik/etc/hooks/helpers.d/02bis-install-shlink-wildcard-certificate.sh) [1] [2]

Other Fixes:

  • Removed unnecessary file creation in Keycloak migration and fixed a bug in database check environment variable handling. (docker-stacks/02-keycloak/etc/hooks/before-migrate.d/10-remove-simva-realm-data.sh, docker-stacks/07-simva/etc/hooks/before-start.d/10-checkout-code.sh) [1] [2]

These changes collectively improve the reliability, maintainability, and developer experience of the SIMVA stack.

Copilot AI review requested due to automatic review settings June 3, 2026 02:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the SIMVA infrastructure stack by introducing a new YetAnalytics LRSQL (LRS) stack, improving local development workflows (notably local js-tracker usage in simva-api), and tightening several operational scripts around Keycloak admin handling, TLS/cert management, and startup/upgrade hooks.

Changes:

  • Add a new 11-lrs stack (LRSQL + Postgres) and wire it into stack ordering and environment variables.
  • Improve local development ergonomics (simplified repo mounts + optional local js-tracker build/install in simva-api).
  • Update Keycloak and Traefik/Nginx operational hooks (admin idempotency, migration/upgrade helpers, Nginx host generation, cert update/install tooling).

Reviewed changes

Copilot reviewed 26 out of 33 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
vagrant/helpers/installation.sh Extends Vagrant provisioning to clone additional repos/plugins used by the stack.
docker-stacks/simva Adds updatecerts operation and changes default start behavior for compose recreation.
docker-stacks/etc/simva.install.d/simva-env.sh Adds 11-lrs to stack order and bumps LimeSurvey plugin versions.
docker-stacks/etc/simva.install.d/simva-env.dev.sh Adds local path env var for mounting js-tracker in dev.
docker-stacks/etc/simva.d/simva-env.sh Introduces LRS subdomain and LRS-related default env vars/credentials.
docker-stacks/etc/simva.d/simva-env.dev.sh Adds dev toggles for js-tracker local deployment and sqlite UI subdomain.
docker-stacks/data/lrs/.gitignore Ignores LRS stack runtime marker files in data volume folder.
docker-stacks/config-template/traefik/nginx/default.conf.template Switches Nginx server_name management to a file include.
docker-stacks/config-template/limesurvey/etc/config.php Updates LimeSurvey OAuth2 plugin autocreation configuration structure.
docker-stacks/bin/update-certs.sh Adds a new cert refresh script used by the new updatecerts command.
docker-stacks/11-lrs/README.md Adds pointers to LRSQL OIDC/authority documentation.
docker-stacks/11-lrs/etc/simva.d/simva-env.sh Declares the LRS stack compose file for the stack runner.
docker-stacks/11-lrs/etc/hooks/after-start.d/10-wait-lrs-available.sh Adds post-start availability check for the LRS admin UI.
docker-stacks/11-lrs/docker-compose.yml New LRSQL + Postgres compose stack with Traefik routing.
docker-stacks/07-simva/etc/simva.d/simva-env.sh Improves LimeSurvey version parsing and fixes defaulting for DB check flag.
docker-stacks/07-simva/etc/hooks/before-start.d/10-checkout-code.sh Adjusts migration-related behavior around checkout/build timing.
docker-stacks/07-simva/etc/hooks/after-start.d/30-wait-simva-simva-front-available.sh Adds front availability wait hook (skips during migration).
docker-stacks/07-simva/etc/hooks/after-start.d/20-wait-simva-simva-api-available.sh Adds API health availability wait hook (skips during migration).
docker-stacks/07-simva/etc/hooks/after-start.d/10-install-cert.sh Adds CA cert installation/update inside selected containers after start.
docker-stacks/07-simva/etc/hooks/after-start.d/00-wait-container-finished-migration.sh Adds hook to wait for migration container completion and clean marker files.
docker-stacks/07-simva/etc/entrypoint.d/setup-local-deps.js Adds js-tracker local build/pack/install helper for simva-api container.
docker-stacks/07-simva/etc/entrypoint.d/docker-startup-api.sh Calls the local dependency setup script in development mode.
docker-stacks/07-simva/docker-compose.yml Injects LRS endpoint/credentials into simva-api service env.
docker-stacks/07-simva/docker-compose.dev.yml Simplifies dev mounts and enables local js-tracker workflow.
docker-stacks/02-keycloak/etc/hooks/purge.d/01-remove-data-and-config.sh Fixes .migration purge path to match where migration marker is written.
docker-stacks/02-keycloak/etc/hooks/helpers.d/keycloak-functions.sh Improves admin login/user creation idempotency and normalizes admin username case.
docker-stacks/02-keycloak/etc/hooks/before-upgrade.d/upgrade.sh Adds a pre-upgrade hook to manage migration markers for older Keycloak versions.
docker-stacks/02-keycloak/etc/hooks/before-migrate.d/10-remove-simva-realm-data.sh Removes unnecessary marker file creation during migrate preparation.
docker-stacks/02-keycloak/etc/hooks/after-upgrate.d/10-migrate-realm-user-client.sh Adds an upgrade hook to merge exported realm data with newly generated clients/roles.
docker-stacks/01-traefik/etc/hooks/helpers.d/02bis-install-shlink-wildcard-certificate.sh Adjusts Shlink certificate generation/skip behavior.
docker-stacks/01-traefik/etc/hooks/before-start.d/20-nginx.sh Generates an include file containing server_name lines for dev load balancer Nginx.
docker-stacks/01-traefik/etc/hooks/before-start.d/00-check-rootCA.sh Minor whitespace/style correction.
docker-stacks/01-traefik/docker-compose.dev-lb.yml Updates Nginx template mount to a single template file and mounts generated host include file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread vagrant/helpers/installation.sh
Comment thread docker-stacks/01-traefik/etc/hooks/before-start.d/20-nginx.sh
Comment thread docker-stacks/02-keycloak/etc/hooks/before-upgrade.d/upgrade.sh Outdated
Comment thread docker-stacks/11-lrs/docker-compose.yml
Comment thread docker-stacks/11-lrs/docker-compose.yml Outdated
Comment thread docker-stacks/simva Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 33 changed files in this pull request and generated 3 comments.

Comment thread docker-stacks/02-keycloak/etc/hooks/helpers.d/keycloak-functions.sh
Comment thread docker-stacks/07-simva/etc/entrypoint.d/setup-local-deps.js
Comment thread docker-stacks/11-lrs/docker-compose.yml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 33 changed files in this pull request and generated 3 comments.

Comment thread docker-stacks/11-lrs/docker-compose.yml
Comment thread docker-stacks/11-lrs/docker-compose.yml
Comment thread docker-stacks/11-lrs/docker-compose.yml Outdated
jujusb and others added 21 commits June 3, 2026 18:36
Update LRS service configuration in Docker Compose and add .gitignore for LRS data
Update 10-wait-lrs-available.sh
Ensure LRS service restarts unless stopped in Docker Compose
jujusb and others added 7 commits June 3, 2026 18:36
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…sh:Target the base /var/lib/postgresql volume so that containers can natively store multiple major versions.
…; specify LRS image and version in environment script
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jujusb jujusb force-pushed the lrs-yetanalytics branch from b1d24cb to 798ec1c Compare June 3, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants