78 lines
1.5 KiB
Bash
78 lines
1.5 KiB
Bash
|
#!/bin/bash
|
||
|
|
||
|
. bin/functions.sh
|
||
|
. bin/variables.sh
|
||
|
|
||
|
echo -e "${PURPLE}${BOLD}Deployment Debian + Caddy + Directus + Nuxt${RESET}"
|
||
|
|
||
|
if [ "$EUID" -ne 0 ]; then
|
||
|
echo "Please run as root"
|
||
|
exit
|
||
|
fi
|
||
|
|
||
|
# A ENVOYER AU WEBHOOK
|
||
|
install_pkg php
|
||
|
install_pkg php-fpm
|
||
|
|
||
|
# USER
|
||
|
echo -e "${PURPLE}${BOLD}Create a user ? (y/N) ${RESET}"
|
||
|
read answer
|
||
|
if [[ "$answer" == "y" ]]; then
|
||
|
. bin/create_user.sh
|
||
|
fi
|
||
|
|
||
|
# SSH
|
||
|
echo -e "${PURPLE}${BOLD}Setup SSH ? (y/N) ${RESET}"
|
||
|
read answer
|
||
|
if [[ "$answer" == "y" ]]; then
|
||
|
. bin/setup_ssh.sh
|
||
|
fi
|
||
|
|
||
|
# FIREWALL AND FAIL2BAN
|
||
|
echo -e "${PURPLE}${BOLD}Setup Firewall and Fail2ban ? (y/N) ${RESET}"
|
||
|
read answer
|
||
|
if [[ "$answer" == "y" ]]; then
|
||
|
. bin/setup_firewall_fail2ban.sh
|
||
|
fi
|
||
|
|
||
|
# CADDY
|
||
|
echo -e "${PURPLE}${BOLD}Install Caddy webserver ? (y/N) ${RESET}"
|
||
|
read answer
|
||
|
if [[ "$answer" == "y" ]]; then
|
||
|
. bin/install_caddy.sh
|
||
|
fi
|
||
|
|
||
|
# MARIADB
|
||
|
echo -e "${PURPLE}${BOLD}Install MariaDB ? (y/N) ${RESET}"
|
||
|
read answer
|
||
|
if [[ "$answer" == "y" ]]; then
|
||
|
. bin/install_mariadb.sh
|
||
|
fi
|
||
|
|
||
|
# DIRECTUS DB
|
||
|
echo -e "${PURPLE}${BOLD}Setup Directus database ? (y/N) ${RESET}"
|
||
|
read answer
|
||
|
if [[ "$answer" == "y" ]]; then
|
||
|
. bin/setup_directus_db.sh
|
||
|
fi
|
||
|
|
||
|
# NODE
|
||
|
echo -e "${PURPLE}${BOLD}Install Node ? (y/N) ${RESET}"
|
||
|
read answer
|
||
|
if [[ "$answer" == "y" ]]; then
|
||
|
. bin/install_node.sh
|
||
|
fi
|
||
|
|
||
|
# SET URL
|
||
|
echo -e "${PURPLE}${BOLD}Set url ? (y/N) ${RESET}"
|
||
|
read answer
|
||
|
if [[ "$answer" == "y" ]]; then
|
||
|
. bin/set_url.sh
|
||
|
fi
|
||
|
|
||
|
# INSTALL DIRECTUS
|
||
|
echo -e "${PURPLE}${BOLD}Install Directus ? (y/N) ${RESET}"
|
||
|
read answer
|
||
|
if [[ "$answer" == "y" ]]; then
|
||
|
. bin/install_directus.sh
|
||
|
fi
|