add infinite query limit to directus env and a swapfile

This commit is contained in:
Valentin 2024-05-29 09:45:04 +02:00
parent 3e208123df
commit 2fce8f8d9f
4 changed files with 30 additions and 8 deletions

View File

@ -28,19 +28,24 @@ On a fresh install as root user using
`bash install.sh` `bash install.sh`
## Environment
Tested and optimised for [OVH VPS Starter](https://www.ovhcloud.com/fr/vps/cheap-vps/).
## Installation steps ## Installation steps
1. Install php for the webhook 1. Install php for the webhook
2. Create a user 2. Create a user
3. Setup ssh, firewall and fail2ban 3. Setup ssh, firewall and fail2ban
4. Install Caddy webserver 4. Add swapfile
5. Install MariaDB 5. Install Caddy webserver
6. Setup the Directus Database 6. Install MariaDB
7. Install Node 7. Setup the Directus Database
8. Prompt for the url 8. Install Node
9. Install and run Directus 9. Prompt for the url
10. Install and run the front-end 10. Install and run Directus
11. Setup a webhook 11. Install and run the front-end
12. Setup a webhook
## Post-install ## Post-install

9
bin/add_swap.sh Normal file
View File

@ -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}"

View File

@ -28,6 +28,7 @@ echo \"KEY='${key}'\" >> ${env_file} &&\
echo \"CORS_ENABLED='true'\" >> ${env_file} &&\ echo \"CORS_ENABLED='true'\" >> ${env_file} &&\
echo \"CORS_ORIGIN='true'\" >> ${env_file} &&\ echo \"CORS_ORIGIN='true'\" >> ${env_file} &&\
echo \"IMPORT_IP_DENY_LIST=\" >> ${env_file} &&\ echo \"IMPORT_IP_DENY_LIST=\" >> ${env_file} &&\
echo \"QUERY_LIMIT_DEFAULT=-1\" >> ${env_file} &&\
cd ${CMS_DIRECTORY} &&\ cd ${CMS_DIRECTORY} &&\
npm init -y &&\ npm init -y &&\
npx directus bootstrap --skipAdminInit &&\ npx directus bootstrap --skipAdminInit &&\

View File

@ -41,6 +41,13 @@ if [[ "$answer" == "y" ]]; then
. bin/setup_ssh.sh . bin/setup_ssh.sh
fi 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 # FIREWALL AND FAIL2BAN
echo -e "${PURPLE}${BOLD}Setup Firewall and Fail2ban ? (y/N) ${RESET}" echo -e "${PURPLE}${BOLD}Setup Firewall and Fail2ban ? (y/N) ${RESET}"
read answer read answer