diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index d8239fe..60584df 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -37,5 +37,5 @@ ENTRYPOINT [ "/usr/local/share/docker-init.sh" ] CMD [ "sleep", "infinity" ] # [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends \ No newline at end of file +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install --no-install-recommends make \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9761bb..b51eb3b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,18 @@ jobs: env: ALPINE_PKG_URL: https://pkgs.alpinelinux.org/package/edge/testing/x86_64/qbittorrent-nox + build: + runs-on: ubuntu-latest + needs: check + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Build + run: make build + meta: runs-on: ubuntu-latest needs: check diff --git a/.gitignore b/.gitignore index 830f56e..7edf369 100644 --- a/.gitignore +++ b/.gitignore @@ -73,3 +73,4 @@ $RECYCLE.BIN/ *.lnk # End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6feec68 --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +CMD = /usr/bin/docker +IMAGE = mogeko/qbittorrent +VERSION = 4.3.8-r0 +PORT = 8080 +CONF_DIR = $(shell pwd)/example/config +DL_DIR = $(shell pwd)/example/data + +.PHONY: all build run help + +all: build run + +build: + @$(CMD) build . \ + --build-arg VERSION=$(VERSION) \ + --tag $(IMAGE) + +run: id := $(shell head -200 /dev/urandom | cksum | cut -f1 -d " ") +run: + @-$(CMD) run -it \ + --name qbt-$(id) \ + -p 6881:6881 \ + -p 6881:6881/udp \ + -p $(PORT):8080 \ + -v $(CONF_DIR):/config \ + -v $(DL_DIR):/downloads \ + $(IMAGE) + @$(CMD) rm -f qbt-$(id) + +help: id := $(shell head -200 /dev/urandom | cksum | cut -f1 -d " ") +help: + @-$(CMD) run -it --name qbt-$(id) $(IMAGE) --help + @$(CMD) rm -f qbt-$(id) + +rm: clean diff --git a/README.md b/README.md index 2382513..4ba8001 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # docker-qbittorrent -[![ci_icon]][ci_link] +[![ci_icon]][ci_link] [![image_size]][docker_link] Docker image for qBittorrent. @@ -90,6 +90,8 @@ The code in this project is released under the [GPL-3.0 License][license]. [ci_icon]: https://github.com/mogeko/docker-qbittorrent/actions/workflows/auto-update.yml/badge.svg [ci_link]: https://github.com/mogeko/docker-qbittorrent/actions/workflows/auto-update.yml +[image_size]: https://img.shields.io/docker/image-size/mogeko/qbittorrent?logo=docker +[docker_link]: https://hub.docker.com/r/mogeko/qbittorrent diff --git a/example/config/qBittorrent-data.conf b/example/config/qBittorrent-data.conf new file mode 100644 index 0000000..b0af648 --- /dev/null +++ b/example/config/qBittorrent-data.conf @@ -0,0 +1,2 @@ +[Stats] +AllStats=@Variant(\0\0\0\x1c\0\0\0\x2\0\0\0\x12\0\x41\0l\0l\0t\0i\0m\0\x65\0\x44\0L\0\0\0\x5\0\0\0\0\0\0\x1a\xb0\0\0\0\x12\0\x41\0l\0l\0t\0i\0m\0\x65\0U\0L\0\0\0\x5\0\0\0\0\0\0&\xb8) diff --git a/example/config/qBittorrent.conf b/example/config/qBittorrent.conf new file mode 100644 index 0000000..16b1133 --- /dev/null +++ b/example/config/qBittorrent.conf @@ -0,0 +1,61 @@ +[AutoRun] +enabled=false +program= + +[Core] +AutoDeleteAddedTorrentFile=Never + +[LegalNotice] +Accepted=true + +[Network] +Cookies=@Invalid() + +[Preferences] +Advanced\RecheckOnCompletion=false +Advanced\trackerPort=9000 +Connection\PortRangeMin=6881 +Connection\ResolvePeerCountries=true +Connection\UPnP=false +Downloads\SavePath=/downloads/ +Downloads\TempPath=/downloads/incomplete/ +DynDNS\DomainName=changeme.dyndns.org +DynDNS\Enabled=false +DynDNS\Password= +DynDNS\Service=0 +DynDNS\Username= +General\Locale=zh +MailNotification\email= +MailNotification\enabled=false +MailNotification\password= +MailNotification\req_auth=true +MailNotification\req_ssl=false +MailNotification\sender=qBittorrent_notification@example.com +MailNotification\smtp_server=smtp.changeme.com +MailNotification\username= +Queueing\QueueingEnabled=true +WebUI\Address=* +WebUI\AlternativeUIEnabled=false +WebUI\AuthSubnetWhitelistEnabled=false +WebUI\BanDuration=3600 +WebUI\CSRFProtection=true +WebUI\ClickjackingProtection=true +WebUI\CustomHTTPHeaders= +WebUI\CustomHTTPHeadersEnabled=false +WebUI\HTTPS\CertificatePath= +WebUI\HTTPS\Enabled=false +WebUI\HTTPS\KeyPath= +WebUI\HostHeaderValidation=true +WebUI\LocalHostAuth=true +WebUI\MaxAuthenticationFailCount=5 +WebUI\Port=8080 +WebUI\RootFolder= +WebUI\SecureCookie=true +WebUI\ServerDomains=* +WebUI\SessionTimeout=3600 +WebUI\UseUPnP=true +WebUI\Username=admin + +[RSS] +AutoDownloader\DownloadRepacks=true +AutoDownloader\SmartEpisodeFilter=s(\\d+)e(\\d+), (\\d+)x(\\d+), "(\\d{4}[.\\-]\\d{1,2}[.\\-]\\d{1,2})", "(\\d{1,2}[.\\-]\\d{1,2}[.\\-]\\d{4})" diff --git a/example/config/rss/feeds.json b/example/config/rss/feeds.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/example/config/rss/feeds.json @@ -0,0 +1,2 @@ +{ +} diff --git a/example/config/watched_folders.json b/example/config/watched_folders.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/example/config/watched_folders.json @@ -0,0 +1,2 @@ +{ +} diff --git a/example/data/.gitkeep b/example/data/.gitkeep new file mode 100644 index 0000000..e69de29