Commit graph

282 commits

Author SHA1 Message Date
1242c19883
Add support for using freeleech tokens if available 2025-07-11 10:12:43 +12:00
ze0s
bc1ec844ff
feat(macros): add Cookie (#2107) 2025-06-22 13:08:38 +02:00
ze0s
46f6fbe5cc
feat(feeds): optimize existing cache items check (#2078)
* feat(feeds): optimize existing items cache check

* feat(feeds): remove ttl from repo method ExistingItems

* feat(feeds): add db integration test for ExistingItems

* feat(feeds): improve release and filter processing

* feat(feeds): fix failing test
2025-06-07 12:46:08 +02:00
Lucian Maly
4ce2241991
feat(lists): add option to skip cleaning of Plaintext data (#2036)
* Added: Plaintext untouched

* Revert "Added: Plaintext untouched"

This reverts commit e6ceaec5f4776cfc8335ae2c02e1caa4a2bbb0bc.

* Added: skipCleanSanitize

* TS definition for List object doesn't yet know about the new skip_clean_sanitize property

* Update: ListForms.tsx with the bypass option

* Update: Database internals for skip_clean_sanitize

* Fix: Snake case
2025-06-01 15:27:48 +02:00
ze0s
fe4f385a22
feat(database): connect postgres via socket and read config from env _FILE secrets (#2061)
* feat(database): connect postgres via socket

* feat(config): read env var secrets from file

* docs: explain env var secrets

* refactor: generate postgres dsn
2025-05-05 21:15:24 +02:00
Fabricio Silva
b980b5530d
feat(filters): add DSD formats to music (#1993) 2025-05-01 15:38:56 +02:00
ze0s
a0dfe89032
fix(filters): multi-single value dynamic range matching (#2033) 2025-05-01 15:08:37 +02:00
nuxen
7c5f5ac9fd
fix(macros): set HasLog when Log Score is missing in announce (#2052)
fix(tags): HasLog not correct when Log Score is omitted in announce
2025-05-01 14:22:28 +02:00
Alex Belanger
6073480bc4
feat(indexers): add T66y (#2044)
* Adds t66y indexer + irc support for templated infohashes and magnet uris.

* Removed trackers from t66y magnets.

* No need to templatize the torrenthash.

* Fixed tests.

* Opps, correct tests again.

* Moved torrentHash to mapvars.

* Removed field and renamed arg.

* feat(indexers): add test parseurls magneturi

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2025-04-27 18:37:31 +02:00
soup
c7efcf1b75
feat(macros): implement template cache (#2049)
* feat(macros): implement template cache

* fix: typo in error

* fix(macros): set DefaultTTL

* fix: accidentally removed SetTimerResolution

* revert: set NoTTL in MustParse
2025-04-27 14:02:39 +02:00
ze0s
ef7317dde6
feat(filters): show current download count in list (#2001)
* feat(filters): show current and max downloads in list

* feat(filters): remove unused func param
2025-03-16 18:33:47 +01:00
soup
ac0b407255
refactor(config): remove mapstructure from OIDC (#1973) 2025-03-02 18:08:22 +01:00
Fabricio Silva
b724429b97
feat(lists): add anilist support (#1949)
* fix(lists): clear selected list

* chore(web): improve onChange set values for select_wide

* feat(web): add anilist lists

* feat(web): Filter is required on ListForm

* fix(web): ListForm reset url when change type

* feat(lists): add anilist support

* feat(lists): filter duplicates for anilist

* feat(anilist): handle special characters

* fix(lists): better title matching
fix(lists): add alternatives to apostrophe replacement

* test(title): add some anime cases

* feat(anilist): replace unicodes with regex

* feat(lists): move additional anilist processing to autobrr instead of brr api

* feat(lists): clean Unicode Block “Latin Extended-A” chars

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2025-01-31 19:17:23 +01:00
soup
024371e4eb
feat(auth): add option to disable built-in login when using OIDC (#1908)
* feat(auth): disable built-in login by config

* cleanup config

* fix(web): prevent login form flash by waiting for OIDC config

* refactor(config): standardize OIDC TOML format

- Adds camelCase TOML tags to OIDC config struct while keeping mapstructure tags for backward compatibility
- Updates config template to use camelCase format

* refactor: kyles changes

* refactor: prefix disablebuiltinlogin with oidc

* docs: revert format change

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2025-01-26 15:25:34 +01:00
Antoine
3f8bc0140c
feat(metrics): add metrics server (#1930)
* feat(metrics): add metrics server

* chore: update license headers

* feat(metrics): add optional basic auth

* feat(metrics): add go and process collectors

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
Co-authored-by: ze0s <ze0s@riseup.net>
2025-01-25 17:58:18 +01:00
soup
25574446f7
chore(license): update copyright year in headers (#1935) 2025-01-08 08:38:10 +01:00
soup
0391629862
chore(license): update copyright year in headers (#1929)
* chore: update copyright year in license headers

* Revert "chore: update copyright year in license headers"

This reverts commit 3e58129c431b9a491089ce36b908f9bb6ba38ed3.

* chore: update copyright year in license headers

* fix: sort go imports

* fix: add missing license headers
2025-01-06 22:23:19 +01:00
ze0s
338bcf38bb
feat(releases): improve collections/website/streaming service parsing (#1923)
* feat(releases): improve collections/website/streaming service parsing

* feat(releases): add more streaming services
2025-01-06 22:09:26 +01:00
ze0s
40c5462df9
fix(lists): improve parsing and exclude unwanted characters (#1918)
* fix(lists): improve parsing and ignore invalid titles

* chore: add missing license headers

* fix(lists): add missing tests from omegabrr
2025-01-03 12:45:58 +01:00
ze0s
9ae798c99a
feat(macros): add MetaIMDB (#1891)
feat(macros): add IMDB

* only supported by PTP at this time
2024-12-25 23:59:13 +01:00
kenstir
4009554d10
feat(filters): skip duplicates (#1711)
* feat(filters): skip duplicates

* fix: add interface instead of any

* fix(filters): tonullint

* feat(filters): skip dupes check month day

* chore: cleanup

* feat(db): set autoincrement id

* feat(filters): add repack and proper to dupe profile

* feat(filters): add default dupe profiles

* feat(duplicates): check audio and website

* feat(duplicates): update tests

* feat(duplicates): add toggles on addform

* feat(duplicates): fix sqlite upgrade path and initialize duplicate profiles

* feat(duplicates): simplify sqlite upgrade

avoiding temp table and unwieldy select.  Besides, FK constraints
are turned off anyway in #229.

* feat(duplicates): change CheckIsDuplicateRelease treatment of PROPER and REPACK

"Proper" and "Repack" are not parallel to the other conditions like "Title",
so they do not belong as dedup conditions.  "PROPER" means there was an issue in
the previous release, and so a PROPER is never a duplicate, even if it replaces
another PROPER.  Similarly, "REPACK" means there was an issue in the previous
release by that group, and so it is a duplicate only if we previously took a
release from a DIFFERENT group.

I have not removed Proper and Repack from the UI or the schema yet.

* feat(duplicates): update postgres schema to match sqlite

* feat(duplicates): fix web build errors

* feat(duplicates): fix postgres errors

* feat(filters): do leftjoin for duplicate profile

* fix(filters): partial update dupe profile

* go fmt `internal/domain/filter.go`

* feat(duplicates): restore straightforward logic for proper/repack

* feat(duplicates): remove mostly duplicate TV duplicate profiles

Having one profile seems the cleanest.  If somebody wants multiple
resolutions then they can add Resolution to the duplicate profile.
Tested this profile with both weekly episodic releases and daily
show releases.

* feat(release): add db indexes and sub_title

* feat(release): add IsDuplicate tests

* feat(release): update action handler

* feat(release): add more tests for skip duplicates

* feat(duplicates): check audio

* feat(duplicates): add more tests

* feat(duplicates): match edition cut and more

* fix(duplicates): tests

* fix(duplicates): missing imports

* fix(duplicates): tests

* feat(duplicates): handle sub_title edition and language in ui

* fix(duplicates): tests

* feat(duplicates): check name against normalized hash

* fix(duplicates): tests

* chore: update .gitignore to ignore .pnpm-store

* fix: tests

* fix(filters): tests

* fix: bad conflict merge

* fix: update release type in test

* fix: use vendored hot-toast

* fix: release_test.go

* fix: rss_test.go

* feat(duplicates): improve title hashing for unique check

* feat(duplicates): further improve title hashing for unique check with lang

* feat(duplicates): fix tests

* feat(duplicates): add macros IsDuplicate and DuplicateProfile ID and name

* feat(duplicates): add normalized hash match option

* fix: headlessui-state prop warning

* fix(duplicates): add missing year in daily ep normalize

* fix(duplicates): check rejections len

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2024-12-25 22:33:46 +01:00
soup
d153ac44b8
feat(filters): RED and OPS fetch record label from API (#1881)
* feat(filters): RED and OPS fetch record label from API

* test: add record label to RED and OPS test data

* refactor: record label check

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2024-12-25 13:39:03 +01:00
ze0s
221bc35371
feat(lists): integrate Omegabrr (#1885)
* feat(lists): integrate Omegabrr

* feat(lists): add missing lists index

* feat(lists): add db repo

* feat(lists): add db migrations

* feat(lists): labels

* feat(lists): url lists and more arrs

* fix(lists): db migrations client_id wrong type

* fix(lists): db fields

* feat(lists): create list form wip

* feat(lists): show in list and create

* feat(lists): update and delete

* feat(lists): trigger via webhook

* feat(lists): add webhook handler

* fix(arr): encode json to pointer

* feat(lists): rename endpoint to lists

* feat(lists): fetch tags from arr

* feat(lists): process plaintext lists

* feat(lists): add background refresh job

* run every 6th hour with a random start delay between 1-35 seconds

* feat(lists): refresh on save and improve logging

* feat(lists): cast arr client to pointer

* feat(lists): improve error handling

* feat(lists): reset shows field with match release

* feat(lists): filter opts all lists

* feat(lists): trigger on update if enabled

* feat(lists): update option for lists

* feat(lists): show connected filters in list

* feat(lists): missing listSvc dep

* feat(lists): cleanup

* feat(lists): typo arr list

* feat(lists): radarr include original

* feat(lists): rename ExcludeAlternateTitle to IncludeAlternateTitle

* fix(lists): arr client type conversion to pointer

* fix(actions): only log panic recover if err not nil

* feat(lists): show spinner on save

* feat(lists): show icon in filters list

* feat(lists): change icon color in filters list

* feat(lists): delete relations on filter delete
2024-12-25 13:23:37 +01:00
soup
43c28fc0c6
feat(auth): implement auth proxy support with OpenID Connect (#1853)
* feat(auth): implement oidc

* refactor(auth): centralize OIDC state cookie handling

* fix(web): resolve unused error variables in route handlers

* docs(readme): add OIDC authentication feature to list

* fix(auth): improve OIDC cookie handling for reverse proxy setups

The OIDC state cookie's Secure flag is now properly set when running behind a reverse proxy by checking both direct TLS and X-Forwarded-Proto header. This fixes authentication issues in common setups where:

- autobrr runs behind a reverse proxy that terminates HTTPS
- local development environments without TLS
- mixed protocol environments (internal HTTP, external HTTPS)

* fix: use crypt/random if argon2id fails

* feat(auth): show both login options when user exists in db

if user doesn't exist, e.g. canOnboard=true then we only show the OIDC button, since regular login makes no sense in that case

If user does not exist in db and the user wants to create a local user, OIDC needs to be disabled first

* feat(auth): improve OIDC provider initialization with discovery logging

* revert(issuer): do not remove trailing slash

* feat(auth): improve OIDC username resolution with additional claims

* fix(auth): handle OIDC issuer URLs with and without trailing slashes

When initializing the OIDC provider, automatically retry with/without trailing
slash if the first attempt fails.

- First attempts with original issuer URL
- If fails with trailing slash, retries without
- If fails without trailing slash, retries with

* feat(oidc): add gorilla sessions store for secure state management

Add gorilla sessions store to handle encrypted state cookies in OIDC flow,
while removing redundant session validation checks

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>

* fix(auth): prevent duplicate OIDC state cookies for authenticated sessions

Modify OIDC config handler to check for existing authenticated sessions
before setting state cookie. Still returns OIDC enabled status to maintain
UI state, but prevents unnecessary cookie creation for authenticated users.

* feat(oidc): use random secret for temporary state cookies

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>

* feat(auth): add rate limiting to OIDC endpoints

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>

* fix(auth): validate OIDC authorization code presence in callback

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>

* fix(auth): properly handle OIDC session errors

Improve error handling in OIDC login flow by properly handling cookie store
session errors. Return HTTP 500 if session cannot be retrieved instead of
silently continuing with potentially invalid state.

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>

* feat(auth): track and display authentication method for oidc and password logins

* fix: tests

* docs(readme): add environment variable section

* go mod tidy

* chore: log style and errors

---------

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
Co-authored-by: ze0s <ze0s@riseup.net>
2024-12-19 14:41:31 +01:00
KaiserBh
4432dfb099
feat(http): implement proper BaseUrl support to coexist with legacy mode (#1298)
* refactor: remove baseUrl from api calls and sseBaseUrl

* refactor: set cookie session to '/'.

Since that's where the api endpoint is that way we set it to the root domain, we can't set it to the subfolder since the api is called directly now and not using the baseUrl.

* feat: add the baseUrl route.

When user for example is in `/autobrr` and hit reload it should just return the index.html.

* refactor: now it have to be `/autobrr`

Remove the trailing `/`, now base url is set to /autobrr aligned with other arrs.

* refactor: remove baseUrl stuff.

* refactor: use separate router for the api endpoint and the baseUrl.

I don't think we need separate router, but I didn't test it, so feel free to test it and see if it works without the separate router, the whole point was to make sure that it's not prefixed with baseUrl and I noticed that it was being called in the frontend `APIClients.ts`. So yea just check if it works without it then keep the old one.

Also removed the index since it was zombie code not being used anywhere.

* feat: Dynamic base url.

* fix: auth handler deps

* feat(http): mount web and api on baseurl

* feat(http): web api client routes

* feat(http): baseurl legacy mode

* feat(http): baseurl legacy mode test

* feat(http): add assetBaseUrl

* feat(http): try separate web handlers

* feat(http): improve file serving

* feat(http): ignore .gitkeep

* fix(assets): windows paths

* fix(assets): windows paths trimprefix

* fix(assets): windows paths join

* fix(assets): cleanup

* fix(assets): additional web route check

* feat(http): add comments

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2024-12-19 12:56:04 +01:00
Alexander Chernov
acef4ac624
feat(filters): RED and OPS fetch uploader from API (#1348)
* feat: added uploader when fetching torrent details on RED indexer

* revert

* tests

* refactor(filters): size and uploader api checks

* refactor(filters): fix test

* refactor(filters): add mutex to rejections

---------

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
Co-authored-by: ze0s <ze0s@riseup.net>
2024-12-17 20:39:09 +01:00
ze0s
04c4bd482f
feat(releases): improve freeleech parsing (#1880)
* capture fl as freeleech from vars
2024-12-17 16:05:18 +01:00
ze0s
e808edab50
fix(releases): set freeleech from downloadVolumeFactor (#1873)
* fix(releases): set freeleech from downloadVolumeFactor

* fix(releases): set freeleechpercent from downloadVolumeFactor
2024-12-11 16:44:09 +01:00
ze0s
24f31574e5
feat(indexers): update PTP announce to new format (#1738)
* feat(indexers): update PTP to new format

* fix: update expect line

* feat: use unique key for dl link

* feat: update pattern

* fix: definition tests

* feat: rename var

* feat: add custom vars map

* feat: start mapCustomVars

* Update internal/indexer/definitions/ptp.yaml

Co-authored-by: nuxen <felix.schubert1998@gmail.com>

* feat(indexers): map custom indexer vars

* feat: support upload unix epoch time

* feat(releases): update mapvars

* feat(indexers): remove ptp api init

* feat(indexers): update ptp category mapping

* feat(releases): show announce type in details

* feat(releases): mapvars announcetype

---------

Co-authored-by: nuxen <felix.schubert1998@gmail.com>
2024-12-08 23:35:32 +01:00
ze0s
f644b3a4d6
feat(filters): implement AnnounceType (#1837)
* feat(filters): implement AnnounceType

* fix: rss tests
2024-12-08 21:08:24 +01:00
Nuno Sénica
ab718b8232
feat(macros): add Description (#1863)
Add release.Description to macros
2024-12-07 17:44:53 +01:00
ze0s
be9a956598
feat(indexers): update SeedPool IRC announce parsing (#1835)
* feat(indexers): update SeedPool IRC port

* feat(indexers): SeedPool add db migration

* fix(indexers): adapt regex, tests and vars

* fix(indexers): set internal var to origin to fix parsing

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2024-11-24 18:34:40 +01:00
ze0s
f54c51fa06
fix(downloadclient): qBittorrent url parse err handling (#1832)
* fix(downloadclient): qBittorrent url parse err handling

* fix(downloadclient): qBittorrent url parse err handling test
2024-11-24 00:53:59 +01:00
Kyle Sanderson
4cc0f9cc83
feat(tests): add Parallelization where possible (#1823)
* feat(tests): add Parallelization where possible
2024-11-23 15:16:09 +01:00
ze0s
c0882aff84
fix(releases): parse missing source and misinterpreted group name (#1820)
fix(releases): parse missing source and groups
2024-11-23 15:08:58 +01:00
martylukyy
74eea79215
feat(database): SQLite database backups (#1756)
* feat(database): SQLite database backups

* feat(database): do not produce SQL injections

* feat(database): retain all backups if 0 or less
refactor(database): specify database driver in func names

* refactor(database): return early on cleanup

* refactor(database): do not call cleanup func if max backups set to 0

* refactor(database): backup retention behavior

* feat(database): improve logging

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2024-11-12 19:14:45 +01:00
soup
b4f0d60b9b
chore: add missing license headers (#1811)
* chore: add missing license headers

* missing license in test files
2024-11-06 21:37:42 +01:00
ze0s
40fe3e9f54
fix(indexers): delete feed with indexer (#1810)
* fix(indexers): delete feed in one go

* fix(indexers): sort imports

* refactor(feeds): db methods for find
2024-11-06 20:48:46 +01:00
ze0s
59c5858bf0
fix(releases): update size after actions run (#1809) 2024-11-06 18:55:00 +01:00
Kyle Sanderson
f4c2aef38c
fix(indexers): BTFiles size parsing (#1805)
* fix(indexers): btfiles size

* fix: revert btfiles definition tests

* fix(release): strip comma of torrentSize string before parse

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2024-11-06 14:13:27 +01:00
ze0s
63b8519bd9
fix(filters): trim user input (#1784) 2024-10-23 17:42:48 +02:00
ze0s
8f2398a627
fix(filters): lint warning variable naming (#1783)
* fix(filters): variable naming

* fix(filters): variable naming
2024-10-23 17:31:49 +02:00
Kyle Sanderson
f89ea9e2ff
feat(filters): sanitize description (#1781)
feat(filters): sanitize description
2024-10-23 16:44:00 +02:00
ze0s
f029de233f
feat(filters): improve rejection handling (#1776)
* feat(filters): improve rejection handling

* fix(filters): rejection tests

* fix(filters): size check error rejection
2024-10-20 22:58:55 +02:00
ze0s
ca2d956e02
fix(notifications): disable notification and events have no effect (#1754)
fix(notifications): disable notificatio nand events
2024-10-06 14:12:01 +02:00
Kyle Sanderson
e9cd6b0049
fix(sanitize): improve handling for newline tabs etc (#1733)
* fix(sanitize): filter properly \t,,, / etc

* jesus christ.

* bah. probably helps if a human reads the tests.

* k done.

* should be safe now?

* edna?

* real life man
2024-09-19 16:44:19 +02:00
Kyle Sanderson
e9f8730ca0
feat(filters): wildcard slice matching optimizations (#1716)
* chore(tests): add more test cases
* chore(tests): add code comments for matching patterns
* chore(tests): fix typos

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2024-09-14 11:31:26 +02:00
martylukyy
e56bf1f8fc
feat(notifications): Telegram set sender (#1723)
feat(notifications): add conditional sender payload for telegram
2024-09-14 11:03:42 +02:00
Kyle Sanderson
c3824f3519
chore(tests): correct typos (#1715) 2024-09-12 08:19:27 +02:00
ze0s
fd90020400
feat(releases): show indexer name instead of identifier (#1706)
* feat(releases): show indexer name instead of identifier

* feat(releases): remove log in Cell

* feat(releases): update Dashboard recent releases

* fix(releases): db tests

* fix(releases): remove unused code

* fix(releases): remove more unused code

* fix(releases): remove even more unused code

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2024-09-03 14:57:48 +02:00