diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index ecc859e8..7e8134e3 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -43,7 +43,7 @@ repos:
- id: pyupgrade
args: [--py3-plus]
- repo: https://github.com/psf/black
- rev: 24.3.0
+ rev: 24.4.0
hooks:
- id: black
language_version: python3
diff --git a/CHANGELOG b/CHANGELOG
index 51a3afdd..8b14a0fc 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,12 +1,8 @@
# New Updates
-- Added docs to qbit-manage repo (under docs folder)
-- Bi-directional wiki sync
-- Automatically update supported version to README
-- Pre-commit hooks to update readme version
-- Dependabot to automatically update qbittorrent-api on master
+- Updated Dockerfile to use alpine image
# Bug Fixes
-- fixes [#522](https://github.com/StuffAnThings/qbit_manage/issues/522)
+- Patches security vulnerabilities by using alpine python base image
+- Beter error handling of invalid `remote_dir` in config
-Special thanks to @bakerboy448 for their contributions!
-**Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v4.1.0...v4.1.1
+**Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v4.1.1...v4.1.2
diff --git a/Dockerfile b/Dockerfile
index 1c6afc94..8a0ec774 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM python:3.11-slim-buster
+FROM python:3.11-alpine
ARG BRANCH_NAME=master
ENV BRANCH_NAME ${BRANCH_NAME}
ENV TINI_VERSION v0.19.0
@@ -8,22 +8,14 @@ COPY requirements.txt /
# install packages
RUN echo "**** install system packages ****" \
- && apt-get update \
- && apt-get upgrade -y --no-install-recommends \
- && apt-get install -y tzdata --no-install-recommends \
- && apt-get install -y gcc g++ libxml2-dev libxslt-dev libz-dev bash curl wget jq grep sed coreutils findutils unzip p7zip ca-certificates \
- && wget -O /tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-"$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
- && chmod +x /tini \
+ && apk update \
+ && apk upgrade \
+ && apk add --no-cache tzdata gcc g++ libxml2-dev libxslt-dev zlib-dev bash curl wget jq grep sed coreutils findutils unzip p7zip ca-certificates tini\
&& pip3 install --no-cache-dir --upgrade --requirement /requirements.txt \
- && apt-get --purge autoremove gcc g++ libxml2-dev libxslt-dev libz-dev -y \
- && apt-get clean \
- && apt-get update \
- && apt-get check \
- && apt-get -f install \
- && apt-get autoclean \
- && rm -rf /requirements.txt /tmp/* /var/tmp/* /var/lib/apt/lists/*
+ && apk del gcc g++ libxml2-dev libxslt-dev zlib-dev \
+ && rm -rf /requirements.txt /tmp/* /var/tmp/* /var/cache/apk/*
COPY . /app
WORKDIR /app
VOLUME /config
-ENTRYPOINT ["/tini", "-s", "python3", "qbit_manage.py", "--"]
+ENTRYPOINT ["/sbin/tini", "-s", "python3", "qbit_manage.py"]
diff --git a/VERSION b/VERSION
index 627a3f43..4d0dcda0 100755
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.1.1
+4.1.2
diff --git a/docs/Config-Setup.md b/docs/Config-Setup.md
index 88da97de..72754726 100644
--- a/docs/Config-Setup.md
+++ b/docs/Config-Setup.md
@@ -162,7 +162,7 @@ Control how torrent share limits are set depending on the priority of your group
| `cleanup` | **WARNING!!** Setting this as true will remove and delete contents of any torrents that satisfies the share limits **(max time OR max ratio)** It will also delete the torrent's data if and only if no other torrents are using the same folder/files. | False | bool |
❌ |
| `max_ratio` | Will set the torrent Maximum share ratio until torrent is stopped from seeding/uploading and may be cleaned up / removed if the minimums have been met. (`-2` : Global Limit , `-1` : No Limit) | -1 | float | ❌ |
| `max_seeding_time` | Will set the torrent Maximum seeding time (minutes) until torrent is stopped from seeding/uploading and may be cleaned up / removed if the minimums have been met. (`-2` : Global Limit , `-1` : No Limit) | -1 | int | ❌ |
-| `min_seeding_time` | Will prevent torrent deletion by cleanup variable if torrent has not yet met minimum seeding time (minutes) even if maximum seeding ratio is met. If the torrent has not yet reached this minimum seeding time, it will change the share limits back to no limits and resume the torrent to continue seeding. Mandatory that `max_seeding_time` is greater than or equal to `min_seeding_time`. If you are not setting a `max_ratio`, then use `max_seeding_time` instead. Mandatory that `max_ratio` is configured and greater than 0. | 0 | int | ❌ |
+| `min_seeding_time` | Will prevent torrent deletion by the cleanup variable if the torrent has reached the `max_ratio` limit you have set. If the torrent has not yet reached this minimum seeding time, it will change the share limits back to no limits and resume the torrent to continue seeding. **MANDATORY: Must use also `max_ratio` with a value greater than `0` (default: `-1`) for this to work.** If you use both `min_seed_time` and `max_seed_time`, then you must set the value of `max_seed_time` to a number greater than `min_seed_time`. | 0 | int | ❌ |
| `last_active` |Will prevent torrent deletion by cleanup variable if torrent has been active within the last x minutes. If the torrent has been active within the last x minutes, it will change the share limits back to no limits and resume the torrent to continue seeding. | 0 | int | ❌ |
| `limit_upload_speed` | Will limit the upload speed KiB/s (KiloBytes/second) (`-1` : No Limit) | -1 | int | ❌ |
| `enable_group_upload_speed` | Upload speed limits are applied at the group level. This will take `limit_upload_speed` defined and divide it equally among the number of torrents in the group. | False | bool | ❌ |
diff --git a/docs/Docker-Installation.md b/docs/Docker-Installation.md
index aa6d22ae..44027216 100644
--- a/docs/Docker-Installation.md
+++ b/docs/Docker-Installation.md
@@ -1,8 +1,8 @@
# Docker Installation
-A simple Dockerfile is available in this repo if you'd like to build it yourself. The official build is also available from dockerhub [here](https://hub.docker.com/r/bobokun/qbit_manage):
-
-`docker run -it -v :/config:rw bobokun/qbit_manage`
+A simple Dockerfile is available in this repo if you'd like to build it yourself.
+The official build on github is available [here](https://ghcr.io/StuffAnThings/qbit_manage):
+`docker run -it -v :/config:rw ghcr.io/stuffanthings/qbit_manage:latest`
* The -v :/config:rw mounts the location you choose as a persistent volume to store your files.
* Change to a folder where your config.yml and other files are.
@@ -52,7 +52,7 @@ version: "3.7"
services:
qbit_manage:
container_name: qbit_manage
- image: bobokun/qbit_manage
+ image: ghcr.io/stuffanthings/qbit_manage:latest
volumes:
- /mnt/user/appdata/qbit_manage/:/config:rw
- /mnt/user/data/torrents/:/data/torrents:rw
diff --git a/docs/Unraid-Installation.md b/docs/Unraid-Installation.md
index e91c537a..a9ab2011 100644
--- a/docs/Unraid-Installation.md
+++ b/docs/Unraid-Installation.md
@@ -20,7 +20,6 @@ Thankfully, getting qbit_manager working on unRAID is a fairly simple task. unRA
6. Hit Apply, and allow unRAID to download the docker container.
7. Navigate to the Docker tab in unRAID, and stop the qbit_manage container if it has auto-started.
8. Create the [config.yml](https://github.com/StuffAnThings/qbit_manage/blob/master/config/config.yml.sample) file as-per the [config-setup documentation](https://github.com/StuffAnThings/qbit_manage/wiki/Config-Setup) and place in the Appdata folder (`/mnt/user/appdata/qbit_manage/` in the example) **Remember to remove the .sample from the filename**
- 1. `remote_dir`: is not required and can be commented out with `#`
9. Once finished, run the container. Voila! Logs are located in `/mnt/user/appdata/qbit_manage/logs`.
# Unraid Installation - Localhost (Alternative)
diff --git a/modules/config.py b/modules/config.py
index 95e7aaa8..d983be0f 100755
--- a/modules/config.py
+++ b/modules/config.py
@@ -578,6 +578,8 @@ def _sort_share_limits(share_limits):
self.remote_dir = self.util.check_for_attribute(
self.data, "remote_dir", parent="directory", var_type="path", default=self.root_dir
)
+ if not self.remote_dir:
+ self.remote_dir = self.root_dir
if self.commands["cross_seed"]:
self.cross_seed_dir = self.util.check_for_attribute(self.data, "cross_seed", parent="directory", var_type="path")
else:
diff --git a/tox.ini b/tox.ini
index 25fd74c8..135a0aa2 100755
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py39,py310,py311,pre-commit
+envlist = py39,py310,py311,py312,pre-commit
skip_missing_interpreters = true
tox_pip_extensions_ext_pip_custom_platform = true
tox_pip_extensions_ext_venv_update = true