diff --git a/README.md b/README.md index 0828a1e..0a1ac3d 100644 --- a/README.md +++ b/README.md @@ -28,19 +28,24 @@ On a fresh install as root user using `bash install.sh` +## Environment + +Tested and optimised for [OVH VPS Starter](https://www.ovhcloud.com/fr/vps/cheap-vps/). + ## Installation steps 1. Install php for the webhook 2. Create a user 3. Setup ssh, firewall and fail2ban -4. Install Caddy webserver -5. Install MariaDB -6. Setup the Directus Database -7. Install Node -8. Prompt for the url -9. Install and run Directus -10. Install and run the front-end -11. Setup a webhook +4. Add swapfile +5. Install Caddy webserver +6. Install MariaDB +7. Setup the Directus Database +8. Install Node +9. Prompt for the url +10. Install and run Directus +11. Install and run the front-end +12. Setup a webhook ## Post-install diff --git a/bin/add_swap.sh b/bin/add_swap.sh new file mode 100644 index 0000000..3b622f7 --- /dev/null +++ b/bin/add_swap.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +fallocate -l 2G /swapfile +chmod 600 /swapfile +mkswap /swapfile +swapon /swapfile +echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab + +echo -e "${PURPLE}${BOLD}2G swapfile created${RESET}" \ No newline at end of file diff --git a/bin/setup_directus.sh b/bin/setup_directus.sh index b9a2e82..21e7dbe 100644 --- a/bin/setup_directus.sh +++ b/bin/setup_directus.sh @@ -28,6 +28,7 @@ echo \"KEY='${key}'\" >> ${env_file} &&\ echo \"CORS_ENABLED='true'\" >> ${env_file} &&\ echo \"CORS_ORIGIN='true'\" >> ${env_file} &&\ echo \"IMPORT_IP_DENY_LIST=\" >> ${env_file} &&\ +echo \"QUERY_LIMIT_DEFAULT=-1\" >> ${env_file} &&\ cd ${CMS_DIRECTORY} &&\ npm init -y &&\ npx directus bootstrap --skipAdminInit &&\ diff --git a/install.sh b/install.sh index 4d7e854..a99c28a 100644 --- a/install.sh +++ b/install.sh @@ -41,6 +41,13 @@ if [[ "$answer" == "y" ]]; then . bin/setup_ssh.sh fi +# SWAP +echo -e "${PURPLE}${BOLD}Add SWAP ? (y/N) ${RESET}" +read answer +if [[ "$answer" == "y" ]]; then + . bin/add_swap.sh +fi + # FIREWALL AND FAIL2BAN echo -e "${PURPLE}${BOLD}Setup Firewall and Fail2ban ? (y/N) ${RESET}" read answer