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

uwsgi additions

This commit is contained in:
Jean-Baptiste Holcroft 2017-09-20 21:43:09 +02:00
parent 601d704d6d
commit c539006eed
7 changed files with 15 additions and 17 deletions

View file

@ -8,7 +8,7 @@ location __PATH__ {
uwsgi_read_timeout 3600;
uwsgi_param SCRIPT_NAME /__PATH__;
uwsgi_modifier1 30;
uwsgi_pass unix:///var/run/uwsgi/app/__NAME__/socket;
uwsgi_pass unix://__FINALPATH__//socket;
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;

View file

@ -2,14 +2,13 @@
plugins = python
master = true
protocol = uwsgi
socket = /var/run/uwsgi/app/__NAME__/socket
socket = __FINALPATH__/socket
virtualenv = __FINALPATH__/venv
wsgi-file = __FINALPATH__/venv/lib/python2.7/site-packages/weblate/wsgi.py
python-path = __FINALPATH__/venv
# In case you're using virtualenv uncomment this:
# virtualenv = /path/to/weblate/virtualenv
# Needed for OAuth/OpenID
buffer-size = 8192
chmod-socket = 666
# Increase number of workers for heavily loaded sites
#workers = 6
# Needed for background processing

View file

@ -4,13 +4,13 @@ Requires=network.target
After=network.target
[Service]
User=root
Group=root
User=__NAME__
Group=__NAME__
RemainAfterExit=yes
WorkingDirectory=__FINALPATH__
ExecStart=/usr/bin/uwsgi \
--ini /etc/uwsgi/apps-enabled/__NAME__.uwsgi.ini \
--socket /var/run/uwsgi/app/__NAME__/socket
--ini /etc/uwsgi/apps-enabled/__NAME__.ini \
--socket __FINALPATH__/socket
Restart=always
StandardError=syslog

View file

@ -71,4 +71,4 @@ ynh_backup "/etc/cron.d/$app" "${backup_dir}/etc/cron.d/$app"
# BACKUP THE SERVICE
#=================================================
ynh_backup "/etc/systemd/system/$app.uwsgi.service" "${backup_dir}/etc/systemd/system/$app.uwsgi.service"
ynh_backup "/etc/systemd/system/$app.service" "${backup_dir}/etc/systemd/system/$app.service"

View file

@ -127,7 +127,7 @@ ynh_replace_string "__FINALPATH__" "$final_path" "/etc/systemd/system/$app.servi
systemctl enable "$app.service"
# Add weblate as a service
yunohost service add "$app.service"
yunohost service add "$app.service" --log "/var/log/$app/APP.log"
#=================================================
# PIP INSTALLATION
@ -198,7 +198,6 @@ ynh_store_file_checksum "$final_path/venv/lib/python2.7/site-packages/weblate/se
# Set permissions to app files
chown -R "$app": "$final_path"
#chown -R 777 /var/run/uwsgi/app/$app/
#=================================================
# SETUP LOGROTATE

View file

@ -26,7 +26,7 @@ db_name=$(ynh_app_setting_get $app db_name)
if yunohost service status | grep -q $app
then
echo "Remove $app service"
yunohost service remove $app.uwsgi.service
yunohost service remove $app.service
fi
#=================================================
@ -83,9 +83,9 @@ ynh_secure_remove "/var/log/$app/"
# REMOVE uwsgi and systemd files
#=================================================
ynh_secure_remove "/etc/uwsgi/apps-enabled/$app.uwsgi.ini"
ynh_secure_remove "/etc/uwsgi/apps-enabled/$app.ini"
ynh_secure_remove "/etc/systemd/system/$app.uwsgi.service"
ynh_secure_remove "/etc/systemd/system/$app.service"
#=================================================
# GENERIC FINALIZATION

View file

@ -96,13 +96,13 @@ pip install pytz python-bidi PyYaML Babel pyuca pylibravatar pydns
# RESTORE THE SERVICE
#=================================================
ynh_restore_file "/etc/systemd/system/$app.uwsgi.service"
ynh_restore_file "/etc/systemd/system/$app.service"
#=================================================
# ADVERTISE SERVICE IN ADMIN PANEL
#=================================================
yunohost service add $app --log "/var/log/$app/APP.log"
yunohost service add $app.service --log "/var/log/$app/APP.log"
#=================================================
# RESTORE THE CRON FILE
@ -123,4 +123,4 @@ ynh_restore_file "/etc/logrotate.d/$app"
#=================================================
systemctl reload nginx
systemctl reload $app.uwsgi.service
systemctl reload $app.service