103 lines
2.0 KiB
Bash
103 lines
2.0 KiB
Bash
#!/bin/bash
|
|
|
|
|
|
# TODO
|
|
## DIRECTUS EMAIL
|
|
## DIRECTUS REDIS
|
|
## LOGING DE TOUT
|
|
## CADDYFILE EN JSON
|
|
## MÀJ
|
|
## reboot a running system
|
|
## MATOMO
|
|
## NODE EXPORTER
|
|
|
|
. 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
|
|
|
|
if [ "$(dirname "$0")" != "$(pwd)" ]; then
|
|
echo "Please run this script from its directory."
|
|
exit
|
|
fi
|
|
|
|
# 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
|
|
|
|
# NUXT STATIC
|
|
echo -e "${PURPLE}${BOLD}Install the front-end ? (y/N) ${RESET}"
|
|
read answer
|
|
if [[ "$answer" == "y" ]]; then
|
|
. bin/install_nuxt_front.sh
|
|
|
|
echo -e "${PURPLE}${BOLD}Setup a webhook ? (y/N) ${RESET}"
|
|
read answer
|
|
if [[ "$answer" == "y" ]]; then
|
|
. bin/setup_webhook.sh
|
|
fi
|
|
fi |