Commit graph

100 commits

Author SHA1 Message Date
1242c19883
Add support for using freeleech tokens if available 2025-07-11 10:12:43 +12:00
ze0s
1ae8624e05
build(deps): bump Go to 1.24 (#2060)
* build(deps): bump Go to 1.24
2025-05-01 16:36:55 +02:00
soup
f308286484
fix(feeds): handle unicode escaped url characters (#1942)
* fix(rss): handle unicode escaped url characters

* refactor: simplify URL encoding function name

Co-authored-by: nuxen <47067662+nuxencs@users.noreply.github.com>

* feat(feeds): sanitize download url

---------

Co-authored-by: nuxen <47067662+nuxencs@users.noreply.github.com>
Co-authored-by: ze0s <ze0s@riseup.net>
2025-01-18 22:27:38 +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
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
Kyle Sanderson
c1d8a4a850
feat(cache): implement TTLCache and TimeCache (#1822)
* feat(pkg): implement ttlcache and timecache
2024-12-17 21:15:06 +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
b0a30dd136
feat(indexers): REDACTED update urls (#1830)
* feat(indexers): REDACTED update urls

* feat(databse): REDACTED update urls in db with migrations
2024-11-24 14:07:45 +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
41216babe6
fix(proxy): add shared transport for proxies (#1808)
fix(proxy): use separate transport for proxies
2024-11-06 18:55:23 +01:00
Kyle Sanderson
594393eaaf
fix(wildcard): improve short word matching (#1806)
fix(wildcard): improve short word matching
2024-11-06 13:06:27 +01:00
Kyle Sanderson
a003f68f92
feat(http): set ResponseHeaderTimeout (#1777)
fix(http): implement ResponseHeaderTimeout
2024-10-23 17:32:19 +02:00
ze0s
8cd7d67cee
fix(wildcard): match on multi-line data (#1780)
* fix(wildcard): match on multi-line data

* fix(wildcard): remove duplicate block
2024-10-23 16:33:49 +02:00
Kyle Sanderson
5df6e78d3b
fix(wildcard): partial match ignoring consumed pattern (#1765)
* tests(wildcard): ?

* really?

* Franklin

* remember when regex was easy

* ==

* why not.

* I need an adult.

* Update match_test.go

* tests + readability

* back to basics
2024-10-20 13:03:52 +02:00
soup
636129f282
fix(indexers): PTP API test function (#1771)
* fix(indexer): ptp api test

* fix: wrong type

* Revert "fix: wrong type"

This reverts commit 282d7c0c007b41b7323c58b3b450ffbf98c56917.
2024-10-19 14:43:11 +02:00
soup
f7e635d5ae
fix(indexers): OPS API test function (#1772)
fix(indexers): change RequiredRatio type from int to float
2024-10-19 13:49:22 +02:00
Kyle Sanderson
a64fd779f8
fix(wildcard): check name length (#1758)
* fix(wildcard): check name length

* fix(wildcard): add additional test

* fix(wildcard): tests

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2024-10-07 15:55:26 +02:00
Kyle Sanderson
caccaf3e09
feat(wildcard): fast-path some cases (#1747)
* feat(wildcard): fast-path some cases
2024-10-06 14:29:18 +02:00
ze0s
bf7e1381ac
fix(downloadclients): arrs change size type to uint64 (#1744)
* fix(downloadclients): arrs change size type to uint64

* fix(downloadclients): check resp.Body
2024-09-29 14:04:16 +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
Kyle Sanderson
982f7ddf68
refactor(wildcard): optimize and add caching (#1634)
* fix(wildcard): avoid excessive allocations every loop

* are you going to Scarborough Fair?

* ruby ruby ruby ruby

* ride on, little murphy

* shirley?

* to the moon

* reggie are you there?

* code 99

* my doctorate is in Art History

* helps to be consistent

* tidy

* slow and steady gets the clam

* oysters were better anyway

* DIAL TONE
2024-09-02 11:18:14 +02:00
ze0s
bc0f4cc055
feat: add support for proxies to use with IRC and Indexers (#1421)
* feat: add support for proxies

* fix(http): release handler

* fix(migrations): define proxy early

* fix(migrations): pg proxy

* fix(proxy): list update delete

* fix(proxy): remove log and imports

* feat(irc): use proxy

* feat(irc): tests

* fix(web): update imports for ProxyForms.tsx

* fix(database): migration

* feat(proxy): test

* feat(proxy): validate proxy type

* feat(proxy): validate and test

* feat(proxy): improve validate and test

* feat(proxy): fix db schema

* feat(proxy): add db tests

* feat(proxy): handle http errors

* fix(http): imports

* feat(proxy): use proxy for indexer downloads

* feat(proxy): indexerforms select proxy

* feat(proxy): handle torrent download

* feat(proxy): skip if disabled

* feat(proxy): imports

* feat(proxy): implement in Feeds

* feat(proxy): update helper text indexer proxy

* feat(proxy): add internal cache
2024-09-02 11:10:45 +02:00
Kyle Sanderson
cc0cca9f0d
refactor(http): implement bufio (#1604)
* fix: misc http fixes

* feat(io): implement bufio around syscalls

* peek-a-boo

* this can't be right.

* you better be wearing a helmet

* jesus christ.

* refactor(notifications): check err on non-ok status

* fix(notifications): add missing name method

* refactor(indexer): api clients

* fix(indexer): ptp test

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2024-08-29 08:51:20 +02:00
ze0s
861f30c144
fix(actions): reject if client is disabled (#1626)
* fix(actions): error on disabled client

* fix(actions): sql scan args

* refactor: download client cache for actions

* fix: tests client store

* fix: tests client store and int conversion

* fix: tests revert findbyid ctx timeout

* fix: tests row.err

* feat: add logging to download client cache
2024-08-27 19:45:06 +02:00
ze0s
da53230077
feat(filters): validate existence of external exec cmd (#1501)
* feat(filters): check external cmd exists

* fix: imports

* Update internal/domain/filter.go

---------

Co-authored-by: s0up4200 <soup@r4tio.dev>
2024-04-12 13:56:57 +02:00
ze0s
c600f41e5a
feat(indexers): sanitize user input (#1420) 2024-02-26 18:06:00 +01:00
ze0s
fbabdfb217
feat(clients): override arr download client by name (#1328)
* feat(clients): override arr client by name

* feat(clients): add missing file

* feat(clients): add section download client arr
2024-01-01 17:57:19 +01:00
ze0s
45b522abf8
chore: update license header year (#1332)
* chore: update license header year

* chore: update license header year tsx files

* chore: update license header
2024-01-01 16:21:02 +01:00
ze0s
a0a81ed34c
fix(filters): ensure sort by priority (#1325)
* fix(filters): sort filters from filtersMap

* fix(filters): use slices.SortStableFunc and fix tests

* fix(filters): add local cmp pkg before go 1.21
2023-12-31 14:59:12 +01:00
Kyle Sanderson
3234f0d919
refactor(http): implement shared transport and clients (#1288)
* fix(http): flip to a shared transport and clients

* nice threads

* that is terrible

* fake uri for magnet

* lazy locking

* why bother with r's

* flip magic params to struct

* refactor(http-clients): use separate clients with shared transport

* refactor(http-clients): add missing license header

* refactor(http-clients): defer and fix errors

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-12-29 23:49:22 +01:00
ze0s
d5d1cecc1b
feat(clients): Transmission support seedtime and ratiolimit (#1211)
* feat(clients): Transmission seedtime ratiolimit

* feat(clients): update client pkg

* feat(clients): update client pkg test

* feat(actions): update transmission
2023-10-31 00:38:23 +01:00
ze0s
2372c942b3
fix(indexers): BTN api handle errors (#1218) 2023-10-26 23:45:21 +02:00
Viktor Elofsson
1413cf9ff3
fix(downloadclient): Porla remove flags property (#1119)
Remove 'flags' property in the torrent item
2023-09-19 18:22:12 +02:00
Kyle Sanderson
08d7ecf329
feat(downloadclients): arrs increase timeout for release/push (#1083)
* fix(sonarr): increase timeout to 120s

* feat(arrs): increase timeouts
2023-09-07 23:47:31 +02:00
ze0s
0d3e10f094
feat(downloadclient): set downloadClientId for arr clients (#1081)
feat(downloadclient): arrs set downloadClientId
2023-09-03 15:34:55 +02:00
Viktor Elofsson
3d9839d234
feat(downloadclients): Porla support preset (#978)
* Correctly omit download/upload limits

* Prefix JWT correctly

* Allow setting Porla preset
2023-06-14 19:51:34 +02:00
ze0s
8925266104
feat(indexers): add API support for Orpheus to fetch size (#944)
* feat(indexers): add API support for Orpheus

* feat(filters): add ops to AdditionalSizeCheck
2023-05-21 16:55:10 +02:00
ze0s
604c7896bd
chore: add LICENSE GPLv2-or-later (#897)
* chore: add LICENSE

* chore: add LICENSE to README
2023-05-01 16:21:59 +02:00
ze0s
f3cfeed8cd
feat(indexers): test API from settings (#829)
* refactor(indexers): test api clients

* feat(indexers): test api connection

* fix(indexers): api client tests

* refactor: indexer api clients

* feat: add Toasts for indexer api tests

* fix: failing red tests
2023-04-15 23:34:27 +02:00
ze0s
64c2da591e
fix(feeds): torznab newznab pubdate parsing (#801)
fix(feeds): torznab newznab pubdate struct tag
2023-03-31 00:01:57 +02:00
ze0s
81d494ec5c
fix(feeds): torznab newznab category parsing (#775) 2023-03-19 23:35:33 +01:00
Kyle Sanderson
13a74f7cc8
feat: add usenet support (#543)
* feat(autobrr): implement usenet support

* feat(sonarr): implement usenet support

* feat(radarr): implement usenet support

* feat(announce): implement usenet support

* announce: cast a line

* feat(release): prevent unknown protocol transfer

* release: lines for days.

* feat: add newznab and sabnzbd support

* feat: add category to sabnzbd

* feat(newznab): map categories

* feat(newznab): map categories

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
Co-authored-by: ze0s <ze0s@riseup.net>
2023-03-04 20:27:18 +01:00
ze0s
ca196f0bf1
feat(releases): support magnet links (#730)
* feat(releases): support magnet links

* feat(feeds): support magnet links

* feat(actions): log messages

* fix: component warning

* fix: check hasprefix instead of hassuffix for magnet

* feat(release): resolve magnet uri from link

* fix(actions): deluge use magnet uri

* fix(macros): add `MagnetURI` var

* fix(actions): run magnet resolving before macros

* feat(feeds): set download type on creation
2023-02-28 22:16:10 +01:00
ze0s
d100703784
feat(download-clients): porla implement rules (#711)
* feat(downloadclients): Porla implement rules

* feat(downloadclients): Porla add basic auth support

* feat(porla): use new token for auth

* feat(porla): update check can download rules
2023-02-24 19:17:02 +01:00
ze0s
2917a7d42d
feat: show new updates in dashboard (#690)
* feat: show new update banner

* feat(http): add request logger

* refactor: updates checker

* feat: make update check optional

* fix: empty releases

* add toggle switch for update checks

* feat: toggle updates check from settings

* feat: toggle updates check from settings

* feat: check on toggle enabled

---------

Co-authored-by: soup <soup@r4tio.dev>
2023-02-05 18:44:11 +01:00
Viktor Elofsson
870e109f6c
feat(download-client): add support for Porla (#553)
* Add support for the 'Test' button to work

* Make Porla show up in filter actions select

* Add an empty Porla action

* Make Porla action find download client

* Make implementation actually add torrent to Porla

* Fix qBittorrent import

* Finish up Porla action

* Check length on commitish before slicing

* Move Porla to the other DL clients

* Add Porla to type name map

* Move Porla to beneath the other download clients
2023-01-29 18:17:01 +01:00