- Remove checkSession from useEffect dependency array to prevent infinite loop
- Improve session validation logic with better error handling
- Add clear session functionality for debugging
- Add 'Clear Session & Reload' button to help with stuck sessions
- Better session cleanup on validation errors
This should resolve the verification loop issue in the admin login.
- Increase health check wait times in Gitea Actions workflow
- Add additional main page accessibility check with longer timeout
- Remove basic auth middleware to use custom admin login only
- Custom admin login at /manage route provides better UX than browser basic auth
This should resolve the 'Main page is not accessible' issue and provide a nicer admin login experience.
- Add proxy network to portfolio service networks
- Define proxy as external network in Docker Compose
- This allows the application to be accessible through the proxy network
- Fixes the 'Main page is not accessible' issue
The portfolio app will now be on both portfolio_net (for internal communication) and proxy (for external access).
- Remove redundant export statements from workflow
- Add default values to Docker Compose environment variables
- Add debugging logs to help diagnose deployment issues
- Ensure environment variables are properly passed to containers
This should resolve the 'variable is not set' warnings and make the main page accessible.
- Change @ts-ignore to @ts-expect-error as required by ESLint
- Simplify React.act mock to avoid TypeScript complexity
- Ensures linting passes in pre-push checks
- Update React.act mock to handle both sync and async callbacks
- Fix type compatibility with React's act function signature
- Ensures proper TypeScript compilation during build
- Change from npm run test to npm run test:production
- This ensures the pre-push checks use the same test configuration as CI
- Fixes the test failures that were blocking pushes
- Removed unused network configurations from docker-compose.yml.
- Added production-specific Jest configuration in jest.config.production.ts for better test management.
- Updated jest.config.ts to include production build fixes and module resolution improvements.
- Enhanced jest.setup.ts to mock React's act function for production builds.
- Introduced new CI/CD workflows for Gitea, focusing on reliability and zero downtime deployments.
- Added scripts for debugging Gitea Actions and verifying environment variables.
These changes streamline the CI/CD process and improve testing capabilities.
- Export all environment variables before deployment to ensure they're available to child processes
- Add logging to show which variables are configured (without revealing secrets)
- This fixes docker-compose warnings about missing environment variables
- Ensures both docker run and docker-compose scenarios work correctly
Updated scripts:
- scripts/gitea-deploy.sh
- scripts/gitea-deploy-simple.sh
- Modify root checks to allow running as root in CI environments
- Add conditional check: only prevent root when not in CI (CI env var not set)
- Updated scripts:
- scripts/gitea-deploy.sh
- scripts/gitea-deploy-simple.sh
- scripts/deploy.sh
- scripts/auto-deploy.sh
- scripts/setup-gitea-runner.sh
This fixes the 'This script should not be run as root' error in Gitea Actions
where containers run as root by default.
- Simplify nginx startup command to avoid YAML syntax issues
- Remove complex fallback configuration that was causing shell errors
- nginx now starts successfully and serves the application correctly
Tested locally: nginx responds to /health and / endpoints properly.
- Introduced `sync-env.ps1` to facilitate the synchronization of environment variables from Bitwarden on Windows.
- Implemented checks for Bitwarden CLI installation and authentication status.
- Added functionality to fetch environment variables from a specified Bitwarden item and create/update a `.env` file.
- Enhanced user feedback with clear error messages and success confirmations.
✅ This script streamlines the management of environment variables by integrating with Bitwarden, ensuring secure and efficient updates.
- Move proxy_set_header directives inside location blocks
- Add DNS resolver for dynamic upstream resolution
- Improve fallback configuration in docker-compose
- Add config validation before starting nginx
This should resolve the nginx startup failures.
- Remove default nginx configuration files to prevent conflicts
- Add command to clear /etc/nginx/conf.d/* before starting nginx
- This fixes the 'events directive not allowed here' error
- Introduced `sync-env.sh` to automate the synchronization of environment variables from Bitwarden.
- Implemented authentication with Bitwarden CLI, including session management and error handling.
- Added functionality to fetch environment variables from Bitwarden items and create/update a `.env` file in the specified target directory.
- Included logging for debugging and operational transparency.
✅ This script enhances the management of environment variables by integrating with Bitwarden, ensuring secure and efficient updates.
- Enhanced health check mechanisms in `ci-cd-fast.yml` and `ci-cd-zero-downtime-fixed.yml` to utilize `docker exec` for internal checks, addressing issues with direct port access.
- Updated health check logic to provide better error messages and fallback methods, ensuring more reliable deployment verification.
- Documented changes in `DEPLOYMENT-FIXES.md` to reflect improvements in health check processes.
✅ These updates enhance the reliability of health checks during deployments and improve debugging capabilities.
- Added new CI/CD workflow `ci-cd-reliable.yml` for reliable deployments with database support.
- Created `docker-compose.zero-downtime-fixed.yml` to address nginx configuration issues for zero-downtime deployments.
- Improved existing workflows to check for nginx configuration file and create a fallback if missing.
- Updated `DEPLOYMENT-FIXES.md` to document new workflows and fixes.
✅ These changes improve deployment reliability and ensure proper nginx configuration for seamless updates.
- Created `DEPLOYMENT-FIXES.md` to document issues and solutions for Gitea Actions.
- Fixed Dockerfile path for standalone build.
- Enhanced `gitea-deploy.sh` with improved environment variable handling and extended health check timeouts.
- Introduced `gitea-deploy-simple.sh` for simplified deployments without database dependencies.
- Updated Next.js configuration to resolve build issues.
- Improved health check logic and error handling across all Gitea workflows.
✅ These changes enhance deployment reliability and provide better debugging information.
- Added serverRuntimeConfig to next.config.ts for improved server-side configuration.
- Updated gitea-deploy.sh to include additional environment variables for deployment.
- Increased sleep duration and health check timeout for better container readiness verification.
- Implemented checks to ensure the container is running during health checks and logs container status if it fails.
✅ Enhancements improve deployment reliability and server configuration management.
- Create new ci-cd-zero-downtime-fixed.yml workflow
- Disable old workflows that try to access port 3000 directly
- New workflow uses docker-compose.zero-downtime.yml
- Health checks now use nginx on port 80 instead of direct port 3000
- Fixes the 'Connection refused' errors in Gitea Actions
✅ Actions now properly work with zero-downtime nginx setup
- Fix Dockerfile standalone build path from /app/.next/standalone/gitea/portfolio to /app/.next/standalone/app
- Fix nginx configuration by removing conflicting server blocks
- Consolidate health check and main proxy into single server block
- Ensure proper load balancing between portfolio-app-1 and portfolio-app-2
✅ Deployment now working successfully with:
- Application running on both instances (healthy)
- Database and Redis running (healthy)
- Nginx load balancer working
- Health endpoints accessible
- Main portfolio site accessible at http://localhost/
- Add aggressive container cleanup including specific problematic container ID
- Export environment variables before docker compose commands
- Remove all containers with 'portfolio' in name to prevent conflicts
- Fix both rolling update and fresh deployment cases
- Tested locally and verified working
- Environment variables now properly passed to docker compose
- Add comprehensive container cleanup before starting services
- Pass environment variables to docker compose commands
- Fix container name conflicts by removing all existing containers first
- Add local test script to verify deployment process
- Ensure clean environment for zero-downtime deployments
- Add specific removal of problematic container afa9a70588844b06e17d5e0527119d589a7a3fde8a17608447cf7d8d448cf261
- Force remove portfolio-app-new container before deployment
- Add container listing for debugging after cleanup
- Upgrade setup-node to v4 for better performance
- Add cache-dependency-path for more efficient caching
- Create fast workflow alternative with manual cache management
- Add comprehensive cleanup of all portfolio-app containers
- Dynamically find and remove containers with portfolio-app in name
- Remove specific problematic container names (portfolio-app-new, etc.)
- Add container pruning to clean up stopped containers
- Ensure clean environment before starting new temporary container
- Prevents any container name conflicts during deployment
- Use unique timestamp-based container names to avoid conflicts
- Clean up existing temporary containers before starting new ones
- Generate unique names like 'portfolio-app-temp-1234567890'
- Prevents 'container name already in use' errors
- Ensures reliable zero-downtime deployments
- Remove port mapping for temporary container to avoid conflicts
- Use docker exec for health checks instead of external port access
- Eliminates 'port already allocated' error
- Maintains zero-downtime functionality without port conflicts
- Add rolling update mechanism for seamless deployments
- Start new container on port 3001, health check, then switch
- Preserve database and redis connections during updates
- Automatic fallback to fresh deployment if no current container
- Add advanced nginx load balancer configuration for future use
- Eliminate container name conflicts with proper cleanup
- Website stays online during deployments
- Split CI/CD into two distinct workflows:
- 'Test and Build' for main branch (testing only)
- 'CI/CD Pipeline' for production branch (full deployment)
- Remove duplicate test-and-build job from production workflow
- Each workflow now has a single, clear purpose
- Eliminates confusion with multiple job views in Gitea
- Replace deprecated 'docker-compose' with modern 'docker compose'
- Update all workflow files to use new syntax
- Update documentation with correct commands
- Fixes 'command not found' error in CI/CD pipeline
- Compatible with Docker Compose V2 and newer versions
- Use Variables for non-sensitive data (NODE_ENV, LOG_LEVEL, URLs, emails)
- Use Secrets for sensitive data (passwords, auth tokens)
- Add all configured variables: NODE_ENV, LOG_LEVEL, UMAMI analytics
- Update verification checks to match actual configuration
- Improve debug workflow to show Variables vs Secrets clearly
- Fix environment variable mapping in Docker Compose deployment
- Allow NEXT_PUBLIC_BASE_URL to be set as either Variable or Secret
- Update CI/CD workflow to check both secrets and variables
- Update debug workflow to show whether values come from secrets or variables
- Use fallback syntax: secrets.VAR || vars.VAR
- Improve error messages to guide users to correct settings location
- Docker must be running and functional before push is allowed
- Added comprehensive Docker status checks (info + hello-world test)
- Enhanced error messages with platform-specific Docker start instructions
- Improved build error reporting with detailed log output
- Added common troubleshooting tips for Docker build failures
- Push will fail if Docker is not available or build fails
- Fix fill and priority boolean attributes in Hero component
- Improve next/image mock in Jest setup to handle boolean props correctly
- Enhance pre-push hook with better Docker detection and error handling
- Make Docker build test non-blocking (warnings instead of errors)
- Add executable permissions for secret check script
- Prevent React DOM warnings in tests
- Update all GitHub Actions to v3 for Gitea compatibility
- Fix artifact upload/download actions (v4 -> v3)
- Remove GitHub-specific features (GITHUB_STEP_SUMMARY)
- Add complete Docker Compose configuration with PostgreSQL and Redis
- Add environment secrets support for all workflows
- Add debug workflow for secrets verification
- Add comprehensive documentation for secrets setup
- Improve container networking and health checks
- Update security scan workflow to utilize a dedicated script for checking secrets, improving detection accuracy.
- Modify database connection setup in multiple scripts to use an environment variable fallback for DATABASE_URL, enhancing flexibility in different environments.
- Update CI/CD workflow to use specific Trivy version and change output format for vulnerability results.
- Add fallback npm audit step in case Trivy scan fails.
- Create a new security scan workflow that runs on push and pull request events, including scheduled scans.
- Introduce a security scan script to perform npm audit, Trivy scans, and check for potential secrets in the codebase.
- Ensure results are uploaded as artifacts for review and maintain retention policies for scan results.
- Modify Dockerfile to install curl without recommended packages for a leaner image.
- Update Next.js configuration to set outputFileTracingRoot for better Docker compatibility.
- Revise contact components to improve messaging and clarity, changing "Get In Touch" to "Contact Me" and enhancing descriptions for collaboration opportunities.
- Clean up Prisma schema by removing unnecessary comments and restructuring the Project model for clarity.