diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..145651d Binary files /dev/null and b/.DS_Store differ diff --git a/README.md b/README.md index bfb6046..97556bf 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,32 @@ + + # Simple Torrent for YunoHost [![Integration level](https://dash.yunohost.org/integration/simple-torrent.svg)](https://dash.yunohost.org/appci/app/simple-torrent) ![](https://ci-apps.yunohost.org/ci/badges/simple-torrent.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/simple-torrent.maintain.svg) -[![Install Simple Torrent with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=simple-torrent/) +[![Install Simple Torrent with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=simple-torrent) *[Lire ce readme en français.](./README_fr.md)* -> *This package allows you to install Simple Torrent quickly and simply on a YunoHost server. -If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* +> *This package allows you to install Simple Torrent quickly and simply on a YunoHost server. +If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview -Simple Torrent is a self-hosted remote torrent client, written in Go (golang). Started torrents remotely, download sets of files on the local disk of the server, which are then retrievable or streamable via HTTP. +Self-hosted remote torrent client + +**Shipped version:** 1.2.23~ynh3 + -**Shipped version:** 1.2.23 ## Screenshots -![](https://user-images.githubusercontent.com/1033514/64239393-bdbb6480-cf32-11e9-9269-d8d10e7c0dc7.png) +![](./doc/screenshots/64239393-bdbb6480-cf32-11e9-9269-d8d10e7c0dc7.png) +![](./doc/screenshots/.DS_Store) + +## Disclaimers / important information ## Configuration @@ -24,34 +34,17 @@ Most of the items can be edited in Web-UI on the fly in the config board. You can also configure Simple Torrent by editing this file `/var/www/simple-torrent/config.json` using the [documentation](https://github.com/boypt/simple-torrent/wiki/Config-File). -## Documentation - - * Official documentation: https://github.com/boypt/simple-torrent/wiki - * YunoHost documentation: https://yunohost.org/en/app_simple-torrent - -## YunoHost specific features - -#### Multi-user support - -* Is LDAP supported? **No** -* Can the app be used by multiple users? **No** - -#### Supported architectures - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/simple-torrent.svg)](https://ci-apps.yunohost.org/ci/apps/simple-torrent/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/simple-torrent.svg)](https://ci-apps-arm.yunohost.org/ci/apps/simple-torrent/) - ## Limitations -* Sorry, this app cannot be installed on a 32-bit ARM machine. +- This app cannot be installed on a 32-bit ARM machine. -## Links +## Documentation and resources - * Report a bug: https://github.com/YunoHost-Apps/simple-torrent_ynh/issues - * Upstream app repository: https://github.com/boypt/simple-torrent - * YunoHost website: https://yunohost.org/ - ---- +* Official app website: https://github.com/boypt/simple-torrent +* Official admin documentation: https://github.com/boypt/simple-torrent/wiki +* Upstream app code repository: https://github.com/boypt/simple-torrent +* YunoHost documentation for this app: https://yunohost.org/app_simple-torrent +* Report a bug: https://github.com/YunoHost-Apps/simple-torrent_ynh/issues ## Developer info @@ -63,3 +56,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/simple-torrent_ynh/tr or sudo yunohost app upgrade simple-torrent -u https://github.com/YunoHost-Apps/simple-torrent_ynh/tree/testing --debug ``` + +**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/README_fr.md b/README_fr.md index e3e7fb8..b94d3ea 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,22 +1,28 @@ # Simple Torrent pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/simple-torrent.svg)](https://dash.yunohost.org/appci/app/simpletorrent) ![](https://ci-apps.yunohost.org/ci/badges/simple-torrent.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/simple-torrent.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/simple-torrent.svg)](https://dash.yunohost.org/appci/app/simple-torrent) ![](https://ci-apps.yunohost.org/ci/badges/simple-torrent.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/simple-torrent.maintain.svg) [![Installer Simple Torrent avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=simple-torrent) -*[Read this readme in english.](./README.md)* +*[Read this readme in english.](./README.md)* +*[Lire ce readme en français.](./README_fr.md)* -> *Ce package vous permet d'installer Simple Torrent rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/install) pour apprendre comment l'installer.* +> *Ce package vous permet d'installer Simple Torrent 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 -Simple Torrent est un client torrent distant auto-hébergé, écrit en Go (golang). Démarrez des torrents à distance, téléchargez des ensembles de fichiers sur le disque local du serveur, qui sont ensuite récupérables ou diffusables via HTTP. +Client torrent distant auto-hébergé + +**Version incluse :** 1.2.23~ynh3 + -**Version incluse :** 1.2.23 ## Captures d'écran -![](https://user-images.githubusercontent.com/1033514/64239393-bdbb6480-cf32-11e9-9269-d8d10e7c0dc7.png) +![](./doc/screenshots/64239393-bdbb6480-cf32-11e9-9269-d8d10e7c0dc7.png) +![](./doc/screenshots/.DS_Store) + +## Avertissements / informations importantes ## Configuration @@ -24,34 +30,17 @@ La plupart des éléments peuvent être modifiés à la volée dans Web-UI dans Vous pouvez configurer Simple Torrent en modifiant le fichier `/var/www/simple-torrent/config.json` en vous aidant de la [documentation](https://github.com/boypt/simple-torrent/wiki/Config-File). -## Documentation - - * Documentation officielle : https://github.com/boypt/simple-torrent/wiki - * Documentation YunoHost : https://yunohost.org/fr/app_simple-torrent - -## Caractéristiques spécifiques YunoHost - -#### Support multi-utilisateur - -* L'authentification LDAP est-elle prise en charge ? **Non** -* L'application peut-elle être utilisée par plusieurs utilisateurs ? **Non** - -#### Architectures supportées - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/simple-torrent.svg)](https://ci-apps.yunohost.org/ci/apps/simple-torrent/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/simple-torrent.svg)](https://ci-apps-arm.yunohost.org/ci/apps/simple-torrent/) - ## Limitations -* Désolé, cette application ne peut pas être installée sur une machine ARM 32 bits. +- Cette application ne peut pas être installée sur une machine ARM 32 bits. -## Liens +## Documentations et ressources - * Signaler un bug : https://github.com/YunoHost-Apps/simple-torrent_ynh/issues - * Dépôt de l'application principale : https://github.com/boypt/simple-torrent - * Site web YunoHost : https://yunohost.org/ - ---- +* Site officiel de l'app : https://github.com/boypt/simple-torrent +* Documentation officielle de l'admin : https://github.com/boypt/simple-torrent/wiki +* Dépôt de code officiel de l'app : https://github.com/boypt/simple-torrent +* Documentation YunoHost pour cette app : https://yunohost.org/app_simple-torrent +* Signaler un bug : https://github.com/YunoHost-Apps/simple-torrent_ynh/issues ## Informations pour les développeurs @@ -63,3 +52,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/simple-torrent_ynh/tr ou sudo yunohost app upgrade simple-torrent -u https://github.com/YunoHost-Apps/simple-torrent_ynh/tree/testing --debug ``` + +**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/check_process b/check_process index 04f2a4b..f7fbeaa 100644 --- a/check_process +++ b/check_process @@ -5,7 +5,6 @@ is_public=1 admin="john" password="pass" - port="4533" ; Checks pkg_linter=1 setup_sub_dir=1 diff --git a/doc/.DS_Store b/doc/.DS_Store new file mode 100644 index 0000000..fc7b8a4 Binary files /dev/null and b/doc/.DS_Store differ diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..9cc9c9b --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1,9 @@ +## Configuration + +Most of the items can be edited in Web-UI on the fly in the config board. + +You can also configure Simple Torrent by editing this file `/var/www/simple-torrent/config.json` using the [documentation](https://github.com/boypt/simple-torrent/wiki/Config-File). + +## Limitations + +- This app cannot be installed on a 32-bit ARM machine. diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md new file mode 100644 index 0000000..3246c1b --- /dev/null +++ b/doc/DISCLAIMER_fr.md @@ -0,0 +1,9 @@ +## Configuration + +La plupart des éléments peuvent être modifiés à la volée dans Web-UI dans la page de configuration. + +Vous pouvez configurer Simple Torrent en modifiant le fichier `/var/www/simple-torrent/config.json` en vous aidant de la [documentation](https://github.com/boypt/simple-torrent/wiki/Config-File). + +## Limitations + +- Cette application ne peut pas être installée sur une machine ARM 32 bits. diff --git a/doc/screenshots/.DS_Store b/doc/screenshots/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/doc/screenshots/.DS_Store differ diff --git a/doc/screenshots/64239393-bdbb6480-cf32-11e9-9269-d8d10e7c0dc7.png b/doc/screenshots/64239393-bdbb6480-cf32-11e9-9269-d8d10e7c0dc7.png new file mode 100644 index 0000000..80407d3 Binary files /dev/null and b/doc/screenshots/64239393-bdbb6480-cf32-11e9-9269-d8d10e7c0dc7.png differ diff --git a/manifest.json b/manifest.json index 71ffddb..da6147c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,8 +6,14 @@ "en": "Self-hosted remote torrent client", "fr": "Client torrent distant auto-hébergé" }, - "version": "1.2.23~ynh2", + "version": "1.2.23~ynh3", "url": "https://github.com/boypt/simple-torrent", + "upstream": { + "license": "AGPL-3.0-only", + "website": "https://github.com/boypt/simple-torrent", + "admindoc": "https://github.com/boypt/simple-torrent/wiki", + "code": "https://github.com/boypt/simple-torrent" + }, "license": "AGPL-3.0-only", "maintainer": { "name": "eric_G" diff --git a/scripts/install b/scripts/install index a5a9dcc..58fbac0 100644 --- a/scripts/install +++ b/scripts/install @@ -93,6 +93,11 @@ pushd "$final_path" mv $(ynh_detect_arch) $app popd +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" +chmod +x $final_path/$app + #================================================= # NGINX CONFIGURATION #================================================= @@ -106,6 +111,9 @@ ynh_add_nginx_config #================================================= mkdir -p /home/yunohost.app/$app/{torrents,downloads} +# Set permissions to app files +chown -R $app:www-data /home/yunohost.app/$app +chmod 755 /home/yunohost.app/$app/{torrents,downloads} #================================================= # MODIFY A CONFIG FILE @@ -121,20 +129,6 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." --weight=1 - -# Set permissions to app files -chown -R $app:www-data $final_path -chmod -R o-rwx $final_path -chown -R $app:www-data /home/yunohost.app/$app -chmod +x $final_path/$app -chmod 755 /home/yunohost.app/$app/{torrents,downloads} - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= diff --git a/scripts/restore b/scripts/restore index 79bec8c..01820b9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -55,6 +55,14 @@ ynh_script_progression --message="Configuring firewall..." --weight=3 #ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port ynh_exec_warn_less yunohost firewall allow Both $peer_port +#================================================= +# RECREATE THE DEDICATED USER +#================================================= +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 + +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir=$final_path + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -62,6 +70,11 @@ ynh_script_progression --message="Restoring $app main directory..." --weight=4 ynh_restore_file --origin_path="$final_path" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" +chmod +x $final_path/$app + #================================================= # RESTORE DATA #================================================= @@ -69,24 +82,7 @@ ynh_script_progression --message="Restoring $app data..." --weight=10 ynh_restore_file --origin_path="/home/yunohost.app/$app" --not_mandatory -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app - -#================================================= -# RESTORE USER RIGHTS -#================================================= -ynh_script_progression --message="Restoring user rights..." - -# Set permissions to app files -chown -R $app:www-data $final_path -chmod -R o-rwx $final_path chown -R $app:www-data /home/yunohost.app/$app -chmod +x $final_path/$app chmod 755 /home/yunohost.app/$app/{torrents,downloads} #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 86475bf..504ae90 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -71,6 +71,14 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action=stop --log_path=systemd +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -78,29 +86,20 @@ ynh_systemd_action --service_name=$app --action=stop --log_path=systemd if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=5 - - tmpdir="$(mktemp -d)" - - # Backup the config file in the temp dir - cp -a "$final_path/config.json" "$tmpdir/config.json" - - # Remove the app directory securely - ynh_secure_remove --file=$final_path # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir=$final_path --source_id="$architecture" + ynh_setup_source --dest_dir=$final_path --source_id="$architecture" --keep="$final_path/config.json" pushd "$final_path" gzip --decompress $(ynh_detect_arch).gz mv $(ynh_detect_arch) $app popd - - # Copy the admin saved settings from tmp directory to final path - cp -a "$tmpdir/config.json" "$final_path/config.json" - - # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" fi +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" +chmod +x $final_path/$app + #================================================= # NGINX CONFIGURATION #================================================= @@ -115,13 +114,8 @@ ynh_add_nginx_config mkdir -p /home/yunohost.app/$app/{torrents,downloads} -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app +chown -R $app:www-data /home/yunohost.app/$app +chmod 755 /home/yunohost.app/$app/{torrents,downloads} #================================================= # SETUP SYSTEMD @@ -130,19 +124,6 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=2 ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." - -chown -R $app:www-data $final_path -chmod -R o-rwx $final_path -chown -R $app:www-data /home/yunohost.app/$app -chmod +x $final_path/$app -chmod 755 /home/yunohost.app/$app/{torrents,downloads} - #================================================= # INTEGRATE SERVICE IN YUNOHOST #=================================================