feat: Fix discovery system critical issues
Resolved multiple critical discovery system issues: ## Discovery System Fixes - Fixed console commands not being discovered on first run - Implemented fallback discovery for empty caches - Added context-aware caching with separate cache keys - Fixed object serialization preventing __PHP_Incomplete_Class ## Cache System Improvements - Smart caching that only caches meaningful results - Separate caches for different execution contexts (console, web, test) - Proper array serialization/deserialization for cache compatibility - Cache hit logging for debugging and monitoring ## Object Serialization Fixes - Fixed DiscoveredAttribute serialization with proper string conversion - Sanitized additional data to prevent object reference issues - Added fallback for corrupted cache entries ## Performance & Reliability - All 69 console commands properly discovered and cached - 534 total discovery items successfully cached and restored - No more __PHP_Incomplete_Class cache corruption - Improved error handling and graceful fallbacks ## Testing & Quality - Fixed code style issues across discovery components - Enhanced logging for better debugging capabilities - Improved cache validation and error recovery Ready for production deployment with stable discovery system. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
170
deployment/infrastructure/templates/production.env.template
Normal file
170
deployment/infrastructure/templates/production.env.template
Normal file
@@ -0,0 +1,170 @@
|
||||
# Production Environment Configuration
|
||||
# Auto-generated from template - DO NOT EDIT DIRECTLY
|
||||
# Generated on: {{ ansible_date_time.date }} {{ ansible_date_time.time }}
|
||||
# Image Tag: {{ IMAGE_TAG }}
|
||||
# Environment: {{ environment }}
|
||||
|
||||
# Project Configuration
|
||||
COMPOSE_PROJECT_NAME={{ project_name | default('michaelschiemer') }}
|
||||
DOMAIN_NAME={{ DOMAIN_NAME }}
|
||||
IMAGE_TAG={{ IMAGE_TAG }}
|
||||
|
||||
# Environment
|
||||
APP_ENV=production
|
||||
APP_DEBUG=false
|
||||
APP_TIMEZONE={{ timezone | default('Europe/Berlin') }}
|
||||
APP_LOCALE={{ locale | default('de') }}
|
||||
|
||||
# SSL/HTTPS Configuration
|
||||
APP_SSL_ENABLED=true
|
||||
SSL_CERT_PATH=/etc/letsencrypt/live/{{ DOMAIN_NAME }}
|
||||
FORCE_HTTPS=true
|
||||
|
||||
# Database Configuration (Production)
|
||||
DB_DRIVER={{ DB_DRIVER | default('mysql') }}
|
||||
DB_HOST={{ DB_HOST | default('db') }}
|
||||
DB_PORT={{ DB_PORT | default(3306) }}
|
||||
DB_DATABASE={{ DB_DATABASE }}
|
||||
DB_USERNAME={{ DB_USERNAME }}
|
||||
DB_PASSWORD={{ DB_PASSWORD }}
|
||||
DB_ROOT_PASSWORD={{ DB_ROOT_PASSWORD }}
|
||||
DB_CHARSET=utf8mb4
|
||||
DB_COLLATION=utf8mb4_unicode_ci
|
||||
|
||||
# Redis Configuration
|
||||
REDIS_HOST={{ REDIS_HOST | default('redis') }}
|
||||
REDIS_PORT={{ REDIS_PORT | default(6379) }}
|
||||
REDIS_PASSWORD={{ REDIS_PASSWORD }}
|
||||
REDIS_DATABASE=0
|
||||
REDIS_PREFIX={{ project_name | default('michaelschiemer') }}_prod_
|
||||
|
||||
# Session Configuration (Production Security)
|
||||
SESSION_DRIVER=redis
|
||||
SESSION_LIFETIME=120
|
||||
SESSION_ENCRYPT=true
|
||||
SESSION_SECURE_COOKIE=true
|
||||
SESSION_HTTP_ONLY=true
|
||||
SESSION_SAME_SITE=strict
|
||||
|
||||
# Session Fingerprinting (Production Security)
|
||||
SESSION_FINGERPRINT_STRICT=true
|
||||
SESSION_FINGERPRINT_USER_AGENT=true
|
||||
SESSION_FINGERPRINT_ACCEPT_LANGUAGE=true
|
||||
SESSION_FINGERPRINT_IP_PREFIX=true
|
||||
SESSION_FINGERPRINT_THRESHOLD=0.8
|
||||
|
||||
# Cache Configuration
|
||||
CACHE_DRIVER=redis
|
||||
CACHE_TTL=3600
|
||||
CACHE_PREFIX={{ project_name | default('michaelschiemer') }}_cache_prod_
|
||||
|
||||
# Queue Configuration
|
||||
QUEUE_DRIVER=redis
|
||||
QUEUE_CONNECTION=redis
|
||||
QUEUE_PREFIX={{ project_name | default('michaelschiemer') }}_queue_prod_
|
||||
WORKER_QUEUE=production
|
||||
WORKER_TIMEOUT=300
|
||||
WORKER_MEMORY_LIMIT=512
|
||||
WORKER_SLEEP=1
|
||||
WORKER_TRIES=5
|
||||
WORKER_BATCH_SIZE=10
|
||||
|
||||
# Mail Configuration (Production)
|
||||
MAIL_DRIVER={{ MAIL_DRIVER }}
|
||||
MAIL_HOST={{ MAIL_HOST }}
|
||||
MAIL_PORT={{ MAIL_PORT }}
|
||||
MAIL_USERNAME={{ MAIL_USERNAME }}
|
||||
MAIL_PASSWORD={{ MAIL_PASSWORD }}
|
||||
MAIL_ENCRYPTION={{ MAIL_ENCRYPTION | default('tls') }}
|
||||
MAIL_FROM_ADDRESS={{ MAIL_FROM_ADDRESS | default('kontakt@michaelschiemer.de') }}
|
||||
MAIL_FROM_NAME="{{ MAIL_FROM_NAME | default('Michael Schiemer') }}"
|
||||
|
||||
# Logging Configuration (Production)
|
||||
LOG_CHANNEL=stack
|
||||
LOG_LEVEL=warning
|
||||
LOG_STACK_CHANNELS=single,syslog
|
||||
LOG_ROTATE_DAYS=30
|
||||
LOG_MAX_FILES=10
|
||||
|
||||
# External APIs (Production)
|
||||
SHOPIFY_WEBHOOK_SECRET={{ SHOPIFY_WEBHOOK_SECRET }}
|
||||
RAPIDMAIL_USERNAME={{ RAPIDMAIL_USERNAME }}
|
||||
RAPIDMAIL_PASSWORD={{ RAPIDMAIL_PASSWORD }}
|
||||
RAPIDMAIL_TEST_MODE=false
|
||||
|
||||
# Analytics Configuration (Production)
|
||||
ANALYTICS_ENABLED=true
|
||||
ANALYTICS_TRACK_PAGE_VIEWS=true
|
||||
ANALYTICS_TRACK_API_CALLS=true
|
||||
ANALYTICS_TRACK_USER_ACTIONS=true
|
||||
ANALYTICS_TRACK_ERRORS=true
|
||||
ANALYTICS_TRACK_PERFORMANCE=true
|
||||
|
||||
# Monitoring & Health Checks
|
||||
PROMETHEUS_ENABLED={{ PROMETHEUS_ENABLED | default(true) }}
|
||||
PROMETHEUS_PORT={{ PROMETHEUS_PORT | default(9090) }}
|
||||
GRAFANA_ADMIN_PASSWORD={{ GRAFANA_ADMIN_PASSWORD }}
|
||||
|
||||
# Security Configuration
|
||||
APP_KEY={{ APP_KEY }}
|
||||
CSRF_TOKEN_LIFETIME=7200
|
||||
RATE_LIMIT_PER_MINUTE=60
|
||||
MAX_LOGIN_ATTEMPTS=5
|
||||
LOGIN_LOCKOUT_DURATION=900
|
||||
|
||||
# Performance Configuration (Production)
|
||||
PHP_MEMORY_LIMIT={{ PHP_MEMORY_LIMIT | default('512M') }}
|
||||
PHP_MAX_EXECUTION_TIME={{ PHP_MAX_EXECUTION_TIME | default(30) }}
|
||||
PHP_OPCACHE_ENABLE=1
|
||||
PHP_OPCACHE_MEMORY_CONSUMPTION={{ PHP_OPCACHE_MEMORY_CONSUMPTION | default(256) }}
|
||||
PHP_OPCACHE_MAX_ACCELERATED_FILES=20000
|
||||
PHP_OPCACHE_REVALIDATE_FREQ=0
|
||||
PHP_OPCACHE_VALIDATE_TIMESTAMPS=0
|
||||
PHP_REALPATH_CACHE_SIZE=4M
|
||||
PHP_REALPATH_CACHE_TTL=3600
|
||||
|
||||
# Nginx Configuration (Production)
|
||||
NGINX_WORKER_PROCESSES={{ ansible_processor_vcpus | default(4) }}
|
||||
NGINX_WORKER_CONNECTIONS=2048
|
||||
NGINX_KEEPALIVE_TIMEOUT=65
|
||||
NGINX_CLIENT_MAX_BODY_SIZE=50m
|
||||
|
||||
# Database Performance (Production)
|
||||
MYSQL_INNODB_BUFFER_POOL_SIZE=1G
|
||||
MYSQL_INNODB_LOG_FILE_SIZE=256M
|
||||
MYSQL_MAX_CONNECTIONS=100
|
||||
MYSQL_QUERY_CACHE_SIZE=0
|
||||
|
||||
# Backup Configuration
|
||||
BACKUP_ENABLED={{ BACKUP_ENABLED | default(true) }}
|
||||
BACKUP_SCHEDULE={{ BACKUP_SCHEDULE | default('0 2 * * *') }}
|
||||
BACKUP_RETENTION_DAYS={{ BACKUP_RETENTION_DAYS | default(30) }}
|
||||
{% if S3_BACKUP_ENABLED | default(false) %}
|
||||
BACKUP_S3_BUCKET={{ BACKUP_S3_BUCKET }}
|
||||
BACKUP_S3_ACCESS_KEY={{ BACKUP_S3_ACCESS_KEY }}
|
||||
BACKUP_S3_SECRET_KEY={{ BACKUP_S3_SECRET_KEY }}
|
||||
{% endif %}
|
||||
|
||||
# SSL/TLS Configuration
|
||||
SSL_PROTOCOLS=TLSv1.2 TLSv1.3
|
||||
SSL_CIPHERS=ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384
|
||||
SSL_PREFER_SERVER_CIPHERS=off
|
||||
SSL_SESSION_CACHE_SIZE=10m
|
||||
SSL_SESSION_TIMEOUT=10m
|
||||
|
||||
# Container User IDs (Production)
|
||||
UID=33
|
||||
GID=33
|
||||
|
||||
# Restart Policy
|
||||
RESTART_POLICY=always
|
||||
|
||||
# Resource Limits (Production)
|
||||
PHP_MEMORY_LIMIT_DOCKER={{ PHP_MEMORY_LIMIT_DOCKER | default('2G') }}
|
||||
PHP_CPU_LIMIT={{ PHP_CPU_LIMIT | default('2.0') }}
|
||||
NGINX_MEMORY_LIMIT_DOCKER={{ NGINX_MEMORY_LIMIT_DOCKER | default('256M') }}
|
||||
NGINX_CPU_LIMIT={{ NGINX_CPU_LIMIT | default('0.5') }}
|
||||
DB_MEMORY_LIMIT_DOCKER={{ DB_MEMORY_LIMIT_DOCKER | default('2G') }}
|
||||
DB_CPU_LIMIT={{ DB_CPU_LIMIT | default('2.0') }}
|
||||
REDIS_MEMORY_LIMIT_DOCKER={{ REDIS_MEMORY_LIMIT_DOCKER | default('1G') }}
|
||||
REDIS_CPU_LIMIT={{ REDIS_CPU_LIMIT | default('0.5') }}
|
||||
158
deployment/infrastructure/templates/staging.env.template
Normal file
158
deployment/infrastructure/templates/staging.env.template
Normal file
@@ -0,0 +1,158 @@
|
||||
# Staging Environment Configuration
|
||||
# Auto-generated from template - DO NOT EDIT DIRECTLY
|
||||
# Generated on: {{ ansible_date_time.date }} {{ ansible_date_time.time }}
|
||||
# Image Tag: {{ IMAGE_TAG }}
|
||||
# Environment: {{ environment }}
|
||||
|
||||
# Project Configuration
|
||||
COMPOSE_PROJECT_NAME={{ project_name | default('michaelschiemer') }}-staging
|
||||
DOMAIN_NAME={{ DOMAIN_NAME }}
|
||||
IMAGE_TAG={{ IMAGE_TAG }}
|
||||
|
||||
# Environment
|
||||
APP_ENV=staging
|
||||
APP_DEBUG={{ APP_DEBUG | default(true) }}
|
||||
APP_TIMEZONE={{ timezone | default('Europe/Berlin') }}
|
||||
APP_LOCALE={{ locale | default('de') }}
|
||||
|
||||
# SSL/HTTPS Configuration
|
||||
APP_SSL_ENABLED=true
|
||||
SSL_CERT_PATH=/etc/letsencrypt/live/{{ DOMAIN_NAME }}
|
||||
FORCE_HTTPS=true
|
||||
|
||||
# Database Configuration (Staging)
|
||||
DB_DRIVER={{ DB_DRIVER | default('mysql') }}
|
||||
DB_HOST={{ DB_HOST | default('db') }}
|
||||
DB_PORT={{ DB_PORT | default(3306) }}
|
||||
DB_DATABASE={{ DB_DATABASE }}
|
||||
DB_USERNAME={{ DB_USERNAME }}
|
||||
DB_PASSWORD={{ DB_PASSWORD }}
|
||||
DB_ROOT_PASSWORD={{ DB_ROOT_PASSWORD }}
|
||||
DB_CHARSET=utf8mb4
|
||||
DB_COLLATION=utf8mb4_unicode_ci
|
||||
|
||||
# Redis Configuration
|
||||
REDIS_HOST={{ REDIS_HOST | default('redis') }}
|
||||
REDIS_PORT={{ REDIS_PORT | default(6379) }}
|
||||
REDIS_PASSWORD={{ REDIS_PASSWORD }}
|
||||
REDIS_DATABASE=1
|
||||
REDIS_PREFIX={{ project_name | default('michaelschiemer') }}_staging_
|
||||
|
||||
# Session Configuration
|
||||
SESSION_DRIVER=redis
|
||||
SESSION_LIFETIME=240
|
||||
SESSION_ENCRYPT=true
|
||||
SESSION_SECURE_COOKIE=true
|
||||
SESSION_HTTP_ONLY=true
|
||||
SESSION_SAME_SITE=lax
|
||||
|
||||
# Cache Configuration
|
||||
CACHE_DRIVER=redis
|
||||
CACHE_TTL=1800
|
||||
CACHE_PREFIX={{ project_name | default('michaelschiemer') }}_cache_staging_
|
||||
|
||||
# Queue Configuration
|
||||
QUEUE_DRIVER=redis
|
||||
QUEUE_CONNECTION=redis
|
||||
QUEUE_PREFIX={{ project_name | default('michaelschiemer') }}_queue_staging_
|
||||
WORKER_QUEUE=staging
|
||||
WORKER_TIMEOUT=300
|
||||
WORKER_MEMORY_LIMIT=256
|
||||
WORKER_SLEEP=3
|
||||
WORKER_TRIES=3
|
||||
WORKER_BATCH_SIZE=5
|
||||
|
||||
# Mail Configuration (Staging)
|
||||
MAIL_DRIVER={{ MAIL_DRIVER | default('log') }}
|
||||
MAIL_HOST={{ MAIL_HOST | default('localhost') }}
|
||||
MAIL_PORT={{ MAIL_PORT | default(1025) }}
|
||||
MAIL_USERNAME={{ MAIL_USERNAME | default('') }}
|
||||
MAIL_PASSWORD={{ MAIL_PASSWORD | default('') }}
|
||||
MAIL_ENCRYPTION={{ MAIL_ENCRYPTION | default('null') }}
|
||||
MAIL_FROM_ADDRESS={{ MAIL_FROM_ADDRESS | default('staging@michaelschiemer.de') }}
|
||||
MAIL_FROM_NAME="{{ MAIL_FROM_NAME | default('Michael Schiemer (Staging)') }}"
|
||||
|
||||
# Logging Configuration (Staging)
|
||||
LOG_CHANNEL=stack
|
||||
LOG_LEVEL={{ LOG_LEVEL | default('debug') }}
|
||||
LOG_STACK_CHANNELS=single,daily
|
||||
LOG_ROTATE_DAYS=7
|
||||
LOG_MAX_FILES=5
|
||||
|
||||
# External APIs (Staging - Test Mode)
|
||||
SHOPIFY_WEBHOOK_SECRET={{ SHOPIFY_WEBHOOK_SECRET | default('test-webhook-secret') }}
|
||||
RAPIDMAIL_USERNAME={{ RAPIDMAIL_USERNAME | default('test') }}
|
||||
RAPIDMAIL_PASSWORD={{ RAPIDMAIL_PASSWORD | default('test') }}
|
||||
RAPIDMAIL_TEST_MODE=true
|
||||
|
||||
# Analytics Configuration (Staging)
|
||||
ANALYTICS_ENABLED={{ ANALYTICS_ENABLED | default(false) }}
|
||||
ANALYTICS_TRACK_PAGE_VIEWS=false
|
||||
ANALYTICS_TRACK_API_CALLS=true
|
||||
ANALYTICS_TRACK_USER_ACTIONS=true
|
||||
ANALYTICS_TRACK_ERRORS=true
|
||||
ANALYTICS_TRACK_PERFORMANCE=true
|
||||
|
||||
# Monitoring & Health Checks
|
||||
PROMETHEUS_ENABLED={{ PROMETHEUS_ENABLED | default(false) }}
|
||||
PROMETHEUS_PORT={{ PROMETHEUS_PORT | default(9091) }}
|
||||
GRAFANA_ADMIN_PASSWORD={{ GRAFANA_ADMIN_PASSWORD | default('admin') }}
|
||||
|
||||
# Security Configuration
|
||||
APP_KEY={{ APP_KEY }}
|
||||
CSRF_TOKEN_LIFETIME=14400
|
||||
RATE_LIMIT_PER_MINUTE=120
|
||||
MAX_LOGIN_ATTEMPTS=10
|
||||
LOGIN_LOCKOUT_DURATION=300
|
||||
|
||||
# Performance Configuration (Staging)
|
||||
PHP_MEMORY_LIMIT={{ PHP_MEMORY_LIMIT | default('256M') }}
|
||||
PHP_MAX_EXECUTION_TIME={{ PHP_MAX_EXECUTION_TIME | default(60) }}
|
||||
PHP_OPCACHE_ENABLE=1
|
||||
PHP_OPCACHE_MEMORY_CONSUMPTION={{ PHP_OPCACHE_MEMORY_CONSUMPTION | default(128) }}
|
||||
PHP_OPCACHE_MAX_ACCELERATED_FILES=10000
|
||||
PHP_OPCACHE_REVALIDATE_FREQ=2
|
||||
PHP_OPCACHE_VALIDATE_TIMESTAMPS=1
|
||||
PHP_REALPATH_CACHE_SIZE=2M
|
||||
PHP_REALPATH_CACHE_TTL=600
|
||||
|
||||
# Nginx Configuration (Staging)
|
||||
NGINX_WORKER_PROCESSES={{ ansible_processor_vcpus | default(2) }}
|
||||
NGINX_WORKER_CONNECTIONS=1024
|
||||
NGINX_KEEPALIVE_TIMEOUT=30
|
||||
NGINX_CLIENT_MAX_BODY_SIZE=100m
|
||||
|
||||
# Database Performance (Staging)
|
||||
MYSQL_INNODB_BUFFER_POOL_SIZE=256M
|
||||
MYSQL_INNODB_LOG_FILE_SIZE=128M
|
||||
MYSQL_MAX_CONNECTIONS=50
|
||||
MYSQL_QUERY_CACHE_SIZE=0
|
||||
|
||||
# Backup Configuration
|
||||
BACKUP_ENABLED={{ BACKUP_ENABLED | default(false) }}
|
||||
BACKUP_SCHEDULE={{ BACKUP_SCHEDULE | default('0 3 * * *') }}
|
||||
BACKUP_RETENTION_DAYS={{ BACKUP_RETENTION_DAYS | default(7) }}
|
||||
|
||||
# SSL/TLS Configuration
|
||||
SSL_PROTOCOLS=TLSv1.2 TLSv1.3
|
||||
SSL_CIPHERS=ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256
|
||||
SSL_PREFER_SERVER_CIPHERS=off
|
||||
SSL_SESSION_CACHE_SIZE=5m
|
||||
SSL_SESSION_TIMEOUT=5m
|
||||
|
||||
# Container User IDs (Staging)
|
||||
UID=33
|
||||
GID=33
|
||||
|
||||
# Restart Policy
|
||||
RESTART_POLICY=unless-stopped
|
||||
|
||||
# Resource Limits (Staging)
|
||||
PHP_MEMORY_LIMIT_DOCKER={{ PHP_MEMORY_LIMIT_DOCKER | default('1G') }}
|
||||
PHP_CPU_LIMIT={{ PHP_CPU_LIMIT | default('1.0') }}
|
||||
NGINX_MEMORY_LIMIT_DOCKER={{ NGINX_MEMORY_LIMIT_DOCKER | default('128M') }}
|
||||
NGINX_CPU_LIMIT={{ NGINX_CPU_LIMIT | default('0.25') }}
|
||||
DB_MEMORY_LIMIT_DOCKER={{ DB_MEMORY_LIMIT_DOCKER | default('1G') }}
|
||||
DB_CPU_LIMIT={{ DB_CPU_LIMIT | default('1.0') }}
|
||||
REDIS_MEMORY_LIMIT_DOCKER={{ REDIS_MEMORY_LIMIT_DOCKER | default('256M') }}
|
||||
REDIS_CPU_LIMIT={{ REDIS_CPU_LIMIT | default('0.25') }}
|
||||
Reference in New Issue
Block a user