Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
782b636
feat(config): Add `trusted_proxies` support to config
ChampionBuffalo1 Nov 24, 2026
00c8936
feat(http): Allow multi value `X-Forwarded-For` & `trusted_proxies` s…
ChampionBuffalo1 Nov 24, 2026
b13e16a
Add dev container support
ChampionBuffalo1 Nov 24, 2026
ce7316f
Publish GHCR Images
ChampionBuffalo1 Nov 24, 2026
04ba4b4
ci(docker): Build and publish the image for linux/amd64 and linux/arm64
ChampionBuffalo1 Nov 24, 2026
9646d94
ci: Drop the test jobs and keep only Linux amd64 and arm64 builds
ChampionBuffalo1 Nov 24, 2026
b8bbfe1
ci: Drop the macOS and Windows jobs from release and install
ChampionBuffalo1 Nov 24, 2026
07a5465
web: Show continue watching as a grid on small screens
ChampionBuffalo1 Nov 24, 2026
3e288d7
web: Let continue watching items be removed
ChampionBuffalo1 Nov 24, 2026
a126141
chore: Formatting changes
ChampionBuffalo1 Nov 24, 2026
0f364a6
Merge pull request #1 from ChampionBuffalo1/feat/web-changes
ChampionBuffalo1 Nov 24, 2026
df783f1
web: Show a pointer on the continue watching remove button
ChampionBuffalo1 Nov 24, 2026
f729f26
fix: Delete a watched rows in `/api/dismiss` handler
ChampionBuffalo1 Nov 24, 2026
30414b7
web: Remove continue watching items with the existing forget API
ChampionBuffalo1 Nov 24, 2026
8288bda
Merge branch 'feat/web-changes'
ChampionBuffalo1 Nov 24, 2026
9fadacb
feat: Configure the web app's name and favicon in config.yaml
ChampionBuffalo1 Nov 24, 2026
c56900a
chore: Drop comments that restate the branding code
ChampionBuffalo1 Nov 24, 2026
8db10a5
Merge pull request #2 from ChampionBuffalo1/feat/branding
ChampionBuffalo1 Nov 24, 2026
1145cc4
feat: Show a configurable icon beside the brand name
ChampionBuffalo1 Nov 25, 2026
0adb6d2
fix: Add memory limit & Makefile
ChampionBuffalo1 Nov 25, 2026
b3b6999
feat: Add an incognito mode that keeps nothing in the watch history
ChampionBuffalo1 Nov 25, 2026
3374435
revert: Build libtorrent in Release for dev builds
ChampionBuffalo1 Nov 25, 2026
33d9e81
Merge pull request #3 from ChampionBuffalo1/feat/incog
ChampionBuffalo1 Nov 25, 2026
e3276e0
fix(search): .torrent links that redirect to a magnet link now download
ChampionBuffalo1 Nov 29, 2026
4e5eb4a
feat(engine): torrent_port sets a fixed listen port for peers
ChampionBuffalo1 Nov 29, 2026
9a331f5
Merge pull request #4 from ChampionBuffalo1/fix/magnet-ports
ChampionBuffalo1 Nov 29, 2026
245e449
Merge branch 'nexxeln:main' into main
ChampionBuffalo1 Nov 29, 2026
9d06b3f
feat(search): rank by live tracker counts and doubt inflated indexer …
ChampionBuffalo1 Nov 29, 2026
fd6f709
feat(engine): live counts fall back to the DHT when trackers do not a…
ChampionBuffalo1 Nov 29, 2026
2905571
feat(titles): a play starts with the first of its top sources whose f…
ChampionBuffalo1 Nov 29, 2026
5843cee
feat(config): torrent settings move under torrent, with file_list_wait
ChampionBuffalo1 Nov 29, 2026
5e2b0e8
feat(config): sources.live_checks sets how many results are counted live
ChampionBuffalo1 Nov 29, 2026
920fabd
feat(sources): live seed counts read as live, and each count names it…
ChampionBuffalo1 Nov 29, 2026
e31d58c
feat(search): archive.org items that are not the film rank last and s…
ChampionBuffalo1 Nov 29, 2026
05f5c51
feat(config): sources.archive_org sets where uploads of films not in …
ChampionBuffalo1 Nov 29, 2026
4ab85f6
feat(sources): a play skips archive.org items that are likely not the…
ChampionBuffalo1 Nov 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# A development container with what `nix develop` gives: CMake, Ninja, Boost, static OpenSSL,
# a C++ compiler, Rust, and bun.
FROM mcr.microsoft.com/devcontainers/base:trixie

# Debian's libssl-dev ships libssl.a and libcrypto.a, which crates/engine/build.rs links. Debian
# builds libcrypto with zlib and zstd compression, so RUSTFLAGS below links those as well.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential cmake ninja-build pkg-config libboost-dev libssl-dev zlib1g-dev libzstd-dev unzip \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s "/usr/lib/$(gcc -dumpmachine)" /usr/lib/openssl-multiarch

USER vscode

# Rust, stable, as in CI.
RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --component rustfmt,clippy
# The bun version CI uses.
ARG BUN_VERSION=1.4.2
RUN curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}"

ENV PATH="/home/vscode/.cargo/bin:/home/vscode/.bun/bin:${PATH}" \
BOOST_ROOT=/usr \
OPENSSL_INCLUDE_DIR=/usr/include \
OPENSSL_LIB_DIR=/usr/lib/openssl-multiarch \
RUSTFLAGS="-C link-arg=-lz -C link-arg=-lzstd" \
LANG=C.UTF-8
29 changes: 29 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "torrential",
// Host networking: works around Docker's bridge network failing on this machine until a reboot
// into the updated kernel. Remove both lines after rebooting.
"build": { "dockerfile": "Dockerfile", "options": ["--network=host"] },
// Caps the container so a heavy build fails inside it rather than freezing the host. Swap equal
// to memory means the container gets no swap.
"runArgs": ["--network=host", "--memory=8g", "--memory-swap=8g", "--cpus=10"],
// VS Code's extra build that matches the user's UID to the host's ignores the options above, so
// it fails the same way. The image's user is already UID 1000, the usual host UID.
"updateRemoteUserUID": false,
"remoteUser": "vscode",
// Downloaded crates and the build output live in volumes, so rebuilding the container keeps them.
"mounts": [
"source=torrential-cargo-registry,target=/home/vscode/.cargo/registry,type=volume",
"source=torrential-target,target=${containerWorkspaceFolder}/target,type=volume"
],
"postCreateCommand": "sudo chown vscode /home/vscode/.cargo/registry ${containerWorkspaceFolder}/target && git submodule update --init --recursive && cd web && bun install --frozen-lockfile",
// With host networking the container's ports are already the host's. Forwarding one makes VS Code
// listen on it on the host, which is the same address the forwarder then connects to inside the
// container: every connection opens another, without end. So nothing is forwarded.
"otherPortsAttributes": { "onAutoForward": "ignore" },
"customizations": {
"vscode": {
"extensions": ["rust-lang.rust-analyzer", "tamasfe.even-better-toml", "bradlc.vscode-tailwindcss"],
"settings": { "remote.autoForwardPorts": false }
}
}
}
106 changes: 0 additions & 106 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,109 +36,3 @@ jobs:
- run: bun run check
- run: bun run build
- run: bun test

test:
strategy:
fail-fast: false
matrix:
include:
- runner: macos-15
target: aarch64-apple-darwin
- runner: ubuntu-24.04
target: x86_64-unknown-linux-musl
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- uses: ./.github/actions/toolchain
with:
target: ${{ matrix.target }}
kind: test
- run: scripts/release.sh test

windows:
runs-on: windows-latest
steps:
# Tests compare files byte for byte, and libtorrent's submodules have long paths.
- run: git config --global core.autocrlf false; git config --global core.longpaths true
- uses: actions/checkout@v7
with:
submodules: recursive
- uses: ./.github/actions/toolchain
with:
target: x86_64-pc-windows-msvc
kind: test
- run: cargo test --workspace --locked --no-fail-fast
- name: The pinned ffmpeg build fetches, runs, and has what conversions use
run: cargo test --locked -p torrential-daemon the_pinned_build_runs_here -- --ignored
- name: The logon task starts the engine, and uninstalling it stops the engine
shell: pwsh
run: |
cargo build --locked -p torrential
$exe = (Resolve-Path target\debug\torrential.exe).Path
function Engine { (& $exe engine status --json | ConvertFrom-Json).engine }
& $exe engine install
if ($LASTEXITCODE) { throw 'engine install failed' }
schtasks /Query /TN 'torrential engine' /V /FO LIST
$deadline = (Get-Date).AddSeconds(60)
while ((Engine) -ne 'running') {
if ((Get-Date) -gt $deadline) {
Get-Content "$env:LOCALAPPDATA\torrential\state\engine.log" -ErrorAction SilentlyContinue
throw 'the logon task did not start the engine within 60 s'
}
Start-Sleep 2
}
& $exe engine status
& $exe engine uninstall
if ($LASTEXITCODE) { throw 'engine uninstall failed' }
schtasks /Query /TN 'torrential engine' 2>$null
if (-not $LASTEXITCODE) { throw 'the task is still registered' }
if ((Engine) -ne 'stopped') { throw 'the engine still runs after uninstall' }
$global:LASTEXITCODE = 0

# A fresh runner installs this build the way a person does, and the engine downloads Sintel.
windows-install:
runs-on: windows-latest
timeout-minutes: 60
steps:
- run: git config --global core.autocrlf false; git config --global core.longpaths true
- uses: actions/checkout@v7
with:
submodules: recursive
- uses: ./.github/actions/toolchain
with:
target: x86_64-pc-windows-msvc
kind: build
- run: scripts/release.ps1
- name: Install with install.ps1, download Sintel, and stop the engine
run: |
$server = Start-Process python -ArgumentList '-m', 'http.server', '8765', '--bind', '127.0.0.1', '--directory', 'dist' -PassThru
$deadline = (Get-Date).AddSeconds(30)
while (-not (Test-Connection 127.0.0.1 -TcpPort 8765 -Quiet)) {
if ((Get-Date) -gt $deadline) { throw 'the release server did not answer within 30 s' }
Start-Sleep -Milliseconds 200
}
$env:TORRENTIAL_DOWNLOAD_URL = 'http://127.0.0.1:8765'
./install.ps1
Stop-Process $server
$torrential = "$env:LOCALAPPDATA\Programs\torrential\torrential.exe"
$sintel = 'magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=udp%3A%2F%2Fexplodie.org%3A6969&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F'
& $torrential get $sintel --json
if ($LASTEXITCODE) { throw 'torrential get failed' }
$deadline = (Get-Date).AddMinutes(5)
do {
Start-Sleep 5
$job = (& $torrential status --json | ConvertFrom-Json).jobs[0]
Write-Host "$($job.name): $($job.progress.verified) of $($job.progress.size) bytes, $($job.progress.peers) peers"
if ((Get-Date) -gt $deadline) { throw 'no verified bytes of Sintel within 5 minutes' }
} until ($job.progress.verified -gt 0)
$stopping = [Diagnostics.Stopwatch]::StartNew()
& $torrential engine stop
$stopped = $LASTEXITCODE
Write-Host "engine stop took $([math]::Round($stopping.Elapsed.TotalSeconds, 1)) s"
if ($stopped) {
Get-Content "$env:LOCALAPPDATA\torrential\state\engine.log" -Tail 50 -ErrorAction SilentlyContinue
throw 'engine stop failed'
}
if ((& $torrential engine status --json | ConvertFrom-Json).engine -ne 'stopped') { throw 'the engine still runs' }
79 changes: 79 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# On a push to main, build the engine as release.yml does, and push
# ghcr.io/<owner>/torrential:latest, :main and :sha-<commit> for linux/amd64 and linux/arm64.
# nexxeln/torrential publishes its image from release.yml instead, so this skips it.
name: docker

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: docker
cancel-in-progress: true

jobs:
build:
if: github.repository != 'nexxeln/torrential'
strategy:
fail-fast: true
matrix:
include:
- runner: ubuntu-24.04
target: x86_64-unknown-linux-musl
- runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- uses: ./.github/actions/toolchain
with:
target: ${{ matrix.target }}
kind: build
- run: scripts/release.sh
- uses: actions/upload-artifact@v7
with:
name: torrential-${{ matrix.target }}
path: dist/*
if-no-files-found: error

image:
needs: build
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
pattern: torrential-*-linux-musl
path: dist
merge-multiple: true
- name: Put each architecture's binary where the Dockerfile looks for it
run: |
mkdir -p image/amd64 image/arm64
tar -xzf dist/torrential-x86_64-unknown-linux-musl.tar.gz -C image/amd64
tar -xzf dist/torrential-aarch64-unknown-linux-musl.tar.gz -C image/arm64
- name: Check the amd64 image runs
run: |
docker build -t torrential:check .
docker run --rm torrential:check --version
- name: Build the image for amd64 and arm64 and push it
env:
GH_TOKEN: ${{ github.token }}
SHA: ${{ github.sha }}
run: |
# GHCR names must be lowercase.
image="ghcr.io/$(echo "$GITHUB_REPOSITORY_OWNER" | tr '[:upper:]' '[:lower:]')/torrential"
echo "$GH_TOKEN" | docker login ghcr.io -u "$GITHUB_ACTOR" --password-stdin
docker buildx create --use --driver docker-container
docker buildx build --platform linux/amd64,linux/arm64 --push \
--build-arg SOURCE="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" --build-arg IMAGE="$image" \
-t "$image:latest" -t "$image:main" -t "$image:sha-${SHA::7}" .
echo "pushed $image:latest" >> "$GITHUB_STEP_SUMMARY"
21 changes: 1 addition & 20 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
runner: [macos-15, ubuntu-24.04, ubuntu-24.04-arm]
runner: [ubuntu-24.04, ubuntu-24.04-arm]
runs-on: ${{ matrix.runner }}
steps:
- name: Install with the one-liner
Expand All @@ -35,25 +35,6 @@ jobs:
done
exit 1

install-windows:
runs-on: windows-latest
steps:
- name: Install with the one-liner
shell: pwsh
env:
WANT: ${{ inputs.version || github.event.release.tag_name }}
run: |
$want = $env:WANT.TrimStart('v')
foreach ($attempt in 1..6) {
irm https://raw.githubusercontent.com/nexxeln/torrential/main/install.ps1 | iex
$got = & "$env:LOCALAPPDATA\Programs\torrential\torrential.exe" --version
Write-Host $got
if ($got -eq "torrential $want") { exit 0 }
Write-Host "expected torrential $want; retrying in 20s"
Start-Sleep 20
}
exit 1

image:
# A version tag pushed ghcr.io/nexxeln/torrential:<version>; it becomes latest only once the release is out.
if: github.event_name == 'release' && !github.event.release.prerelease
Expand Down
40 changes: 1 addition & 39 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ on:
paths:
- .github/**
- scripts/release.sh
- scripts/release.ps1
- install.sh
- install.ps1
- Dockerfile
- .dockerignore
- flake.nix
Expand Down Expand Up @@ -50,61 +48,25 @@ jobs:
fail-fast: false
matrix:
include:
- runner: macos-15
target: aarch64-apple-darwin
- runner: ubuntu-24.04
target: x86_64-unknown-linux-musl
- runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
- runner: windows-latest
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.runner }}
steps:
- if: runner.os == 'Windows'
run: git config --global core.autocrlf false; git config --global core.longpaths true
- uses: actions/checkout@v7
with:
submodules: recursive
- uses: ./.github/actions/toolchain
with:
target: ${{ matrix.target }}
kind: build
- if: runner.os != 'Windows'
run: scripts/release.sh
- if: runner.os == 'Windows'
run: scripts/release.ps1
- run: scripts/release.sh
- name: Check the binary runs
if: runner.os != 'Windows'
run: |
mkdir -p check && tar -xzf dist/torrential-${{ matrix.target }}.tar.gz -C check
ls check
check/torrential --version
- name: Check the binary runs
if: runner.os == 'Windows'
run: |
Expand-Archive dist/torrential-${{ matrix.target }}.zip check
Get-ChildItem check
check/torrential.exe --version
- name: Install this build with install.ps1, which starts the engine
if: runner.os == 'Windows'
run: |
$server = Start-Process python -ArgumentList '-m', 'http.server', '8765', '--bind', '127.0.0.1', '--directory', 'dist' -PassThru
Start-Sleep 2
$env:TORRENTIAL_DOWNLOAD_URL = 'http://127.0.0.1:8765'
./install.ps1
$dir = "$env:LOCALAPPDATA\Programs\torrential"
$path = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey('Environment').GetValue('Path', '', 'DoNotExpandEnvironmentNames')
if (($path -split ';') -notcontains $dir) { throw "$dir is not on the user's PATH: $path" }
$status = & "$dir\torrential.exe" engine status --json | ConvertFrom-Json
if ($status.engine -ne 'running') { throw "the engine is $($status.engine)" }
& "$dir\torrential.exe" engine stop
Stop-Process $server
- name: Say whether Invoke-WebRequest marks a download from the internet
if: runner.os == 'Windows'
run: |
Invoke-WebRequest -UseBasicParsing https://raw.githubusercontent.com/nexxeln/torrential/main/install.sh -OutFile downloaded.txt
$mark = Get-Content downloaded.txt -Stream Zone.Identifier -Raw -ErrorAction SilentlyContinue
if ($mark) { "Zone.Identifier: $mark" } else { 'no Zone.Identifier stream' }
- uses: actions/upload-artifact@v7
with:
name: torrential-${{ matrix.target }}
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates

FROM debian:13-slim
ARG TARGETARCH
LABEL org.opencontainers.image.source="https://github.com/nexxeln/torrential" \
# The repository and image name this build is published under.
ARG SOURCE=https://github.com/nexxeln/torrential
ARG IMAGE=ghcr.io/nexxeln/torrential
LABEL org.opencontainers.image.source="${SOURCE}" \
org.opencontainers.image.description="Search for a film or show, press Play, and watch it while it downloads." \
org.opencontainers.image.licenses="MIT"
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build --chown=1000:1000 /out/data /data
COPY --chmod=755 image/${TARGETARCH}/torrential /usr/local/bin/torrential
# Config in /data/config, downloads in /data/Downloads/torrential.
ENV HOME=/data TORRENTIAL_HOME=/data TORRENTIAL_IMAGE=ghcr.io/nexxeln/torrential
ENV HOME=/data TORRENTIAL_HOME=/data TORRENTIAL_IMAGE=${IMAGE}
USER 1000:1000
WORKDIR /data
VOLUME /data
Expand Down
Loading