diff --git a/manifest.json b/manifest.json index d3cb3e4..a30c5df 100644 --- a/manifest.json +++ b/manifest.json @@ -29,6 +29,15 @@ }, "example": "/hextris", "default": "/hextris" + }, + { + "name": "is_public", + "ask": { + "en": "Is it a public site ?", + "fr": "Est-ce un site public ?" + }, + "choices": ["Yes", "No"], + "default": "Yes" } ] } diff --git a/scripts/install b/scripts/install index f917b38..3701dbb 100755 --- a/scripts/install +++ b/scripts/install @@ -3,6 +3,7 @@ # Retrieve arguments domain=$1 path=$2 +is_public=$3 # Check domain/path availability sudo yunohost app checkurl $domain$path -a hextris @@ -10,6 +11,10 @@ if [[ ! $? -eq 0 ]]; then exit 1 fi + +# Save app settings +sudo yunohost app setting hextris is_public -v "$is_public" + # Copy files to the right place final_path=/var/www/hextris sudo mkdir -p $final_path @@ -26,6 +31,11 @@ sudo cp ../conf/nginx.conf $nginxconf sudo chown root: $nginxconf sudo chmod 600 $nginxconf +if [ "$is_public" = "Yes" ]; +then + sudo yunohost app setting hextris skipped_uris -v "/" +fi + # Reload web server & sso sudo service nginx reload sudo yunohost app ssowatconf diff --git a/scripts/upgrade b/scripts/upgrade index 1a8f01f..f40f4c3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -3,6 +3,7 @@ # Retrieve settings domain=$(sudo yunohost app setting hextris domain) path=$(sudo yunohost app setting hextris path) +is_public=$(sudo yunohost app setting hextris is_public) # Remove trailing "/" for next commands path=${path%/} @@ -23,6 +24,11 @@ sudo cp ../conf/nginx.conf $nginxconf sudo chown root: $nginxconf sudo chmod 600 $nginxconf +if [ "$is_public" = "Yes" ]; +then + sudo yunohost app setting hextris skipped_uris -v "/" +fi + # Reload web server & sso sudo service nginx reload sudo yunohost app ssowatconf