From 65cc1428df983dee519b5c9b4ebe401a160d78a0 Mon Sep 17 00:00:00 2001 From: hael Date: Tue, 23 May 2023 16:35:13 +0000 Subject: [PATCH] local backend deploy --- deploy.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/deploy.sh b/deploy.sh index 84883cf..7420395 100755 --- a/deploy.sh +++ b/deploy.sh @@ -23,6 +23,7 @@ WIREGUARD=$(toUpperCase $WIREGUARD) OPENVPN=$(toUpperCase $OPENVPN) LETSENCRYPT_MAIL=$LETSENCRYPT_MAIL USER_CONFIG_PATH=$USER_CONFIG_PATH +DOMAIN=$DOMAIN; if [ "$USER_CONFIG_PATH" = "" ]; then USER_CONFIG_PATH=/etc/user/config/user.json @@ -58,6 +59,16 @@ fi if [ "$CRON_REPO" == "" ]; then CRON_REPO="cron"; fi +if [ "$LOCAL_BACKEND_REPO" == "" ]; then + LOCAL_BACKEND_REPO="local-backend"; +fi + +install_local_backend() { + + sed -i s/DOMAIN_NAME/$DOMAIN/g /tmp/$LOCAL_BACKEND_PROXY/*.json + + cp -rv /tmp/$LOCAL_BACKEND_PROXY/*.json $SERVICE_DIR/ ; +} install_core_dns() { @@ -99,6 +110,10 @@ install_additionals() { install_core_dns + if [[ "$SMARTHOST_PROXY" == "YES" || "$SMART_HOST_PROXY" == "TRUE" ]]; then + install_local_backend + fi + if [[ "$LOCAL_PROXY" == "YES" || "$LOCAL_PROXY" == "TRUE" ]]; then cp -av /tmp/$LOCAL_PROXY_REPO/*.json $SERVICE_DIR/ fi @@ -141,6 +156,8 @@ if [[ "$CRON" == "YES" || "$CRON" == "TRUE" ]]; then git clone ssh://$GIT_REPO/$ORGANIZATION/$CRON_REPO.git /tmp/$CRON_REPO fi +git clone ssh://$GIT_REPO/$ORGANIZATION/$LOCAL_BACKEND_REPO.git /tmp/$LOCAL_BACKEND_REPO + # INSTALL PROXY SERVICES for i in $(echo $PROXY_TYPE); do