1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/weblate_ynh.git synced 2024-10-01 13:35:04 +02:00

Removed location hierarchy, and use __NAME__ instead of __APP__ so ynh nginx help works as expected

This commit is contained in:
Jean-Baptiste Holcroft 2017-09-14 09:33:06 +02:00
parent fb93b9c758
commit 1ce33422cf
4 changed files with 32 additions and 32 deletions

View file

@ -3,37 +3,37 @@ location __PATH__ {
# Path to source # Path to source
alias __FINALPATH__/ ; alias __FINALPATH__/ ;
location __PATH__/favicon.ico {
# DATA_DIR/static/favicon.ico
alias __FINALPATH__/static/favicon.ico;
expires 30d;
}
location __PATH__/robots.txt {
# DATA_DIR/static/robots.txt
alias __FINALPATH__/static/robots.txt;
expires 30d;
}
location __PATH__/static {
# DATA_DIR/static/
alias __FINALPATH__/static/;
expires 30d;
}
location __PATH__/media {
# DATA_DIR/media/
alias __FINALPATH__/media/;
expires 30d;
}
include uwsgi_params; include uwsgi_params;
# Needed for long running operations in admin interface # Needed for long running operations in admin interface
uwsgi_read_timeout 3600; uwsgi_read_timeout 3600;
# Adjust based to uwsgi configuration: # Adjust based to uwsgi configuration:
uwsgi_pass unix:///opt/__APP__/uwsgi.sock uwsgi_pass unix:///opt/__NAME__/uwsgi.sock
# uwsgi_pass 127.0.0.1:8080; # uwsgi_pass 127.0.0.1:8080;
# Include SSOWAT user panel. # Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc; include conf.d/yunohost_panel.conf.inc;
} }
location __PATH__/favicon.ico {
# DATA_DIR/static/favicon.ico
alias __FINALPATH__/static/favicon.ico;
expires 30d;
}
location __PATH__/robots.txt {
# DATA_DIR/static/robots.txt
alias __FINALPATH__/static/robots.txt;
expires 30d;
}
location __PATH__/static {
# DATA_DIR/static/
alias __FINALPATH__/static/;
expires 30d;
}
location __PATH__/media {
# DATA_DIR/media/
alias __FINALPATH__/media/;
expires 30d;
}

View file

@ -40,9 +40,9 @@ DATABASES = {
# Database engine # Database engine
'ENGINE': 'django.db.backends.mysql', 'ENGINE': 'django.db.backends.mysql',
# Database name # Database name
'NAME': '__APP__', 'NAME': '__NAME__',
# Database user # Database user
'USER': '__APP__', 'USER': '__NAME__',
# Database password # Database password
'PASSWORD': '__DB_PWD__', 'PASSWORD': '__DB_PWD__',
# Set to empty string for localhost # Set to empty string for localhost

View file

@ -1,5 +1,5 @@
[uwsgi] [uwsgi]
uid = __APP__ uid = __NAME__
gid = users gid = users
protocol = uwsgi protocol = uwsgi
@ -22,10 +22,10 @@ master = true
# maximum number of worker processes # maximum number of worker processes
processes = 4 processes = 4
# the socket (use the full path to be safe # the socket (use the full path to be safe
socket = /opt/__APP__/uwsgi.sock socket = /opt/__NAME__/uwsgi.sock
# ... with appropriate permissions - may be needed # ... with appropriate permissions - may be needed
chmod-socket = 666 chmod-socket = 666
stats = /opt/__APP__/stats.sock stats = /opt/__NAME__/stats.sock
# clear environment on exit # clear environment on exit
vacuum = true vacuum = true
plugins = python3 plugins = python3

View file

@ -118,7 +118,7 @@ ynh_system_user_create $app
# Copy Files # Copy Files
sudo cp ../conf/uwsgi.ini $final_path/uwsgi.ini sudo cp ../conf/uwsgi.ini $final_path/uwsgi.ini
ynh_replace_string "__APP__" "$app" $final_path/uwsgi.ini ynh_replace_string "__NAME__" "$app" $final_path/uwsgi.ini
ynh_replace_string "__FINALPATH__" "$finalpath" $final_path/uwsgi.ini ynh_replace_string "__FINALPATH__" "$finalpath" $final_path/uwsgi.ini
# Config service # Config service
@ -144,7 +144,7 @@ key=$(ynh_string_random 64)
sudo cp $final_path/weblate/settings_example.py $final_path/weblate/settings.py sudo cp $final_path/weblate/settings_example.py $final_path/weblate/settings.py
sudo cp ../conf/settings.py $final_path/weblate/settings.py sudo cp ../conf/settings.py $final_path/weblate/settings.py
ynh_replace_string "__APP__" "$app" $final_path/settings.py ynh_replace_string "__NAME__" "$app" $final_path/settings.py
ynh_replace_string "__DB_PWD__" "$db_pwd" $final_path/weblate/settings.py ynh_replace_string "__DB_PWD__" "$db_pwd" $final_path/weblate/settings.py
ynh_replace_string "__ADMIN__" "$admin" $final_path/weblate/settings.py ynh_replace_string "__ADMIN__" "$admin" $final_path/weblate/settings.py
ynh_replace_string "__ADMINMAIL__" "$admin_mail" $final_path/weblate/settings.py ynh_replace_string "__ADMINMAIL__" "$admin_mail" $final_path/weblate/settings.py