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_read_timeout 3600;
uwsgi_param SCRIPT_NAME /__PATH__; uwsgi_param SCRIPT_NAME /__PATH__;
uwsgi_modifier1 30; uwsgi_modifier1 30;
uwsgi_pass unix:///var/run/uwsgi/app/__NAME__/socket; uwsgi_pass unix://__FINALPATH__//socket;
# Include SSOWAT user panel. # Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc; include conf.d/yunohost_panel.conf.inc;

View file

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

View file

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

View file

@ -71,4 +71,4 @@ ynh_backup "/etc/cron.d/$app" "${backup_dir}/etc/cron.d/$app"
# BACKUP THE SERVICE # 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" systemctl enable "$app.service"
# Add weblate as a service # Add weblate as a service
yunohost service add "$app.service" yunohost service add "$app.service" --log "/var/log/$app/APP.log"
#================================================= #=================================================
# PIP INSTALLATION # 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 # Set permissions to app files
chown -R "$app": "$final_path" chown -R "$app": "$final_path"
#chown -R 777 /var/run/uwsgi/app/$app/
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE

View file

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

View file

@ -96,13 +96,13 @@ pip install pytz python-bidi PyYaML Babel pyuca pylibravatar pydns
# RESTORE THE SERVICE # 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 # 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 # RESTORE THE CRON FILE
@ -123,4 +123,4 @@ ynh_restore_file "/etc/logrotate.d/$app"
#================================================= #=================================================
systemctl reload nginx systemctl reload nginx
systemctl reload $app.uwsgi.service systemctl reload $app.service