diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..71ca37d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.json] +indent_size = 2 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b2ccc79 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,74 @@ +FROM alpine:3.20.2 AS base + +FROM base AS builder + +# renovate: datasource=github-tags depName=transmission packageName=transmission/transmission +ENV TRANSMISSION_VERSION=4.0.5 + +# Install base utilities and dependencies to build transmission +RUN set -ex && \ + apk add --no-cache --upgrade \ + git \ + python3 \ + build-base \ + cmake \ + curl-dev \ + gettext-dev \ + openssl-dev \ + linux-headers \ + samurai + +# Get transmission source code from GitHub using the specified tag +RUN git clone \ + --branch ${TRANSMISSION_VERSION} \ + --depth 1 \ + --recurse-submodules \ + https://github.com/transmission/transmission.git \ + /usr/src/transmission + +WORKDIR /usr/src/transmission + +# Build transmission +RUN cmake \ + -S . \ + -B obj \ + -G Ninja \ + -D CMAKE_BUILD_TYPE=Release \ + -D ENABLE_CLI=OFF \ + -D ENABLE_DAEMON=ON \ + -D ENABLE_GTK=OFF \ + -D ENABLE_MAC=OFF \ + -D ENABLE_QT=OFF \ + -D ENABLE_TESTS=OFF \ + -D ENABLE_UTILS=OFF \ + -D ENABLE_UTP=ON \ + -D ENABLE_WERROR=OFF \ + -D ENABLE_DEPRECATED=OFF \ + -D ENABLE_NLS=ON \ + -D INSTALL_WEB=ON \ + -D REBUILD_WEB=OFF \ + -D INSTALL_DOC=OFF \ + -D INSTALL_LIB=OFF \ + -D RUN_CLANG_TIDY=OFF \ + -D WITH_INOTIFY=ON \ + -D WITH_CRYPTO="openssl" \ + -D WITH_SYSTEMD=OFF \ + && cmake --build obj --config Release \ + && cmake --build obj --config Release --target install/strip + +FROM base AS runtime + +RUN set -ex && \ + apk update && \ + apk add --no-cache --upgrade libcurl libintl libgcc libstdc++ + +COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local/share /usr/local/share + +EXPOSE 9091/tcp 51413/tcp 51413/udp + +VOLUME [ "/root/config", "/root/Downloads" ] + +STOPSIGNAL SIGTERM + +ENTRYPOINT ["/usr/local/bin/transmission-daemon", "--foreground", "--config-dir", "/root/config"] diff --git a/README.md b/README.md index 3787824..2c988c3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ # transmission-daemon -A Docker image for the Transmission Daemon \ No newline at end of file +A Docker image for the Transmission Daemon. + +## Manually build + +```sh +docker build . +``` diff --git a/settings.json b/settings.json new file mode 100644 index 0000000..a118a86 --- /dev/null +++ b/settings.json @@ -0,0 +1,80 @@ +{ + "alt-speed-down": 100, + "alt-speed-enabled": false, + "alt-speed-time-begin": 540, + "alt-speed-time-day": 127, + "alt-speed-time-enabled": false, + "alt-speed-time-end": 1020, + "alt-speed-up": 100, + "announce-ip": "", + "announce-ip-enabled": false, + "anti-brute-force-enabled": false, + "anti-brute-force-threshold": 100, + "bind-address-ipv4": "0.0.0.0", + "bind-address-ipv6": "::", + "blocklist-enabled": false, + "blocklist-url": "http://www.example.com/blocklist", + "cache-size-mb": 4, + "default-trackers": "", + "dht-enabled": true, + "download-dir": "/root/Downloads", + "download-queue-enabled": true, + "download-queue-size": 5, + "encryption": 1, + "idle-seeding-limit": 30, + "idle-seeding-limit-enabled": false, + "incomplete-dir": "/root/Downloads", + "incomplete-dir-enabled": false, + "lpd-enabled": true, + "message-level": 2, + "peer-congestion-algorithm": "", + "peer-id-ttl-hours": 6, + "peer-limit-global": 200, + "peer-limit-per-torrent": 50, + "peer-port": 51413, + "peer-port-random-high": 65535, + "peer-port-random-low": 49152, + "peer-port-random-on-start": false, + "peer-socket-tos": "default", + "pex-enabled": true, + "port-forwarding-enabled": true, + "preallocation": 1, + "prefetch-enabled": true, + "queue-stalled-enabled": true, + "queue-stalled-minutes": 30, + "ratio-limit": 2, + "ratio-limit-enabled": true, + "rename-partial-files": true, + "rpc-authentication-required": false, + "rpc-bind-address": "0.0.0.0", + "rpc-enabled": true, + "rpc-host-whitelist": "", + "rpc-host-whitelist-enabled": false, + "rpc-password": "", + "rpc-port": 9091, + "rpc-socket-mode": "0750", + "rpc-url": "/transmission/", + "rpc-username": "tdkim", + "rpc-whitelist": "127.0.0.1,::1", + "rpc-whitelist-enabled": false, + "scrape-paused-torrents-enabled": true, + "script-torrent-added-enabled": false, + "script-torrent-added-filename": "", + "script-torrent-done-enabled": false, + "script-torrent-done-filename": "", + "script-torrent-done-seeding-enabled": false, + "script-torrent-done-seeding-filename": "", + "seed-queue-enabled": false, + "seed-queue-size": 10, + "speed-limit-down": 100, + "speed-limit-down-enabled": false, + "speed-limit-up": 100, + "speed-limit-up-enabled": false, + "start-added-torrents": true, + "tcp-enabled": true, + "torrent-added-verify-mode": "fast", + "trash-original-torrent-files": false, + "umask": 0, + "upload-slots-per-torrent": 14, + "utp-enabled": true +}