Commit Graph

349 Commits

Author SHA1 Message Date
38af81e2db fix: Don't start containers in install-composer-dependencies playbook
Some checks failed
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been cancelled
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been cancelled
🚀 Build & Deploy Image / Build Docker Image (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been cancelled
Security Vulnerability Scan / Check for Dependency Changes (push) Has been cancelled
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
🚀 Build & Deploy Image / Determine Build Necessity (push) Has been cancelled
- Remove container start logic - containers should be started by deploy-image.yml
- Add clear error message if container is not running
- Provides helpful instructions for manual container start if needed
2025-11-08 15:35:22 +01:00
ae592c21c7 fix: Add container status check and better error handling
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 56s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 24s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 12s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 15s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 1m3s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
- Check if container is running before executing composer
- Start container if not running
- Display detailed error output for debugging
- Fixes composer install failures when container is not running
2025-11-08 15:31:06 +01:00
f0a412a221 fix: Use application code directory for docker-compose files
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 53s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 25s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 12s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 15s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 1m20s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
- Change from stacks path to application code directory (/home/deploy/michaelschiemer/current)
- docker-compose files are in the application root, not in deployment/stacks
- Fixes 'no such file or directory' error for docker-compose.base.yml
2025-11-08 15:26:42 +01:00
dd072ded3c fix: Use correct path for docker-compose files
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 34s
🚀 Build & Deploy Image / Build Docker Image (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been cancelled
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been cancelled
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been cancelled
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
Security Vulnerability Scan / Check for Dependency Changes (push) Has been cancelled
- Change stacks_base_path_default from /home/deploy to /home/deploy/deployment/stacks
- Matches actual server directory structure where stacks are located
2025-11-08 15:25:57 +01:00
f7bac92b64 fix: Resolve recursive loop in stacks_base_path variable
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 30s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 11s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 13s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 54s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 54s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
- Use stacks_base_path_default instead of self-reference
- Fixes 'Recursive loop detected' error in install-composer-dependencies playbook
2025-11-08 15:19:37 +01:00
eeaf025fed fix: Define stacks_base_path variable with default value
Some checks failed
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 29s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 13s
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 29s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 12s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 52s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
- Add stacks_base_path variable with default '/home/deploy'
- Fixes 'stacks_base_path is undefined' error in install-composer-dependencies playbook
2025-11-08 15:16:24 +01:00
2e14557b21 fix: Handle case where destination exists but is not a git repo
Some checks failed
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 13s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 27s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 31s
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 13s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 1m22s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
- Check if destination directory exists separately from git repo check
- Remove directory if it exists but is not a git repository
- Prevents 'destination path already exists' error during clone
2025-11-08 15:12:06 +01:00
03f4d90ed0 fix: Remove unsupported owner/group parameters from git module
Some checks failed
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 28s
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 28s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 9s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 10s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 43s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
- ansible.builtin.git no longer supports owner and group parameters
- Set ownership in separate file task after git operations
- Fixes 'Unsupported parameters' error
2025-11-08 15:08:52 +01:00
2f98c52300 refactor: Simplify git_repo_url logic
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 59s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 26s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 10s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 12s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 48s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
- Use single set_fact task with ternary operator
- Cleaner and more efficient than multiple conditional tasks
2025-11-08 15:04:20 +01:00
163460c22e fix: Use separate variable git_repo_url to avoid recursive loop
Some checks failed
Security Vulnerability Scan / Check for Dependency Changes (push) Has been cancelled
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been cancelled
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been cancelled
🚀 Build & Deploy Image / Build Docker Image (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been cancelled
🚀 Build & Deploy Image / Determine Build Necessity (push) Has been cancelled
- Use git_repo_url instead of git_repository_url in tasks
- Set git_repo_url based on whether git_repository_url is provided
- This completely avoids the recursive loop issue
2025-11-08 15:04:04 +01:00
0ab3b6a799 fix: Set git_repository_url using set_fact to avoid recursive loop
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 33s
🚀 Build & Deploy Image / Build Docker Image (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been cancelled
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been cancelled
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been cancelled
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
Security Vulnerability Scan / Check for Dependency Changes (push) Has been cancelled
- Use set_fact task to set git_repository_url instead of vars section
- This prevents recursive loop when variable is referenced in tasks
2025-11-08 15:03:09 +01:00
acecc23cec fix: Resolve recursive loop in git_repository_url variable
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 57s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 11s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 1m7s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 25s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 10s
- Change git_repository_url to use git_repository_url_default instead of self-reference
- Fixes 'Recursive loop detected in template' error in Ansible playbook
2025-11-08 14:59:16 +01:00
95b53c0ab8 test: Verify workflow with ANSIBLE_VAULT_PASSWORD secret
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 25s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 26s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 14s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 11s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 44s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
- Test commit to verify that workflow can now:
  - Use php-ci image with Ansible
  - Use ANSIBLE_VAULT_PASSWORD secret for vault decryption
  - Successfully deploy to staging
2025-11-08 14:56:35 +01:00
13d627d351 fix: Use php-ci runner for deploy jobs
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 57s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 52s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 10s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 15s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 40s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
- Change deploy-staging and deploy-production to use php-ci runner
- php-ci image has Ansible pre-installed, fixing 'ansible-playbook: command not found' error
2025-11-08 14:50:25 +01:00
deddb87dcf test: Trigger workflow by changing deployment path
Some checks failed
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 50s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 26s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 10s
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 14s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 41s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
This commit changes a file in deployment/ to trigger the build workflow
2025-11-08 14:46:22 +01:00
f498a13ee1 test: Verify workflow with registry secrets
All checks were successful
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 31s
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
- Test commit to verify that workflow can now:
  - Use php-ci image from docker-dind
  - Login to registry with configured secrets
  - Build and push images successfully
2025-11-08 14:44:15 +01:00
efa97f8b5d fix: Build CI images on production server
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 33s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 39s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 17s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Successful in 1m15s
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Failing after 33s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
- Add build-ci-image-production.sh script for building CI images on production
- Add BUILD_ON_PRODUCTION.md documentation
- Fix Dockerfile to handle optional PECL extensions for PHP 8.5 RC

This fixes the issue where Gitea workflows fail with:
'Error response from daemon: pull access denied for php-ci'
2025-11-08 14:33:59 +01:00
07e92a8709 fix: Install Ansible in docker-build image instead of runtime
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 44s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 18s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Failing after 2s
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Failing after 44s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 40s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
2025-11-08 13:54:01 +01:00
e9e87c9c5e fix: Replace apt-get with apk for Alpine-based docker-build container
Some checks failed
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 1m1s
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 28s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 10s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 16s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 38s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
2025-11-08 13:45:18 +01:00
1b9cda6dd3 docs: Add CI image setup documentation
Some checks failed
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 40s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 46s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 1m0s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 11s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 12s
2025-11-08 13:38:46 +01:00
50e58c6ba9 docs: Update deployment status - Gitea repository created, Traefik issues fixed
Some checks failed
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 34s
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been cancelled
🚀 Build & Deploy Image / Build Docker Image (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been cancelled
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been cancelled
🚀 Build & Deploy Image / Determine Build Necessity (push) Has been cancelled
2025-11-08 13:13:42 +01:00
63799a7655 test: CI/CD pipeline production test 2025-11-08 12:15:36 +01:00
7093693cfb test: CI/CD pipeline staging test 2025-11-08 11:16:01 +01:00
9e77ac3b42 feat(traefik): Add Gitea service definition for Traefik
- Add gitea-service.yml with proper timeout configuration
- Service definition required for Traefik to route to Gitea
- Replaces old gitea.yml file that was removed
2025-11-07 23:24:20 +01:00
e8a26d7807 test: CI/CD pipeline staging test - Redis aktiviert, Bad Gateway dokumentiert 2025-11-07 20:54:44 +01:00
c088d08639 test: CI/CD pipeline staging test - Repository Setup automatisiert 2025-11-07 20:17:35 +01:00
07c054b5ff test: CI/CD pipeline staging test 2025-11-07 19:52:48 +01:00
1963b10749 feat: Integrate Ansible playbooks into CI/CD workflows
- Add deploy-application-code.yml for Git-based code deployment
- Add install-composer-dependencies.yml for dependency installation
- Add deploy-image.yml for Docker image deployment
- Update build-image.yml to use Ansible playbooks
- Update manual-deploy.yml to use Ansible playbooks
- Add ANSIBLE_VAULT_PASSWORD secret handling
2025-11-07 18:14:11 +01:00
cf903f2582 fix(traefik): update local dev ports and gitea SSH IP
- Change Traefik local HTTP port from 8080 to 8081 (conflict with cadvisor)
- Change Traefik dashboard port to 8093 (conflicts with cadvisor, Hyperion)
- Update Gitea SSH service IP from 172.23.0.2 to 172.23.0.3
- Note: Gitea SSH works directly via Docker port mapping in local dev
- Traefik TCP routing only needed for production (host network mode)
2025-11-05 14:51:37 +01:00
95147ff23e refactor(deployment): Remove WireGuard VPN dependency and restore public service access
Remove WireGuard integration from production deployment to simplify infrastructure:
- Remove docker-compose-direct-access.yml (VPN-bound services)
- Remove VPN-only middlewares from Grafana, Prometheus, Portainer
- Remove WireGuard middleware definitions from Traefik
- Remove WireGuard IPs (10.8.0.0/24) from Traefik forwarded headers

All monitoring services now publicly accessible via subdomains:
- grafana.michaelschiemer.de (with Grafana native auth)
- prometheus.michaelschiemer.de (with Basic Auth)
- portainer.michaelschiemer.de (with Portainer native auth)

All services use Let's Encrypt SSL certificates via Traefik.
2025-11-05 12:48:25 +01:00
7c52065aae feat(traefik): add TCP routing for Gitea SSH port 2222
- Add TCP entrypoint 'gitea-ssh' on port 2222 in static config
- Create TCP router configuration for routing SSH traffic to Gitea
- Use Gitea container IP (172.23.0.2) since Traefik runs in host network mode
- Routes git.michaelschiemer.de:2222 through Traefik instead of direct VPN access
2025-11-05 12:12:42 +01:00
aeeed293af feat(monitoring): Add direct VPN access configuration
- Add docker-compose-direct-access.yml for VPN-only admin access
- Configure Portainer on port 9002 (avoid MinIO conflict)
- Add grafana.ini to disable external plugin update checks
- Bind services to 10.8.0.1 (WireGuard VPN gateway)

This configuration enables direct access to admin services via WireGuard VPN
while removing Traefik routing overhead. Services are bound exclusively to
the VPN gateway IP to prevent public access.
2025-11-05 04:42:17 +01:00
e23c5ce12f fix(Infrastructure): correct PHP 8.0+ parameter order and interface signatures
- MinIoClient: Move required parameters before optional ones
  - Fixes PHP 8.0+ deprecation warning
  - Required deps (RandomGenerator, HmacService, HttpClient) now before optional ($region, $usePathStyle)

- ErrorAggregatorInterface: Align signature with implementation
  - Changed from ErrorHandlerContext to Throwable + ExceptionContextProvider pattern
  - Matches existing ErrorAggregator implementation
  - Maintains flexibility with isDebug flag
2025-11-05 03:51:20 +01:00
f9b8cf9f33 feat: add API Gateway, RapidMail and Shopify integrations, update WireGuard configs, add Redis override and architecture docs 2025-11-04 23:08:17 +01:00
5d6edea3bb feat(deployment): migrate to external Redis stack
Architecture Changes:
- Remove embedded Redis service from production configuration
- Remove port 80/443 direct bindings (Traefik handles routing)
- Update queue-worker and scheduler dependencies (Redis now external)
- Completes Redis stack migration following PostgreSQL pattern
- Resolves port conflict with Traefik reverse proxy

Related Files:
- deployment/stacks/redis/docker-compose.yml (Redis stack - already deployed)
- docker-compose.redis-override.yml (application integration - already created)

Migration Benefits:
- Architectural consistency with PostgreSQL stack pattern
- Better separation of concerns (infrastructure vs application)
- Independent Redis lifecycle management
- Shared Redis instance via app-internal network
- Eliminated port 80 binding conflict

Deployment Command:
docker compose -f docker-compose.base.yml -f docker-compose.production.yml \
  -f docker-compose.postgres-override.yml -f docker-compose.redis-override.yml up -d
2025-11-04 22:31:37 +01:00
7246e89448 fix(deployment): add CHOWN and DAC_OVERRIDE capabilities to Redis for AOF persistence
The Redis container was failing with 'Permission denied' when trying to create
the appendonlydir for AOF (Append-Only File) persistence. The error occurred because:

1. Redis runs as root to read Docker Secrets from /run/secrets/redis_password
2. The /data volume is owned by UID 999 (default redis user)
3. cap_drop: ALL removed the CHOWN capability needed to create subdirectories
4. AOF persistence requires creating appendonlydir in /data with proper ownership

Solution:
- Added CHOWN capability: Allows Redis to create directories with correct ownership
- Added DAC_OVERRIDE capability: Allows writing to volume owned by different user
- Maintains all other security restrictions (no-new-privileges, minimal capabilities)

This fixes the continuous restart loop that persisted through commits:
- 5f7ebd9: Fixed healthcheck variable syntax
- 700fe81: Fixed entrypoint script variables
- bfe6a96: Changed healthcheck to read secret directly

The real issue was not the healthcheck but the permission error that prevented
Redis from starting in the first place.

Refs: Redis container logs showed:
'Can't open or create append-only dir appendonlydir: Permission denied'
2025-11-04 21:29:32 +01:00
bfe6a966b5 fix(deployment): Redis health check reads password directly from Docker Secret
The health check now reads the password directly from /run/secrets/redis_password
instead of relying on an environment variable, which is not available in the
health check context.

This resolves the 'container application-redis-1 is unhealthy' error.
2025-11-04 21:16:25 +01:00
3ed2685e74 feat: add comprehensive framework features and deployment improvements
Major additions:
- Storage abstraction layer with filesystem and in-memory implementations
- Gitea API integration with MCP tools for repository management
- Console dialog mode with interactive command execution
- WireGuard VPN DNS fix implementation and documentation
- HTTP client streaming response support
- Router generic result type
- Parameter type validator for framework core

Framework enhancements:
- Console command registry improvements
- Console dialog components
- Method signature analyzer updates
- Route mapper refinements
- MCP server and tool mapper updates
- Queue job chain and dependency commands
- Discovery tokenizer improvements

Infrastructure:
- Deployment architecture documentation
- Ansible playbook updates for WireGuard client regeneration
- Production environment configuration updates
- Docker Compose local configuration updates
- Remove obsolete docker-compose.yml (replaced by environment-specific configs)

Documentation:
- PERMISSIONS.md for access control guidelines
- WireGuard DNS fix implementation details
- Console dialog mode usage guide
- Deployment architecture overview

Testing:
- Multi-purpose attribute tests
- Gitea Actions integration tests (typed and untyped)
2025-11-04 20:39:48 +01:00
700fe8118b fix(deployment): complete Redis health check fix - update entrypoint script variable syntax
Previous fix (5f7ebd9) only updated health check line but missed entrypoint script.
The entrypoint script was still using $$REDIS_PASSWORD (Docker Compose escaping)
instead of $REDIS_PASSWORD (shell variable syntax).

Changes:
- Line 180: export REDIS_PASSWORD=$(cat ...) - now uses single $
- Line 182: if [ -n "$REDIS_PASSWORD" ] - now uses single $
- Line 190: --requirepass "$REDIS_PASSWORD" - now uses single $

Technical explanation:
The command: block is a multi-line shell script passed to /bin/sh -c.
Within this shell script context, we use normal shell variable syntax with
single $ for variable references. The export statement makes REDIS_PASSWORD
available to both the Redis process and the health check command.

This completes the fix for: "container application-redis-1 is unhealthy"

Related: 5f7ebd9 (health check fix), b1e3a00 (fallback strategy)
2025-11-04 19:24:06 +01:00
5f7ebd9133 fix(deployment): correct Redis health check variable syntax for environment variable access
- Changed health check from $$REDIS_PASSWORD to $REDIS_PASSWORD
- Double dollar sign is Docker Compose variable escaping (wrong context)
- Single dollar sign correctly references environment variable exported by entrypoint
- Health check runs in container shell where REDIS_PASSWORD is available
- Fixes 'container application-redis-1 is unhealthy' deployment failure
2025-11-04 18:33:03 +01:00
b8cfabeed0 Trigger workflow to build missing Docker image for deployment
Added comment to force Gitea workflow execution and build Docker image
for deployment fix #12.
2025-11-04 18:16:58 +01:00
5633959b9d fix(deployment): use environment variable for Redis health check authentication
Changes:
- Export REDIS_PASSWORD from Docker Secret in entrypoint script
- Health check now uses exported environment variable instead of reading Secret file
- Increased start_period to 30s to allow more time for initialization

Why this works:
- Environment variables are accessible to both main process and health checks
- Docker Secret file reading in health check context was unreliable
- Export makes password available in same shell session for health check

Security:
- Password still sourced from Docker Secret (encrypted at rest)
- Only exported within container environment (not exposed externally)
- Redis still requires password authentication (--requirepass)

Deployment fix #11 (continued): Redis container health check
2025-11-04 17:40:48 +01:00
b1e3a0025a fix(deployment): improve Redis health check with fallback strategy
Changed health check to try without password first, then with Docker Secret.
This handles both scenarios where password might not be immediately available
or where the Secret read might fail in health check context.

Changes:
- Use CMD-SHELL instead of CMD for shell expansion support
- Try 'redis-cli ping' first (no auth)
- Fallback to authenticated ping if first attempt fails
- Properly quote password from Docker Secret

This is the eleventh cumulative fix for production deployment pipeline.

Related: commit 477fe67 (initial Redis health check fix)
2025-11-04 17:28:54 +01:00
5b958dc6b1 fix(deployment): remove db service from base config - use external PostgreSQL stack for all environments
User specified that all environments (local, staging, production) should
use external PostgreSQL stacks consistently instead of embedded database.

Changes:
- Removed db service definition from base config (lines 87-114)
- Removed db dependency from queue-worker service
- Updated php-test DB_HOST to use external 'postgres' service

This eliminates the need for production overrides and creates uniform
architecture across all environments. The application-db-1 container
will no longer be started, fixing deployment failure.

This is the tenth cumulative fix for production deployment pipeline.

Related commits:
- f97863a: Add image references to production config
- 5b5fdee: Fix registry upload with sequential push
- a1b9a53: Remove CI test file
- 0b54086: Fix Node.js cache dependency
- 6263d7a: Trigger CI workflow verification
- 08f6f64: Stable IMAGE_TAG
- 2e539ed: Add build: null overrides
- 6e1faab: Deploy docker-compose via scp
- c1d6a71: Fix scp working directory
- a4ca6e9: Trigger pipeline
- 0c0c3ba: Fix .env mount conflict
- 41882da: Fix storage/var volume mounts
- 477fe67: Fix Redis health check
2025-11-04 17:19:20 +01:00
477fe6767e fix(deployment): correct Redis health check command and add authentication
Previous health check used incorrect command: redis-cli --raw incr ping
This increments a counter instead of checking Redis health.

Changed to proper health check:
- Use standard redis-cli ping command
- Authenticate with password from Docker Secret
- Verify PONG response with grep

This is the ninth cumulative fix for production deployment pipeline.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 17:01:47 +01:00
41882dafe6 fix(deployment): change application mount to read-write, remove storage/var volume overlays
Docker named volumes cannot create mount points inside read-only directories.
Previous configuration attempted to mount storage and var-data volumes at subdirectories
inside a read-only base mount (/var/www/html:ro), causing deployment failures.

Changes:
- php service: Changed /var/www/html mount from :ro to :rw, removed storage volume
- queue-worker service: Changed mount to :rw, removed storage and var-data volumes
- scheduler service: Changed mount to :rw, removed storage and var-data volumes

Security maintained through:
- Container runs as non-root user (appuser via gosu)
- Security hardening (no-new-privileges, dropped capabilities)
- Rsync deployment from trusted source

This is the eighth cumulative fix for production deployment pipeline.
2025-11-04 16:43:46 +01:00
0c0c3ba845 fix(deployment): remove conflicting .env file mounts
Remove separate .env file mounts from php, queue-worker, and scheduler
services to fix read-only filesystem mount conflict.

The .env file is already included in the rsync deployment at
/home/deploy/michaelschiemer/current/.env and is accessible through
the main application code mount. Separate file mounts are redundant
and cause Docker mount conflicts because they attempt to create mount
points inside read-only parent directories.

Error fixed:
- error mounting '/var/www/html/.env': read-only file system

Services fixed:
- php: removed .env mount (line 154)
- queue-worker: removed .env mount (line 254)
- scheduler: removed .env mount (line 327)
2025-11-04 16:24:06 +01:00
a4ca6e9e16 chore: trigger pipeline for scp working directory fix
Update comment to trigger CI/CD workflow with cd /workspace/repo fix
(commit c1d6a71).

This deployment will:
1. cd to /workspace/repo before scp
2. Transfer docker-compose files successfully
3. Deploy all six fixes to production
2025-11-04 16:10:39 +01:00
c1d6a71494 fix(deployment): cd to /workspace/repo before scp
The 'Deploy to Production Server' step is separate from the clone step and
doesn't inherit the working directory. The scp command was running from the
default directory where docker-compose files don't exist.

Adding 'cd /workspace/repo' before scp to access the cloned repository files.

This fixes the error:
docker-compose.base.yml: No such file or directory
docker-compose.production.yml: No such file or directory
2025-11-04 16:07:05 +01:00
870db892e7 chore: trigger pipeline for docker-compose scp deployment
Update comment to trigger CI/CD workflow with docker-compose file deployment
via scp (commit 6e1faab).

This deployment will:
1. Build and push image with stable git-SHA tag
2. Transfer docker-compose.base.yml and docker-compose.production.yml via scp
3. Pull new image on production server
4. Restart services with updated configuration including build: null overrides

All five deployment fixes are now integrated:
- Sequential push (0b342c6)
- Stable IMAGE_TAG (08f6f64)
- build: null overrides (2e539ed)
- scp docker-compose deployment (6e1faab)
- Source file trigger (this commit)
2025-11-04 16:01:49 +01:00