From ec8eb807db34bf647e48f84a5549cbff61852d7c Mon Sep 17 00:00:00 2001 From: Walmir Silva Date: Mon, 10 Nov 2025 20:40:09 -0300 Subject: [PATCH 1/2] chore: remove .env from version control (ignored locally) --- .env | 212 ----------------------------------------------------------- 1 file changed, 212 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 3e85f1e..0000000 --- a/.env +++ /dev/null @@ -1,212 +0,0 @@ -# ============================================================================== -# KaririCode DevKit - Environment Configuration -# ============================================================================== -# Professional environment variables for Docker Compose -# Copy to .env and customize: cp .env.example .env -# ============================================================================== - -# ============================================================================== -# APPLICATION -# ============================================================================== -APP_NAME=kariricode-devkit -APP_ENV=development -APP_DEBUG=true -APP_SECRET=change-me-in-production -APP_VERSION=dev -SYMFONY_ENV=dev - -# ============================================================================== -# DOCKER & SYSTEM -# ============================================================================== -# User/Group IDs (match host user for volume permissions) -# Note: PHP container runs as root internally but processes run as www-data -UID=1000 -GID=1000 - -# Timezone -TZ=UTC - -# Volume consistency (macOS performance) -VOLUME_CONSISTENCY=cached - -# ============================================================================== -# PORTS -# ============================================================================== -APP_PORT=8089 -REDIS_PORT=6379 -MEMCACHED_PORT=11211 - -# ============================================================================== -# PHP SERVICE (kariricode/php-api-stack) -# ============================================================================== -PHP_STACK_VERSION=dev - -# PHP Configuration -PHP_MEMORY_LIMIT=2G -PHP_MAX_EXECUTION_TIME=300 -PHP_UPLOAD_MAX_FILESIZE=50M -PHP_POST_MAX_SIZE=50M - -# Resource Limits -PHP_CPU_LIMIT=2.0 -PHP_CPU_RESERVATION=0.5 -PHP_MEMORY_RESERVATION=512M - -# OPcache -OPCACHE_ENABLE=1 -OPCACHE_VALIDATE_TIMESTAMPS=1 -OPCACHE_REVALIDATE_FREQ=2 - -# PHP-FPM Configuration -PHP_FPM_PM=dynamic -PHP_FPM_PM_MAX_CHILDREN=50 -PHP_FPM_PM_START_SERVERS=5 -PHP_FPM_PM_MIN_SPARE_SERVERS=5 -PHP_FPM_PM_MAX_SPARE_SERVERS=10 -PHP_FPM_PM_MAX_REQUESTS=500 - -# ============================================================================== -# XDEBUG -# ============================================================================== -XDEBUG_MODE=off -XDEBUG_CLIENT_HOST=host.docker.internal -XDEBUG_CLIENT_PORT=9003 -XDEBUG_SESSION=PHPSTORM - -# ============================================================================== -# SESSION HANDLER -# ============================================================================== -# Session storage: files (local) or redis (distributed) -SESSION_SAVE_HANDLER=files -SESSION_SAVE_PATH=/tmp - -# ============================================================================== -# REDIS (Internal - Inside PHP Container) -# ============================================================================== -# Redis runs internally at 127.0.0.1:6379 inside PHP container -REDIS_HOST=127.0.0.1 -REDIS_PORT_INTERNAL=6379 -REDIS_PASSWORD= -REDIS_DB=0 -REDIS_TIMEOUT=5 -REDIS_LOG_FILE=/var/log/redis.log - -# ============================================================================== -# NGINX (Internal - Inside PHP Container) -# ============================================================================== -NGINX_WORKER_PROCESSES=auto -NGINX_WORKER_CONNECTIONS=1024 -NGINX_CLIENT_MAX_BODY_SIZE=100M -NGINX_KEEPALIVE_TIMEOUT=65 - -# ============================================================================== -# COMPOSER -# ============================================================================== -COMPOSER_MEMORY_LIMIT=-1 -COMPOSER_HOME=/root/.composer - -# ============================================================================== -# MEMCACHED (External Service) -# ============================================================================== -MEMCACHED_VERSION=1.6-alpine -MEMCACHED_MEMORY=256 -MEMCACHED_MAX_CONNECTIONS=1024 -MEMCACHED_THREADS=4 -MEMCACHED_MAX_ITEM_SIZE=5m - -# Resource Limits -MEMCACHED_CPU_LIMIT=1.0 -MEMCACHED_CPU_RESERVATION=0.25 -MEMCACHED_MEMORY_TOTAL=512M -MEMCACHED_MEMORY_RESERVATION=256M - -# Health Check -MEMCACHED_HEALTHCHECK_INTERVAL=10s -MEMCACHED_HEALTHCHECK_TIMEOUT=5s -MEMCACHED_HEALTHCHECK_RETRIES=3 -MEMCACHED_HEALTHCHECK_START_PERIOD=10s - -# ============================================================================== -# FEATURES -# ============================================================================== -DEMO_MODE=false -HEALTH_CHECK_INSTALL=false - -# ============================================================================== -# NETWORK -# ============================================================================== -ENABLE_IPV6=false -BRIDGE_NAME=kariricode0 -NETWORK_MTU=1500 -NETWORK_SUBNET=172.20.0.0/16 -NETWORK_GATEWAY=172.20.0.1 - -# ============================================================================== -# LOGGING -# ============================================================================== -LOG_MAX_SIZE=10m -LOG_MAX_FILE=3 -LOG_LEVEL=info - -# ============================================================================== -# HEALTH CHECKS -# ============================================================================== -HEALTHCHECK_INTERVAL=30s -HEALTHCHECK_TIMEOUT=10s -HEALTHCHECK_RETRIES=3 -HEALTHCHECK_START_PERIOD=40s - -# ============================================================================== -# TEMPORARY FILESYSTEM -# ============================================================================== -TMPFS_SIZE=100M - -# ============================================================================== -# TROUBLESHOOTING -# ============================================================================== -# Port conflicts? -# - Change APP_PORT, REDIS_PORT, or MEMCACHED_PORT -# - Run: make diagnose-ports -# - Run: make fix-ports -# -# Performance issues on macOS? -# - Try VOLUME_CONSISTENCY=delegated -# -# Permission errors? -# - Note: Container runs as root, but PHP-FPM/Nginx run as www-data -# - Check file ownership: ls -la -# -# Memory issues? -# - Adjust PHP_MEMORY_LIMIT and resource limits -# -# Session/Redis errors? -# - Use SESSION_SAVE_HANDLER=files for development -# - Use SESSION_SAVE_HANDLER=redis for distributed sessions -# -# PHP-FPM crashes? -# - Check logs: make logs SERVICE=php -# - Verify config: docker compose config -# -# Run diagnostics: -# - make env-check # Validate .env file -# - make diagnose-ports # Check port conflicts -# - make docker-info # Docker environment info -# - make status # Service status -# - make health # Health checks -# ============================================================================== - -# ============================================================================== -# PRODUCTION NOTES -# ============================================================================== -# For production deployment: -# 1. Change APP_ENV=production -# 2. Set APP_DEBUG=false -# 3. Generate strong APP_SECRET: openssl rand -hex 32 -# 4. Set XDEBUG_MODE=off -# 5. Set OPCACHE_VALIDATE_TIMESTAMPS=0 -# 6. Use SESSION_SAVE_HANDLER=redis with password -# 7. Set proper resource limits -# 8. Enable HTTPS/SSL termination -# 9. Use managed Redis/Memcached services -# 10. Implement proper backup strategy -# ============================================================================== From 2bcfc2058349c21b805a02e27cb709fda1a97706 Mon Sep 17 00:00:00 2001 From: Walmir Silva Date: Mon, 10 Nov 2025 20:40:45 -0300 Subject: [PATCH 2/2] chore: remove .env from version control (ignored locally) --- .gitignore | 122 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 102 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index f811d09..e1bf860 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,37 @@ -# Composer +# ============================================================================== +# KaririCode DevKit - .gitignore +# ============================================================================== +# Mantém o repositório limpo, rastreando apenas código-fonte e configs relevantes +# ============================================================================== + +# ------------------------------------------------------------------------------ +# Composer / Vendors +# ------------------------------------------------------------------------------ /vendor/ composer.lock +/composer.phar + +# ------------------------------------------------------------------------------ +# Environment Files +# ------------------------------------------------------------------------------ +.env +.env.local +.env.*.local +/.envrc +/.envrc.d/ + +# ------------------------------------------------------------------------------ +# Build / Distribution / Packaging +# ------------------------------------------------------------------------------ +/build/ +/dist/ +/tmp/ +/var/tmp/ +/*.phar +# ------------------------------------------------------------------------------ +# QA & Code Quality Tools +# ------------------------------------------------------------------------------ # PHPUnit .phpunit.cache/ .phpunit.result.cache @@ -9,38 +39,90 @@ composer.lock /reports/ # PHPStan +/.phpstan.cache /var/cache/phpstan/ -.phpstan.cache # Psalm -psalm-baseline.xml -.psalm/ +/.psalm/ +/psalm-baseline.xml # PHP-CS-Fixer -.php-cs-fixer.cache +/.php-cs-fixer.cache -# Infection +# Infection (mutation testing) /var/cache/infection/ -infection.log -infection.html -infection-summary.log -infection-debug.log -infection-per-mutator.md +/infection*.{log,html,md} +/infection-debug.log +/infection-summary.log # PHPBench -.phpbench/ -benchmarks/ +/.phpbench/ +/benchmarks/ + +# Rector / PHPMD / CodeSniffer +/.rector.php +/.phpcs-cache +/.phpmd-cache +/.phpstan-baseline.neon +/.rector-cache + +# ------------------------------------------------------------------------------ +# Logs +# ------------------------------------------------------------------------------ +/*.log +/logs/ +/storage/logs/ +/var/log/ +/*.pid + +# ------------------------------------------------------------------------------ +# Docker / WSL / CI +# ------------------------------------------------------------------------------ +/.docker/ +/docker-compose.override.yml +/.wslconfig +/.wsl2/ +.cache/ +.dockerignore -# IDEs +# ------------------------------------------------------------------------------ +# IDEs / Editors / OS +# ------------------------------------------------------------------------------ +# JetBrains / VSCode /.idea/ +/.vscode/ +*.code-workspace + +# Vim / Emacs / Misc +*~ *.swp *.swo -*~ + +# macOS / Windows .DS_Store +Thumbs.db +Desktop.ini -# Build artifacts -/build/ -/dist/ +# ------------------------------------------------------------------------------ +# Node / Frontend (quando integrados ao DevKit) +# ------------------------------------------------------------------------------ +node_modules/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* -# Logs -*.log +# ------------------------------------------------------------------------------ +# Backups / Artifacts +# ------------------------------------------------------------------------------ +*.bak +*.old +*.orig +*.rej +*.tmp + +# ------------------------------------------------------------------------------ +# Cache geral +# ------------------------------------------------------------------------------ +.cache/ +var/cache/