mirror of
https://github.com/fscotto/infra.git
synced 2026-11-25 21:29:51 +00:00
Add LAN-only aria2 downloads to Atlas
This commit is contained in:
86
docs/atlas-aria2.md
Normal file
86
docs/atlas-aria2.md
Normal file
@@ -0,0 +1,86 @@
|
||||
# Atlas HTTP downloader: aria2 + AriaNg
|
||||
|
||||
Ansible manages two admin-owned rootless Quadlets, `atlas-aria2.service` and
|
||||
`atlas-ariang.service`, with pinned images. The third-party aria2 image is used
|
||||
only for its binary: its init scripts, tracker updates and automatic deletion
|
||||
hooks are bypassed. The static frontend has no host-data or credential mounts.
|
||||
|
||||
- Web UI (LAN only): `http://192.168.178.55:8091`.
|
||||
- RPC (LAN only, mandatory secret): `http://192.168.178.55:6800/jsonrpc`.
|
||||
- Payloads: `/zpool/archive/Downloads`, shared with qBittorrent and SMB Archive.
|
||||
- Private state: `zpool/services/data/aria2`, mounted at `/zpool/services/data/aria2`.
|
||||
- The persistent 256-bit RPC secret is generated only on Atlas; it is not committed
|
||||
or printed by Ansible. It is not a username/password: AriaNg passes it as an
|
||||
RPC token. Whoever has it can control the downloader.
|
||||
- No DNS/NPM/public exposure or WireGuard changes are performed. Never publish
|
||||
the bare RPC port on the Internet. LAN HTTP does not encrypt the token; use
|
||||
only a trusted LAN or an SSH tunnel.
|
||||
|
||||
## Deploy
|
||||
|
||||
From the repository root:
|
||||
|
||||
```sh
|
||||
ansible-playbook ansible/site.yml --limit atlas --tags aria2 --check
|
||||
ansible-playbook ansible/site.yml --limit atlas --tags aria2
|
||||
```
|
||||
|
||||
Check mode validates storage and Quadlet/firewall changes but skips generation,
|
||||
reading and rendering of secret-dependent configuration and runtime probes.
|
||||
Boot startup uses admin lingering plus `WantedBy=default.target`; a host reboot
|
||||
must be tested separately.
|
||||
|
||||
## First use
|
||||
|
||||
Open the LAN Web UI. In **AriaNg Settings -> RPC**, use:
|
||||
|
||||
- Protocol: HTTP (JSON-RPC)
|
||||
- Host/address: `192.168.178.55`
|
||||
- Port: `6800`
|
||||
- Interface/path: `jsonrpc`
|
||||
- Secret: privately read it in your terminal with:
|
||||
|
||||
```sh
|
||||
ssh admin@192.168.178.55 'cat /zpool/services/data/aria2/rpc-secret'
|
||||
```
|
||||
|
||||
Do not paste it into chat or share exported AriaNg settings, which may include
|
||||
it. After saving settings the status should be Connected. Select **New**, add
|
||||
one or more actual file URLs and start the download. One download/connection at
|
||||
a time is the default, to reduce load and avoid excessive requests to Apple.
|
||||
|
||||
The UI may store the secret in browser-local settings. There is no additional
|
||||
login for the static page; the RPC token protects the actual service. Do not
|
||||
publish this interface on the qBittorrent endpoint (`torrent.fscotto.co`).
|
||||
|
||||
## Interrupted downloads and iCloud
|
||||
|
||||
The queue is saved every 30 seconds and on graceful shutdown. Keep both partial
|
||||
payloads and `.aria2` control files for resume. Restarting restores pending tasks.
|
||||
Resume requires server support and a valid link. Expired Apple links must be
|
||||
refreshed; some downloads also require authenticated cookies or headers. Never
|
||||
share full signed URLs or cookie files. Apple exports have not been tested until
|
||||
new links are available. TLS certificate verification remains enabled.
|
||||
|
||||
No completion/error deletion hooks are enabled. Cancelling a task does not
|
||||
implicitly clean payloads. Downloads remain inside the existing Archive backup
|
||||
scope, including incomplete files. Session files contain URLs and are kept
|
||||
private; their dataset inherits existing recursive backup/snapshot coverage.
|
||||
|
||||
References:
|
||||
- <https://github.com/aria2/aria2>
|
||||
- <https://github.com/mayswind/AriaNg>
|
||||
- <https://github.com/P3TERX/Aria2-Pro-Docker>
|
||||
|
||||
## Verified on 2026-10-10
|
||||
|
||||
The pinned aria2 binary reports 1.36.0. The Web UI and authenticated RPC are
|
||||
operational; RPC requests without a token are rejected. A second targeted
|
||||
Ansible application reported `changed=0`, `failed=0`.
|
||||
|
||||
A real HTTPS smoke test downloaded the official curl 8.10.1 source archive
|
||||
(2,726,748 bytes). After pausing at 1,048,576 bytes and restarting only
|
||||
`atlas-aria2.service`, the saved task and partial progress were restored. The
|
||||
completed file matched an independently downloaded reference by SHA-256.
|
||||
Only the exact smoke-test task and its temporary payload/control files were
|
||||
removed. A host reboot and authenticated Apple export downloads are not claimed.
|
||||
@@ -7,7 +7,7 @@ WireGuard configuration is unchanged.
|
||||
|
||||
- LAN Web UI: `http://192.168.178.55:8090` (LAN-only firewalld rule,
|
||||
already including Aegis at `192.168.178.54`).
|
||||
- Prepared public domain: `downloads.fscotto.co`, through NPM on Prometheus.
|
||||
- Prepared public domain: `torrent.fscotto.co`, through NPM on Prometheus.
|
||||
DNS and the NPM Proxy Host remain manual operations.
|
||||
- Downloads: `/zpool/archive/Downloads`, available through SMB `Archive`.
|
||||
- Private configuration dataset: `zpool/services/data/qbittorrent`.
|
||||
@@ -72,7 +72,7 @@ for its persistent UPnP/NAT-PMP option.
|
||||
|
||||
## Manual public endpoint setup
|
||||
|
||||
Atlas is prepared for `downloads.fscotto.co`, with reverse-proxy support enabled
|
||||
Atlas is prepared for `torrent.fscotto.co`, with reverse-proxy support enabled
|
||||
and only `192.168.178.54` (the Aegis source-NAT gateway) trusted for forwarded
|
||||
client addresses. Existing LAN access remains available. No new firewall opening
|
||||
is required because the existing `192.168.178.0/24` rule includes Aegis.
|
||||
@@ -83,12 +83,12 @@ the reverse proxy or disable CSRF/Host validation.
|
||||
|
||||
Namecheap:
|
||||
|
||||
- Type: A Record; Host: `downloads`; Value: `179.237.102.172` (Prometheus).
|
||||
- Type: A Record; Host: `torrent`; Value: `179.237.102.172` (Prometheus).
|
||||
- Do not point this record to Atlas' private LAN address.
|
||||
|
||||
NPM on Prometheus:
|
||||
|
||||
- Domain Names: `downloads.fscotto.co`
|
||||
- Domain Names: `torrent.fscotto.co`
|
||||
- Scheme: `http`
|
||||
- Forward Hostname/IP: `192.168.178.55`
|
||||
- Forward Port: `8090`
|
||||
@@ -105,9 +105,16 @@ complete. Preparing the Web proxy does not change torrent peer connectivity.
|
||||
|
||||
### Reverse-proxy preparation verified on 2026-10-10
|
||||
|
||||
Atlas accepts `downloads.fscotto.co` with HTTPS forwarded headers from the NPM
|
||||
The previous live domain `downloads.fscotto.co` was verified with HTTPS forwarded headers from the NPM
|
||||
container on Prometheus through Aegis (HTTP 200). Unauthenticated API access is
|
||||
still denied (403), and an unrelated Host is rejected (401). No DNS record,
|
||||
NPM Proxy Host, certificate, router forwarding or WireGuard configuration was
|
||||
changed. The existing LAN firewall rule already permits Aegis. A permanent
|
||||
Web UI password still needs to be configured before public exposure.
|
||||
|
||||
The domain change to `torrent.fscotto.co` was subsequently applied to Atlas with
|
||||
the targeted `qbittorrent` playbook tag. The old live Host allowlist caused HTTP
|
||||
401 (Unauthorized) on the new public domain. After deployment, public HTTPS
|
||||
returned 200 and unauthenticated API access remained denied (403). Credentials,
|
||||
Host validation and CSRF protection were preserved; all existing Atlas services
|
||||
remained active. DNS and NPM were not modified by this deployment.
|
||||
|
||||
Reference in New Issue
Block a user