π Bug Fixes & Improvements
β
Fixes the problem that no web error occurs when the port is subsequently changed.
# π 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
## β¨ 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
β¨ New Features
π Automatic Log Cleanup Before Cloudflared Startup
Logs are now automatically deleted if they exceed 10MB or are older than 30 days:
/home/container/logs/naccess.log
/home/container/logs/nerror.log
/home/container/logs/error.log
/home/container/logs/php_errors.log
/home/container/logs/php-fpm.log
π Prevents excessive log accumulation and improves disk space management.
π¨ Improved Status Messages & Formatting
Color-coded console output for better readability:
π΅ Blue β Headers & sections
π£ Purple β Cleanup processes
π‘ Yellow β Status messages (e.g., "Waiting for Cloudflared to start...")
π’ Green β Success messages
π΄ Red β Errors or missing files
π’ More structured output with section dividers (ββββββββββββββββββββββββ).
π Optimized Cloudflared Startup
Cloudflared startup process improved:
Better error handling:
If Cloudflared fails, the error is displayed immediately.
Last 10 log lines are shown for troubleshooting.
Safer PID file storage.
π Bug Fixes & Improvements
β Improved Error Handling:
Cloudflared token validation: If missing or empty, a clear error is shown.
Log existence checks: No errors if logs donβt exist.
π Code Refactoring:
Better script structure with logical sections.
Standardized use of echo -e for consistent formatting.
π Automatic Log Cleanup Before Cloudflared Startup
Logs are now automatically deleted if they exceed 10MB or are older than 30 days:
/home/container/logs/naccess.log
/home/container/logs/nerror.log
/home/container/logs/error.log
/home/container/logs/php_errors.log
/home/container/logs/php-fpm.log
π Prevents excessive log accumulation and improves disk space management.
π¨ Improved Status Messages & Formatting
Color-coded console output for better readability:
π΅ Blue β Headers & sections
π£ Purple β Cleanup processes
π‘ Yellow β Status messages (e.g., "Waiting for Cloudflared to start...")
π’ Green β Success messages
π΄ Red β Errors or missing files
π’ More structured output with section dividers (ββββββββββββββββββββββββ).
π Optimized Cloudflared Startup
Cloudflared startup process improved:
Better error handling:
If Cloudflared fails, the error is displayed immediately.
Last 10 log lines are shown for troubleshooting.
Safer PID file storage.
π Bug Fixes & Improvements
β Improved Error Handling:
Cloudflared token validation: If missing or empty, a clear error is shown.
Log existence checks: No errors if logs donβt exist.
π Code Refactoring:
Better script structure with logical sections.
Standardized use of echo -e for consistent formatting.
### β¨ Added
- π Integration of **Cloudflared** for secure tunneling. (#22 | @zarti0)
### π Fixed
- π Minor bug fixes to improve stability and performance.
### π Changed
- π Revised text for better clarity.
- π Integration of **Cloudflared** for secure tunneling. (#22 | @zarti0)
### π Fixed
- π Minor bug fixes to improve stability and performance.
### π Changed
- π Revised text for better clarity.
New
[βοΈ] PHP8.4 support added
[βοΈ] PHP8.4 support added
[βοΈ] Fixes the problem that when not using Git or wordpress no php info file is created during the initial installation.
Fixed
[βοΈ] Fix the error that the web server is permanently marked as starting
[βοΈ] Fix the bug that the use of git login data led to an incorrect download url for the git repo
[βοΈ] Fix the error that the web server is permanently marked as starting
[βοΈ] Fix the bug that the use of git login data led to an incorrect download url for the git repo
Added
[+] Simplified version changer added
[+] Added support for git (www folder)
[+] Added support for ARM64 (thanks to @GergoEB)
[+] Comments have been added to some files for a better overview
[+] Added "install-script.sh" for a better overview of the installation script
Other
[O] PHP version 7.3 removed
[+] Simplified version changer added
[+] Added support for git (www folder)
[+] Added support for ARM64 (thanks to @GergoEB)
[+] Comments have been added to some files for a better overview
[+] Added "install-script.sh" for a better overview of the installation script
Other
[O] PHP version 7.3 removed
Fixed
[βοΈ] Incorrectly defined variable in egg-nginx.json (led to problems when assigning ram for php)
Other
[O] License updated
[βοΈ] Incorrectly defined variable in egg-nginx.json (led to problems when assigning ram for php)
Other
[O] License updated
Added
[+] More PHP extensions
[+] Access and error log now optionally displayable in the console
Fixed
[βοΈ] Missing PHP extensions between PHP versions
[βοΈ] Access and error log cannot be displayed in the console
Other
[O] Small improvements
[+] More PHP extensions
[+] Access and error log now optionally displayable in the console
Fixed
[βοΈ] Missing PHP extensions between PHP versions
[βοΈ] Access and error log cannot be displayed in the console
Other
[O] Small improvements
Added PHP8.3 support
Updatet Egg.nginx.json