From d312e7423900a78461be7f60e6bb61c83a63f80f Mon Sep 17 00:00:00 2001 From: Cryptik-Rick <105178852+Cryptik-Rick@users.noreply.github.com> Date: Sun, 9 Jun 2024 15:51:33 -0400 Subject: [PATCH] PR from crazymax head (#1) * cleanup workflow * Bump action to latest major * readme: fix badge and typo * readme: update about section * Alpine Linux 3.17 Also update to PHP 8.1 and Nginx 1.22.1. GeoIP2 extension has been updated to 1.3.1 from a fork for compat with PHP 8.1. Created a fork of xmlrpc-c on GitHub to fix issues with SVN checkout from Sourceforge. * Set S6_KILL_GRACETIME to 10 seconds (#171) * Align xmlrpc-c version * ci: increase timeout * Update CHANGELOG * Configure xml-rpc correctly `xmlrpc-c` is not configured properly. It will cause a very significant performance regression, if the `wininet` and `libwww` clients are not disabled. We want `xmlrpc-c` to use `curl` because it's razor fast and stable. These changes require testing before being merged. I don't have time to test it. The change value is of high importance. * Install nginx and webdav module from Alpine repo * New year * Update CHANGELOG * Make rtorrent and libtorrent with -O2 -flto rTorrent, libTorrent and xmlrpc support link time optimizations. It's safe to do this. Make rTorrent and libTorrent with Level 2 optimizations. (default is no optimization) * Bump php version Needed to bump php7 to php81 to match the installed version, so rutorrent plugins can initiatlise properly. * Update CHANGELOG * Fix nginx logs folder perms * ruTorrent v4.0-stable * Update GeoIP2 ruTorrent plugin * Update CHANGELOG * ruTorrent V4.0.1-hotfix * Update CHANGELOG * feat(rutorrent): sets `$localHostedMode = true` (#215) * Update CHANGELOG * ruTorrent v4.0.2-hotfix Bumps ruTorrent version to 4.0.2-hotfix for additional stability improvements. * Set $cachedPluginLoading to false * Update CHANGELOG * Improve watch directory support Use inotify event instead of task schedule to check watch directory. https://man7.org/linux/man-pages/man7/inotify.7.html * Remove erase data workaround This workaround is no longer desirable, as discussed here: https://github.com/crazy-max/docker-rtorrent-rutorrent/pull/225#issuecomment-1500285041 closes #203 closes #225 * Fix RU_REMOVE_CORE_PLUGINS defaults Remove erasedata from defaults. Set to `false` to disable removal of core ruTorrent plugins. * ruTorrent v4.0.4 * RU_CACHED_PLUGIN_LOADING env var (default false) * Update CHANGELOG * Bump docker/bake-action from 2 to 3 Bumps [docker/bake-action](https://github.com/docker/bake-action) from 2 to 3. - [Release notes](https://github.com/docker/bake-action/releases) - [Commits](https://github.com/docker/bake-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/bake-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * ruTorrent: version 4.1.2 stable This commit bumps ruTorrent to version 4.1.2 stable. Critical bugs are resolved, which cause the web interface to fail to load. It is backwards compatible with other settings in version 4.0.4 stable. https://github.com/Novik/ruTorrent/releases/tag/v4.1.2 * ruTorrent: version 4.1.3 stable This commit fixes an issue with the RSS context menu not displaying when the `rssurlrewrite` plugin is enabled. https://github.com/Novik/ruTorrent/releases/tag/v4.1.3 * Update CHANGELOG * Install php81-dom for ruTorrent v4.1 The `php81-dom` extension is required for ruTorrent v4.1 to function properly. https://github.com/Novik/ruTorrent/issues/2500 `v4.1.3` throws an error when trying to update RSS Feeds. `v4.1.4` will be released next and fix this issue. However, it's still highly recommended to include this extension for optimization. See #236. It wasn't enough to just include `php81-xml`. Alpine puts the DOM module into a separate package. * ruTorrent: Upgrade to version 4.1.5 Fixes a bunch of bugs with RSS Feeds, torrent deletion and caching issues. Cache expiry removed in version 4.1.4. Deprecated options removed from configuration. * Curl: Add building optimizations Compile curl and c-ares with level 2 optimizations and link time optimizations. Pipe curl because it barely takes any memory. * Update CHANGELOG * chore: remove gitignore and dockerignore * rTorrent: Improve session saving This commit improves session saving support for rTorrent to prevent unnecessary loss of torrent files. It also increases the session saving interval from 20 minutes to 1 hour to reduce disk i/o usage with thousands of torrents. Session saving is a very intensive task and torrents fail to save into session by default when added. * Update CHANGELOG * ruTorrent: Upgrade to version 4.1.6 * ruTorrent: Upgrade to version 4.1.7 * chore: update labels * chore: cleanup labels config * chore: update github form templates * ci: missing concurrency check * test: use composite container-logs-check action * ci: use compose stack for testing * switch to compose v2 * Alpine Linux 3.18 * Dockerfile: fix src stages * Update CHANGELOG * ruTorrent v4.2.2 * Update CHANGELOG * ruTorrent v4.2.5 * Update CHANGELOG * rutorrent 4.2.6 Updating rutorrent to 4.2.6 * Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Bump crazy-max/ghaction-github-labeler from 4 to 5 Bumps [crazy-max/ghaction-github-labeler](https://github.com/crazy-max/ghaction-github-labeler) from 4 to 5. - [Release notes](https://github.com/crazy-max/ghaction-github-labeler/releases) - [Commits](https://github.com/crazy-max/ghaction-github-labeler/compare/v4...v5) --- updated-dependencies: - dependency-name: crazy-max/ghaction-github-labeler dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Bump docker/setup-qemu-action from 2 to 3 Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3. - [Release notes](https://github.com/docker/setup-qemu-action/releases) - [Commits](https://github.com/docker/setup-qemu-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/setup-qemu-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Bump docker/bake-action from 3 to 4 Bumps [docker/bake-action](https://github.com/docker/bake-action) from 3 to 4. - [Release notes](https://github.com/docker/bake-action/releases) - [Commits](https://github.com/docker/bake-action/compare/v3...v4) --- updated-dependencies: - dependency-name: docker/bake-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Bump docker/login-action from 2 to 3 Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/login-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Update README * Update CHANGELOG * Bump docker/setup-buildx-action from 2 to 3 Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Bump docker/metadata-action from 4 to 5 Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4 to 5. - [Release notes](https://github.com/docker/metadata-action/releases) - [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md) - [Commits](https://github.com/docker/metadata-action/compare/v4...v5) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Upgrade to ruTorrent v4.2.9 * Update CHANGELOG * rTorrent: Add stability patches This commit adds multiple stability patches to rtorrent. * Update CHANGELOG * fix version for tagging * rTorrent: Add tracker scrape feature Resolves a software stability issue on rTorrent with tens of thousands of trackers. Announces trackers by default at regular intervals instead of forcefully announcing everything at startup. * ci: distribute build across runners * ci: fix build * Improve c-ares & curl build process This commit improves the c-ares and curl build process to use cmake instead. This is a much better choice for docker container. We do not require the features GNU Make provides. CMake should also be more stable for testing pull requests on GitHub. It also upgrades the c-ares and curl version to receive the latest bug fixes and performance changes. There's been a huge leap forward since the older changes. Put simple, curl 8 is faster. * Update README * Update CHANGELOG * Build fixes & improvements - Compile everything with level 3 optimizations. - Disable warnings for the rtorrent software stack to prevent overflows and reduce overall ARM build time. - Fix critical issues with xml-rpc and libtorrent not applying the build flags. - Add build flags to mktorrent. - Fix configure params. Spaces are not allowed. - Drop c++ support for xmlrpc (not required) * Upgrade to Alpine 3.19 php 8.2 for ruTorrent v4.2.9. gcc 13.2 for the rTorrent packages * Update CHANGELOG * build(deps): bump docker/metadata-action from 4 to 5 Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4 to 5. - [Release notes](https://github.com/docker/metadata-action/releases) - [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md) - [Commits](https://github.com/docker/metadata-action/compare/v4...v5) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * rTorrent: Implement UDNS support This pull request implements the UDNS library into libtorrent for asynchronous DNS requests on UDP trackers. The current c-ares support is limited to TCP trackers. It resolves stability issues with the rTorrent software stack where it resolves UDP trackers synchronously by default. With a large number of torrents, the software will give out and fail to seed. It also caches the result of `sscanf` into vector object, to avoid calling it thousands of times on broken trackers. This prevents the software from crashing and increases performance. * Fix PHP version in rtlocal.rc * Update CHANGELOG * Update CHANGELOG.md * rTorrent: Resolve memory leaks This patch resolves critical memory leaks with the rTorrent software, that can cause an out of memory condition to happen. It has been tested for months and has demonstrated proven memory stability for rTorrent. * rTorrent: Resolve memory access crash rTorrent requires the usage of aligned memory access on all platforms (x86 and ARM) to prevent a memory access crash from happening. As such, we need to configure libtorrent with `--enable-aligned` to enable the feature. This is also more efficient for CPU usage at the cost of slightly more memory consumption. However, due to the relatively small usage of memory, all platforms will benefit. More information can be found here: https://github.com/rakshasa/libtorrent/issues/244 * ruTorrent v4.2.10 Signed-off-by: djerfy * rTorrent: Add TCP socket configurations By overriding the default rmem and wmem values for TCP sockets, we can greatly improve torrent throughput on rTorrent at a tiny cost to memory. The default values of 4M per socket are a significant step up from rTorrent defaults. The maximum values are raised on alpine, allowing the user to configure up to 64M if they desire. Environment variables are added to allow the user to control the values within the docker container. Documentation is updated explaining the environment variables and a recommendation for the next steps. * Add php82-fileinfo package Fixes uploading of custom PNG icons for trackers. * new year * ruTorrent v4.3.0 * update examples and test case * readme: fix markdown * Update CHANGELOG * Fix CHANGELOG * Update .rtlocal.rc file for changes fixes #336 * ruTorrent v4.3.0 fix We must add `$useInternalHybrid = true;` to the torrent creator configuration file for ruTorrent v4.3.0. * update README * Update CHANGELOG * ruTorrent v4.3.1-hotfix Signed-off-by: djerfy * ruTorrent: Do not permit core plugin removal of httprpc Users are receiving 404 errors during version upgrades. We need to disallow removing the httprpc plugin because it's required for ruTorrent v4.3+ operation. See #345. * Update CHANGELOG * Switch to rTorrent stickz project rTorrent stickz is a project maintained by a core collaborator of ruTorrent. https://github.com/stickz/rtorrent It includes significant performance and stability optimizations for the rTorrent software. It also ensures full compatibility with link time optimizations during the build process. It is a drop in replacement for rTorrent with all the core patches from this docker container included. It also improves the implementation of UDNS to make it more reliable. The rTorrent stickz project focuses on performance and stability of the torrent client. It is designed to be fully compatible with ruTorrent. Also, it does not seek to modify the torrent software in any way that may be undesirable for users. As a result, it is a perfect candidate for this docker container! * nginx: Disable listening for IPV6 fixes #348 There is no point in supporting IPV6 on this docker container. IPV4 is required anyways for rTorrent to function properly. If the user disables loading the IPV6 kernel module at boot time, the docker container will fail to initialize if nginx is listening for IPV6. * ruTorrent: Upgrade to v4.3.2 * Update CHANGELOG * rTorrent: Upgrade to version 3.1 closes #354 Please tag a next release after merging. * Update CHANGELOG * rTorrent: Upgrade to v3.2 # Version 3.2 hotfix - This hotfix resolves a critical issue with flushing invalid bencode to disk. - It also optimizes writing bencode to disk. Metadata is now only flushed when required. ## What's Changed * rTorrent: Fix & optimize write_bencode by @stickz in https://github.com/stickz/rtorrent/commit/970deaebe765e8f56bc342aa03e5c81c8d4c9c8f **Full Changelog**: https://github.com/stickz/rtorrent/compare/v3.1-0.9.8-0.13.8...v3.2-0.9.8-0.13.8 --------- Signed-off-by: dependabot[bot] Signed-off-by: djerfy Co-authored-by: CrazyMax Co-authored-by: CrazyMax Co-authored-by: stickz Co-authored-by: Aciel Co-authored-by: Jeremy Chabernaud Co-authored-by: blueberryapple <9259833+blueberryapple@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ac1dburn Co-authored-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> Co-authored-by: daschiller --- .dockerignore | 14 - .github/ISSUE_TEMPLATE/bug.yml | 53 ++-- .github/ISSUE_TEMPLATE/config.yml | 6 + .github/ISSUE_TEMPLATE/feature.yml | 15 ++ .github/dependabot.yml | 4 +- .github/labels.yml | 110 ++++---- .github/workflows/build.yml | 142 ++++++++-- .github/workflows/label-sponsor.yml | 18 -- .github/workflows/labels.yml | 14 +- .github/workflows/test.yml | 72 +++-- .gitignore | 3 - CHANGELOG.md | 138 +++++++++- Dockerfile | 252 +++++++----------- LICENSE | 2 +- README.md | 92 +++++-- .../{docker-compose.yml => compose.yml} | 14 +- examples/compose/rtorrent-rutorrent.env | 1 - examples/traefik/README.md | 4 +- .../{docker-compose.yml => compose.yml} | 17 +- examples/traefik/rtorrent-rutorrent.env | 1 - rootfs/etc/cont-init.d/02-fix-perms.sh | 8 +- rootfs/etc/cont-init.d/03-config.sh | 87 +++--- rootfs/etc/cont-init.d/04-create-services.sh | 2 +- rootfs/tpls/.rtorrent.rc | 5 +- rootfs/tpls/etc/nginx/conf.d/rpc.conf | 3 +- rootfs/tpls/etc/nginx/conf.d/rutorrent.conf | 5 +- rootfs/tpls/etc/nginx/conf.d/webdav.conf | 1 - rootfs/tpls/etc/nginx/nginx.conf | 5 +- .../etc/{php7 => php82}/conf.d/opcache.ini | 2 +- .../etc/{php7 => php82}/php-fpm.d/www.conf | 6 +- rootfs/tpls/etc/rtorrent/.rtlocal.rc | 15 +- test/.env | 5 + test/compose.yml | 60 +++++ test/rtorrent-rutorrent.env | 40 +++ 34 files changed, 781 insertions(+), 435 deletions(-) delete mode 100644 .dockerignore create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature.yml delete mode 100644 .github/workflows/label-sponsor.yml delete mode 100644 .gitignore rename examples/compose/{docker-compose.yml => compose.yml} (79%) rename examples/traefik/{docker-compose.yml => compose.yml} (89%) rename rootfs/tpls/etc/{php7 => php82}/conf.d/opcache.ini (86%) rename rootfs/tpls/etc/{php7 => php82}/php-fpm.d/www.conf (82%) create mode 100644 test/.env create mode 100644 test/compose.yml create mode 100644 test/rtorrent-rutorrent.env diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index cc7c1c63..00000000 --- a/.dockerignore +++ /dev/null @@ -1,14 +0,0 @@ -/.dev -/.idea -/*.iml - -/.git -/.github -/.res -/examples -/.editorconfig -/.gitattributes -/.gitignore -/CHANGELOG.md -/LICENSE -/README.md diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 311b5fb3..f519f99b 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -1,8 +1,11 @@ +# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema name: Bug Report description: Report a bug +labels: + - kind/bug + - status/triage body: - - type: checkboxes attributes: label: Support guidelines @@ -14,7 +17,8 @@ body: - type: checkboxes attributes: label: I've found a bug and checked that ... - description: Make sure that your request fulfills all of the following requirements. If one requirement cannot be satisfied, explain in detail why. + description: | + Make sure that your request fulfills all of the following requirements. If one requirement cannot be satisfied, explain in detail why. options: - label: ... the documentation does not mention anything about my problem - label: ... there are no open or closed issues that are related to my problem @@ -22,28 +26,32 @@ body: - type: textarea attributes: label: Description - description: Please provide a brief description of the bug in 1-2 sentences. + description: | + Please provide a brief description of the bug in 1-2 sentences. validations: required: true - type: textarea attributes: label: Expected behaviour - description: Please describe precisely what you'd expect to happen. + description: | + Please describe precisely what you'd expect to happen. validations: required: true - type: textarea attributes: label: Actual behaviour - description: Please describe precisely what is actually happening. + description: | + Please describe precisely what is actually happening. validations: required: true - type: textarea attributes: label: Steps to reproduce - description: Please describe the steps to reproduce the bug. + description: | + Please describe the steps to reproduce the bug. placeholder: | 1. ... 2. ... @@ -54,39 +62,30 @@ body: - type: textarea attributes: label: Docker info - description: Please provide the Docker system-wide information. - placeholder: Output of `docker info` command - render: yaml + description: | + Output of `docker info` command. + render: text validations: required: true - type: textarea attributes: - label: Version - description: Please provide FTPGrab, operating system version and system infirmation. - value: | - * Docker compose version (type `docker-compose --version`): - * System info (type `uname -a`): - validations: - required: true - - - type: textarea - attributes: - label: Docker compose - description: Please provide your compose config if applicable. - placeholder: Output of `docker-compose config` command + label: Docker Compose config + description: | + Output of `docker compose config` command. render: yaml - validations: - required: true - type: textarea attributes: - label: Container logs - description: Please provide the container logs (set `LOG_LEVEL=debug` if applicable). + label: Logs + description: | + Please provide the container logs (set `LOG_LEVEL=debug` if applicable). + render: text validations: required: true - type: textarea attributes: label: Additional info - description: Please provide any additional information that seem useful. + description: | + Please provide any additional information that seem useful. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..f9d88f5f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,6 @@ +# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser +blank_issues_enabled: true +contact_links: + - name: Questions and Discussions + url: https://github.com/crazy-max/docker-rtorrent-rutorrent/discussions/new + about: Use Github Discussions to ask questions and/or open discussion topics. diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml new file mode 100644 index 00000000..6ab75684 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -0,0 +1,15 @@ +# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema +name: Feature request +description: Missing functionality? Come tell us about it! +labels: + - kind/enhancement + - status/triage + +body: + - type: textarea + id: description + attributes: + label: Description + description: What is the feature you want to see? + validations: + required: true diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 556e0c1d..7ac65bb8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,5 +7,5 @@ updates: time: "08:00" timezone: "Europe/Paris" labels: - - ":game_die: dependencies" - - ":robot: bot" + - "kind/dependencies" + - "bot" diff --git a/.github/labels.yml b/.github/labels.yml index ac87246e..b5d2b8c0 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -1,85 +1,73 @@ ## more info https://github.com/crazy-max/ghaction-github-labeler -- # automerge - name: ":bell: automerge" - color: "8f4fbc" - description: "" -- # bot - name: ":robot: bot" +- + name: "bot" color: "69cde9" description: "" -- # bug - name: ":bug: bug" +- + name: "good first issue" + color: "7057ff" + description: "" +- + name: "help wanted" + color: "4caf50" + description: "" +- + name: "area/ci" + color: "ed9ca9" + description: "" +- + name: "area/dockerfile" + color: "03a9f4" + description: "" +- + name: "kind/bug" color: "b60205" description: "" -- # dependencies - name: ":game_die: dependencies" +- + name: "kind/dependencies" color: "0366d6" description: "" -- # documentation - name: ":memo: documentation" +- + name: "kind/docs" color: "c5def5" description: "" -- # duplicate - name: ":busts_in_silhouette: duplicate" +- + name: "kind/duplicate" color: "cccccc" description: "" -- # enhancement - name: ":sparkles: enhancement" +- + name: "kind/enhancement" color: "0054ca" description: "" -- # feature request - name: ":bulb: feature request" - color: "0e8a16" - description: "" -- # feedback - name: ":mega: feedback" - color: "03a9f4" - description: "" -- # future maybe - name: ":rocket: future maybe" - color: "fef2c0" +- + name: "kind/invalid" + color: "e6e6e6" description: "" -- # good first issue - name: ":hatching_chick: good first issue" - color: "7057ff" +- + name: "kind/upstream" + color: "fbca04" description: "" -- # help wanted - name: ":pray: help wanted" - color: "4caf50" +- + name: "kind/wontfix" + color: "ffffff" description: "" -- # invalid - name: ":no_entry_sign: invalid" - color: "e6e6e6" +- + name: "status/automerge" + color: "8f4fbc" description: "" -- # investigate - name: ":mag: investigate" +- + name: "status/needs-investigation" color: "e6625b" description: "" -- # needs more info - name: ":thinking: needs more info" +- + name: "status/needs-more-info" color: "795548" description: "" -- # pinned - name: ":pushpin: pinned" - color: "28008e" - description: "" -- # question - name: ":question: question" - color: "3f51b5" - description: "" -- # sponsor - name: ":sparkling_heart: sponsor" - color: "fedbf0" - description: "" -- # stale - name: ":skull: stale" +- + name: "status/stale" color: "237da0" description: "" -- # upstream - name: ":eyes: upstream" - color: "fbca04" - description: "" -- # wontfix - name: ":coffin: wontfix" - color: "ffffff" +- + name: "status/triage" + color: "dde4b7" description: "" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8b638c20..a06cce2c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: build concurrency: - group: build-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true on: @@ -15,8 +15,6 @@ on: paths-ignore: - '**.md' pull_request: - branches: - - 'master' paths-ignore: - '**.md' @@ -25,16 +23,46 @@ env: GHCR_SLUG: ghcr.io/crazy-max/rtorrent-rutorrent jobs: + prepare: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.platforms.outputs.matrix }} + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Create matrix + id: platforms + run: | + echo "matrix=$(docker buildx bake image-all --print | jq -cr '.target."image-all".platforms')" >>${GITHUB_OUTPUT} + - + name: Show matrix + run: | + echo ${{ steps.platforms.outputs.matrix }} + build: runs-on: ubuntu-latest + timeout-minutes: 480 + needs: + - prepare + strategy: + fail-fast: false + matrix: + platform: ${{ fromJson(needs.prepare.outputs.matrix) }} steps: + - + name: Prepare + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | ${{ env.DOCKERHUB_SLUG }} @@ -47,50 +75,116 @@ jobs: org.opencontainers.image.title=rTorrent and ruTorrent org.opencontainers.image.description=rTorrent and ruTorrent org.opencontainers.image.vendor=CrazyMax + - + name: Rename meta bake definition file + run: | + mv "${{ steps.meta.outputs.bake-file }}" "/tmp/bake-meta.json" + - + name: Upload meta bake definition + uses: actions/upload-artifact@v3 + with: + name: bake-meta + path: /tmp/bake-meta.json + if-no-files-found: error + retention-days: 1 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 + with: + buildkitd-flags: --debug - name: Login to DockerHub if: github.event_name != 'pull_request' - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Login to GHCR if: github.event_name != 'pull_request' - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build - uses: docker/bake-action@v2 + id: bake + uses: docker/bake-action@v4 with: files: | ./docker-bake.hcl - ${{ steps.meta.outputs.bake-file }} - targets: image-all - push: ${{ github.event_name != 'pull_request' }} + /tmp/bake-meta.json + targets: image set: | - *.cache-from=type=gha - *.cache-to=type=gha,mode=max + *.tags= + *.platform=${{ matrix.platform }} + *.cache-from=type=gha,scope=build-${{ env.PLATFORM_PAIR }} + *.cache-to=type=gha,scope=build-${{ env.PLATFORM_PAIR }},mode=max + *.output=type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }} - - name: Check manifest - if: github.event_name != 'pull_request' + name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ fromJSON(steps.bake.outputs.metadata).image['containerimage.digest'] }}" + touch "/tmp/digests/${digest#sha256:}" + - + name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + if: github.event_name != 'pull_request' + needs: + - build + steps: + - + name: Download meta bake definition + uses: actions/download-artifact@v3 + with: + name: bake-meta + path: /tmp + - + name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests + path: /tmp/digests + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - + name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Create manifest list and push + working-directory: /tmp/digests run: | - docker buildx imagetools inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }} - docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }} + docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${{ env.DOCKERHUB_SLUG }}")) | "-t " + .) | join(" ")' /tmp/bake-meta.json) \ + $(printf '${{ env.DOCKERHUB_SLUG }}@sha256:%s ' *) + docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${{ env.GHCR_SLUG }}")) | "-t " + .) | join(" ")' /tmp/bake-meta.json) \ + $(printf '${{ env.GHCR_SLUG }}@sha256:%s ' *) - name: Inspect image - if: github.event_name != 'pull_request' run: | - docker pull ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }} - docker image inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }} - docker pull ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }} - docker image inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }} + tag=$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json) + docker buildx imagetools inspect ${{ env.DOCKERHUB_SLUG }}:${tag} + docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:${tag} diff --git a/.github/workflows/label-sponsor.yml b/.github/workflows/label-sponsor.yml deleted file mode 100644 index 15194f00..00000000 --- a/.github/workflows/label-sponsor.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: label-sponsor - -on: - issues: - types: - - 'opened' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - - name: Set sponsor label - uses: JasonEtco/is-sponsor-label-action@024ac24f8b170abce078cad4ee748852369853c8 - with: - label: ":sparkling_heart: sponsor" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index f5b81637..1342d9e6 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -1,5 +1,9 @@ name: labels +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: @@ -7,6 +11,10 @@ on: paths: - '.github/labels.yml' - '.github/workflows/labels.yml' + pull_request: + paths: + - '.github/labels.yml' + - '.github/workflows/labels.yml' jobs: labeler: @@ -14,7 +22,9 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run Labeler - uses: crazy-max/ghaction-github-labeler@v3 + uses: crazy-max/ghaction-github-labeler@v5 + with: + dry-run: ${{ github.event_name == 'pull_request' }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd1e1309..da3a704c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,9 @@ name: test +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: @@ -7,70 +11,56 @@ on: paths-ignore: - '**.md' pull_request: - branches: - - 'master' paths-ignore: - '**.md' +env: + BUILD_TAG: rtorrent-rutorrent:test + CONTAINER_NAME: rtorrent-rutorrent + jobs: test: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 - - - name: Prepare - id: prep - run: | - echo ::set-output name=build_tag::test - echo ::set-output name=container_name::rtorrent-rutorrent - echo ::set-output name=running_timeout::120 - echo ::set-output name=running_log_check::ready to handle connections + uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Build - uses: docker/bake-action@v2 + uses: docker/bake-action@v4 with: targets: image-local set: | *.cache-from=type=gha env: - DEFAULT_TAG: ${{ steps.prep.outputs.build_tag }} + DEFAULT_TAG: ${{ env.BUILD_TAG }} - - name: Start container + name: Start run: | - docker rm -f ${{ steps.prep.outputs.container_name }} > /dev/null 2>&1 || true - docker run -d --name ${{ steps.prep.outputs.container_name }} ${{ steps.prep.outputs.build_tag }} + docker compose up -d + working-directory: test + env: + RTORRENT_RUTORRENT_IMAGE: ${{ env.BUILD_TAG }} + RTORRENT_RUTORRENT_CONTAINER: ${{ env.CONTAINER_NAME }} - - name: Test run - run: | - TIMEOUT=$((SECONDS + ${{ steps.prep.outputs.running_timeout }})) - while read LOGLINE; do - echo ${LOGLINE} - if [[ ${LOGLINE} == *"${{ steps.prep.outputs.running_log_check }}"* ]]; then - echo "🎉 Container up!" - break - fi - if [[ $SECONDS -gt ${TIMEOUT} ]]; then - >&2 echo "❌ Failed to run ${{ steps.prep.outputs.container_name }} container" - exit 1 - fi - done < <(docker logs -f ${{ steps.prep.outputs.container_name }} 2>&1) - - CONTAINER_STATUS=$(docker container inspect --format "{{.State.Status}}" ${{ steps.prep.outputs.container_name }}) - if [[ ${CONTAINER_STATUS} != "running" ]]; then - >&2 echo "❌ Container ${{ steps.prep.outputs.container_name }} returned status '$CONTAINER_STATUS'" - exit 1 - fi + name: Check container logs + uses: crazy-max/.github/.github/actions/container-logs-check@main + with: + container_name: ${{ env.CONTAINER_NAME }} + log_check: "ready to handle connections" + timeout: 120 - - name: Container logs + name: Logs if: always() run: | - docker logs ${{ steps.prep.outputs.container_name }} - docker rm -f ${{ steps.prep.outputs.container_name }} > /dev/null 2>&1 || true + docker compose logs + working-directory: test + env: + RTORRENT_RUTORRENT_IMAGE: ${{ env.BUILD_TAG }} + RTORRENT_RUTORRENT_CONTAINER: ${{ env.CONTAINER_NAME }} diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 7261aafb..00000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/.dev -/.idea -/*.iml diff --git a/CHANGELOG.md b/CHANGELOG.md index 53ac8232..231e01f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,133 @@ # Changelog +## 4.3.2-3.1-r0 (2024/06/01) + +* rTorrent v3.1 (#355) + +## 4.3.2-3.0-r0 (2024/05/27) + +* ruTorrent v4.3.2 (#344) +* Switch to [rTorrent stickz](https://github.com/stickz/rtorrent) repo (#347) +* Disable listening for IPv6 ofr nginx (#349) + +## 4.3.1-0.9.8_3-0.13.8_2-r0 (2024/05/17) + +* ruTorrent v4.3.1 (#344) +* Disallow ruTorrent `httprpc` core plugin removal (#346) + +## 4.3.0-0.9.8_3-0.13.8_2-r0 (2024/05/01) + +* Set `useInternalHybrid` ruTorrent setting to `true` (#341) +* Fix missing changes in `.rtlocal.rc` (#338) + +## 4.3.0-0.9.8_2-0.13.8_2-r0 (2024/04/27) + +* ruTorrent v4.3.0 (#327 #316) +* rTorrent: Add TCP socket configurations (#322) +* Add `php82-fileinfo` package (#325) +* rTorrent: Set of patches to fix memory leaks (#308) +* rTorrent: Fix memory access crash (#310) + +## 4.2.9-0.9.8_2-0.13.8_2-r0 (2023/12/27) + +* UDNS support (#303) +* Fix PHP version in rtlocal.rc (#305) + +## 4.2.9-0.9.8_2-0.13.8_1-r0 (2023/12/23) + +* rTorrent: tracker scrape feature patch (#288) +* Alpine Linux 3.19 and PHP 8.2 (#297) +* cURL 8.5.0, c-ares 1.24.0 (#295) + +## 4.2.9-0.9.8_1-0.13.8_1-r0 (2023/12/17) + +* rTorrent patches + * Avoid stack overflow for lockfile buffer + * Increase maximum SCGI request to 16MB + * Fix saving session files + * Fix a common rtorrent xml-rpc crash when trying to queue an invalid task + * Resolve xmlrpc logic crash +* libtorrent patches + * Allow 10 gigabit speed throttles + +## 4.2.9-0.9.8-0.13.8-r0 (2023/11/18) + +* ruTorrent v4.2.9 (#282) + +## 4.2.6-0.9.8-0.13.8-r0 (2023/09/24) + +* ruTorrent v4.2.6 (#266) + +## 4.2.5-0.9.8-0.13.8-r0 (2023/08/29) + +* ruTorrent v4.2.5 (#263) + +## 4.2.2-0.9.8-0.13.8-r0 (2023/08/13) + +* ruTorrent v4.2.2 (#260) + +## 4.1.7-0.9.8-0.13.8-r0 (2023/08/01) + +* ruTorrent v4.1.7 (#251 #248) +* Alpine Linux 3.18 (#258) + +## 4.1.5-0.9.8-0.13.8-r1 (2023/05/17) + +* Improve session saving in rTorrent (#242) + +## 4.1.5-0.9.8-0.13.8-r0 (2023/05/02) + +* ruTorrent v4.1.5 (#238) +* Optimize cURL build (#239) +* Add `php81-dom` extension (#237) + +## 4.1.3-0.9.8-0.13.8-r0 (2023/04/27) + +* ruTorrent v4.1.3 (#235) + +## 4.0.4-0.9.8-0.13.8-r0 (2023/04/10) + +* ruTorrent v4.0.4 (#231) +* Fix `RU_REMOVE_CORE_PLUGINS` defaults (#230) +* Remove erase data workaround (#229) +* Improve watch directory support (#219) + +## 4.0.2-0.9.8-0.13.8-r0 (2023/02/21) + +* ruTorrent v4.0.2-hotfix (#218) + +## 4.0.1-0.9.8-0.13.8-r1 (2023/02/05) + +* Set `$localHostedMode = true` (#215) + +## 4.0.1-0.9.8-0.13.8-r0 (2023/01/29) + +* ruTorrent v4.0.1-hotfix (#214) + +## 4.0-0.9.8-0.13.8-r0 (2023/01/11) + +* ruTorrent v4.0-stable (#208) +* Update GeoIP2 ruTorrent plugin (#211) +* Fix nginx logs folder perms (#207) + +## 3.10-0.9.8-0.13.8-r23 (2023/01/07) + +* Fix PHP version in `.rtlocal.rc` (#204) +* Make rtorrent and libtorrent with `-O2 -flto` (#202) + +## 3.10-0.9.8-0.13.8-r22 (2023/01/02) + +* Install nginx and webdav module from Alpine repo (#200) +* Fix xmlrpc-c build configuration (#198) + +## 3.10-0.9.8-0.13.8-r21 (2022/12/31) + +* Set `S6_KILL_GRACETIME` to 10 seconds (#171) +* Alpine Linux 3.17 (#195) +* PHP 8.1 (#195) +* GeoIP2 PHP extension 1.3.1 (#195) +* Nginx 1.22.1 (#195) + ## 3.10-0.9.8-0.13.8-r20 (2022/05/02) * Fix unrar not available since alpine 3.15 (#161) @@ -161,7 +289,7 @@ * Switch to GitHub Actions * Stop publishing Docker image on Quay -* Move boostrap (default) config for rTorrent to `/etc/rtorrent/.rtlocal.rc` +* Move bootstrap (default) config for rTorrent to `/etc/rtorrent/.rtlocal.rc` * Run as non-root user * Prevent exposing nginx version * Set timezone through tzdata @@ -169,10 +297,10 @@ > :warning: **UPGRADE NOTES** > As the Docker container now runs as a non-root user, you have to first stop the container and change permissions to volumes: > ``` -> docker-compose stop +> docker compose stop > chown -R 1000:1000 data/ passwd/ -> docker-compose pull -> docker-compose up -d +> docker compose pull +> docker compose up -d > ``` ## 3.9-0.9.8-0.13.8-RC3 (2019/09/04) @@ -237,7 +365,7 @@ * Add ruTorrent 3.8 web client * Add option to remove core plugins of ruTorrent (default `erasedata,httprpc`) -* Add a boostrap (default) config for rTorrent in `/etc/.rtlocal.rc` +* Add a bootstrap (default) config for rTorrent in `/etc/.rtlocal.rc` * Move `/var/rtorrent` to `/data/rtorrent` * Use Nginx WebDAV module instead of Apache * Compile Nginx from source for better performance diff --git a/Dockerfile b/Dockerfile index ee930264..1607d6a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,101 +1,75 @@ # syntax=docker/dockerfile:1 -ARG ALPINE_S6_TAG=3.15-2.2.0.3 - ARG LIBSIG_VERSION=3.0.3 -ARG CARES_VERSION=1.17.2 -ARG CURL_VERSION=7.78.0 +ARG CARES_VERSION=1.24.0 +ARG CURL_VERSION=8.5.0 ARG XMLRPC_VERSION=01.58.00 -ARG LIBTORRENT_VERSION=v0.13.8 -ARG RTORRENT_VERSION=v0.9.8 ARG MKTORRENT_VERSION=v1.1 +ARG GEOIP2_PHPEXT_VERSION=1.3.1 + +# v4.3.2 +ARG RUTORRENT_VERSION=201ef857f1863df6b5463c31fa27434915116717 +ARG GEOIP2_RUTORRENT_VERSION=4ff2bde530bb8eef13af84e4413cedea97eda148 -ARG NGINX_VERSION=1.21.1 -ARG NGINX_DAV_VERSION=v3.0.0 -ARG NGINX_UID=102 -ARG NGINX_GID=102 -ARG GEOIP2_PHPEXT_VERSION=1.1.1 +# v3.2-0.9.8-0.13.8 +ARG RTORRENT_STICKZ_VERSION=970deaebe765e8f56bc342aa03e5c81c8d4c9c8f -# 3.10 -ARG RUTORRENT_VERSION=954479ffd00eb58ad14f9a667b3b9b1e108e80a2 -ARG GEOIP2_RUTORRENT_VERSION=9f7b59e29bc472eec8c3943d7646bf9462577b16 +ARG ALPINE_VERSION=3.19 +ARG ALPINE_S6_VERSION=${ALPINE_VERSION}-2.2.0.3 -FROM --platform=$BUILDPLATFORM alpine AS src -RUN apk --update --no-cache add curl git subversion tar tree xz +FROM --platform=${BUILDPLATFORM} alpine:${ALPINE_VERSION} AS src +RUN apk --update --no-cache add curl git tar tree xz WORKDIR /src FROM src AS src-libsig ARG LIBSIG_VERSION -RUN curl -sSL "http://ftp.gnome.org/pub/GNOME/sources/libsigc++/3.0/libsigc++-${LIBSIG_VERSION}.tar.xz" | tar xJv --strip 1 +RUN curl -sSL "https://download.gnome.org/sources/libsigc%2B%2B/3.0/libsigc%2B%2B-${LIBSIG_VERSION}.tar.xz" | tar xJv --strip 1 FROM src AS src-cares ARG CARES_VERSION -RUN curl -sSL "https://c-ares.haxx.se/download/c-ares-${CARES_VERSION}.tar.gz" | tar xz --strip 1 +RUN curl -sSL "https://c-ares.org/download/c-ares-${CARES_VERSION}.tar.gz" | tar xz --strip 1 FROM src AS src-xmlrpc +RUN git init . && git remote add origin "https://github.com/crazy-max/xmlrpc-c.git" ARG XMLRPC_VERSION -RUN svn checkout "http://svn.code.sf.net/p/xmlrpc-c/code/release_number/${XMLRPC_VERSION}/" . +RUN git fetch origin "${XMLRPC_VERSION}" && git checkout -q FETCH_HEAD FROM src AS src-curl ARG CURL_VERSION -RUN curl -sSL "https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.gz" | tar xz --strip 1 - -FROM src AS src-libtorrent -ARG LIBTORRENT_VERSION -RUN <> /etc/sysctl.conf \ + && echo "net.core.wmem_max = 67108864" >> /etc/sysctl.conf \ + && sysctl -p + # unrar package is not available since alpine 3.15 RUN echo "@314 http://dl-cdn.alpinelinux.org/alpine/v3.14/main" >> /etc/apk/repositories \ && apk --update --no-cache add unrar@314 -ARG NGINX_UID -ARG NGINX_GID RUN apk --update --no-cache add \ apache2-utils \ bash \ @@ -271,6 +198,7 @@ RUN apk --update --no-cache add \ brotli \ ca-certificates \ coreutils \ + cppunit-dev \ dhclient \ ffmpeg \ findutils \ @@ -280,39 +208,37 @@ RUN apk --update --no-cache add \ libstdc++ \ mediainfo \ ncurses \ + nginx \ + nginx-mod-http-dav-ext \ + nginx-mod-http-geoip2 \ openssl \ - pcre \ - php7 \ - php7-bcmath \ - php7-cli \ - php7-ctype \ - php7-curl \ - php7-fpm \ - php7-json \ - php7-mbstring \ - php7-openssl \ - php7-phar \ - php7-posix \ - php7-session \ - php7-sockets \ - php7-xml \ - php7-zip \ - php7-zlib \ + php82 \ + php82-bcmath \ + php82-ctype \ + php82-curl \ + php82-dom \ + php82-fileinfo \ + php82-fpm \ + php82-mbstring \ + php82-openssl \ + php82-phar \ + php82-posix \ + php82-session \ + php82-sockets \ + php82-xml \ + php82-zip \ python3 \ py3-pip \ shadow \ sox \ tar \ tzdata \ + udns \ unzip \ util-linux \ zip \ - zlib \ - && ln -s /usr/lib/nginx/modules /etc/nginx/modules \ - && addgroup -g ${NGINX_UID} -S nginx \ - && adduser -S -D -H -u ${NGINX_GID} -h /var/cache/nginx -s /sbin/nologin -G nginx -g nginx nginx \ - && pip3 install --upgrade pip \ - && pip3 install cfscrape cloudscraper \ + && pip3 install --upgrade --break-system-packages pip \ + && pip3 install --break-system-packages cfscrape cloudscraper \ && addgroup -g ${PGID} rtorrent \ && adduser -D -H -u ${PUID} -G rtorrent -s /bin/sh rtorrent \ && curl --version \ diff --git a/LICENSE b/LICENSE index 96730a05..92c78af4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2022 CrazyMax +Copyright (c) 2018-2024 CrazyMax Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index caf628a0..ce46fca4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

Latest Version - Build Status + Build Status Docker Stars Docker Pulls
Become a sponsor @@ -11,10 +11,12 @@ ## About -[rTorrent](https://github.com/rakshasa/rtorrent) and [ruTorrent](https://github.com/Novik/ruTorrent) Docker image based on Alpine Linux.
-If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other Docker images! +[rTorrent](https://github.com/rakshasa/rtorrent) with [ruTorrent](https://github.com/Novik/ruTorrent) +Docker image. -💡 Want to be notified of new releases? Check out 🔔 [Diun (Docker Image Update Notifier)](https://github.com/crazy-max/diun) project! +> [!TIP] +> Want to be notified of new releases? Check out 🔔 [Diun (Docker Image Update Notifier)](https://github.com/crazy-max/diun) +> project! ___ @@ -34,11 +36,14 @@ ___ * [XMLRPC through nginx](#xmlrpc-through-nginx) * [WebDAV](#webdav) * [Populate .htpasswd files](#populate-htpasswd-files) - * [Boostrap config `.rtlocal.rc`](#boostrap-config-rtlocalrc) + * [Bootstrap config `.rtlocal.rc`](#bootstrap-config-rtlocalrc) * [Override or add a ruTorrent plugin/theme](#override-or-add-a-rutorrent-plugintheme) * [Edit a ruTorrent plugin configuration](#edit-a-rutorrent-plugin-configuration) * [Increase Docker timeout to allow rTorrent to shutdown gracefully](#increase-docker-timeout-to-allow-rtorrent-to-shutdown-gracefully) * [WAN IP address](#wan-ip-address) + * [Configure rTorrent session saving](#configure-rtorrent-session-saving) + * [Configure rTorrent tracker scrape](#rtorrent-tracker-scrape-patch) + * [Configure rTorrent send receive buffers](#rtorrent-send-receive-buffers) * [Upgrade](#upgrade) * [Contributing](#contributing) * [License](#license) @@ -47,9 +52,11 @@ ___ * Run as non-root user * Multi-platform image -* Latest [rTorrent](https://github.com/rakshasa/rtorrent) / [libTorrent](https://github.com/rakshasa/libtorrent) release compiled from source +* Latest rTorrent and libTorrent from [rTorrent stickz](https://github.com/stickz/rtorrent) project. + * Includes significant performance and stability improvements. + * Includes compatibility with Link Time Optimizations. * Latest [ruTorrent](https://github.com/Novik/ruTorrent) release -* Name resolving enhancements with [c-ares](https://github.com/rakshasa/rtorrent/wiki/Performance-Tuning#rtrorrent-with-c-ares) for asynchronous DNS requests (including name resolves) +* Domain name resolving enhancements with [c-ares](https://github.com/rakshasa/rtorrent/wiki/Performance-Tuning#rtrorrent-with-c-ares) and [UDNS](https://www.corpit.ru/mjt/udns.html) for asynchronous DNS requests * Enhanced [rTorrent config](rootfs/tpls/.rtorrent.rc) and bootstraping with a [local config](rootfs/tpls/etc/rtorrent/.rtlocal.rc) * XMLRPC through nginx over SCGI socket (basic auth optional) * WebDAV on completed downloads (basic auth optional) @@ -128,12 +135,16 @@ Image: crazymax/rtorrent-rutorrent:latest * `RT_LOG_LEVEL`: rTorrent log level (default `info`) * `RT_LOG_EXECUTE`: Log executed commands to `/data/rtorrent/log/execute.log` (default `false`) * `RT_LOG_XMLRPC`: Log XMLRPC queries to `/data/rtorrent/log/xmlrpc.log` (default `false`) +* `RT_SESSION_SAVE_SECONDS`: Seconds between writing torrent information to disk (default `3600`) +* `RT_TRACKER_DELAY_SCRAPE`: Delay tracker announces at startup (default `true`) * `RT_DHT_PORT`: DHT UDP port (`dht.port.set`, default `6881`) * `RT_INC_PORT`: Incoming connections (`network.port_range.set`, default `50000`) +* `RT_SEND_BUFFER_SIZE`: Sets default tcp wmem value (`network.send_buffer.size.set`, default `4M`) +* `RT_RECEIVE_BUFFER_SIZE`: Sets default tcp rmem value (`network.receive_buffer.size.set`, default `4M`) ### ruTorrent -* `RU_REMOVE_CORE_PLUGINS`: Remove ruTorrent core plugins ; comma separated (default `erasedata,httprpc`) +* `RU_REMOVE_CORE_PLUGINS`: Comma separated list of core plugins to remove ; set to `false` to disable removal * `RU_HTTP_USER_AGENT`: ruTorrent HTTP user agent (default `Mozilla/5.0 (Windows NT 6.0; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0`) * `RU_HTTP_TIME_OUT`: ruTorrent HTTP timeout in seconds (default `30`) * `RU_HTTP_USE_GZIP`: Use HTTP Gzip compression (default `true`) @@ -145,6 +156,7 @@ Image: crazymax/rtorrent-rutorrent:latest * `RU_SCHEDULE_RAND`: Rand for schedulers start, +0..X seconds (default `10`) * `RU_LOG_FILE`: ruTorrent log file path for errors messages (default `/data/rutorrent/rutorrent.log`) * `RU_DO_DIAGNOSTIC`: ruTorrent diagnostics like permission checking (default `true`) +* `RU_CACHED_PLUGIN_LOADING`: Set to `true` to enable rapid cached loading of ruTorrent plugins (default `false`) * `RU_SAVE_UPLOADED_TORRENTS`: Save torrents files added wia ruTorrent in `/data/rutorrent/share/torrents` (default `true`) * `RU_OVERWRITE_UPLOADED_TORRENTS`: Existing .torrent files will be overwritten (default `false`) * `RU_FORBID_USER_SETTINGS`: If true, allows for single user style configuration, even with webauth (default `false`) @@ -182,8 +194,8 @@ following command: ```shell mkdir data downloads passwd chown ${PUID}:${PGID} data downloads passwd -docker-compose up -d -docker-compose logs -f +docker compose up -d +docker compose logs -f ``` ### Command line @@ -239,7 +251,7 @@ Htpasswd files used: * `rutorrent.htpasswd`: ruTorrent basic auth * `webdav.htpasswd`: WebDAV on completed downloads -### Boostrap config `.rtlocal.rc` +### Bootstrap config `.rtlocal.rc` When rTorrent is started the bootstrap config [/etc/rtorrent/.rtlocal.rc](rootfs/tpls/etc/rtorrent/.rtlocal.rc) is imported. This configuration cannot be changed unless you rebuild the image @@ -307,7 +319,7 @@ closed forcefully and the lockfile isn't removed. This stale lockfile will prevent rTorrent from restarting until the lockfile is removed manually. The timeout period can be extended by either adding the parameter `-t XX` to -the docker command or `stop_grace_period: XXs` in docker-compose.yml, where +the docker command or `stop_grace_period: XXs` in `compose.yml`, where `XX` is the number of seconds to wait for a graceful shutdown. ### WAN IP address @@ -325,20 +337,66 @@ resolve your public IP address. Here are some commands you can use: * `curl -s ifconfig.me` * `curl -s ident.me` +### Configure rTorrent session saving + +`RT_SESSION_SAVE_SECONDS` is the seconds between writing torrent information to +disk. The default is 3600 seconds which equals 1 hour. rTorrent has a bad +default of 20 minutes. Twenty minutes is bad for the lifespan of SSDs and +greatly reduces torrent throughput. + +It is no longer possible to lose torrents added through ruTorrent on this +docker container. Only torrent statistics are lost during a crash. (Ratio, +Total Uploaded & Downloaded etc.) + +Higher values will reduce disk usage, at the cost of minor stat loss during a +crash. Consider increasing to 10800 seconds (3 hours) if running thousands of +torrents. + +### rTorrent tracker scrape patch + +`RT_TRACKER_DELAY_SCRAPE` specifies whether to delay tracker announces at +rTorrent startup. The default value is `true`. There are two main benefits to +keeping this feature enabled: + +1) Software Stability: rTorrent will not crash or time-out with tens of thousands of trackers. +2) Immediate Access: ruTorrent can be accessed immediately after rTorrent is started. + +### rTorrent send receive buffers + +Overriding the default TCP rmem and wmem values for rTorrent improves torrent +throughput. + +* `RT_SEND_BUFFER_SIZE`: Sets default tcp wmem value for the socket. +* `RT_RECEIVE_BUFFER_SIZE`: Sets default tcp rmem value for the socket. + +Recommended values: +* `2GB of less system memory`: Reduce to 1M send and 1M receive regardless of speed. +* `4GB to 16GB of system memory`: Keep at default values of 4M send and 4M receive. +* `16GB to 32GB of system memory`: Increase to 8M send for 500Mbps speeds. +* `32GB to 64GB of system memory`: Increase to 16M send for 1G speeds. +* `64GB to 128GB of system memory`: Increase to 32M send for 2.5G speeds. +* `128GB to 256GB of system memory`: Increase to 64M send for 10G speeds. + +Memory is better spent elsewhere except under limited circumstances for high +memory and speed conditions. The default values should not be increased, unless +both the memory and speed requirements are met. These values of system memory +are also recommended based on the port speed for rTorrent to reduce disk usage. + ## Upgrade To upgrade, pull the newer image and launch the container: ```shell -docker-compose pull -docker-compose up -d +docker compose pull +docker compose up -d ``` ## Contributing -Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You -can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) or by making -a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely! +Want to contribute? Awesome! The most basic way to show your support is to star +the project, or to raise issues. You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) +or by making a [PayPal donation](https://www.paypal.me/crazyws) to ensure this +journey continues indefinitely! Thanks again for your support, it is much appreciated! :pray: diff --git a/examples/compose/docker-compose.yml b/examples/compose/compose.yml similarity index 79% rename from examples/compose/docker-compose.yml rename to examples/compose/compose.yml index b3ba3365..cbd7f804 100644 --- a/examples/compose/docker-compose.yml +++ b/examples/compose/compose.yml @@ -1,8 +1,11 @@ -version: "3.2" +name: rtorrent-rutorrent services: geoip-updater: image: crazymax/geoip-updater:latest + container_name: geoip-updater + networks: + - rtorrent-rutorrent volumes: - "./data/geoip:/data" env_file: @@ -11,6 +14,9 @@ services: rtorrent-rutorrent: image: crazymax/rtorrent-rutorrent:latest + container_name: rtorrent-rutorrent + networks: + - rtorrent-rutorrent expose: - "${RT_DHT_PORT}/udp" - "${XMLRPC_PORT}" @@ -46,9 +52,15 @@ services: rtorrent-logs: image: bash + container_name: rtorrent-rutorrent-logs command: bash -c 'tail -f /log/*.log' + network_mode: none depends_on: - rtorrent-rutorrent volumes: - "./data/rtorrent/log:/log" restart: always + +networks: + rtorrent-rutorrent: + name: rtorrent-rutorrent diff --git a/examples/compose/rtorrent-rutorrent.env b/examples/compose/rtorrent-rutorrent.env index 10bd14f1..13eaee25 100644 --- a/examples/compose/rtorrent-rutorrent.env +++ b/examples/compose/rtorrent-rutorrent.env @@ -22,7 +22,6 @@ RT_LOG_LEVEL=info RT_LOG_EXECUTE=false RT_LOG_XMLRPC=false -RU_REMOVE_CORE_PLUGINS=erasedata,httprpc RU_HTTP_USER_AGENT=Mozilla/5.0 (Windows NT 6.0; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0 RU_HTTP_TIME_OUT=30 RU_HTTP_USE_GZIP=true diff --git a/examples/traefik/README.md b/examples/traefik/README.md index 7036102e..fbdb89a1 100644 --- a/examples/traefik/README.md +++ b/examples/traefik/README.md @@ -5,6 +5,6 @@ mkdir data passwd chown ${PUID}:${PGID} data passwd touch acme.json chmod 600 acme.json -docker-compose up -d -docker-compose logs -f +docker compose up -d +docker compose logs -f ``` diff --git a/examples/traefik/docker-compose.yml b/examples/traefik/compose.yml similarity index 89% rename from examples/traefik/docker-compose.yml rename to examples/traefik/compose.yml index 6638a81d..ff060d9e 100644 --- a/examples/traefik/docker-compose.yml +++ b/examples/traefik/compose.yml @@ -1,8 +1,9 @@ -version: "3.2" +name: rtorrent-rutorrent services: traefik: image: traefik:2.5 + container_name: traefik command: - "--global.checknewversion=false" - "--global.sendanonymoususage=false" @@ -22,6 +23,8 @@ services: - "--providers.docker" - "--providers.docker.watch=true" - "--providers.docker.exposedbydefault=false" + networks: + - rtorrent-rutorrent ports: - target: 80 published: 80 @@ -36,6 +39,9 @@ services: geoip-updater: image: crazymax/geoip-updater:latest + container_name: geoip-updater + networks: + - rtorrent-rutorrent volumes: - "./data/geoip:/data" env_file: @@ -44,6 +50,9 @@ services: rtorrent-rutorrent: image: crazymax/rtorrent-rutorrent:latest + container_name: rtorrent-rutorrent + networks: + - rtorrent-rutorrent expose: - "${RT_DHT_PORT}/udp" - "${XMLRPC_PORT}" @@ -89,9 +98,15 @@ services: rtorrent-logs: image: bash + container_name: rtorrent-rutorrent-logs command: bash -c 'tail -f /log/*.log' + network_mode: none depends_on: - rtorrent-rutorrent volumes: - "./data/rtorrent/log:/log" restart: always + +networks: + rtorrent-rutorrent: + name: rtorrent-rutorrent diff --git a/examples/traefik/rtorrent-rutorrent.env b/examples/traefik/rtorrent-rutorrent.env index 0ecd5953..154e958c 100644 --- a/examples/traefik/rtorrent-rutorrent.env +++ b/examples/traefik/rtorrent-rutorrent.env @@ -22,7 +22,6 @@ RT_LOG_LEVEL=info RT_LOG_EXECUTE=false RT_LOG_XMLRPC=false -RU_REMOVE_CORE_PLUGINS=erasedata,httprpc RU_HTTP_USER_AGENT=Mozilla/5.0 (Windows NT 6.0; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0 RU_HTTP_TIME_OUT=30 RU_HTTP_USE_GZIP=true diff --git a/rootfs/etc/cont-init.d/02-fix-perms.sh b/rootfs/etc/cont-init.d/02-fix-perms.sh index d51ec13c..38346129 100644 --- a/rootfs/etc/cont-init.d/02-fix-perms.sh +++ b/rootfs/etc/cont-init.d/02-fix-perms.sh @@ -10,21 +10,23 @@ mkdir -p /data/rtorrent \ /etc/rtorrent \ /var/cache/nginx \ /var/lib/nginx \ + /var/log/nginx \ /var/run/nginx \ /var/run/php-fpm \ /var/run/rtorrent -chown rtorrent. \ +chown rtorrent:rtorrent \ /data \ /data/rtorrent \ /data/rutorrent \ /downloads -chown -R rtorrent. \ +chown -R rtorrent:rtorrent \ /etc/rtorrent \ /passwd \ /tpls \ /var/cache/nginx \ /var/lib/nginx \ - /var/log/php7 \ + /var/log/nginx \ + /var/log/php82 \ /var/run/nginx \ /var/run/php-fpm \ /var/run/rtorrent diff --git a/rootfs/etc/cont-init.d/03-config.sh b/rootfs/etc/cont-init.d/03-config.sh index c0523c12..c6558d64 100644 --- a/rootfs/etc/cont-init.d/03-config.sh +++ b/rootfs/etc/cont-init.d/03-config.sh @@ -24,7 +24,12 @@ WEBDAV_AUTHBASIC_STRING=${WEBDAV_AUTHBASIC_STRING:-WebDAV restricted access} RT_LOG_LEVEL=${RT_LOG_LEVEL:-info} RT_LOG_EXECUTE=${RT_LOG_EXECUTE:-false} RT_LOG_XMLRPC=${RT_LOG_XMLRPC:-false} +RT_SESSION_SAVE_SECONDS=${RT_SESSION_SAVE_SECONDS:-3600} +RT_TRACKER_DELAY_SCRAPE=${RT_TRACKER_DELAY_SCRAPE:-true} +RT_SEND_BUFFER_SIZE=${RT_SEND_BUFFER_SIZE:-4M} +RT_RECEIVE_BUFFER_SIZE=${RT_RECEIVE_BUFFER_SIZE:-4M} +RU_REMOVE_CORE_PLUGINS=${RU_REMOVE_CORE_PLUGINS:-false} RU_HTTP_USER_AGENT=${RU_HTTP_USER_AGENT:-Mozilla/5.0 (Windows NT 6.0; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0} RU_HTTP_TIME_OUT=${RU_HTTP_TIME_OUT:-30} RU_HTTP_USE_GZIP=${RU_HTTP_USE_GZIP:-true} @@ -36,6 +41,7 @@ RU_PHP_GZIP_LEVEL=${RU_PHP_GZIP_LEVEL:-2} RU_SCHEDULE_RAND=${RU_SCHEDULE_RAND:-10} RU_LOG_FILE=${RU_LOG_FILE:-/data/rutorrent/rutorrent.log} RU_DO_DIAGNOSTIC=${RU_DO_DIAGNOSTIC:-true} +RU_CACHED_PLUGIN_LOADING=${RU_CACHED_PLUGIN_LOADING:-false} RU_SAVE_UPLOADED_TORRENTS=${RU_SAVE_UPLOADED_TORRENTS:-true} RU_OVERWRITE_UPLOADED_TORRENTS=${RU_OVERWRITE_UPLOADED_TORRENTS:-false} RU_FORBID_USER_SETTINGS=${RU_FORBID_USER_SETTINGS:-false} @@ -69,17 +75,17 @@ echo "Setting PHP-FPM configuration..." sed -e "s/@MEMORY_LIMIT@/$MEMORY_LIMIT/g" \ -e "s/@UPLOAD_MAX_SIZE@/$UPLOAD_MAX_SIZE/g" \ -e "s/@CLEAR_ENV@/$CLEAR_ENV/g" \ - /tpls/etc/php7/php-fpm.d/www.conf > /etc/php7/php-fpm.d/www.conf + /tpls/etc/php82/php-fpm.d/www.conf > /etc/php82/php-fpm.d/www.conf echo "Setting PHP INI configuration..." -sed -i "s|memory_limit.*|memory_limit = ${MEMORY_LIMIT}|g" /etc/php7/php.ini -sed -i "s|;date\.timezone.*|date\.timezone = ${TZ}|g" /etc/php7/php.ini -sed -i "s|max_file_uploads.*|max_file_uploads = ${MAX_FILE_UPLOADS}|g" /etc/php7/php.ini +sed -i "s|memory_limit.*|memory_limit = ${MEMORY_LIMIT}|g" /etc/php82/php.ini +sed -i "s|;date\.timezone.*|date\.timezone = ${TZ}|g" /etc/php82/php.ini +sed -i "s|max_file_uploads.*|max_file_uploads = ${MAX_FILE_UPLOADS}|g" /etc/php82/php.ini # OpCache echo "Setting OpCache configuration..." sed -e "s/@OPCACHE_MEM_SIZE@/$OPCACHE_MEM_SIZE/g" \ - /tpls/etc/php7/conf.d/opcache.ini > /etc/php7/conf.d/opcache.ini + /tpls/etc/php82/conf.d/opcache.ini > /etc/php82/conf.d/opcache.ini # Nginx echo "Setting Nginx configuration..." @@ -176,6 +182,10 @@ sed -e "s!@RT_LOG_LEVEL@!$RT_LOG_LEVEL!g" \ -e "s!@RT_DHT_PORT@!$RT_DHT_PORT!g" \ -e "s!@RT_INC_PORT@!$RT_INC_PORT!g" \ -e "s!@XMLRPC_SIZE_LIMIT@!$XMLRPC_SIZE_LIMIT!g" \ + -e "s!@RT_SESSION_SAVE_SECONDS@!$RT_SESSION_SAVE_SECONDS!g" \ + -e "s!@RT_TRACKER_DELAY_SCRAPE@!$RT_TRACKER_DELAY_SCRAPE!g" \ + -e "s!@RT_SEND_BUFFER_SIZE@!$RT_SEND_BUFFER_SIZE!g" \ + -e "s!@RT_RECEIVE_BUFFER_SIZE@!$RT_RECEIVE_BUFFER_SIZE!g" \ /tpls/etc/rtorrent/.rtlocal.rc > /etc/rtorrent/.rtlocal.rc if [ "${RT_LOG_EXECUTE}" = "true" ]; then echo " Enabling rTorrent execute log..." @@ -192,26 +202,26 @@ if [ ! -f /data/rtorrent/.rtorrent.rc ]; then echo " Creating default configuration..." cp /tpls/.rtorrent.rc /data/rtorrent/.rtorrent.rc fi -chown rtorrent. /data/rtorrent/.rtorrent.rc +chown rtorrent:rtorrent /data/rtorrent/.rtorrent.rc # ruTorrent config echo "Bootstrapping ruTorrent configuration..." cat > /var/www/rutorrent/conf/config.php < /var/www/rutorrent/conf/config.php < /var/www/rutorrent/conf/config.php < '', @@ -262,8 +280,11 @@ cat > /var/www/rutorrent/conf/config.php < /etc/services.d/php-fpm/run <