mirror of
https://github.com/YunoHost-Apps/hextris_ynh.git
synced 2024-09-03 19:16:05 +02:00
[enh] Add 'is_public' setting.
This commit is contained in:
parent
810eb81d11
commit
45020dc94b
3 changed files with 25 additions and 0 deletions
|
@ -29,6 +29,15 @@
|
||||||
},
|
},
|
||||||
"example": "/hextris",
|
"example": "/hextris",
|
||||||
"default": "/hextris"
|
"default": "/hextris"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "is_public",
|
||||||
|
"ask": {
|
||||||
|
"en": "Is it a public site ?",
|
||||||
|
"fr": "Est-ce un site public ?"
|
||||||
|
},
|
||||||
|
"choices": ["Yes", "No"],
|
||||||
|
"default": "Yes"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
domain=$1
|
domain=$1
|
||||||
path=$2
|
path=$2
|
||||||
|
is_public=$3
|
||||||
|
|
||||||
# Check domain/path availability
|
# Check domain/path availability
|
||||||
sudo yunohost app checkurl $domain$path -a hextris
|
sudo yunohost app checkurl $domain$path -a hextris
|
||||||
|
@ -10,6 +11,10 @@ if [[ ! $? -eq 0 ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Save app settings
|
||||||
|
sudo yunohost app setting hextris is_public -v "$is_public"
|
||||||
|
|
||||||
# Copy files to the right place
|
# Copy files to the right place
|
||||||
final_path=/var/www/hextris
|
final_path=/var/www/hextris
|
||||||
sudo mkdir -p $final_path
|
sudo mkdir -p $final_path
|
||||||
|
@ -26,6 +31,11 @@ sudo cp ../conf/nginx.conf $nginxconf
|
||||||
sudo chown root: $nginxconf
|
sudo chown root: $nginxconf
|
||||||
sudo chmod 600 $nginxconf
|
sudo chmod 600 $nginxconf
|
||||||
|
|
||||||
|
if [ "$is_public" = "Yes" ];
|
||||||
|
then
|
||||||
|
sudo yunohost app setting hextris skipped_uris -v "/"
|
||||||
|
fi
|
||||||
|
|
||||||
# Reload web server & sso
|
# Reload web server & sso
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
sudo yunohost app ssowatconf
|
sudo yunohost app ssowatconf
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
# Retrieve settings
|
# Retrieve settings
|
||||||
domain=$(sudo yunohost app setting hextris domain)
|
domain=$(sudo yunohost app setting hextris domain)
|
||||||
path=$(sudo yunohost app setting hextris path)
|
path=$(sudo yunohost app setting hextris path)
|
||||||
|
is_public=$(sudo yunohost app setting hextris is_public)
|
||||||
|
|
||||||
# Remove trailing "/" for next commands
|
# Remove trailing "/" for next commands
|
||||||
path=${path%/}
|
path=${path%/}
|
||||||
|
@ -23,6 +24,11 @@ sudo cp ../conf/nginx.conf $nginxconf
|
||||||
sudo chown root: $nginxconf
|
sudo chown root: $nginxconf
|
||||||
sudo chmod 600 $nginxconf
|
sudo chmod 600 $nginxconf
|
||||||
|
|
||||||
|
if [ "$is_public" = "Yes" ];
|
||||||
|
then
|
||||||
|
sudo yunohost app setting hextris skipped_uris -v "/"
|
||||||
|
fi
|
||||||
|
|
||||||
# Reload web server & sso
|
# Reload web server & sso
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
sudo yunohost app ssowatconf
|
sudo yunohost app ssowatconf
|
||||||
|
|
Loading…
Reference in a new issue