# 📜 Changelog (Version 2.0 – 2025-05-01)
## ✨ New Features
### 🎉 Full Modular Orchestrator
- **Auto-discover modules** in `modules/*` and run them in a defined order
- **Dynamic enable flags**: each module uses `_STATUS` (`true`/`1` = on)
- **Execution order**:
1. **LogCleaner** (clears temp and log files)
2. All other enabled modules (Git, Composer, Cloudflare Tunnel, PHP-NGINX, etc.)
3. **NGINX** last in the foreground (blocks to keep container alive)
### 🧹 LogCleaner Module
- Controlled by `LOGCLEANER_STATUS` toggle
- Deletes temporary files, oversized logs (`> MAX_SIZE_MB`), and old logs (`> MAX_AGE_DAYS`)
- **Dry-run** support (`DRY_RUN`) to preview deletions
- Live output of each deleted file for full transparency
### 🌲 Git Module
- Controlled by `GIT_STATUS` toggle
- Guard-clause pattern: early exit if disabled, Git missing, or not a repository
- Auto-pulls latest changes in `/home/container/www`
### 📦 Composer Module
- Controlled by `COMPOSER_STATUS`; installs packages from `COMPOSER_MODULES`
- Creates and exports a writable `COMPOSER_CACHE_DIR` to eliminate cache warnings
- Honors `COMPOSER_WWW_DIR` for custom webroot
### 🌐 Cloudflare Tunnel Module
- Controlled by `CLOUDFLARED_STATUS`; token read from `CLOUDFLARED_TOKEN`
- Writes logs to `CLOUDFLARED_LOG_FILE` and PID to `CLOUDFLARED_PID_FILE`
- Monitors startup with configurable `CLOUDFLARED_STATUS_TIMES` and timeout (`CLOUDFLARED_MAX_ATTEMPTS`)
### 🐘 PHP-NGINX Startup
- Auto-detects installed PHP version via CLI if `PHP_VERSION` unset
- Falls back between `php-fpm` and generic `php-fpm` binary
- Clear error on version mismatch between Docker image and `PHP_VERSION`
---
## 🐛 Bug Fixes & Improvements
### 🔧 Script Hygiene
- Strips Windows CRLFs from all scripts at startup
- Unified `set -euo pipefail` and `trap` for consistent error reporting
- Centralized color definitions and header formatting
### 📖 Documentation
- Updated each module’s README with new env vars and usage examples
- Added Egg JSON snippets for all toggles (`*_STATUS`, etc.)
### ⚡ Performance & Reliability
- Fixed Composer cache directory to eliminate “cannot create cache” warnings
- Replaced fragile `bash -c` calls with native shell functions (`delete_file`, `enabled()`)
- Eliminated stray “command not found” and misformatted output
---
## 🚨 Upgrade Notice
**This is a major, non-backwards-compatible update.**
Due to extensive script and configuration changes, **you must recreate or rebuild your webserver/container** when upgrading to v2.0. Existing instances will not automatically adapt to the new module structure, env var names, and startup sequence.
---
## 🚀 Deprecated & Removed
- **PHP 8.0** support marked as EOL (no longer recommended)
- Legacy Cloudflared file-based token handling removed in favor of `CLOUDFLARED_TOKEN` env var
---
## What's Changed
* Feat/composer by @Ym0T in https://github.com/Ym0T/pterodactyl-nginx-egg/pull/29
* Matched the egg's variable casing of the environment variable name by @mattmentrup in https://github.com/Ym0T/pterodactyl-nginx-egg/pull/33
## New Contributors
* @mattmentrup made their first contribution in https://github.com/Ym0T/pterodactyl-nginx-egg/pull/33
**Full Changelog**: https://github.com/Ym0T/pterodactyl-nginx-egg/compare/v1.5.1...v2.0
## What's Changed
* Complete Modularization & Startup Process Optimization by @Ym0T in https://github.com/Ym0T/pterodactyl-nginx-egg/pull/34
**Full Changelog**: https://github.com/Ym0T/pterodactyl-nginx-egg/compare/v1.5.2...v2.0