diff --git a/README.md b/README.md index b00ca98..d4f945a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Tor relay for YunoHost -[![Integration level](https://dash.yunohost.org/integration/torrelay.svg)](https://dash.yunohost.org/appci/app/torrelay) ![](https://ci-apps.yunohost.org/ci/badges/torrelay.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/torrelay.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/torrelay.svg)](https://dash.yunohost.org/appci/app/torrelay) ![Working status](https://ci-apps.yunohost.org/ci/badges/torrelay.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/torrelay.maintain.svg) + [![Install Tor relay with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=torrelay) *[Lire ce readme en français.](./README_fr.md)* @@ -17,27 +18,25 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in The Tor network relies on volunteers to donate bandwidth. The more people who run relays, the better the Tor network will be. The current Tor network is quite small compared to the number of people who need to use Tor, which means we need more dedicated volunteers like you to run relays. -**Shipped version:** 0.4.6.10~ynh1 - - - +**Shipped version:** 0.4.7.13~ynh1 ## Documentation and resources -* Official app website: https://www.torproject.org/ -* Official admin documentation: https://community.torproject.org/relay/setup/bridge/debian-ubuntu/ -* Upstream app code repository: https://github.com/torproject/tor -* YunoHost documentation for this app: https://yunohost.org/app_torrelay -* Report a bug: https://github.com/YunoHost-Apps/torrelay_ynh/issues +* Official app website: +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/torrelay_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/torrelay_ynh/tree/testing --debug or sudo yunohost app upgrade torrelay -u https://github.com/YunoHost-Apps/torrelay_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index 823d02b..d5a890c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,39 +1,42 @@ + + # Tor relay pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/torrelay.svg)](https://dash.yunohost.org/appci/app/torrelay) ![](https://ci-apps.yunohost.org/ci/badges/torrelay.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/torrelay.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/torrelay.svg)](https://dash.yunohost.org/appci/app/torrelay) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/torrelay.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/torrelay.maintain.svg) + [![Installer Tor relay avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=torrelay) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* -> *Ce package vous permet d'installer Tor relay rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer Tor relay rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble The Tor network relies on volunteers to donate bandwidth. The more people who run relays, the better the Tor network will be. The current Tor network is quite small compared to the number of people who need to use Tor, which means we need more dedicated volunteers like you to run relays. -**Version incluse :** 0.4.6.10~ynh1 - - - +**Version incluse :** 0.4.7.13~ynh1 ## Documentations et ressources -* Site officiel de l'app : https://www.torproject.org/ -* Documentation officielle de l'admin : https://community.torproject.org/relay/setup/bridge/debian-ubuntu/ -* Dépôt de code officiel de l'app : https://github.com/torproject/tor -* Documentation YunoHost pour cette app : https://yunohost.org/app_torrelay -* Signaler un bug : https://github.com/YunoHost-Apps/torrelay_ynh/issues +* Site officiel de l’app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/torrelay_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/torrelay_ynh/tree/testing --debug ou sudo yunohost app upgrade torrelay -u https://github.com/YunoHost-Apps/torrelay_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file diff --git a/conf/systemd.service b/conf/systemd.service deleted file mode 100644 index 31e9da3..0000000 --- a/conf/systemd.service +++ /dev/null @@ -1,45 +0,0 @@ -[Unit] -Description=Small description of the service -After=network.target - -[Service] -Type=simple -User=__APP__ -Group=__APP__ -WorkingDirectory=__FINALPATH__/ -ExecStart=__FINALPATH__/script -StandardOutput=append:/var/log/__APP__/__APP__.log -StandardError=inherit - -# Sandboxing options to harden security -# 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 -PrivateTmp=yes -PrivateDevices=yes -RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 -RestrictNamespaces=yes -RestrictRealtime=yes -DevicePolicy=closed -ProtectSystem=full -ProtectControlGroups=yes -ProtectKernelModules=yes -ProtectKernelTunables=yes -LockPersonality=yes -SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap - -# Denying access to capabilities that should not be relevant for webapps -# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html -CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD -CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE -CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT -CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK -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 - -[Install] -WantedBy=multi-user.target diff --git a/manifest.json b/manifest.json index 8504d3e..571e958 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Defend Your Privacy! How To Create Your Own Tor Relay!", "fr": "Defend Your Privacy! How To Create Your Own Tor Relay!" }, - "version": "0.4.6.10~ynh1", + "version": "0.4.7.13~ynh1", "url": "https://www.torproject.org/", "upstream": { "license": "BSD-3-Clause", @@ -23,10 +23,9 @@ "yunohost": ">= 4.3.0" }, "multi_instance": false, - "services": [ - ], + "services": [], "arguments": { - "install" : [ + "install": [ { "name": "domain", "type": "domain" @@ -51,4 +50,4 @@ } ] } -} +} \ No newline at end of file diff --git a/scripts/_common.sh b/scripts/_common.sh index fe89279..ee93074 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,8 @@ #================================================= # dependencies used by the app -pkg_dependencies="tor obfs4proxy" +pkg_dependencies="apt-transport-https obfs4proxy" +pkg_dependencies_extra="tor tor-geoipdb deb.torproject.org-keyring" #================================================= # PERSONAL HELPERS diff --git a/scripts/change_url b/scripts/change_url index 11f740d..cfea773 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -32,7 +32,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --time --weight=1 +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -67,14 +67,14 @@ fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -111,14 +111,14 @@ fi #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -126,4 +126,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --time --last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index 7b84ddc..3087755 100755 --- a/scripts/install +++ b/scripts/install @@ -60,7 +60,9 @@ ynh_exec_warn_less yunohost firewall allow Both $obfs4_port #================================================= ynh_script_progression --message="Installing dependencies..." --weight=10 -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies "$pkg_dependencies" + +ynh_install_extra_app_dependencies --repo="deb https://deb.torproject.org/torproject.org $(lsb_release -cs) main" --package="$pkg_dependencies_extra" --key="https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc" #================================================= # ADD A CONFIGURATION @@ -77,7 +79,7 @@ chown :debian-tor /etc/tor/torrc #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 -yunohost service add tor --description="Tor Relay" --log="/var/log/$app/$app.log" --needs_exposed_ports="$or_port" +yunohost service add tor --description="Tor Relay" --log="/var/log/$app/$app.log" --needs_exposed_ports="$or_port" --test_status="pgrep tor" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/restore b/scripts/restore index 1990054..e3cedd6 100755 --- a/scripts/restore +++ b/scripts/restore @@ -36,12 +36,14 @@ obfs4_port=$(ynh_app_setting_get --app=$app --key=obfs4_port) ynh_script_progression --message="Reinstalling dependencies..." --weight=10 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies "$pkg_dependencies" + +ynh_install_extra_app_dependencies --repo="deb https://deb.torproject.org/torproject.org $(lsb_release -cs) main" --package="$pkg_dependencies_extra" --key="https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc" #================================================= # RESTORE VARIOUS FILES #================================================= -ynh_script_progression --message="Restoring various files..." --time --weight=1 +ynh_script_progression --message="Restoring various files..." --weight=1 ynh_restore_file --origin_path="/etc/tor/torrc" @@ -50,7 +52,7 @@ ynh_restore_file --origin_path="/etc/tor/torrc" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add tor --description="Tor Relay" --log="/var/log/$app/$app.log" --needs_exposed_ports="$or_port" +yunohost service add tor --description="Tor Relay" --log="/var/log/$app/$app.log" --needs_exposed_ports="$or_port" --test_status="pgrep tor" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 144be9c..44d0c90 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,7 +56,9 @@ ynh_systemd_action --service_name=tor --action="stop" --log_path="systemd" #================================================= ynh_script_progression --message="Upgrading dependencies..." --weight=10 -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies "$pkg_dependencies" + +ynh_install_extra_app_dependencies --repo="deb https://deb.torproject.org/torproject.org $(lsb_release -cs) main" --package="$pkg_dependencies_extra" --key="https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc" #================================================= # UPDATE A CONFIG FILE @@ -73,7 +75,7 @@ chown :debian-tor /etc/tor/torrc #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add tor --description="Tor Relay" --log="/var/log/$app/$app.log" --needs_exposed_ports="$or_port" +yunohost service add tor --description="Tor Relay" --log="/var/log/$app/$app.log" --needs_exposed_ports="$or_port" --test_status="pgrep tor" #================================================= # START SYSTEMD SERVICE diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..cbbeef1 --- /dev/null +++ b/tests.toml @@ -0,0 +1,3 @@ +test_format = 1.0 + +[default]