mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
Added ability to make the service public
This commit is contained in:
parent
6cf166e216
commit
5d2a476e30
2 changed files with 22 additions and 3 deletions
|
@ -30,6 +30,15 @@
|
|||
},
|
||||
"example": "/example",
|
||||
"default": "/ihatemoney"
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"ask": {
|
||||
"en": "Is it a public website ? (even if service is public, each project is protected by a password)",
|
||||
"fr": "Le service est-il public ? (même dans ce cas, chaque projet est protégé par un mot de passe)"
|
||||
},
|
||||
"choices": ["Yes", "No"],
|
||||
"default": "Yes"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ set -e
|
|||
# Retrieve arguments
|
||||
domain=$1
|
||||
path=$2
|
||||
is_public=$3
|
||||
app=ihatemoney
|
||||
|
||||
# Constant arguments
|
||||
db_user=ihatemoney
|
||||
|
@ -19,8 +21,9 @@ fi
|
|||
# Remove trailing "/" for next commands
|
||||
path=${path%/}
|
||||
|
||||
# Configure domain
|
||||
sudo yunohost app setting ihatemoney domain -v $domain
|
||||
# Save app settings
|
||||
sudo yunohost app setting $app domain -v $domain
|
||||
sudo yunohost app setting $app is_public -v "$is_public"
|
||||
|
||||
# Install debian packages dependencies
|
||||
sudo apt-get install -y -qq python-dev python-virtualenv supervisor
|
||||
|
@ -55,7 +58,7 @@ sudo yunohost service add supervisor
|
|||
|
||||
# Configure database
|
||||
db_pwd=`sudo yunohost app initdb $db_user`
|
||||
sudo yunohost app setting ihatemoney mysqlpwd -v $db_pwd
|
||||
sudo yunohost app setting $app mysqlpwd -v $db_pwd
|
||||
|
||||
# Configure ihatemoney
|
||||
sed -i "s@MY_SECRET_KEY@$secret_key@" ../conf/settings.py
|
||||
|
@ -67,6 +70,13 @@ sudo install -o ihatemoney -g ihatemoney -m 640 \
|
|||
# The settings have to be stored here (on python path)
|
||||
sudo ln -s /etc/ihatemoney/settings.py /opt/yunohost/ihatemoney/src/budget/settings.py
|
||||
|
||||
|
||||
# If app is public, add url to SSOWat conf as skipped_uris
|
||||
if [ "$is_public" = "Yes" ];
|
||||
then
|
||||
sudo yunohost app setting $app unprotected_uris -v "/"
|
||||
fi
|
||||
|
||||
# Configure Nginx and reload
|
||||
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
||||
sudo install -o root -g root -m644 \
|
||||
|
|
Loading…
Add table
Reference in a new issue