diff --git a/bin/install_directus.sh b/bin/install_directus.sh index e69f5b4..704a1f1 100644 --- a/bin/install_directus.sh +++ b/bin/install_directus.sh @@ -13,8 +13,8 @@ if [[ -z "$CMS_DIRECTORY" ]]; then fi echo "set -g default-shell /bin/sh" >> /etc/tmux.conf -mkdir "$CMS_DIRECTORY" -chown www-data:www-data "$CMS_DIRECTORY" +mkdir $CMS_DIRECTORY +chown www-data:www-data $CMS_DIRECTORY echo -e "${PURPLE}${BOLD}Import the Directus database ? (y/N) ${RESET}" read answer @@ -35,6 +35,10 @@ else echo -e "${ORANGE}${BOLD}User role ${RESET}${ORANGE}All permissions on content collections, directus_files and directus_folders${RESET}" fi +if [[ -z "$CADDYFILE" ]]; then + CADDYFILE="/etc/caddy/Caddyfile" +fi + echo "cms.${DOMAIN_NAME} {" >> $CADDYFILE echo "reverse_proxy ${ip}:${port}" >> $CADDYFILE echo "}" >> $CADDYFILE diff --git a/bin/install_nuxt_front.sh b/bin/install_nuxt_front.sh index 5053cc1..8ecc218 100644 --- a/bin/install_nuxt_front.sh +++ b/bin/install_nuxt_front.sh @@ -8,6 +8,10 @@ echo -e "${BLUE}git push origin prod${RESET}" echo -e "${PURPLE}${BOLD}Enter the .git url of the repo${RESET}" read repo_url +if [[ -z "$REPO_DIRECTORY" ]]; then + . bin/set_url.sh +fi + front_repo_name=$(echo "$repo_url" | sed 's#.*/\([^/]*\)\.git#\1#') front_directory="${REPO_DIRECTORY}/${front_repo_name}" if [[ -z "$WEBSITE_TOKEN" ]]; then @@ -36,6 +40,10 @@ node --max-old-space-size=250 `which npm` run generate --prerender" www-data cp -r "${front_directory}/.output/public" /var/www/html chown -R www-data:www-data /var/www/html/public +if [[ -z "$CADDYFILE" ]]; then + CADDYFILE="/etc/caddy/Caddyfile" +fi + echo "www.${DOMAIN_NAME} {" >> $CADDYFILE echo "redir ${DOMAIN_NAME}{uri} permanent" >> $CADDYFILE echo "}" >> $CADDYFILE