Minor changes
This commit is contained in:
46
deploy.sh
46
deploy.sh
@@ -18,7 +18,18 @@ PUBLIC_PROXY=$(toUpperCase $PUBLIC_PROXY)
|
|||||||
SMARTHOST_PROXY=$(toUpperCase $SMARTHOST_PROXY)
|
SMARTHOST_PROXY=$(toUpperCase $SMARTHOST_PROXY)
|
||||||
WIREGUARD=$(toUpperCase $WIREGUARD)
|
WIREGUARD=$(toUpperCase $WIREGUARD)
|
||||||
OPENVPN=$(toUpperCase $OPENVPN)
|
OPENVPN=$(toUpperCase $OPENVPN)
|
||||||
|
LETSENCRYPT_MAIL=$LETSENCRYPT_MAIL
|
||||||
|
USER_CONFIG_PATH=$USER_CONFIG_PATH
|
||||||
|
|
||||||
|
if [ "$USER_CONFIG_PATH" = "" ]; then
|
||||||
|
USER_CONFIG_PATH=/etc/user/config/user.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
DOCKER_REGISTRY_URL=$DOCKER_REGISTRY_URL
|
||||||
|
|
||||||
|
if [ "$DOCKER_REGISTRY_URL" = "" ]; then
|
||||||
|
DOCKER_REGISTRY_URL=registry.format.hu
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$PUBLIC_PROXY" == "YES" || "$PUBLIC_PROXY" == "TRUE" ]]; then
|
if [[ "$PUBLIC_PROXY" == "YES" || "$PUBLIC_PROXY" == "TRUE" ]]; then
|
||||||
PROXY_TYPE=public-proxy;
|
PROXY_TYPE=public-proxy;
|
||||||
@@ -88,7 +99,7 @@ for i in $(echo $PROXY_TYPE); do
|
|||||||
# CHECK proxy config file exists
|
# CHECK proxy config file exists
|
||||||
SOURCE=$(cat /tmp/$i/proxy_config| tail -n+2 |head -n-2);
|
SOURCE=$(cat /tmp/$i/proxy_config| tail -n+2 |head -n-2);
|
||||||
TARGET=$(cat $PROXY_DIR/proxy.json | tail -n+2);
|
TARGET=$(cat $PROXY_DIR/proxy.json | tail -n+2);
|
||||||
TMP_FILE=/tmp/proxy.json
|
TMP_FILE=$(mktemp -p /tmp/)
|
||||||
{
|
{
|
||||||
echo "{"
|
echo "{"
|
||||||
echo $SOURCE
|
echo $SOURCE
|
||||||
@@ -108,6 +119,7 @@ for i in $(echo $PROXY_TYPE); do
|
|||||||
|
|
||||||
# formats json content and removes duplications
|
# formats json content and removes duplications
|
||||||
jq -r . $TMP_FILE > $PROXY_DIR/proxy.json
|
jq -r . $TMP_FILE > $PROXY_DIR/proxy.json
|
||||||
|
rm $TMP_FILE
|
||||||
|
|
||||||
if [ "$i" == "public-proxy" ]; then
|
if [ "$i" == "public-proxy" ]; then
|
||||||
|
|
||||||
@@ -120,6 +132,38 @@ for i in $(echo $PROXY_TYPE); do
|
|||||||
|
|
||||||
if [ "$i" == "smarthost-proxy" ]; then
|
if [ "$i" == "smarthost-proxy" ]; then
|
||||||
|
|
||||||
|
# SETUP LETSENCRYPT USER SPECIFIED CONFIGURATION
|
||||||
|
|
||||||
|
if [ "$LETSENCRYPT_MAIL" = "" ]; then
|
||||||
|
echo "No email address given, Let's Encrypt will not work properly."
|
||||||
|
else
|
||||||
|
TMP_FILE=$(mktemp -p /tmp/)
|
||||||
|
LETS_CONTENT=$(echo '"letsencrypt": {"EMAIL": "'$LETSENCRYPT_MAIL'","DOCKER_REGISTRY_URL": "'$DOCKER_REGISTRY_URL'"'});
|
||||||
|
|
||||||
|
if [[ -f $USER_CONFIG_PATH ]]; then
|
||||||
|
TARGET=$(cat $USER_CONFIG_PATH | head -n-2);
|
||||||
|
{
|
||||||
|
echo $TARGET
|
||||||
|
echo "},"
|
||||||
|
echo $LETS_CONTENT
|
||||||
|
echo "}"
|
||||||
|
} >> "$TMP_FILE";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo "{"
|
||||||
|
echo $LETS_CONTENT
|
||||||
|
echo "}"
|
||||||
|
} >> "$TMP_FILE";
|
||||||
|
fi
|
||||||
|
|
||||||
|
# formats json content and removes duplications
|
||||||
|
jq -r . $TMP_FILE > $USER_CONFIG_PATH
|
||||||
|
rm $TMP_FILE
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# SETUP PROXY DNS SERVICE
|
||||||
# COPY PROXY DNS FILES
|
# COPY PROXY DNS FILES
|
||||||
if [ "$PROXY_DNS" == "" ]; then
|
if [ "$PROXY_DNS" == "" ]; then
|
||||||
PROXY_DNS=proxy-dns
|
PROXY_DNS=proxy-dns
|
||||||
|
Reference in New Issue
Block a user