install directus

This commit is contained in:
Valentin 2024-02-23 20:15:32 +01:00
parent 54e69e0012
commit 53496574d9
1 changed files with 15 additions and 13 deletions

View File

@ -8,7 +8,7 @@ install_pkg() {
pkg="$1" pkg="$1"
if ! command -v "$pkg" &> /dev/null; then if ! command -v "$pkg" &> /dev/null; then
apt install -y "$pkg" apt install -y "$pkg"
echo -e "${PURPLE}${BOLD}expect installed${RESET}" echo -e "${PURPLE}${BOLD}${pkg} installed${RESET}"
fi fi
} }
@ -29,7 +29,7 @@ fi
# #
# USER # USER
# #
echo -e "${PURPLE}${BOLD}Create a user ? (y/n) ${RESET}" echo -e "${PURPLE}${BOLD}Create a user ? (y/N) ${RESET}"
read answer read answer
if [[ "$answer" == "y" ]]; then if [[ "$answer" == "y" ]]; then
echo -e "${PURPLE}${BOLD}Create user${RESET}" echo -e "${PURPLE}${BOLD}Create user${RESET}"
@ -56,7 +56,7 @@ fi
# #
# SSH # SSH
# #
echo -e "${PURPLE}${BOLD}Setup SSH ? (y/n) ${RESET}" echo -e "${PURPLE}${BOLD}Setup SSH ? (y/N) ${RESET}"
read answer read answer
if [[ "$answer" == "y" ]]; then if [[ "$answer" == "y" ]]; then
echo -e "${PURPLE}${BOLD}Setup SSH${RESET}" echo -e "${PURPLE}${BOLD}Setup SSH${RESET}"
@ -70,7 +70,7 @@ 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
if [[ "$answer" == "y" ]]; then if [[ "$answer" == "y" ]]; then
echo -e "${PURPLE}${BOLD}Setup Firewall and Fail2ban${RESET}" echo -e "${PURPLE}${BOLD}Setup Firewall and Fail2ban${RESET}"
@ -90,7 +90,7 @@ echo -e "${PURPLE}${BOLD}TODO : Zabbix and Urbackup${RESET}"
# #
# CADDY # CADDY
# #
echo -e "${PURPLE}${BOLD}Install Caddy webserver ? (y/n) ${RESET}" echo -e "${PURPLE}${BOLD}Install Caddy webserver ? (y/N) ${RESET}"
read answer read answer
if [[ "$answer" == "y" ]]; then if [[ "$answer" == "y" ]]; then
echo -e "${PURPLE}${BOLD}Install Caddy Webserver${RESET}" echo -e "${PURPLE}${BOLD}Install Caddy Webserver${RESET}"
@ -105,7 +105,7 @@ fi
# MARIADB # MARIADB
# #
echo -e "${PURPLE}${BOLD}Install MariaDB ? (y/n) ${RESET}" echo -e "${PURPLE}${BOLD}Install MariaDB ? (y/N) ${RESET}"
read answer read answer
if [[ "$answer" == "y" ]]; then if [[ "$answer" == "y" ]]; then
apt install -y mariadb-server apt install -y mariadb-server
@ -145,7 +145,7 @@ fi
# DIRECTUS DB # DIRECTUS DB
# #
echo -e "${PURPLE}${BOLD}Setup Directus database ? (y/n) ${RESET}" echo -e "${PURPLE}${BOLD}Setup Directus database ? (y/N) ${RESET}"
read answer read answer
if [[ "$answer" == "y" ]]; then if [[ "$answer" == "y" ]]; then
echo -e "${PURPLE}${BOLD}Generate and store the password somewhere safe${RESET}" echo -e "${PURPLE}${BOLD}Generate and store the password somewhere safe${RESET}"
@ -179,7 +179,7 @@ fi
# NODE # NODE
# #
echo -e "${PURPLE}${BOLD}Install Node ? (y/n) ${RESET}" echo -e "${PURPLE}${BOLD}Install Node ? (y/N) ${RESET}"
read answer read answer
if [[ "$answer" == "y" ]]; then if [[ "$answer" == "y" ]]; then
get_username get_username
@ -209,12 +209,14 @@ read
# DIRECTUS # DIRECTUS
# #
echo -e "${PURPLE}${BOLD}Install Directus ? (y/n) ${RESET}" echo -e "${PURPLE}${BOLD}Install Directus ? (y/N) ${RESET}"
read answer read answer
if [[ "$answer" == "y" ]]; then if [[ "$answer" == "y" ]]; then
echo "yooo" install_pkg tmux
# get_username get_username
# su -c 'cd &&\ su -c 'cd &&\
# ' $username npm init directus-project@latest cms.${domain_name} &&\
echo "HOST=${ip}" >> cms.${domain_name}/.env &&\
echo "PUBLIC_URL=cms.${domain_name}" >> cms.${domain_name}/.env' $username
fi fi
# TODO REMOVE EXPECT IF IT IS INSTALLED # TODO REMOVE EXPECT IF IT IS INSTALLED