### Frontend development setup Source: https://github.com/autobrr/autobrr/blob/develop/CONTRIBUTING.md Commands to install web dependencies and start the development server. ```shell cd web && pnpm install ``` ```shell pnpm dev ``` -------------------------------- ### Install project dependencies Source: https://github.com/autobrr/autobrr/blob/develop/CONTRIBUTING.md Installs all required Go and web dependencies. ```shell make deps ``` -------------------------------- ### List Download Clients Response Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Example JSON response for the GET /download-clients endpoint. ```json { "data": [ { "id": 1, "name": "qBittorrent Main", "type": "QBITTORRENT", "enabled": true, "host": "192.168.1.10", "port": 8080, "tls": false, "username": "admin", "password": "***word", "settings": { "rules": { "enabled": true, "max_active_downloads": 10 } } } ] } ``` -------------------------------- ### Install Homebrew on macOS Source: https://github.com/autobrr/autobrr/blob/develop/README.md Standard installation command for Homebrew. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Install and Run autobrr on macOS Source: https://github.com/autobrr/autobrr/blob/develop/README.md Commands to install autobrr via Homebrew and start the service. ```bash brew install autobrr ``` ```bash brew services start autobrr ``` -------------------------------- ### Install autobrr on Bytesized Hosting Source: https://github.com/autobrr/autobrr/blob/develop/README.md Execute the Bytesized Hosting installation script via wget. ```bash wget https://gobrr.sh/install_bytesized && bash install_bytesized ``` -------------------------------- ### Install autobrr via QuickBox Source: https://github.com/autobrr/autobrr/blob/develop/README.md Use the qb command to install autobrr, replacing ${username} with your actual system username. ```bash qb install autobrr -u ${username} ``` -------------------------------- ### Install Playwright Browser Driver Source: https://github.com/autobrr/autobrr/blob/develop/test/e2e/README.md Installs the required browser driver for Playwright-go. This is a one-time setup step. ```sh go run github.com/mxschmitt/playwright-go/cmd/playwright@v0.6100.0 install --with-deps chromium ``` -------------------------------- ### Install autobrr on Feralhosting Source: https://github.com/autobrr/autobrr/blob/develop/README.md Execute the Feralhosting installation script via wget. ```bash wget https://gobrr.sh/install_feral && bash install_feral ``` -------------------------------- ### Install autobrr via Saltbox Source: https://github.com/autobrr/autobrr/blob/develop/README.md Use the sb command to install autobrr on Saltbox systems. ```bash sb install autobrr ``` -------------------------------- ### Install autobrr via Swizzin Source: https://github.com/autobrr/autobrr/blob/develop/README.md Use the box command to install autobrr on Swizzin-based systems. ```bash sudo box install autobrr ``` -------------------------------- ### Install autobrr on other providers Source: https://github.com/autobrr/autobrr/blob/develop/README.md Use the generic Seedbox.io installer script for unsupported providers. ```bash wget https://gobrr.sh/install_sbio && bash install_sbio ``` -------------------------------- ### Define Download Client Configurations Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/download-client-domain.md Examples for configuring qBittorrent, SABnzbd, and Transmission clients, including external client references. ```go // qBittorrent qb := &DownloadClient{ Name: "qBittorrent Main", Type: DownloadClientTypeQbittorrent, Enabled: true, Host: "192.168.1.10", Port: 8080, TLS: false, Username: "admin", Password: "password", Settings: DownloadClientSettings{ Rules: DownloadClientRules{ Enabled: true, MaxActiveDownloads: 10, }, }, } // SABnzbd sab := &DownloadClient{ Name: "SABnzbd", Type: DownloadClientTypeSabnzbd, Enabled: true, Host: "192.168.1.20", Port: 8080, TLS: true, TLSSkipVerify: true, Settings: DownloadClientSettings{ APIKey: "nzb-api-key-here", }, } // Transmission with external client reference trans := &DownloadClient{ Name: "Transmission Remote", Type: DownloadClientTypeTransmission, Enabled: true, Host: "192.168.1.30", Port: 9091, Username: "user", Password: "pass", Settings: DownloadClientSettings{ ExternalDownloadClientId: 2, ExternalDownloadClient: "Remote Transmission", }, } ``` -------------------------------- ### Exec Action Configuration Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/action-domain.md Example configuration for executing a shell script with macro expansion. ```text ExecCmd: /usr/local/bin/custom-handler.sh ExecArgs: --name {TorrentName} --category {Category} --torrent {TorrentPathName} ``` -------------------------------- ### Add an IRC test scenario Source: https://github.com/autobrr/autobrr/blob/develop/test/irc/README.md Example of setting up a test server, network configuration, and verifying a release announcement. ```go srv := ircd.New(t) srv.AddChannel("#announce", ircd.Key("s3cr3t"), ircd.Announcer("Bot")) def := harness.MinimalDefinition("mytracker", "#announce", "Bot") net := harness.Network(srv, "mynick", harness.SASL("acct", "pass"), harness.ChannelWithPassword("#announce", "s3cr3t")) inst := harness.Start(t, net, harness.Defs(def)) inst.WaitForMonitoring("#announce", 10*time.Second) srv.Announce("#announce", "Bot", "New torrent: Some.Release in Movies") rls, ok := inst.Releases.Wait(5 * time.Second) ``` -------------------------------- ### Enable and start autobrr service Source: https://github.com/autobrr/autobrr/blob/develop/README.md Activates the service to run immediately and ensures it starts on system boot. ```bash systemctl enable --now autobrr@$USER.service ``` -------------------------------- ### Start Docker Compose Source: https://github.com/autobrr/autobrr/blob/develop/README.md Command to start the autobrr container in detached mode. ```bash docker compose up -d ``` -------------------------------- ### Build cross-platform binaries with GoReleaser Source: https://github.com/autobrr/autobrr/blob/develop/CONTRIBUTING.md Instructions for installing and using GoReleaser to create cross-platform builds. ```shell go install github.com/goreleaser/goreleaser/v2@latest ``` ```shell goreleaser build --snapshot --clean ``` -------------------------------- ### New Torrent Announcement Example Source: https://github.com/autobrr/autobrr/blob/develop/test/mockindexer/README.md This is an example of a new torrent announcement that can be posted to the MockIndexer. The number at the end of the URL corresponds to the torrent file name. ```text New Torrent Announcement: Name:'debian live 10 6 0 amd64 standard iso' uploaded by 'Anonymous' freeleech - http://localhost:3999/torrent/1 ``` -------------------------------- ### RedactString Output Examples Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/download-client-domain.md Examples showing how RedactString masks input strings while preserving partial visibility for verification. ```text Input: "supersecretkey123" Output: "***ey123" (last 3 chars visible) Input: "user:pass" Output: "***:pass" ``` -------------------------------- ### Conventional commit examples Source: https://github.com/autobrr/autobrr/blob/develop/CONTRIBUTING.md Examples of commit messages following the Conventional Commits specification. ```text fix(indexers): Mock improve parsing feat(notifications): add NewService ``` -------------------------------- ### Webhook Action Configuration Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/action-domain.md Example configuration for sending release data to an HTTP endpoint. ```text WebhookHost: https://api.example.com/releases WebhookMethod: POST WebhookData: {"name":"{TorrentName}","category":"{Category}","year":{Year}} WebhookHeaders: ["Content-Type: application/json", "Authorization: Bearer token123"] ``` -------------------------------- ### GET /download-clients Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md List all configured download clients. ```APIDOC ## GET /download-clients ### Description List all configured download clients. ### Method GET ### Endpoint /download-clients ### Response #### Success Response (200) - **data** (array) - List of download client objects #### Response Example { "data": [ { "id": 1, "name": "qBittorrent Main", "type": "QBITTORRENT", "enabled": true, "host": "192.168.1.10", "port": 8080, "tls": false, "username": "admin", "password": "***word", "settings": { "rules": { "enabled": true, "max_active_downloads": 10 } } } ] } ``` -------------------------------- ### Watch Folder Configuration Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/action-domain.md Example configuration for writing torrent files to a monitored directory. ```text WatchFolder: /mnt/watch/qbittorrent/ ``` -------------------------------- ### Run integration tests with Docker Source: https://github.com/autobrr/autobrr/blob/develop/CONTRIBUTING.md Starts the required PostgreSQL container and executes the full test suite including integration tests. ```shell docker compose up -d test_postgres ``` ```shell go test ./... -tags=integration ``` -------------------------------- ### Run Autobrr Web in Development Mode Source: https://github.com/autobrr/autobrr/blob/develop/web/README.md Use this command to start the development server. It provides hot-reloading and displays lint errors in the console. Access the app at http://localhost:3000. ```bash pnpm dev ``` -------------------------------- ### Define New Test Scenario Source: https://github.com/autobrr/autobrr/blob/develop/test/e2e/README.md Example structure for creating a new end-to-end test using the harness. ```go func TestSomething(t *testing.T) { app := harness.Start(t) page := app.NewAuthedPage() page.Open("/settings/indexers") page.AddNew() page.Select("Generic RSS") page.Fill("feed.url", "https://example.com/rss") page.Submit() page.ExpectRow("Generic RSS") } ``` -------------------------------- ### GET /indexers Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md List all configured indexers. ```APIDOC ## GET /indexers ### Description List all configured indexers. ### Method GET ### Endpoint /indexers ### Response #### Success Response (200) - **data** (array) - List of indexer objects #### Response Example { "data": [ { "id": 1, "name": "PassThePopcorn", "identifier": "ptp", "enabled": true, "implementation": "IRC", "settings": { "passkey": "***key", "userid": "***" } } ] } ``` -------------------------------- ### GET /releases Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md List releases with filtering and pagination support. ```APIDOC ## GET /api/v1/releases ### Description List releases with filtering and pagination. ### Method GET ### Endpoint /api/v1/releases ### Parameters #### Query Parameters - **limit** (integer) - Optional - Results per page (default 50, max 500) - **offset** (integer) - Optional - Pagination offset (default 0) - **sort** (string) - Optional - Sort key and direction: "timestamp:desc" (default), "size:asc", etc. - **filters.indexers** (string) - Optional - Comma-separated indexer IDs to filter - **filters.push_status** (string) - Optional - Filter by push status: PENDING, PUSH_APPROVED, PUSH_REJECTED, PUSH_ERROR - **search** (string) - Optional - Full-text search on release name ### Response #### Success Response (200) - **data** (array) - List of release objects - **count** (integer) - Total count of releases - **next_cursor** (integer) - Cursor for next page ``` -------------------------------- ### Create Indexer Request Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Example JSON request body for the POST /indexers endpoint to create a new indexer. ```json { "name": "Tracker Name", "identifier": "tracker", "implementation": "IRC", "enabled": true, "settings": { "passkey": "actual-key-here", "userid": "12345" } } ``` -------------------------------- ### Define and initialize IndexerIRCParseLine Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/indexer-domain.md Defines the regex structure for parsing IRC announcements and provides an example initialization. ```go type IndexerIRCParseLine struct { Regex string Vars map[string]string Matches int } ``` ```go IndexerIRCParseLine{ Regex: `(?P[\w\-\.]+)\s+(?P\w+)\s+(?P[\d\.]+\s+\w+)`, Vars: map[string]string{ "releaseName": "Release name", "category": "Category", "torrentSize": "Torrent size", }, } ``` -------------------------------- ### GET /filters Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md List all filters with associated actions. ```APIDOC ## GET /filters ### Description List all filters with associated actions. ### Method GET ### Endpoint /filters ### Response #### Success Response (200) - **data** (array) - List of filter objects ``` -------------------------------- ### GET /releases/stats/activity Response Format Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Daily breakdown of release matches and push statuses. ```json { "days": 30, "daily": [ { "date": "2024-07-15", "matched_count": 150, "push_approved_count": 120, "push_rejected_count": 20, "push_error_count": 10 } ] } ``` -------------------------------- ### Get Formatted Audio String Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/release-domain.md Combines audio codecs and channels into a single formatted string. ```go func (r *Release) AudioString() string ``` -------------------------------- ### Action Configuration and Macro Parsing Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/action-domain.md Demonstrates initializing an action, parsing macros based on release data, and checking if a torrent download is required. ```go // Create action for qBittorrent with macros action := &Action{ ID: 1, Name: "Add to qBittorrent", Type: ActionTypeQbittorrent, Enabled: true, ClientID: 1, Category: "Movies/{Category}", Tags: "autobrr,{Year}", SavePath: "/mnt/media/{Title}/", ContentLayout: ActionContentLayoutSubfolderCreate, LimitRatio: 2.0, LimitSeedTime: 7 * 24 * 3600, // 7 days in seconds FirstLastPiecePrio: true, } // Parse macros release := &Release{ TorrentName: "Movie.Title.2024.1080p.BluRay.x264", Title: "Movie Title", Year: 2024, Category: "movies", } if err := action.ParseMacros(release); err != nil { log.Fatal(err) } // Check if torrent download needed if action.NeedsTorrentDownloaded() { // Download torrent from indexer release.DownloadTorrentFileCtx(ctx) } // Action is ready to be executed ``` -------------------------------- ### GET /releases/stats/volume Response Format Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Daily download volume in bytes for approved pushes. ```json { "days": 30, "daily": [ { "date": "2024-07-15", "downloaded_bytes": 1099511627776 } ] } ``` -------------------------------- ### Build the application Source: https://github.com/autobrr/autobrr/blob/develop/CONTRIBUTING.md Commands to build the backend binary or the full application. ```shell make build/app ``` ```shell make build ``` -------------------------------- ### List Indexers Response Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Example JSON response for the GET /indexers endpoint, showing redacted sensitive settings. ```json { "data": [ { "id": 1, "name": "PassThePopcorn", "identifier": "ptp", "enabled": true, "implementation": "IRC", "settings": { "passkey": "***key", "userid": "***" } } ] } ``` -------------------------------- ### GET /releases/stats Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Get aggregate release statistics. ```APIDOC ## GET /api/v1/releases/stats ### Description Get aggregate release statistics. ### Method GET ### Endpoint /api/v1/releases/stats ``` -------------------------------- ### Get Normalized Release Title Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/release-domain.md Creates a normalized title string by combining various release metadata fields. ```go func (r *Release) NormalizedTitle() string ``` -------------------------------- ### GET /releases Response Format Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md The response structure for listing releases, including pagination metadata and a list of release objects. ```json { "data": [ { "id": 12345, "torrent_name": "Release.Name.2024.1080p.BluRay.x264", "title": "Release Name", "size": 5368709120, "filter": "My Filter", "filter_status": "FILTER_APPROVED", "action_status": [ { "id": 1, "status": "PUSH_APPROVED", "action": "qBittorrent", "type": "QBITTORRENT", "client": "qBittorrent Main" } ], "indexer": { "id": 1, "name": "PassThePopcorn", "identifier": "ptp" }, "timestamp": "2024-08-13T10:30:00Z" } ], "count": 150, "next_cursor": 50 } ``` -------------------------------- ### GET /releases/recent Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Get recently matched/pushed releases. ```APIDOC ## GET /api/v1/releases/recent ### Description Get recently matched/pushed releases (limit 100). ### Method GET ### Endpoint /api/v1/releases/recent ### Parameters #### Query Parameters - **limit** (integer) - Optional - Max results (default 100) ``` -------------------------------- ### GET /filters/{filterID} Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Get single filter details. ```APIDOC ## GET /filters/{filterID} ### Description Get single filter details. ### Method GET ### Endpoint /filters/{filterID} ### Parameters #### Path Parameters - **filterID** (integer) - Required - The ID of the filter ``` -------------------------------- ### GET /indexers/{indexerID} Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Get single indexer with full definition. ```APIDOC ## GET /indexers/{indexerID} ### Description Get single indexer with full definition. ### Method GET ### Endpoint /indexers/{indexerID} ### Parameters #### Path Parameters - **indexerID** (integer) - Required - The ID of the indexer ``` -------------------------------- ### GET /releases/stats/activity Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Get daily release activity (matches and pushes). ```APIDOC ## GET /api/v1/releases/stats/activity ### Description Get daily release activity (matches and pushes). ### Method GET ### Endpoint /api/v1/releases/stats/activity ### Parameters #### Query Parameters - **days** (integer) - Optional - Number of days (0 or negative = all-time) ``` -------------------------------- ### Create systemd service file Source: https://github.com/autobrr/autobrr/blob/develop/README.md Initializes the service file template in the systemd directory. ```bash touch /etc/systemd/system/autobrr@.service ``` -------------------------------- ### GET /releases/stats/heatmap Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Get 168-cell heatmap (dow * 24 + hour, UTC). ```APIDOC ## GET /api/v1/releases/stats/heatmap ### Description Get 168-cell heatmap (dow * 24 + hour, UTC). ### Method GET ### Endpoint /api/v1/releases/stats/heatmap ``` -------------------------------- ### Run the mock indexer Source: https://github.com/autobrr/autobrr/blob/develop/CONTRIBUTING.md Execute the mock indexer locally using the Go toolchain. ```shell go run test/mockindexer/main.go ``` -------------------------------- ### GET /releases/stats/volume Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Get daily download volume (size of approved pushes). ```APIDOC ## GET /api/v1/releases/stats/volume ### Description Get daily download volume (size of approved pushes). ### Method GET ### Endpoint /api/v1/releases/stats/volume ### Parameters #### Query Parameters - **days** (integer) - Optional - Number of days ``` -------------------------------- ### Initialize Application Base URL and Theme Source: https://github.com/autobrr/autobrr/blob/develop/web/index.html Sets the application's base URL dynamically and applies a theme based on user preferences or system settings. Requires JavaScript to be enabled. ```javascript window.APP = {}; window.APP.baseUrl = "{{.BaseUrl}}"; // Update the base tag dynamically const base = document.createElement('base'); base.href = window.APP.baseUrl; document.head.appendChild(base); const browserPrefers = !(window.matchMedia !== undefined && window.matchMedia("(prefers-color-scheme: light)").matches); const {darkTheme = browserPrefers} = JSON.parse(localStorage.getItem("settings")) || {}; document.documentElement.classList.toggle("dark", darkTheme); ``` -------------------------------- ### Clone the repository Source: https://github.com/autobrr/autobrr/blob/develop/CONTRIBUTING.md Initial step to download the project source code. ```shell git clone https://github.com/YOURNAME/autobrr.git && cd autobrr ``` -------------------------------- ### Build the frontend Source: https://github.com/autobrr/autobrr/blob/develop/CONTRIBUTING.md Compiles the frontend assets for production. ```shell pnpm --dir web run build ``` -------------------------------- ### GET /releases/{releaseID} Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Get single release details with full metadata and action history. ```APIDOC ## GET /api/v1/releases/{releaseID} ### Description Get single release details with full metadata and action history. ### Method GET ### Endpoint /api/v1/releases/{releaseID} ### Parameters #### Path Parameters - **releaseID** (integer) - Required - Release ID ### Response #### Success Response (200) - **id** (integer) - Release ID - **torrent_name** (string) - Full torrent name - **title** (string) - Release title ``` -------------------------------- ### Backend development commands Source: https://github.com/autobrr/autobrr/blob/develop/CONTRIBUTING.md Commands to manage Go dependencies and run the backend application. ```shell go mod download ``` ```shell go run cmd/autobrr/main.go ``` -------------------------------- ### DownloadClientSettings Methods Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/download-client-domain.md Methods for handling JSON marshaling and unmarshaling, ensuring backward compatibility by converting Basic to Auth. ```go func (dcs *DownloadClientSettings) MarshalJSON() ([]byte, error) ``` ```go func (dcs *DownloadClientSettings) UnmarshalJSON(data []byte) error ``` -------------------------------- ### GET /health Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Performs a health check on the service. ```APIDOC ## GET /health ### Description Health check endpoint (no auth required). ### Method GET ### Endpoint /health ### Response #### Success Response (200) - **status** (string) - The status of the service - **version** (string) - The current version of the service #### Response Example { "status": "ok", "version": "2.3.0" } ``` -------------------------------- ### GET /auth/user Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Retrieves the currently authenticated user. ```APIDOC ## GET /auth/user ### Description Get current authenticated user. ### Method GET ### Endpoint /auth/user ``` -------------------------------- ### Download Client Service Interface Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/service-layer.md Defines the contract for managing download client configurations and retrieving initialized client instances. ```go type downloadClientService interface { Find(ctx context.Context) ([]*domain.DownloadClient, error) Get(ctx context.Context, id int32) (*domain.DownloadClient, error) Store(ctx context.Context, client *domain.DownloadClient) (int32, error) Update(ctx context.Context, client *domain.DownloadClient) error Delete(ctx context.Context, id int32) error GetClient(ctx context.Context, id int32) (interface{}, error) // returns typed client } ``` -------------------------------- ### GET /releases/indexers Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Retrieves a list of all available indexers. ```json { "indexers": [ "ptp", "ggn", "redacted", "ops" ] } ``` -------------------------------- ### GET /releases/stats/indexers Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Top indexers by approved pushes. ```APIDOC ## GET /api/v1/releases/stats/indexers ### Description Top indexers by approved pushes. ### Method GET ### Endpoint /api/v1/releases/stats/indexers ### Parameters #### Query Parameters - **days** (integer) - Optional - Number of days - **limit** (integer) - Optional - Top N indexers ``` -------------------------------- ### POST /releases/process Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Manually triggers the processing of a release for testing purposes. ```json { "indexer_identifier": "ptp", "indexer_implementation": "IRC", "announce_lines": [ "[ANNOUNCE] Release.Name.2024.1080p.BluRay.x264 | Movies | 5GB | FREELEECH" ] } ``` ```json { "matched_filters": 1, "releases": [ { "id": 12345, "torrent_name": "Release.Name.2024.1080p.BluRay.x264" } ] } ``` -------------------------------- ### GET /releases/indexers Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Retrieves a list of available indexers for filtering. ```APIDOC ## GET /releases/indexers ### Description Get list of available indexers for filtering. ### Method GET ### Endpoint /releases/indexers ### Response #### Success Response (200) - **indexers** (string[]) - List of indexer identifiers #### Response Example { "indexers": [ "ptp", "ggn", "redacted", "ops" ] } ``` -------------------------------- ### Build Autobrr Web for Production Source: https://github.com/autobrr/autobrr/blob/develop/web/README.md This command creates an optimized production build of the application in the 'dist' folder. It bundles React in production mode and minifies the output with hashed filenames for efficient deployment. ```bash pnpm run build ``` -------------------------------- ### GET /releases/stats Response Format Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Aggregate statistics for all releases. ```json { "total_count": 10000, "filtered_count": 8000, "filter_rejected_count": 2000, "push_approved_count": 7500, "push_rejected_count": 300, "push_error_count": 200 } ``` -------------------------------- ### GET /api/v1/config Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Retrieves the current configuration (requires admin privileges). ```APIDOC ## GET /api/v1/config ### Description Get current configuration (requires admin). ### Method GET ### Endpoint /api/v1/config ``` -------------------------------- ### Configure Action Field Macros Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/README.md Use these patterns within action fields to dynamically inject release metadata and torrent data. ```text Category: "Movies/{Category}/{Year}/" Tags: "autobrr,{Source},{Codec}" WebhookData: {"name":"{TorrentName}","category":"{Category}"} ``` -------------------------------- ### GET /filters/{filterID}/test Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Test filter matching against sample releases. ```APIDOC ## GET /filters/{filterID}/test ### Description Test filter matching against sample releases. ### Method GET ### Endpoint /filters/{filterID}/test ### Parameters #### Path Parameters - **filterID** (integer) - Required - The ID of the filter #### Query Parameters - **test_releases** (string) - Required - Comma-separated release names to test ### Response #### Success Response (200) - **results** (array) - List of test results ``` -------------------------------- ### DownloadClientSettings Structure Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/download-client-domain.md Defines the configuration options for download clients. Note that the Basic field is deprecated in favor of Auth. ```go type DownloadClientSettings struct { APIKey string Basic BasicAuth Rules DownloadClientRules ExternalDownloadClientId int ExternalDownloadClient string Auth DownloadClientAuth } ``` -------------------------------- ### GET /releases/stats/filters Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Retrieves statistics for top filters based on matched releases. ```json { "days": 30, "top": [ { "filter": "HD Movies", "matched_count": 300, "push_approved_count": 280 } ] } ``` -------------------------------- ### Define and Validate a Filter in Go Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/filter-domain.md Demonstrates initializing a Filter struct, validating it, and checking a release against the defined criteria. ```go // Create a filter filter := &Filter{ Name: "HD Movies", Enabled: true, MinSize: "1GB", MaxSize: "10GB", Resolutions: []string{"1080p"}, Codecs: []string{"x264", "x265"}, Sources: []string{"BluRay", "WEB-DL"}, MatchReleases: "action, drama", ExceptReleases: "documentary", UseRegex: false, MaxDownloads: 5, MaxDownloadsUnit: FilterMaxDownloadsDay, } // Validate filter if err := filter.Validate(); err != nil { log.Fatal(err) } // Check if release matches release := &Release{ Title: "Action Movie", Resolution: "1080p", Codec: []string{"x264"}, Source: "BluRay", } rejections, passes := filter.CheckFilter(release) if !passes { fmt.Printf("Release rejected: %v\n", rejections.Reasons) } ``` -------------------------------- ### GET /releases/stats/indexers Response Format Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Top indexers ranked by approved pushes. ```json { "days": 30, "top": [ { "indexer": "PassThePopcorn", "matched_count": 500, "push_approved_count": 450 }, { "indexer": "GGn", "matched_count": 300, "push_approved_count": 280 } ] } ``` -------------------------------- ### POST /download-clients Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Create new download client. ```APIDOC ## POST /download-clients ### Description Create new download client. ### Method POST ### Endpoint /download-clients ``` -------------------------------- ### Get Torrent Data Reader Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/release-domain.md Returns an io.Reader for accessing in-memory torrent data. ```go func (r *Release) TorrentReader() io.Reader ``` -------------------------------- ### GET /health Response Body Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Standard response format for the health check endpoint. ```json { "status": "ok", "version": "2.3.0" } ``` -------------------------------- ### Build Docker images Source: https://github.com/autobrr/autobrr/blob/develop/CONTRIBUTING.md Commands to build standard or cross-platform Docker images for the project. ```shell make build/docker ``` ```shell make build/dockerx ``` -------------------------------- ### Run Go integration tests Source: https://github.com/autobrr/autobrr/blob/develop/AGENTS.md Executes integration tests located in the test/integration directory, requiring Docker for Postgres. ```bash go test ./... -tags=integration ``` -------------------------------- ### Configure Database Settings Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/configuration.md Sets the database type and connection details for SQLite or PostgreSQL. ```toml [database] type = "sqlite" # "sqlite" or "postgres" max_backups = 5 # SQLite backup count dsn = "" # Connection string (use this OR individual settings) [database.postgres] host = "localhost" port = 5432 database = "autobrr" user = "autobrr" password = "" sslmode = "disable" # "disable", "require", "verify-ca", "verify-full" socket = "" # Unix socket path extra_params = "" # Additional connection parameters ``` -------------------------------- ### Define DownloadClientType types Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/types.md Represents the supported download client types. ```go type DownloadClientType string const ( DownloadClientTypeQbittorrent DownloadClientType = "QBITTORRENT" DownloadClientTypeDelugeV1 DownloadClientType = "DELUGE_V1" DownloadClientTypeDelugeV2 DownloadClientType = "DELUGE_V2" DownloadClientTypeRTorrent DownloadClientType = "RTORRENT" DownloadClientTypeTransmission DownloadClientType = "TRANSMISSION" DownloadClientTypePorla DownloadClientType = "PORLA" DownloadClientTypeAria2 DownloadClientType = "ARIA2" DownloadClientTypeSabnzbd DownloadClientType = "SABNZBD" DownloadClientTypeNzbget DownloadClientType = "NZBGET" ) ``` -------------------------------- ### Define ReleaseProcessReq structure Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/types.md Request structure for processing release announcements. ```go type ReleaseProcessReq struct { IndexerIdentifier string IndexerImplementation string AnnounceLines []string } ``` -------------------------------- ### Build Frontend Assets Source: https://github.com/autobrr/autobrr/blob/develop/test/e2e/README.md Compiles the web frontend required for the tests to function. ```sh cd web && pnpm install --frozen-lockfile && pnpm run build ``` -------------------------------- ### GET /releases/stats/heatmap Response Format Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Heatmap data representing release activity over a 168-cell grid. ```json { "days": 7, "heatmap": [ 100, 95, 87, 72, 45, 23, 15, // Sunday hours 0-6 120, 145, 180, 200, 195, 170, 150, // Sunday hours 7-13 // ... more cells for remaining days and hours ] } ``` -------------------------------- ### Configure TLS for Download Clients Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/download-client-domain.md Enables TLS encryption and skips certificate validation for self-signed certificates. ```go // Example: Self-signed certificate client := &DownloadClient{ Host: "192.168.1.100", Port: 8080, TLS: true, TLSSkipVerify: true, } ``` -------------------------------- ### GET /releases/{releaseID} Response Format Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md The detailed metadata response for a single specific release. ```json { "id": 12345, "torrent_name": "Release.Name.2024.1080p.BluRay.x264-Group", "title": "Release Name", "subtitle": "Season 1", "type": "Series", "size": 5368709120, "protocol": "torrent", "implementation": "IRC", "category": "TV", "resolution": "1080p", "source": "BluRay", "codec": ["x264"], "container": "mkv", "group": "Group", "season": 1, "episode": 5, "year": 2024, "proper": false, "repack": false, "freeleech": true, "seeders": 50, "leechers": 10, "timestamp": "2024-08-13T10:30:00Z", "indexer": { ... }, "filter": "Filter Name", "action_status": [ ... ] } ``` -------------------------------- ### Minimal SQLite Configuration Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/configuration.md Basic configuration for running autobrr with a local SQLite database. ```toml [server] host = "127.0.0.1" port = 7474 [database] type = "sqlite" ``` -------------------------------- ### Run a single Go test Source: https://github.com/autobrr/autobrr/blob/develop/AGENTS.md Execute a specific test function within a package. ```bash go test ./path/to/pkg -run TestName ``` -------------------------------- ### GET /releases/stats/filters Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Retrieves the top filters by matched releases based on specified time range and limit. ```APIDOC ## GET /releases/stats/filters ### Description Returns the top filters by matched releases. ### Method GET ### Endpoint /releases/stats/filters ### Parameters #### Query Parameters - **days** (integer) - Optional - Number of days - **limit** (integer) - Optional - Top N filters ### Response #### Success Response (200) - **days** (integer) - Number of days - **top** (array) - List of top filters #### Response Example { "days": 30, "top": [ { "filter": "HD Movies", "matched_count": 300, "push_approved_count": 280 } ] } ``` -------------------------------- ### Configure Logging Settings Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/configuration.md Controls log levels, file paths, and rotation policies. ```toml [logging] level = "INFO" # DEBUG, INFO, WARN, ERROR path = "" # Log file path (stdout if empty) max_size = 10 # Max log file size in MB (before rotation) max_backups = 5 # Number of rotated logs to keep ``` -------------------------------- ### Execute Transactional Operations Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/service-layer.md Demonstrates wrapping multiple repository operations within a transaction to ensure atomicity. ```go // Example: Store filter with actions err := s.WithTx(ctx, func(tx Transaction) error { filterID, err := tx.Filter().Store(ctx, filter) if err != nil { return err } for _, action := range filter.Actions { action.FilterID = int(filterID) _, err := tx.Action().Store(ctx, action) if err != nil { return err // Tx rolled back } } return nil // Tx committed }) ``` -------------------------------- ### Get MD5 Hash of Release Name Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/release-domain.md Returns the MD5 hash of the normalized release name for duplicate detection. ```go func (r *Release) Hash() string ``` -------------------------------- ### Configure Profiling Settings Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/configuration.md Enables pprof profiling for debugging and performance analysis. ```toml [profiling] enabled = false host = "127.0.0.1" port = 6060 ``` -------------------------------- ### Default Configuration File Structure Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/configuration.md The default config.toml file generated on the first run of the application. ```toml [server] host = "127.0.0.1" port = 7474 base_url = "/" base_url_mode_legacy = true [database] type = "sqlite" max_backups = 5 [logging] level = "INFO" path = "" max_size = 10 max_backups = 5 [auth.oidc] enabled = false disable_built_in_login = false [indexers] custom_definitions = "" check_for_updates = true [metrics] enabled = false host = "127.0.0.1" port = 9074 [profiling] enabled = false host = "127.0.0.1" port = 6060 ``` -------------------------------- ### Run Go unit tests Source: https://github.com/autobrr/autobrr/blob/develop/AGENTS.md Executes standard Go tests while excluding integration tests. ```bash go test $(go list ./... | grep -v test/integration) ``` -------------------------------- ### POST /releases/process Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Manually process a release for testing purposes. ```APIDOC ## POST /releases/process ### Description Manually process a release (for testing). ### Method POST ### Endpoint /releases/process ### Parameters #### Request Body - **indexer_identifier** (string) - Required - Indexer identifier - **indexer_implementation** (string) - Required - Indexer implementation type - **announce_lines** (string[]) - Required - List of announce lines ### Response #### Success Response (200) - **matched_filters** (integer) - Number of matched filters - **releases** (array) - List of processed releases #### Response Example { "matched_filters": 1, "releases": [ { "id": 12345, "torrent_name": "Release.Name.2024.1080p.BluRay.x264" } ] } ``` -------------------------------- ### CheckFilter Method Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/filter-domain.md Evaluates all filter rules against a release and returns rejection reasons and pass/fail status. ```go func (f *Filter) CheckFilter(r *Release) (*RejectionReasons, bool) ``` -------------------------------- ### Configure Indexer Settings Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/configuration.md Sets paths for custom indexer definitions and update behavior. ```toml [indexers] custom_definitions = "" # Path to custom indexer definitions check_for_updates = true # Check for indexer definition updates ``` -------------------------------- ### Nginx Reverse Proxy Configuration Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/configuration.md Example Nginx server block to handle HTTPS termination and proxy requests to the autobrr service. ```nginx server { listen 443 ssl; server_name autobrr.example.com; ssl_certificate /etc/letsencrypt/live/autobrr.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/autobrr.example.com/privkey.pem; location /autobrr/ { proxy_pass http://localhost:7474/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } ``` -------------------------------- ### Update Indexer Request Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Example JSON request body for the PUT /indexers/{indexerID} endpoint. Secret settings must be included in the update. ```json { "enabled": false, "settings": { "passkey": "***key" } } ``` -------------------------------- ### Configure Server Settings Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/configuration.md Defines the host, port, and reverse proxy settings for the autobrr server. ```toml [server] host = "127.0.0.1" # Listen address port = 7474 # Listen port base_url = "/" # Base URL for reverse proxy base_url_mode_legacy = true # Legacy proxy mode ``` -------------------------------- ### CheckMacrosNeedTorrentTmpFile Method Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/action-domain.md Checks if action macros reference torrent path fields that require writing a file to disk. ```go func (a *Action) CheckMacrosNeedTorrentTmpFile(release *Release) bool ``` -------------------------------- ### CheckReleaseSize Method Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/filter-domain.md Validates release size against min/max limits parsed from human-readable strings. ```go func (f *Filter) CheckReleaseSize(releaseSize uint64) (bool, error) ``` -------------------------------- ### Webhook with Timeout and Status Parameters Source: https://github.com/autobrr/autobrr/blob/develop/test/mockindexer/README.md Example of using the MockIndexer as a webhook endpoint with custom timeout and status code parameters. The timeout specifies a delay in seconds before responding, and status sets the HTTP response status code. ```url http://localhost:3999/webhook?timeout=2&status=500 ``` -------------------------------- ### BasicAuth Structure Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/download-client-domain.md Deprecated authentication structure. Use DownloadClientAuth instead. ```go type BasicAuth struct { Auth bool Username string Password string } ``` -------------------------------- ### Run IRC integration tests Source: https://github.com/autobrr/autobrr/blob/develop/test/irc/README.md Commands to execute the IRC integration tests using the required build tag. ```sh # just the irc integration tests: go test -tags=irc_integration_test ./test/irc/... # with the race detector: go test -tags=irc_integration_test -race ./test/irc/... # as part of the whole suite: go test -tags=irc_integration_test ./... ``` -------------------------------- ### PostgreSQL with Reverse Proxy Configuration Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/configuration.md Configuration for using a PostgreSQL database and setting a base URL for reverse proxy compatibility. ```toml [server] host = "0.0.0.0" port = 7474 base_url = "/autobrr/" [database] type = "postgres" [database.postgres] host = "db.example.com" port = 5432 database = "autobrr" user = "autobrr" password = "secure-password" sslmode = "require" [logging] level = "INFO" path = "/var/log/autobrr/autobrr.log" max_size = 50 max_backups = 10 ``` -------------------------------- ### Stringify ReleaseImplementation Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/types.md Method to convert ReleaseImplementation to its string representation. ```go func (r ReleaseImplementation) String() string ``` -------------------------------- ### PUT /download-clients/{clientID} Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/http-endpoints.md Update client (passwords must be included). ```APIDOC ## PUT /download-clients/{clientID} ### Description Update client (passwords must be included). ### Method PUT ### Endpoint /download-clients/{clientID} ### Parameters #### Path Parameters - **clientID** (integer) - Required - The ID of the download client ``` -------------------------------- ### Define FeedSettings structure Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/indexer-domain.md Configuration schema for RSS, Torznab, and Newznab feed integration. ```go type FeedSettings struct { URL string Interval int Timeout int Headers []string CookieString string RedownloadNx int } ``` -------------------------------- ### DownloadClient struct definition Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/download-client-domain.md Represents the configuration and connection state for an external download client. ```go type DownloadClient struct { ID int32 Name string Type DownloadClientType Enabled bool Host string Port int TLS bool TLSSkipVerify bool Username string Password string Settings DownloadClientSettings Client any // cached HTTP client } ``` -------------------------------- ### Run non-integration backend tests Source: https://github.com/autobrr/autobrr/blob/develop/CONTRIBUTING.md Executes all unit tests within the project using the Go test tool. ```shell go test -v ./... ``` -------------------------------- ### Run autobrr test suites Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/README.md Execute different categories of tests using Go build tags to include or exclude specific test types. ```bash # Unit tests only go test ./... # Include integration tests (needs database) go test -tags=integration ./... # IRC integration tests (in-process ircd) go test -tags=irc_integration_test ./test/irc/... # End-to-end tests (browser automation) go test -tags=e2e ./test/e2e/... ``` -------------------------------- ### DownloadClientRules Structure Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/download-client-domain.md Defines client-specific behavior rules such as download limits and magnet size thresholds. ```go type DownloadClientRules struct { Enabled bool MaxActiveDownloads int MaxActiveMagnetCount int MaxMagnetSize int64 } ``` -------------------------------- ### Stringify ReleaseProtocol Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/types.md Method to convert ReleaseProtocol to its string representation. ```go func (r ReleaseProtocol) String() string ``` -------------------------------- ### Define Release Repository Interface Source: https://github.com/autobrr/autobrr/blob/develop/_autodocs/service-layer.md Defines the CRUD operations and query capabilities for release data access. ```go type releaseRepository interface { Store(ctx context.Context, release *domain.Release) (int64, error) Get(ctx context.Context, id int64) (*domain.Release, error) Find(ctx context.Context, query QueryParams) ([]Release, error) Count(ctx context.Context) (int64, error) Delete(ctx context.Context, id int64) error } ```