Skip to content

Commit

Permalink
4.1.2 (#536)
Browse files Browse the repository at this point in the history
* 4.1.2-develop1

* update docs to use ghcr.io instead

* chore(docs): Sync wiki to docs [skip-cd]

* chore(docs): Sync wiki to docs [skip-cd]

* update dockerfile to use alpine image

* fix dockerfile image

* minor fixes

* bump tox to support python3.12

* additional error checking for empty string in remote_dir

* chore(docs): Sync wiki to docs [skip-cd]

* [pre-commit.ci] pre-commit autoupdate (#534)

updates:
- [github.com/psf/black: 24.3.0 → 24.4.0](psf/black@24.3.0...24.4.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* 4.1.2

---------

Co-authored-by: Actionbot <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Apr 20, 2024
1 parent 0a6c5b8 commit 4651857
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 4 additions & 8 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
22 changes: 7 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"]
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.1
4.1.2
2 changes: 1 addition & 1 deletion docs/Config-Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | <center>❌</center> |
| `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 | <center>❌</center> |
| `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 | <center>❌</center> |
| `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 | <center>❌</center> |
| `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 | <center>❌</center> |
| `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 | <center>❌</center> |
| `limit_upload_speed` | Will limit the upload speed KiB/s (KiloBytes/second) (`-1` : No Limit) | -1 | int | <center>❌</center> |
| `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 | <center>❌</center> |
Expand Down
8 changes: 4 additions & 4 deletions docs/Docker-Installation.md
Original file line number Diff line number Diff line change
@@ -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): <br>

`docker run -it -v <PATH_TO_CONFIG>:/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): <br>
`docker run -it -v <PATH_TO_CONFIG>:/config:rw ghcr.io/stuffanthings/qbit_manage:latest`

* The -v <PATH_TO_CONFIG>:/config:rw mounts the location you choose as a persistent volume to store your files.
* Change <PATH_TO_CONFIG> to a folder where your config.yml and other files are.
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion docs/Unraid-Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions modules/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 4651857

Please sign in to comment.