1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/torrelay_ynh.git synced 2024-09-03 20:26:36 +02:00

Merge pull request #4 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2023-04-21 16:22:01 +02:00 committed by GitHub
commit a8ae123500
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 59 additions and 93 deletions

View file

@ -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: <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>
## 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
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View file

@ -1,39 +1,42 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# 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 dinté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 dinstaller Tor relay rapidement et simplement sur un serveur YunoHost.
Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment linstaller et en profiter.*
## Vue d'ensemble
## Vue densemble
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 lapp : <https://www.torproject.org/>
* Documentation officielle de ladmin : <https://community.torproject.org/relay/setup/bridge/debian-ubuntu/>
* Dépôt de code officiel de lapp : <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>
## 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
**Plus dinfos sur le packaging dapplications :** <https://yunohost.org/packaging_apps>

View file

@ -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

View file

@ -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,8 +23,7 @@
"yunohost": ">= 4.3.0"
},
"multi_instance": false,
"services": [
],
"services": [],
"arguments": {
"install": [
{

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

3
tests.toml Normal file
View file

@ -0,0 +1,3 @@
test_format = 1.0
[default]