Commit Graph

240 Commits

Author SHA1 Message Date
35ce316f98 chore: update HttpRouter 2025-11-03 12:50:19 +01:00
ee06cbbbf1 chore: update console components, logging, router and add subdomain support 2025-11-03 12:44:39 +01:00
6d355c9897 refactor(logging): update context manager and log path configuration
- Replace `environment` with `type` for global context data
- Update default log directory path from `storage/logs` to `logs`
- Comment out Nginx log paths to disable by default
- Change `DockerJsonHandler` contract from `FormattableHandler` to `LogHandler`
2025-11-03 01:43:38 +01:00
d90f4386d9 Make sure port is read as int from environment 2025-11-03 01:06:36 +01:00
a60b4b6ac2 fix: Allow root to read Docker Secret files with restrictive permissions
- Remove is_readable() check when running as root
- Root can read files even with 0700 permissions
- Should fix issue where REDIS_PASSWORD file exists but is not readable (0700, owner 1000, process 0)
- Docker secrets may have restrictive permissions that root can bypass
2025-11-03 01:05:13 +01:00
4be249a57b fix: Normalize Docker Secret file paths to support both formats
- Handle paths like /redis_password and convert to /run/secrets/redis_password
- Docker Swarm may set *_FILE variables with just the secret name
- Add file permission debugging to diagnose read issues
- Should fix issue where REDIS_PASSWORD_FILE points to /redis_password instead of /run/secrets/redis_password
2025-11-03 00:57:20 +01:00
b070767d0a refactor: simplify Redis configuration initialization
- Use RedisConfig::fromEnvironment() in LoggerInitializer
- Remove fallback logic in QueueInitializer, always use connection pool
- Make RedisConfig constructor private
- Clean up Redis connection error message
2025-11-03 00:43:28 +01:00
7a2cb0b63e fix: staging deployment configuration and redis secrets handling 2025-11-03 00:15:43 +01:00
ff572534e9 ci: update deploy-staging job dependencies and conditions 2025-11-02 23:25:31 +01:00
7f3ce7f969 fix: update build workflow default branch to staging
- Change default branch from 'main' to 'staging'
- Add choice input type for branch selection
- Add debug check for RUNTIME_IMAGE_NAME
- Remove unused env variable
2025-11-02 23:12:18 +01:00
77c656af62 feat(deployment): update Semaphore stack and Traefik configuration
- Add QUICKSTART.md and SETUP_REPOSITORY.md for Semaphore stack
- Add playbooks directory for Semaphore deployment
- Update Semaphore docker-compose.yml, env.example, and README
- Add Traefik local configuration files
- Disable semaphore.yml in Traefik dynamic config
- Update docker-compose.local.yml and build-image workflow
2025-11-02 22:55:51 +01:00
0c4ff1283c fix: Add workaround for REDIS_PASSWORD_FILE not being set by Docker Compose
- Manually set REDIS_PASSWORD_FILE if file exists but variable is not set
- Handles cases where Docker Compose doesn't set the variable correctly
- Should fix issue where REDIS_PASSWORD_FILE is missing even though configured
2025-11-02 22:48:10 +01:00
73de91c2d3 debug: Add logging for all *_FILE environment variables
- Log all *_FILE variables from getenv() and $_ENV
- Help diagnose why REDIS_PASSWORD_FILE is not set
- Check if other *_FILE variables are present
2025-11-02 22:38:27 +01:00
3f7c6e79fb fix: Add explicit secrets definition to docker-compose.staging.yml
- Add secrets section at end of docker-compose.staging.yml
- Ensures secrets are properly loaded even if inherited from base file
- Should fix issue where REDIS_PASSWORD_FILE variable is not set
- Secrets are now explicitly defined: redis_password, db_user_password, app_key, vault_encryption_key, git_token
2025-11-02 22:31:46 +01:00
64400a317b debug: Add extended Docker Secrets debugging
- Check getenv(), $_ENV and $_SERVER for REDIS_PASSWORD_FILE
- Check if /run/secrets/redis_password file exists
- Help diagnose why REDIS_PASSWORD_FILE is not in environment
2025-11-02 22:25:13 +01:00
14900940c5 debug: Add Docker Secrets debugging to AppBootstrapper
- Add debug logging for REDIS_PASSWORD_FILE and REDIS_PASSWORD
- Check if REDIS_PASSWORD_FILE exists and has correct value
- Check if secret file exists and is readable
- Help diagnose why REDIS_PASSWORD_FILE is not in logs
2025-11-02 22:17:10 +01:00
bd9df7e630 fix: Don't store empty values when Docker Secret resolution fails in all()
- Update all() first pass to skip storing empty values when secret resolution fails
- Ensures second pass can still resolve secrets from *_FILE variables
- Prevents empty values from blocking secret resolution in second pass
- Should fix issue where REDIS_PASSWORD was empty even though REDIS_PASSWORD_FILE existed
2025-11-02 21:58:40 +01:00
c530fbf8f1 fix: Resolve Docker Secrets from *_FILE variables even if base variable is missing
- Update all() method to check for *_FILE variables and resolve their base variables
- Ensures APP_KEY, DB_PASSWORD, etc. are resolved even if they don't exist in the array
- Two-pass approach: first processes existing variables, second checks for *_FILE patterns
- Fixes issue where APP_KEY was empty even though APP_KEY_FILE existed
2025-11-02 21:52:04 +01:00
417b451be1 fix: Add REDIS_PASSWORD_FILE Docker Secret to staging-app service
- Add REDIS_PASSWORD_FILE=/run/secrets/redis_password to staging-app environment
- Add redis_password to staging-app secrets list
- Ensures REDIS_PASSWORD can be resolved from Docker Secret via *_FILE pattern
- Fixes issue where REDIS_PASSWORD was empty in staging-app even though secret exists
2025-11-02 21:48:01 +01:00
0912df0537 fix: Resolve Docker Secrets in all() method for empty variables
- Update all() to automatically resolve Docker Secrets (*_FILE pattern) for empty variables
- Ensures DB_PASSWORD, REDIS_PASSWORD, etc. are resolved from their *_FILE counterparts when empty
- Variables like DB_PASSWORD_FILE are still included in output, but empty values are replaced with resolved secrets
- Fixes issue where DB_PASSWORD and REDIS_PASSWORD appeared empty in logs even though *_FILE variables existed
2025-11-02 21:36:07 +01:00
0a5d0ecd0c fix: Allow Docker Secrets to override empty environment variables
- Update get() method to treat empty strings as 'not set' for Docker Secrets resolution
- Allows Docker Secrets (*_FILE pattern) to override empty values
- Preserves original behavior: explicitly set empty strings are still returned
- Fixes issue where RAPIDMAIL_USERNAME and RAPIDMAIL_PASSWORD appear empty even when Docker Secrets are available
2025-11-02 21:26:07 +01:00
fce990f3b5 fix: Make all() method dynamically check system environment variables
- Update all() to merge internal variables with system environment variables
- Ensures variables set after initialization (e.g., by PHP-FPM) are included
- Internal variables take precedence over system variables
- Fixes issue where RAPIDMAIL_USERNAME and RAPIDMAIL_PASSWORD were missing in all() output
2025-11-02 21:18:48 +01:00
d2ee59bd65 fix: Fix environment variables not being captured correctly in PHP-FPM
- Fix priority order in loadSystemEnvironment() to check  and  first
- Add dynamic fallback in Environment::get() to handle variables set after initialization
- Ensure all environment variables are captured during bootstrap, including those set dynamically by PHP-FPM/FastCGI

Fixes issue where environment variables like RAPIDMAIL_USERNAME and RAPIDMAIL_PASSWORD were missing during bootstrap but available later in request processing.
2025-11-02 21:11:29 +01:00
6b633996a1 chore: remove acme.json from repository and add to .gitignore 2025-11-02 20:55:33 +01:00
516b7a847a feat(deployment): add manual deploy workflow and update semaphore configuration 2025-11-02 20:53:10 +01:00
a5cd49bde7 feat(deployment): update semaphore configuration and deployment workflows 2025-11-02 20:46:18 +01:00
24cbbccf4c feat: update deployment configuration and encrypted env loader
- Update Ansible playbooks and roles for application deployment
- Add new Gitea/Traefik troubleshooting playbooks
- Update Docker Compose configurations (base, local, staging, production)
- Enhance EncryptedEnvLoader with improved error handling
- Add deployment scripts (autossh setup, migration, secret testing)
- Update CI/CD workflows and documentation
- Add Semaphore stack configuration
2025-11-02 20:38:06 +01:00
7b7f0b41d2 chore: update VPN routing configuration and add Grafana VPN documentation 2025-11-02 18:10:04 +01:00
2dd8468d70 chore: add separator line to environment logging output 2025-11-02 16:25:58 +01:00
8344032fb6 feat: add Redis connection diagnostics, VPN routing fixes, and Traefik middleware updates 2025-11-02 15:58:30 +01:00
d5655b1456 feat: add debug logging for environment and server variables in index.php 2025-11-02 15:39:49 +01:00
edcf509a4f feat: add PHP ini management system and update infrastructure configs
- Add PHP ini management classes (Access, IniDirective, IniKey, PhpIni)
- Update deployment configurations (Wireguard, Traefik, Monitoring)
- Add DNS stack and Ansible role
- Add deployment debugging playbooks
- Update framework components (FilePath, RedisConnectionPool)
- Update .gitignore and documentation
2025-11-02 15:29:41 +01:00
e628d30fa0 fix: hide sensitive env output in entrypoint 2025-11-02 04:35:23 +01:00
871c5b842b fix: ensure redis secrets flow from vault 2025-11-02 04:27:12 +01:00
e598309c48 feat: improve WireGuard client management and framework initialization
- Improve WireGuard client IP calculation logic (find next available IP)
- Add local wireguard-clients directory for storing client configs
- Integrate Redis pool into CacheInitializer
- Improve ContainerBootstrapper with better imports and Redis pool
- Add monitoring role tags for better task organization
- Update WireGuard documentation
- Store generated WireGuard client configs locally
2025-11-02 03:29:23 +01:00
f56d53d873 fix: add automatic nginx upstream fix for staging 502 errors
- Add post-deployment fix in build-image.yml workflow to automatically fix nginx upstream configuration
- nginx sites-available/default uses 127.0.0.1:9000 but PHP-FPM runs in staging-app container
- Fix runs automatically after each staging deployment
- Add troubleshooting documentation for staging 502 errors
- Add Ansible playbooks for quick fix and diagnosis
2025-11-02 02:29:12 +01:00
4cec6dd8a0 fix: improve Redis connection error messages and add staging troubleshooting playbooks
- Improve Redis connection error message to include password info
- Add Ansible playbooks for staging 502 error troubleshooting
  - check-staging-status.yml: Check nginx logs and upstream config
  - fix-staging-502-verify.yml: Fix and verify nginx upstream configuration
2025-11-02 02:16:12 +01:00
70875be4b9 fix(redis): include host in connection error message 2025-11-02 02:06:29 +01:00
0d16417888 fix(redis): include database in connection error message 2025-11-02 02:04:28 +01:00
efbdbcb468 chore: Handler-Name zum Log-Output in DefaultLogger hinzufügen 2025-11-02 01:46:59 +01:00
cf0ad6e905 refactor: improve logging system and add deployment fixes
- Enhance logging handlers (Console, DockerJson, File, JsonFile, MultiFile)
- Improve exception and line formatters
- Update logger initialization and processor management
- Add Ansible playbooks for staging 502 error troubleshooting
- Update deployment documentation
- Fix serializer and queue components
- Update error kernel and queued log handler
2025-11-02 01:37:49 +01:00
2defdf2baf chore: update staging branch with current changes 2025-11-02 00:05:26 +01:00
1f2ab358f9 ci: simplify stack path resolution in build-image workflow 2025-11-01 23:13:24 +01:00
25f05c6a17 ci: improve stack path handling in staging deployment
- Simplify local stack path normalization
- Enhance remote shell path resolution to handle user-specific paths (e.g. ~username/path)
- Better handling of escaped tilde paths in SSH heredoc
2025-11-01 23:06:54 +01:00
988e14f3c2 fix(ci): normalize stack path for staging deployment
Normalize stack path locally to avoid ~ confusion when passing to remote shell
2025-11-01 22:54:56 +01:00
ad0598d301 fix: improve stack path handling in staging deployment
- Fix user home directory detection for stack path expansion
- Handle tilde expansion and relative paths correctly
- Add fallback logic for path resolution
2025-11-01 22:47:07 +01:00
ff4b8dd848 fix(ci): expand tilde in staging deployment stack path 2025-11-01 22:32:01 +01:00
888b9cce7f ci: improve build job conditional execution in workflow
- Replace job-level if condition with env variable for better control
- Add conditional checks to all build steps
- Add skip step when build not required
- Simplify deploy-staging conditions
2025-11-01 22:23:18 +01:00
5ec5c41a0a fix(ci): improve image selection and registry handling in deployment workflow
- Add better image selection logic with fallback handling
- Support multiple registry logins for different image sources
- Improve error handling and image URL parsing
- Add proper argument escaping for SSH deployment script
2025-11-01 22:16:23 +01:00
fa28e3580a fix(ci): add image tag fallback logic and code style fixes
- Add fallback to 'latest' tag when build fails
- Add fallback mechanism when pulling specific image tag fails
- Fix code style: move opening brace in ObjectInfo
- Remove unused comment in ObjectStorage
2025-11-01 22:06:12 +01:00