From ca9c32e72881e1ae0e30e3263d93fc3580060e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 14 Jul 2021 09:06:51 +0200 Subject: [PATCH] Testing (#46) * Upgrade to 1.3.0 --- README.md | 4 +- README_fr.md | 4 +- conf/arm64.src | 6 +-- conf/config.default.json | 20 ---------- conf/config.default.yaml | 81 ++++++++++++++++++++++++++++++++++++++++ conf/i386.src | 7 ++++ conf/systemd.service | 2 +- conf/x86_64.src | 4 +- doc/DISCLAIMER.md | 2 +- doc/DISCLAIMER_fr.md | 2 +- manifest.json | 2 +- scripts/_common.sh | 4 +- scripts/install | 2 +- scripts/upgrade | 13 ++++++- 14 files changed, 117 insertions(+), 36 deletions(-) delete mode 100644 conf/config.default.json create mode 100644 conf/config.default.yaml create mode 100644 conf/i386.src diff --git a/README.md b/README.md index 97556bf..b4a34d5 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Self-hosted remote torrent client -**Shipped version:** 1.2.23~ynh3 +**Shipped version:** 1.3.0~ynh1 @@ -32,7 +32,7 @@ Self-hosted remote torrent client 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). +You can also configure Simple Torrent by editing this file `/var/www/simple-torrent/config.yaml` using the [documentation](https://github.com/boypt/simple-torrent/wiki/Config-File). ## Limitations diff --git a/README_fr.md b/README_fr.md index b94d3ea..bff89ee 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Client torrent distant auto-hébergé -**Version incluse :** 1.2.23~ynh3 +**Version incluse :** 1.3.0~ynh1 @@ -28,7 +28,7 @@ Client torrent distant auto-hébergé 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). +Vous pouvez configurer Simple Torrent en modifiant le fichier `/var/www/simple-torrent/config.yaml` en vous aidant de la [documentation](https://github.com/boypt/simple-torrent/wiki/Config-File). ## Limitations diff --git a/conf/arm64.src b/conf/arm64.src index 7001de8..af471e5 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/boypt/simple-torrent/releases/download/1.2.23/cloud-torrent_linux_arm64_static.gz -SOURCE_SUM=28a752920f03a18e5830d4d1e2b2eff15cf6872fed6b83c56232c72acee05f12 +SOURCE_URL=https://github.com/boypt/simple-torrent/releases/download/1.3.0/cloud-torrent_linux_arm64_static.gz +SOURCE_SUM=16835738f35ebfa69a6d6a687f4f17917fa9019c07228da7cee62b16829b7a00 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=gz SOURCE_IN_SUBDIR=false SOURCE_FILENAME= -SOURCE_EXTRACT=false \ No newline at end of file +SOURCE_EXTRACT=false diff --git a/conf/config.default.json b/conf/config.default.json deleted file mode 100644 index 20be7cc..0000000 --- a/conf/config.default.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "autostart": true, - "enginedebug": false, - "MuteEngineLog": true, - "donecmd": "", - "SeedRatio": "", - "uploadrate": "", - "donecmdthreshold": "30s", - "watchdirectory": "/home/yunohost.app/__APP__/torrents", - "downloaddirectory": "/home/yunohost.app/__APP__/downloads", - "enableseeding": true, - "enableupload": true, - "incomingport": "__PEER_PORT__", - "obfspreferred": true, - "obfsrequirepreferred": false, - "proxyurl": "", - "scraperurl": "https://raw.githubusercontent.com/boypt/simple-torrent/master/scraper-config.json", - "seedratio": 0, - "trackerlisturl": "https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt" -} \ No newline at end of file diff --git a/conf/config.default.yaml b/conf/config.default.yaml new file mode 100644 index 0000000..c9949db --- /dev/null +++ b/conf/config.default.yaml @@ -0,0 +1,81 @@ +AutoStart: true +# AutoStart Whether start torrent task on added Magnet/Torrent. + +AllowRuntimeConfigure: true +# AllowRuntimeConfigure is the switch whether to offer the WEB UI configuration to users. + +EngineDebug: false +# EngineDebug Print debug log from anacrolix/torrent engine (lots of them) + +MuteEngineLog: true +# MuteEngineLog anacrolix/torrent engine prints chunks exchanging logs, normal user can just mute them. + +ObfsPreferred: true +# ObfsPreferred Whether torrent header obfuscation is preferred. + +ObfsRequirePreferred: false +# ObfsRequirePreferred Whether the value of ObfsPreferred is a strict requirement. This hides torrent traffic from being censored. + +DisableTrackers: false +# DisableTrackers Don't announce to trackers. This only leaves DHT to discover peers. + +DisableIPv6: false +# DisableIPv6 Don't connect to IPv6 peers. + +DisableUTP: false +# Disable UTP in the torrent protocol. +# In recent versions, the UTP process cause quite high CPU usage. Set to true can ease the situation. + +NoDefaultPortForwarding: true +# Don't broadcast the UPNP request for gateway port forwarding, which is unnecessary in machines that has public IP (of which this program is mean for?) + +DownloadDirectory: /home/yunohost.app/__APP__/downloads +# DisableEncryption A switch disables [BitTorrent protocol encryption](https://en.wikipedia.org/wiki/BitTorrent_protocol_encryption) + +WatchDirectory: /home/yunohost.app/__APP__/torrents +# DownloadDirectory The directory where downloaded file saves. + +EnableUpload: true +# EnableUpload Whether send chunks to peers + +EnableSeeding: true +# EnableSeeding Whether upload even after there's nothing further for us. By default uploading is not altruistic, we'll only upload to encourage the peer to reciprocate. + +IncomingPort: __PEER_PORT__ +# IncomingPort The port SimpleTorrent listens to. + +DoneCmd: "" +# DoneCmd is An external program to call on task finished. See [DoneCmd Usage](https://github.com/boypt/simple-torrent/wiki/DoneCmdUsage). + +SeedRatio: 1.5 +# SeedRatio The ratio of task Upload/Download data when reached, the task will be stop. + +SeedTime: "0s" +# SeedTime is the time to seed after a task is done downloading, during which if `SeedRatio` is reached, the tasks will stop and deleted; after the duration, the tasks will also stop and removed. But if the waiting queue is empty, will not remove. + +UploadRate: High +DownloadRate: Unlimited +# UploadRate/DownloadRate The global speed limiter, +# a fixed level amoung Low(~50k/s), Medium(~500k/s) and High(~1500k/s) is accepted , Unlimited / 0 +# or empty result in unlimited rate, or a customed value eg: 850k/720kb/2.85MB. + +TrackerListURL: https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt +# TrackerListURL A https URL to a trackers list, this option is design to retrive public trackers from https://github.com/ngosang/trackerslist. + +AlwaysAddTrackers: true +# Always add tracers from TrackerListURL wheather the torrent/magnet link has it's own trackers already + +MaxConcurrentTask: 0 +# MaxConcurrentTask the the maximum tasks concurrently running. Too many task consumes CPU a lot, use this option to limit and queue up download task. + +ProxyURL: "" +# ProxyURL Socks5 Proxy to torrent engine. Authentication should be included in the url if needed. +# Eg. socks5://demo:demo@192.168.99.100:1080 + +# ScraperURL: "https://raw.githubusercontent.com/boypt/simple-torrent/master/scraper-config.json" +# The magnet search engine configuration file. Don't set this option (leave it commented) if not intended to. + +RSSUrl: |- + http://domian./rss.xml + http://some-other-site/rss.xml +# The RSS superscription list. diff --git a/conf/i386.src b/conf/i386.src new file mode 100644 index 0000000..dda3f42 --- /dev/null +++ b/conf/i386.src @@ -0,0 +1,7 @@ +SOURCE_URL=https://github.com/boypt/simple-torrent/releases/download/1.3.0/cloud-torrent_linux_386_static.gz +SOURCE_SUM=56fa0b4ef9dbd3d06c531786cad2e095afd4556722e4ef8b7f9f65cb1853b4cc +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=gz +SOURCE_IN_SUBDIR=false +SOURCE_FILENAME= +SOURCE_EXTRACT=false diff --git a/conf/systemd.service b/conf/systemd.service index 23fb665..26151be 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ User=__APP__ Group=__APP__ Environment=PORT=__PORT__ WorkingDirectory=__FINALPATH__ -ExecStart=__FINALPATH__/__APP__ -c __FINALPATH__/config.json --host 127.0.0.1 +ExecStart=__FINALPATH__/__APP__ -c __FINALPATH__/config.yaml --host 127.0.0.1 Restart=always RestartSec=3 diff --git a/conf/x86_64.src b/conf/x86_64.src index 2fca0bd..f39fb26 100644 --- a/conf/x86_64.src +++ b/conf/x86_64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/boypt/simple-torrent/releases/download/1.2.23/cloud-torrent_linux_amd64_static.gz -SOURCE_SUM=4df4987bf027d6f72b8e54062eda35b34c9af15ea73cbde0c4940aa843a7e280 +SOURCE_URL=https://github.com/boypt/simple-torrent/releases/download/1.3.0/cloud-torrent_linux_amd64_static.gz +SOURCE_SUM=91f3f8538d90cf2fd4f5899d1ebd8c7820578fdc1947047d1cf0e5f53e99e81e SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=gz SOURCE_IN_SUBDIR=false diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 9cc9c9b..4d586e9 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -2,7 +2,7 @@ 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). +You can also configure Simple Torrent by editing this file `/var/www/simple-torrent/config.yaml` using the [documentation](https://github.com/boypt/simple-torrent/wiki/Config-File). ## Limitations diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index 3246c1b..16261a3 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/DISCLAIMER_fr.md @@ -2,7 +2,7 @@ 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). +Vous pouvez configurer Simple Torrent en modifiant le fichier `/var/www/simple-torrent/config.yaml` en vous aidant de la [documentation](https://github.com/boypt/simple-torrent/wiki/Config-File). ## Limitations diff --git a/manifest.json b/manifest.json index da6147c..4f11a9e 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Self-hosted remote torrent client", "fr": "Client torrent distant auto-hébergé" }, - "version": "1.2.23~ynh3", + "version": "1.3.0~ynh1", "url": "https://github.com/boypt/simple-torrent", "upstream": { "license": "AGPL-3.0-only", diff --git a/scripts/_common.sh b/scripts/_common.sh index 318d9dd..8fc49a5 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -26,7 +26,9 @@ ynh_detect_arch() { local architecture if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then - architecture="arm64" + architecture="arm64" + elif [ -n "$(uname -m | grep 86)" ]; then + architecture="i386" elif [ -n "$(uname -m | grep 64)" ]; then architecture="x86_64" else diff --git a/scripts/install b/scripts/install index 58fbac0..d99620a 100644 --- a/scripts/install +++ b/scripts/install @@ -120,7 +120,7 @@ chmod 755 /home/yunohost.app/$app/{torrents,downloads} #================================================= ynh_script_progression --message="Modifying a config file..." --weight=1 -ynh_add_config --template="../conf/config.default.json" --destination="$final_path/config.json" +ynh_add_config --template="../conf/config.default.yaml" --destination="$final_path/config.yaml" #================================================= # SETUP SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index 504ae90..f2d0f31 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -87,8 +87,12 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=5 + # 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" --keep="$final_path/config.json" + ynh_setup_source --dest_dir=$final_path --source_id="$architecture" + pushd "$final_path" gzip --decompress $(ynh_detect_arch).gz mv $(ynh_detect_arch) $app @@ -108,6 +112,13 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config +#================================================= +# MODIFY A CONFIG FILE +#================================================= +ynh_script_progression --message="Modifying a config file..." --weight=1 + +ynh_add_config --template="../conf/config.default.yaml" --destination="$final_path/config.yaml" + #================================================= # CREATE DIRECTORIES #=================================================