feat(podman-transmission): IP blocklist, magnet handler, awk session ID fix#80
Merged
smartwatermelon merged 6 commits intomainfrom Mar 10, 2026
Merged
Conversation
Adds two features to the containerized Transmission stack that were
present in the native transmission-setup.sh but missing from the
podman setup:
1. IP blocklist (compose.yml): TRANSMISSION_BLOCKLIST_ENABLED + URL
pointing to BT_BlockLists feed. haugene maps these directly to
settings.json at container start.
2. macOS magnet handler (podman-transmission-setup.sh, Section 12):
- Deploys ~/.local/bin/transmission-add-magnet.sh — a curl-based
RPC client that fetches the CSRF session token, then POSTs the
magnet URL to the Transmission JSON-RPC endpoint (host port
baked in at deploy time)
- Compiles TransmissionMagnetHandler.app via osacompile with an
AppleScript open-URL handler that calls the shell helper
- Injects CFBundleIdentifier + CFBundleURLTypes via PlistBuddy
- Registers with lsregister and sets defaults LSHandlers
Both changes are idempotent; the setup script can be re-run safely.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The 409 response body HTML contains a duplicate of the session ID in a <code> tag, causing the awk pattern to match twice and produce a two-line SESSION_ID. Anchor to ^ (start of line) so the body line (which starts with <code>) doesn't match, and exit after the first match. Found during live testing: helper script exited 0 but torrent wasn't added because curl received a malformed X-Transmission-Session-Id header. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7-task plan covering: PR merge, blocklist application, magnet handler OS wiring, kill switch test, port forwarding verification, trigger-watcher end-to-end, and Phase 2 cutover. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Convert all **Step N:** bold-as-heading patterns to actual h3 headings to satisfy the CI markdownlint MD036 rule. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Check RPC response before notifying (HIGH): capture curl output into $RESPONSE; only show success notification if result=="success", otherwise show error notification and exit 1. Fixes false positive feedback when Transmission rejects the magnet (duplicate, invalid, etc.) - Guard LSHandlers -array-add (MEDIUM): check if bundle ID already present via 'defaults read | grep -q' before -array-add. Re-runs no longer accumulate duplicate LSHandlers entries. Both fixes applied to the deployed TILSIT helper script as well. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cript
${MAGNET_HELPER} is baked in at setup time but may contain spaces if
OPERATOR_USERNAME has them. Wrap with AppleScript's 'quoted form of'
so the shell receives the path single-quoted at runtime.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TRANSMISSION_BLOCKLIST_ENABLED=true+TRANSMISSION_BLOCKLIST_URLtocompose.yml. haugene maps these directly to Transmission'ssettings.jsonat container start.podman-transmission-setup.sh— deploystransmission-add-magnet.sh(curl-based Transmission RPC client with session token handling), compilesTransmissionMagnetHandler.appviaosacompile, injects bundle ID + URL scheme via PlistBuddy, registers withlsregister+defaults write LSHandlers.<code>tag, causing the awk pattern to match twice and produce a two-lineSESSION_ID. Fixed by anchoring to^and addingexitafter the first match. Found during live testing — helper script exited 0 but torrent wasn't actually added.docs/plans/2026-03-10-containerized-transmission-completion.mdwith 7 tasks covering remaining Phase 1 validation and Phase 2 cutover.Test plan
shellcheckclean onpodman-transmission-setup.shtransmission-add-magnet.shdeployed to TILSIT and tested live —{"result":"success"}confirmed🤖 Generated with Claude Code