Compare commits

...

4 Commits

Author SHA1 Message Date
Flaminel
b9376e02fa fixed size data type 2024-11-12 08:59:10 +02:00
Flaminel
2d5c59ddba changed release workflow to use universal-workflows 2024-11-11 15:27:16 +02:00
Flaminel
11864617de updated readme 2024-11-11 11:01:32 +02:00
Flaminel
d5bff76a62 added custom assembly name 2024-11-11 10:37:17 +02:00
4 changed files with 28 additions and 84 deletions

View File

@@ -1,78 +1,13 @@
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version number'
required: true
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies
run: dotnet restore code/Executable/Executable.csproj
- name: Build win-x64
run: dotnet publish code/Executable/Executable.csproj -c Release --runtime win-x64 --self-contained -o artifacts/cleanuperr-win /p:PublishSingleFile=true /p:AssemblyVersion=${{ github.event.inputs.version }}
- name: Build linux-x64
run: dotnet publish code/Executable/Executable.csproj -c Release --runtime linux-x64 --self-contained -o artifacts/cleanuperr-linux /p:PublishSingleFile=true /p:AssemblyVersion=${{ github.event.inputs.version }}
- name: Build osx-x64
run: dotnet publish code/Executable/Executable.csproj -c Release --runtime osx-x64 --self-contained -o artifacts/cleanuperr-osx /p:PublishSingleFile=true /p:AssemblyVersion=${{ github.event.inputs.version }}
- name: Zip the Win release
run: zip ./artifacts/cleanuperr-win.zip ./artifacts/cleanuperr-win/cleanuperr.exe ./artifacts/cleanuperr-win/appsettings.json
- name: Zip the Linux release
run: zip ./artifacts/cleanuperr-linux.zip ./artifacts/cleanuperr-linux/cleanuperr ./artifacts/cleanuperr-win/appsettings.json
- name: Zip the OSX release
run: zip ./artifacts/cleanuperr-osx.zip ./artifacts/cleanuperr-osx/cleanuperr ./artifacts/cleanuperr-win/appsettings.json
- name: Release
id: create_release
uses: actions/create-release@v1.1.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
draft: false
- name: Upload cleanuperr-win
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/cleanuperr-win.zip
asset_name: cleanuperr-win.zip
asset_content_type: application/exe
- name: Upload cleanuperr-linux
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/cleanuperr-linux.zip
asset_name: cleanuperr-linux.zip
asset_content_type: application/exe
- name: Upload cleanuperr-osx
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/cleanuperr-osx.zip
asset_name: cleanuperr-osx.zip
asset_content_type: application/exe
release:
uses: flmorg/universal-workflows/.github/workflows/dotnet.release.yml@main
with:
githubContext: ${{ toJSON(github) }}
secrets: inherit

View File

@@ -1,7 +1,16 @@
# cleanuperr
## How it works
1. Add excluded file names to prevent malicious files from being downloaded by qBittorrent.
2. cleanuperr goes through all items in Sonarr's queue every at every 5th minute.
3. For each queue item, a call is made to qBittorrent to get the stats of the torrent.
4. If a torrent is found to be marked as completed, but with 0 downloaded bytes, cleanuperr calls Sonarr to add that torrent to the blocklist.
5. If any malicious torrents have been found, cleanuperr calls Sonarr to automatically search again.
## Usage
### Docker
```
docker run \
-e QuartzConfig__BlockedTorrentTrigger="0 0/10 * * * ?" \
@@ -16,7 +25,7 @@ docker run \
flaminel/cleanuperr:latest
```
## Environment variables
### Environment variables
| Variable | Required | Description | Default value |
|---|---|---|---|
@@ -38,16 +47,15 @@ SonarrConfig__Instances__<NUMBER>__ApiKey
where `<NUMBER>` starts from 0.
## How it works
1. Add excluded file names to prevent malicious files from being downloaded by qBittorrent.
2. cleanuperr goes through all items in Sonarr's queue every at every 5th minute.
3. For each queue item, a call is made to qBittorrent to get the stats of the torrent.
4. If a torrent is found to be marked as completed, but with 0 downloaded bytes, cleanuperr calls Sonarr to add that torrent to the blocklist.
5. If any malicious torrents have been found, cleanuperr calls Sonarr to automatically search again.
#
### Binaries
1. Download the binaries from [releases](https://github.com/flmorg/cleanuperr/releases).
2. Extract them from the zip file.
3. Edit **appsettings.json**. The paths from this json file correspond with the docker env vars, as described [above](/README.md#environment-variables).
## Extensions to block in qBittorrent
<details>
<summary>Extensions to block</summary>
<summary>Extensions</summary>
<pre><code>*.apk
*.bat
*.bin

View File

@@ -7,9 +7,9 @@ public record Record(
IReadOnlyList<Language> Languages,
IReadOnlyList<CustomFormat> CustomFormats,
int CustomFormatScore,
int Size,
long Size,
string Title,
int Sizeleft,
long Sizeleft,
string Timeleft,
DateTime EstimatedCompletionTime,
DateTime Added,

View File

@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">
<PropertyGroup>
<AssemblyName>cleanuperr</AssemblyName>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>