├── README.md ├── nginx-set-real-visitor-ip-from-cloudflare-disable.sh ├── nginx-set-real-visitor-ip-from-cloudflare-enable.php ├── system-install-php-essentials.sh └── system-stop-and-disable-services-on-boot.sh /README.md: -------------------------------------------------------------------------------- 1 | # Laravel Forge Recipes 2 | 3 | Just a small collection of recipes for repetitive tasks after provisioning a server/app under Laravel Forge. 4 | To use any of these, it is recommended to use the contents of the shell script as opposed to the curl snippets. 5 | Copy the code and paste under ```New Recipe``` in Forge. 6 | 7 |   8 | 9 | #### System - Stop and Disable Services On Boot (MySQL / Postgres / Beanstalkd / Redis / Memcached) 10 | Will disable and stop services installed by Forge on provisioning but leave nginx alone. Useful if your app already connects to external resources like AWS. 11 | 12 | Executes: [system-stop-and-disable-services-on-boot.sh](system-stop-and-disable-services-on-boot.sh) 13 | ```bash 14 | curl -sS "https://raw.githubusercontent.com/mojopollo/laravel-forge-recipes/master/system-stop-and-disable-services-on-boot.sh" | sh 15 | ``` 16 | 17 |   18 | 19 | #### Nginx - Set Real visitor ip address from Cloudflare (Enable) 20 | Will create a conf file ```/etc/nginx/conf.d/cloudflare-set-real-ip.conf``` 21 | with cloudflare's ip addresses and use the ```CF-Connecting-IP``` header to set the real ip address then restarts nginx. 22 | If cloudflare updates their ip address, all that needs to be done is run this command again to update ip addresses. 23 | 24 | Executes: [nginx-set-real-visitor-ip-from-cloudflare-enable.php](nginx-set-real-visitor-ip-from-cloudflare-enable.php) 25 | ```bash 26 | curl -sS "https://raw.githubusercontent.com/mojopollo/laravel-forge-recipes/master/nginx-set-real-visitor-ip-from-cloudflare-enable.php" | php 27 | ``` 28 | 29 |   30 | 31 | #### Nginx - Set Real visitor ip address from Cloudflare (Disable) 32 | Removes ```/etc/nginx/conf.d/cloudflare-set-real-ip.conf``` and restarts nginx 33 | 34 | Executes: [nginx-set-real-visitor-ip-from-cloudflare-disable.sh](nginx-set-real-visitor-ip-from-cloudflare-disable.sh) 35 | ```bash 36 | curl -sS "https://raw.githubusercontent.com/mojopollo/laravel-forge-recipes/master/nginx-set-real-visitor-ip-from-cloudflare-disable.sh" | sh 37 | ``` 38 | 39 |   40 | 41 | #### System - Install PHP Essentials 42 | Will install packages mostly used by php apps and with some other custom packages 43 | 44 | Executes: [system-install-php-essentials.sh](system-install-php-essentials.sh) 45 | ```bash 46 | curl -sS "https://raw.githubusercontent.com/mojopollo/laravel-forge-recipes/master/system-install-php-essentials.sh" | sh 47 | ``` 48 | -------------------------------------------------------------------------------- /nginx-set-real-visitor-ip-from-cloudflare-disable.sh: -------------------------------------------------------------------------------- 1 | [ -f /etc/nginx/conf.d/cloudflare-set-real-ip.conf ] \ 2 | && rm /etc/nginx/conf.d/cloudflare-set-real-ip.conf \ 3 | && service nginx restart 4 | -------------------------------------------------------------------------------- /nginx-set-real-visitor-ip-from-cloudflare-enable.php: -------------------------------------------------------------------------------- 1 |