1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ihatemoney_ynh.git synced 2024-09-03 19:26:15 +02:00

Add compatibility with Yunohost 3.2 / Stretch:

* Pip<10
* Nginx path configuration dynamic
This commit is contained in:
admin 2018-10-12 00:09:18 +02:00
parent 98cad80c80
commit 2b9fd12b11
3 changed files with 6 additions and 2 deletions

View file

@ -1,5 +1,5 @@
location PATHTOCHANGE/static/ { location PATHTOCHANGE/static/ {
alias /opt/yunohost/ihatemoney/venv/lib/python3.4/site-packages/ihatemoney/static/; alias APPHOME/static/;
} }
location PATHTOCHANGE { location PATHTOCHANGE {
# Force https. # Force https.

View file

@ -41,8 +41,10 @@ init_virtualenv () {
configure_nginx () { configure_nginx () {
local domain=$1 local domain=$1
local path=$2 local path=$2
local app_home=$3
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
sed -i "s@APPHOME@$app_home@g" ../conf/nginx.conf
# Fix double-slash for domain-root install # Fix double-slash for domain-root install
sed -i "s@location //@location /@" ../conf/nginx.conf sed -i "s@location //@location /@" ../conf/nginx.conf
sudo install -o root -g root -m644 \ sudo install -o root -g root -m644 \

View file

@ -62,11 +62,13 @@ create_unix_user
# Prepare venv # Prepare venv
init_virtualenv init_virtualenv
sudo /opt/yunohost/ihatemoney/venv/bin/pip install 'pip<10'
sudo /opt/yunohost/ihatemoney/venv/bin/pip install \ sudo /opt/yunohost/ihatemoney/venv/bin/pip install \
'gunicorn>=19.3.0' \ 'gunicorn>=19.3.0' \
'PyMySQL>=0.9,<0.10' \ 'PyMySQL>=0.9,<0.10' \
'ihatemoney>=2,<3' \ 'ihatemoney>=2,<3' \
app_home=$(dirname $(find /opt/yunohost/ihatemoney/venv/lib/ -type d -name static | head -n1))
create_system_dirs create_system_dirs
# Configure gunicorn # Configure gunicorn
@ -97,7 +99,7 @@ then
fi fi
# Configure Nginx # Configure Nginx
configure_nginx "$domain" "$path" configure_nginx "$domain" "$path" "$app_home"
# Start backend # Start backend
sudo systemctl start supervisor sudo systemctl start supervisor