Add file_envs for secrets and allow passing database url via separate envs #246

Merged
simon merged 5 commits from add-file-envs into main 2025-12-03 14:29:34 +01:00
Owner

Description of the implemented changes

The changes were:

  • Bugfixing
  • New Feature
  • Breaking Change
  • Refactoring

What has been changed?

changed runtime.exs to support file_envs

update docker-compose.prod.yml to reflect these changes in said environment, added just commands to generate secrets on first start

Definition of Done

Code Quality

  • No new technical depths
  • Linting passed
  • Documentation is added were needed

Accessibility

  • New elements are properly defined with html-tags
  • Colour contrast follows WCAG criteria
  • Aria labels are added when needed
  • Everything is accessible by keyboard
  • Tab-Order is comprehensible
  • All interactive elements have a visible focus

Testing

  • Tests for new code are written
  • All tests pass
  • axe-core dev tools show no critical or major issues

Additional Notes

## Description of the implemented changes The changes were: - [ ] Bugfixing - [x] New Feature - [ ] Breaking Change - [x] Refactoring ## What has been changed? changed runtime.exs to support file_envs update docker-compose.prod.yml to reflect these changes in said environment, added just commands to generate secrets on first start ## Definition of Done ### Code Quality - [x] No new technical depths - [x] Linting passed - [x] Documentation is added were needed ### Accessibility - [ ] New elements are properly defined with html-tags - [ ] Colour contrast follows WCAG criteria - [ ] Aria labels are added when needed - [ ] Everything is accessible by keyboard - [ ] Tab-Order is comprehensible - [ ] All interactive elements have a visible focus ### Testing - [ ] Tests for new code are written - [ ] All tests pass - [ ] axe-core dev tools show no critical or major issues ## Additional Notes <!--- Add any additional information for the reviewers here -->
simon added 3 commits 2025-12-03 12:58:17 +01:00
chore: update prod-compose to use file-envs for secrets
All checks were successful
continuous-integration/drone/push Build is passing
d8384098b4
fix: mailto formatting
All checks were successful
continuous-integration/drone/push Build is passing
ce15b8f59b
simon added this to the Sprint 9: 20.11 - 11.12 project 2025-12-03 12:58:23 +01:00
requested review from rafael 2025-12-03 12:58:33 +01:00
rafael approved these changes 2025-12-03 13:37:18 +01:00
rafael left a comment
Collaborator

Great work!

One thing that would be great is updating README.md to list the new _FILE vars in the configuration guide.

Great work! One thing that would be great is updating README.md to list the new `_FILE` vars in the configuration guide.
Justfile Outdated
@ -88,0 +90,4 @@
# ================================
# Initialize secrets directory with generated secrets (only if not exists)
init-secrets:
Collaborator

Should we name this action init-prod-secrets to communicate its scope?

Should we name this action `init-prod-secrets` to communicate its scope?
simon marked this conversation as resolved
@ -10,0 +21,4 @@
file_path ->
case File.read(file_path) do
{:ok, content} ->
String.trim(content)
Collaborator

Is this trim specifically needed? Seems like it could lead to some surprising behavior in some edge cases.

Is this `trim` specifically needed? Seems like it could lead to some surprising behavior in some edge cases.
Author
Owner

replaced by trim_trailing

  • leading whitespaces remain
  • only trailing whitespaces are removed, common use case when using secret files, with newlines etc
replaced by trim_trailing - leading whitespaces remain - only trailing whitespaces are removed, common use case when using secret files, with newlines etc
simon marked this conversation as resolved
@ -58,3 +123,3 @@
client_id: System.get_env("OIDC_CLIENT_ID") || "mv",
base_url: System.get_env("OIDC_BASE_URL") || "http://localhost:8080/auth/v1",
client_secret: System.get_env("OIDC_CLIENT_SECRET"),
client_secret: get_env_or_file.("OIDC_CLIENT_SECRET", nil),
Collaborator

Let's add an error message here, similar to the other calls

Let's add an error message here, similar to the other calls
simon marked this conversation as resolved
@ -1,22 +1,33 @@
services:
app:
image: git.local-it.org/local-it/mitgliederverwaltung:latest
image: mitgliederverwaltung:latest
Collaborator

Should we change this back? Or is there a way we can support dev environments and "real" prod deployments with the same file?

Should we change this back? Or is there a way we can support dev environments and "real" prod deployments with the same file?
Author
Owner

was just for testing, whoopsie

was just for testing, whoopsie
simon marked this conversation as resolved
simon was assigned by rafael 2025-12-03 13:39:15 +01:00
simon added 1 commit 2025-12-03 14:27:37 +01:00
fix: resolve review comments
Some checks reported errors
continuous-integration/drone/push Build was killed
1623b63207
simon added 1 commit 2025-12-03 14:29:12 +01:00
Merge remote-tracking branch 'origin/main' into add-file-envs
Some checks reported errors
continuous-integration/drone/push Build was killed
d1bab1288c
simon merged commit a10d42f1ed into main 2025-12-03 14:29:34 +01:00
simon deleted branch add-file-envs 2025-12-03 14:29:35 +01:00
Sign in to join this conversation.
No description provided.