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