add install_additionals - vpn, local proxy, cron

This commit is contained in:
2023-04-27 09:24:21 +00:00
parent dfbf890422
commit acc9682483
3 changed files with 55 additions and 1 deletions

View File

@@ -17,6 +17,9 @@ docker run \
--volume /root/.ssh/installer:/root/.ssh/id_rsa \
--env PUBLIC_PROXY=yes \
--env SMARTHOST_PROXY=yes \
--env LOCAL_PROXY=yes \
--env VPN_PROXY=yes \
--env CRON=yes \
--volume /etc/user/:/etc/user/ \
--volume /etc/system/:/etc/system/ \
--env LETSENCRYPT_MAIL=noreply@galaxis.xyz

View File

@@ -16,6 +16,9 @@ fi
PUBLIC_PROXY=$(toUpperCase $PUBLIC_PROXY)
SMARTHOST_PROXY=$(toUpperCase $SMARTHOST_PROXY)
LOCAL_PROXY=$(toUpperCase $LOCAL_PROXY)
VPN_PROXY=$(toUpperCase $VPN_PROXY)
CRON=$(toUpperCase $CRON)
WIREGUARD=$(toUpperCase $WIREGUARD)
OPENVPN=$(toUpperCase $OPENVPN)
LETSENCRYPT_MAIL=$LETSENCRYPT_MAIL
@@ -46,6 +49,15 @@ fi
if [ "$CORE_DNS" == "" ]; then
CORE_DNS=core-dns
fi
if [ "$LOCAL_PROXY_REPO" == "" ]; then
LOCAL_PROXY_REPO="local-proxy";
fi
if [ "$VPN_PROXY_REPO" == "" ]; then
VPN_PROXY_REPO="wireguard-proxy-client";
fi
if [ "$CRON_REPO" == "" ]; then
CRON_REPO="cron";
fi
install_core_dns() {
@@ -83,8 +95,44 @@ install_core_dns() {
}
install_additionals() {
install_core_dns
if [[ "$LOCAL_PROXY" == "YES" || "$LOCAL_PROXY" == "TRUE" ]]; then
cp -av /tmp/$LOCAL_PROXY_REPO/*.json $SERVICE_DIR/
fi
if [[ "$VPN_PROXY" == "YES" || "$VPN_PROXY" == "TRUE" ]]; then
cp -av /tmp/$VPN_PROXY_REPO/*.json $SERVICE_DIR/
fi
if [[ "$CRON" == "YES" || "$CRON" == "TRUE" ]]; then
cp -av /tmp/$CRON_REPO/*.json $SERVICE_DIR/
CRON_VOLUMES=$(jq -r .containers[].VOLUMES[].SOURCE $SERVICE_DIR/cron.json |grep -v '\.')
for VOLUME in $(echo $CRON_VOLUMES); do
mkdir -p $VOLUME;
cp -rv /tmp/$CRON_REPO/crontab_letsencrypt.txt $VOLUME/crontab.txt ;
done
fi
}
git clone ssh://$GIT_REPO/$ORGANIZATION/$CORE_DNS.git /tmp/$CORE_DNS
if [[ "$LOCAL_PROXY" == "YES" || "$LOCAL_PROXY" == "TRUE" ]]; then
git clone ssh://$GIT_REPO/$ORGANIZATION/$LOCAL_PROXY_REPO.git /tmp/$LOCAL_PROXY_REPO
fi
if [[ "$VPN_PROXY" == "YES" || "$VPN_PROXY" == "TRUE" ]]; then
git clone ssh://$GIT_REPO/$ORGANIZATION/$VPN_PROXY_REPO.git /tmp/$VPN_PROXY_REPO
fi
if [[ "$CRON" == "YES" || "$CRON" == "TRUE" ]]; then
git clone ssh://$GIT_REPO/$ORGANIZATION/$CRON_REPO.git /tmp/$CRON_REPO
fi
# INSTALL PROXY SERVICES
for i in $(echo $PROXY_TYPE); do
@@ -126,7 +174,7 @@ for i in $(echo $PROXY_TYPE); do
mkdir -p $SERVICE_DIR;
cp -av /tmp/$i/*.json $SERVICE_DIR/
install_core_dns
install_additionals
# CREATE FILESYSTEM ACCESS FOR SERVICES

View File

@@ -12,6 +12,9 @@ fi
PUBLIC_PROXY=$(toUpperCase $PUBLIC_PROXY)
SMARTHOST_PROXY=$(toUpperCase $SMARTHOST_PROXY)
LOCAL_PROXY=$(toUpperCase $LOCAL_PROXY)
VPN_PROXY=$(toUpperCase $VPN_PROXY)
CRON=$(toUpperCase $CRON)
GIT_REPOSITORY=$GIT_REPOSITORY
HOST=$HOST
PORT=$PORT