From fb3e33c06f48a4c4bff16f311d62da3db2a85d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 21 Aug 2022 09:12:56 +0200 Subject: [PATCH] Fix linter --- README.md | 9 ++------- check_process | 2 -- conf/nginx.conf | 5 ----- conf/systemd.service | 6 +++--- scripts/_common.sh | 13 +------------ scripts/restore | 5 ++--- scripts/upgrade | 2 +- 7 files changed, 9 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index ad22de5..3501fe9 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Mozilla’s Sync Server for YunoHost -[![Integration level](https://dash.yunohost.org/integration/ffsync.svg)](https://dash.yunohost.org/appci/app/ffsync) ![](https://ci-apps.yunohost.org/ci/badges/ffsync.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/ffsync.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/ffsync.svg)](https://dash.yunohost.org/appci/app/ffsync) ![](https://ci-apps.yunohost.org/ci/badges/ffsync.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/ffsync.maintain.svg) [![Install ffsync with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ffsync) *[Lire ce readme en français.](./README_fr.md)* -> *This package allow you to install ffsync quickly and simply on a YunoHost server. +> *This package allow you to install ffsync quickly and simply on a YunoHost server. If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* ## Overview @@ -24,11 +24,6 @@ By default, a server set up will defer authentication to the Mozilla-hosted acco Once installed, reaching `http://domain.tld/path` should show a page explaining how to configure it. -#### Supported architectures - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/ffsync%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/ffsync/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/ffsync%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/ffsync/) - ## Links * Report a bug about this package: https://github.com/YunoHost-Apps/ffsync_ynh/issues diff --git a/check_process b/check_process index cf3e7f8..7038a13 100644 --- a/check_process +++ b/check_process @@ -10,11 +10,9 @@ setup_private=0 setup_public=1 upgrade=1 - upgrade=1 from_commit=028501b35335139cff4fc41477a9dbc969657576 backup_restore=1 multi_instance=1 port_already_use=0 change_url=0 ;;; Upgrade options - ; commit=028501b35335139cff4fc41477a9dbc969657576 name=Before migration to pypy diff --git a/conf/nginx.conf b/conf/nginx.conf index a4db401..4797701 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,11 +4,6 @@ location __PATH__/ { # Path to source alias __FINALPATH__/ ; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - include uwsgi_params; # Needed for long running operations in admin interface proxy_pass http://localhost:__PORT__/; diff --git a/conf/systemd.service b/conf/systemd.service index 12cc844..55f4b1c 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -12,13 +12,13 @@ After=mysql.service #LimitNOFILE=65535 Type=simple User=__APP__ -Group=www-data +Group=__APP__ WorkingDirectory=/opt/yunohost/__APP__ ExecStart=/opt/yunohost/__APP__/local/bin/gunicorn --paste /opt/yunohost/__APP__/syncserver.ini Restart=always # Sandboxing options to harden security -# Depending on specificities of your service/app, you may need to tweak these +# Depending on specificities of your service/app, you may need to tweak these # .. but this should be a good baseline # Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html NoNewPrivileges=yes @@ -45,7 +45,7 @@ CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW -CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG +CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG [Install] WantedBy=multi-user.target diff --git a/scripts/_common.sh b/scripts/_common.sh index 3ad66a9..cfdfe78 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -14,18 +14,7 @@ pkg_dependencies="pypy pypy-dev python3-virtualenv build-essential libssl-dev li #================================================= call_pip() { - # Sometime we get a segfault error while we invoke pip - # As we don't have a really clean way to fix this really bad error we just try many time utils it works - i=0 - result_ok=false - while [ $i -lt 5 ] && ! $result_ok; do - ynh_exec_warn_less pip $@ && result_ok=true - i=$((i+1)) - done - if ! $result_ok; then - echo "Error on build package" - false - fi + ynh_exec_warn_less pip $@ } install_sources() { diff --git a/scripts/restore b/scripts/restore index c3e3831..e42080b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -30,8 +30,6 @@ db_user=$db_name #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " @@ -82,7 +80,8 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ ynh_script_progression --message="Reloading services..." --weight=3 systemctl daemon-reload -systemctl enable $app.service +systemctl enable --quiet $app.service +yunohost service add "$app" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 101af48..09c4e39 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -96,7 +96,7 @@ ynh_script_progression --message="Checking backware compatibility..." --weight=1 # Detect old installation with uwsgi if [ -e /etc/uwsgi/apps-available/$app.ini ]; then systemctl stop uwsgi-app@$app.service - systemctl disable uwsgi-app@$app.service + systemctl disable --quiet uwsgi-app@$app.service yunohost service remove "uwsgi-app@$app" ynh_secure_remove --file=/etc/uwsgi/apps-available/$app.ini ynh_secure_remove --file=/etc/systemd/system/uwsgi-app@$app.service.d