disable caddy
Some checks failed
ci / build (push) Failing after 22m11s
ci / Tests & Checks (push) Failing after 7m31s

This commit is contained in:
CJ_Clippy 2025-02-21 23:32:48 -08:00
parent 694dc89f03
commit 30be956029
38 changed files with 94 additions and 61 deletions

View File

@ -30,14 +30,27 @@ jobs:
uses: docker/build-push-action@v6
with:
context: ./apps/aquatic
file: ./apps/aquatic/docker/aquatic_udp.Dockerfile
file: ./apps/aquatic/docker/aquatic_udp_futureporn.Dockerfile
push: true
tags: gitea.futureporn.net/futureporn/aquatic:latest
- name: Build futureporn/tracker-helper
uses: docker/build-push-action@v6
with:
context: ./services/tracker-helper
push: true
tags: gitea.futureporn.net/futureporn/tracker-helper:latest
labels: |
org.opencontainers.image.description=Custom Aquatic helper service, adding info_hash accesslist operations via HTTP
org.opencontainers.image.title=tracker-helper
org.opencontainers.image.licenses=unlicense
org.opencontainers.image.source=https://gitea.futureporn.net/futureporn/fp
org.opencontainers.image.url=https://gitea.futureporn.net/futureporn/-/packages/container/tracker-helper
- name: Build futureporn/tracker
uses: docker/build-push-action@v6
with:
context: ./services/tracker
context: ./apps/tracker
push: true
tags: gitea.futureporn.net/futureporn/tracker:latest
labels: |
@ -50,19 +63,19 @@ jobs:
TRACKER_HELPER_USERNAME=${{ secrets.TRACKER_HELPER_USERNAME }}
TRACKER_HELPER_PASSWORD=${{ secrets.TRACKER_HELPER_PASSWORD }}
- name: Build futureporn/bright
uses: docker/build-push-action@v6
with:
context: ./apps/bright
push: true
tags: gitea.futureporn.net/futureporn/bright:latest
build-args: |
MIX_ENV=prod
labels: |
org.opencontainers.image.description=The Galaxy's Best VTuber hentai site
org.opencontainers.image.title=bright
org.opencontainers.image.created={{commit_date 'YYYY-MM-DDTHH:mm:ss.SSS[Z]'}}
org.opencontainers.image.version={{version}}
org.opencontainers.image.licenses=unlicense
org.opencontainers.image.source=https://gitea.futureporn.net/futureporn/fp
org.opencontainers.image.url=https://gitea.futureporn.net/futureporn/-/packages/container/bright
# - name: Build futureporn/bright
# uses: docker/build-push-action@v6
# with:
# context: ./apps/bright
# push: true
# tags: gitea.futureporn.net/futureporn/bright:latest
# build-args: |
# MIX_ENV=prod
# labels: |
# org.opencontainers.image.description=The Galaxy's Best VTuber hentai site
# org.opencontainers.image.title=bright
# org.opencontainers.image.created={{commit_date 'YYYY-MM-DDTHH:mm:ss.SSS[Z]'}}
# org.opencontainers.image.version={{version}}
# org.opencontainers.image.licenses=unlicense
# org.opencontainers.image.source=https://gitea.futureporn.net/futureporn/fp
# org.opencontainers.image.url=https://gitea.futureporn.net/futureporn/-/packages/container/bright

View File

@ -37,6 +37,9 @@ jobs:
TRACKER_HELPER_URL: ${{ vars.TRACKER_HELPER_URL }}
TRACKER_HELPER_USERNAME: ${{ secrets.TRACKER_HELPER_USERNAME }}
TRACKER_HELPER_PASSWORD: ${{ secrets.TRACKER_HELPER_PASSWORD }}
TRACKER_HELPER_ACCESSLIST_URL: ${{ vars.TRACKER_HELPER_ACCESSLIST_URL }}
TRACKER_HELPER_ACCESSLIST_PATH: /var/lib/aquatic/accesslist
DB_NAME: ${{ vars.DB_NAME }}
DB_HOST: ${{ vars.DB_HOST }}
DB_PORT: ${{ vars.DB_PORT }}
@ -79,7 +82,8 @@ jobs:
- 3003:3003
- 9000:9000
env:
TRACKER_HELPER_ACCESSLIST_PATH: /var/lib/aquatic/whitelist
TRACKER_HELPER_ACCESSLIST_PATH: /var/lib/aquatic/accesslist
TRACKER_HELPER_ACCESSLIST_URL: http://localhost:5063/accesslist
TRACKER_HELPER_USERNAME: ${{ secrets.TRACKER_HELPER_USERNAME }}
TRACKER_HELPER_PASSWORD: ${{ secrets.TRACKER_HELPER_PASSWORD }}
TRACKER_HELPER_PORT: 5063

View File

@ -0,0 +1,40 @@
# syntax=docker/dockerfile:1
FROM rust:latest AS builder
WORKDIR /usr/src/aquatic
COPY . .
RUN . ./scripts/env-native-cpu-without-avx-512 && cargo build --release -p aquatic_udp
FROM debian:stable-slim
ENV CONFIG_FILE_CONTENTS "[statistics]\ninterval = 5\nprint_to_stdout = true"
ENV ACCESS_LIST_CONTENTS ""
WORKDIR /etc/aquatic/
COPY --from=builder /usr/src/aquatic/target/release/aquatic_udp /usr/local/bin/aquatic_udp
COPY <<-"EOT" /usr/local/bin/entrypoint.sh
#!/bin/bash
echo -e "$CONFIG_FILE_CONTENTS" > /etc/aquatic/config.toml
echo -e "$ACCESS_LIST_CONTENTS" > /var/lib/aquatic/whitelist
exec /usr/local/bin/aquatic_udp -c /etc/aquatic/config.toml "$@"
EOT
RUN mkdir -p /var/lib/aquatic && \
touch /var/lib/aquatic/whitelist && \
chmod 0666 /var/lib/aquatic/whitelist && \
chmod +x /usr/local/bin/entrypoint.sh
HEALTHCHECK --interval=5s --timeout=3s --retries=3 \
CMD pidof aquatic_udp || exit 1
## we cd before running to workaround nektos/act behavior which overrides WORKDIR
ENTRYPOINT ["sh", "-c", "cd /etc/aquatic && /usr/local/bin/entrypoint.sh"]
# ENTRYPOINT ["tail", "-f", "/dev/null"] # for debugging

View File

@ -32,7 +32,7 @@ config :bright,
config :bright, :torrent,
tracker_url: System.get_env("TRACKER_URL"),
tracker_helper_url: System.get_env("TRACKER_HELPER_URL"),
tracker_helper_accesslist_url: System.get_env("TRACKER_HELPER_ACCESSLIST_URL"),
tracker_helper_username: System.get_env("TRACKER_HELPER_USERNAME"),
tracker_helper_password: System.get_env("TRACKER_HELPER_PASSWORD")

View File

@ -17,16 +17,16 @@ defmodule Bright.Tracker do
This is where we send infohashes that end up in aquatic's accesslist
Usually it's port 5063, path /accesslist
"""
@spec accesslist_url() :: binary()
def accesslist_url do
@spec tracker_helper_accesslist_url() :: binary()
def tracker_helper_accesslist_url do
url =
case Application.fetch_env!(:bright, :torrent)[:tracker_helper_accesslist_url] do
nil -> raise "accesslist_url missing or empty in app config"
"" -> raise "accesslist_url missing or empty in app config"
nil -> raise "tracker_helper_accesslist_url missing or empty in app config"
"" -> raise "tracker_helper_accesslist_url missing or empty in app config"
url -> url
end
Logger.debug("accesslist_url=#{url}")
Logger.debug("tracker_helper_accesslist_url=#{url}")
url
end
@ -49,7 +49,7 @@ defmodule Bright.Tracker do
end
def accesslist_info_hash(info_hash) do
accesslist_url = accesslist_url()
accesslist_url = tracker_helper_accesslist_url()
username = tracker_helper_username()
password = tracker_helper_password()

View File

@ -13,7 +13,7 @@ defmodule Bright.ImagesTest do
{:ok, filename} =
Images.create_thumbnail(@test_mp4_fixture)
assert Regex.match?(~r/^\/root\/\.cache\/futureporn\/[^\/]+\/[^\/]+\.png$/, filename)
assert Regex.match?(~r/\.cache\/futureporn\/[^\/]+\/[^\/]+\.png$/, filename)
assert File.exists?(filename)
assert File.stat!(filename).size > 0, "thumbnail file is empty"
end

View File

@ -3,24 +3,22 @@ defmodule Bright.TrackerTest do
use Bright.DataCase
alias Bright.Tracker
alias Bright.URLEncoder
describe "tracker" do
use ExUnit.Case, async: false
import Bright.StreamsFixtures
# tails-amd64-6.10-img (BT info_hash v1)
@info_hash_v1_fixture "07b4516336e4afe9232c73bc312642590a7d7e95"
@tag :integration
test "whitelist_info_hash/1 using a string info_hash" do
case Tracker.whitelist_info_hash(@info_hash_v1_fixture) do
test "accesslist_info_hash/1 using a string info_hash" do
case Tracker.accesslist_info_hash(@info_hash_v1_fixture) do
{:ok, info_hash} ->
assert :ok
assert info_hash === @info_hash_v1_fixture
{:error, :closed} ->
flunk("The connection to opentracker was closed. Is opentracker running?")
flunk("The connection to tracker was closed. Is tracker running?")
other ->
flunk("Unexpected result: #{inspect(other)}")

View File

@ -1,5 +1,5 @@
#!/bin/sh
pidof aquatic_udp || exit 111
curl -f http://localhost:5063/helper || exit 112
curl -f http://localhost:5063/health || exit 112
curl -f http://localhost:9000/metrics || exit 113

View File

@ -89,39 +89,21 @@ ssh:
# Use accessory services (secrets come from .kamal/secrets).
#
accessories:
tracker-helper:
image: gitea.futureporn.net/futureporn/opentracker:latest
host: 45.76.57.101
port: "127.0.0.1:3000:3000"
env:
secret:
- WL_CREDENTIALS
proxy:
ssl: true
forward_headers: true
app_port: 3000
host: tracker-helper.futureporn.net
healthcheck:
path: /health
volumes:
- opentracker-etc:/etc/opentracker
- opentracker-var:/var/run/opentracker
tracker:
image: gitea.futureporn.net/futureporn/tracker:latest
host: 45.76.57.101
port: "0.0.0.0:5063:5063"
env:
clear:
HELPER_ACCESSLIST_PATH: "/var/lib/aquatic/accesslist"
TRACKER_HELPER_ACCESSLIST_PATH: "/var/lib/aquatic/accesslist"
secret:
- HELPER_USERNAME
- HELPER_PASSWORD
- TRACKER_HELPER_USERNAME
- TRACKER_HELPER_PASSWORD
proxy:
ssl: true
forward_headers: true
app_port: 5063 # note: tracker also uses port 6969/udp and 9000/tcp, but the api at 5063/tcp is what we specify here. # @todo @blocking https://github.com/basecamp/kamal-proxy/issues/48
forward_headers: false
# note: tracker also uses port 6969/udp and 9000/tcp, but the api at 5063/tcp is what we specify here. # @todo @blocking https://github.com/basecamp/kamal-proxy/issues/48
app_port: 5063
host: tracker.futureporn.net
healthcheck:
path: /health

View File

@ -1,4 +0,0 @@
b22ea43e4c0a7f73fc706b5faf1c35bb078d3722
3aa5ad5e62eaffd148cff3dbe93ff2e1e9cbcf01
3aa5ad5e62eaffd148cff3dbe93ff2e1e9cbcf01
3aa5ad5e62eaffd148cff3dbe93ff2e1e9cbcf01