Commit graph

646 commits

Author SHA1 Message Date
KaiserBh
e63aec1ab2
enhancement(feeds): change max age default value to 0 (#1313)
* refactor: update help text for RSS, TORZNAB, and NEWZNAB

* refactor: change default to 0.

* fix: update sqlite_migrate.go

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2023-12-25 15:11:26 +01:00
soup
3b60365483
feat(web): link Dashboard stats to Releases page (#1281)
* feat(web): link stats to release table

- added Errored Pushes
- Made Recent Activity same color as Stats

* feat(releasetable): made links a separate row

https://i.imgur.com/ZoAOrXP.png

remove comment

* added LinkIcon to StatsItem

- Changed grid-cols to 2, as we now have 4 for narrow widths

* fix linting

* move some text modifier to parent element

* feat: add scale on hover with transition

deduplicated some classes

* adapt gap between StatsItems for mobile
remove border and title on stats divs

---------

Co-authored-by: Fabricio Silva <hi@fabricio.dev>
Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2023-12-25 14:03:29 +01:00
Kuredant
937d62fb82
refactor(indexers): ANT improve freeleech support (#1302)
feat(indexers): add freeleech support for ANT
2023-12-25 13:48:58 +01:00
Kyle Sanderson
0b34efc753
fix(http): specify ip stack when listen fails (#1306)
* fix(http): specify ip stack when listen fails

* break your err

* fix(http): log msg

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2023-12-25 13:29:20 +01:00
soup
80c2530116
fix(actions): qBit handle Ignore slow torrents rule correctly when disabled (#1309)
* fix(qbittorrent): handle 'Ignore slow torrents' rule correctly when disabled

* move IgnoreSlowTorrents bool check
2023-12-17 22:46:44 +01:00
soup
6e12654f6a
feat(filters): show enabled and disabled actions in list view (#1304)
* feat(filters): reflect enabled actions

* dont store release unless enabled action found

* store the release after the delay

* add new parameter to FindByFilterID method
2023-12-17 21:18:26 +01:00
soup
a89a1a55d9
feat(notifications): add LunaSea support (#1284)
* feat(notifications): add lunasea

* fix(web): truncate overflow in PasswordFieldWide

* refactor(notifications): centralize msg building

Left the building logic in discord.go and notifiarr.go as is because of their unique structure.

* refactor: moved components and swapped to outline

- Refactored the iconComponentMap to use a single iconStyle variable.

* upped size from 4 to 5

* rename NotificationBuilder function
2023-12-15 23:13:44 +01:00
Kyle Sanderson
3580472cbd
refactor(filters): optimize assignment to allocation (#1293)
nit(filters): move explicit assignment to allocation
2023-12-14 21:41:05 +01:00
soup
fc0bf33412
fix(config): PostgresExtraParams struct tag (#1294)
fix: PostgresExtraParams to lowercase in Config
2023-12-12 20:35:12 +01:00
Shivaram Lingamneni
b2c32a421e
fix(irc): improve IRC handler management (#1269)
* fix some races in IRC handler management

* remove go 1.21 and slices package

* chore: update deps

* fix: use exp/slices pkg and client callbacks

* fix(irc): remove deadlock mutex from authenticate

* restore locking in authenticate()

* fix(irc): data races

* fix(irc): do not allow restart of disabled network

* fix(irc): disable restart btn if net disabled

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2023-12-12 20:29:43 +01:00
ze0s
17e97201fd
fix(config): log level change causes panic (#1296) 2023-12-02 17:23:08 +01:00
Frederick Robinson
365055fbe1
refactor(filters): move rejections from release to filter (#1272)
* refactor: size check

* refactor(filters): checkfilter rejections from release to filter

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-12-01 18:04:23 +01:00
KaiserBh
c0f8ecfa9e
fix(filters): could not delete filter without actions (#1275)
* fix(database): hot fix for deleting filter.

This fixes the no sql row set, no idea why it does that but removing the row check I added fixes it, Not sure if it affects others rowsAffected in the delete function.

* fix: imports

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2023-11-26 13:24:05 +01:00
Kuredant
f89a25d645
feat(irc): support optional bot mode (#1246)
* feat(irc): set bot mode when the server supports it

See https://ircv3.net/specs/extensions/bot-mode.

* feat(irc): add a config option per network for bot mode
2023-11-22 19:57:16 +01:00
Frederick Robinson
8d3921fd3b
feat(filters): validate filter size (#1263)
* update comments

* refactor, fail on malformed size constraints

* refactor validation, add failing test

* unify in ReleaseSizeOkay, refactor test

* validate filter limit parseability

* logging improvement

* refactor. more clear, explicit parsing step

* inline, add log

* comment tweak

* pass error with more info

* tweak parsedSizeLimits interface
2023-11-20 18:41:53 +01:00
Fabricio Silva
8a8069408a
fix(indexers): toggle state (#1214)
* fix(indexers): toggle state

* fix(indexers): toggle state

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2023-11-19 23:11:12 +01:00
ze0s
8b5e08727b
fix(config): load from env vars (#995)
* fix(config): load from env and bind

* fix(config): remove unused imports

* feat: add new postgres config as vars
2023-11-19 22:16:46 +01:00
soup
d8c977b5ba
refactor(config): copylocks and staticcheck findings (#1261)
refactor: copylocks and staticcheck findings

Refactor mutex handling, optimize byte slice creation, and clean up code in accordance with go.staticcheck and copylocks guidelines.

- Changed AppConfig's mutex to *sync.Mutex, preventing mutex copying and enhancing thread safety.
- Simplified byte slice initialization in writeConfig for efficiency.
- Removed redundant return in DynamicReload for better code clarity.
2023-11-19 16:03:53 +01:00
Frederick Robinson
570af0940b
fix(indexers): AnimeBytes parsing (#1259)
* change test to expect correct output

* fix regex

* improve error message
2023-11-18 23:07:50 +01:00
soup
2bd1a68a94
feat(feeds): add force run (#1243)
* feat(feeds): add force run

* fix: simplify ForceRun

* add confirmation modal

* handle errors by using the test func

* require user input to run

* make sure to reschedule next job after forcerun

* refactor modal centering with grid

* refactor: Simplify startJob and forceRun logic

- Refactor `startJob` to accept a `runImmediately` flag. This flag controls whether the job should be run immediately or scheduled for later. This change simplifies the `ForceRun` function by allowing it to call `startJob` with `runImmediately` set to `true`.

- Remove redundant checks in `ForceRun` related to feed type. These checks are handled in `startJob`.

BREAKING CHANGE: The `startJob` function now requires a second argument, `runImmediately`. This change affects all calls to `startJob`.

* fix(web) Invalidate queries after forceRun

* refactor(feeds): init and test run

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2023-11-18 21:54:53 +01:00
KaiserBh
666bdf68cd
feat(database): setup integration tests (#1118)
* refactor: this should be Debug() just like the rest.

* feat: catch error when updating client table.

Before if we provided the wrong ID it will just say it's successful when it shouldn't.

* chore: handle the errors.

* fix: defer tx.Rollback().

When I try handling the error we always hit the error no matter what even though there wasn't any error, This is due that defer block being executed unconditionally so even after we commit it successfully it will just give error. So add checking then commit it if all good.

* feat: added testing env.

This way we can use in memory sqlite.

* chore: Delete log should be debug as well.

* feat: enable foreign keys for testing for sqlite.

I recommend enabling all together. Not sure why it's commented but for now will keep it the same and only enable for testing.

* chore: catch error, if deleting a record fails.

* chore: catch error, if deleting a record fails.

* chore: catch error, when failed to enable toggle.

* chore: catch error, if updating failed.

* chore(filter): catch error, if deleting failed.

* chore(filter): catch error, if row is not modified for ToggleEnabled.

* chore(feed): Should be debug level to match with others.

* chore(feed): catch error when nothing is updated.

* chore: update docker-compose.yml add test_db for postgres.

* chore(ci): update include postgres db service before running tests.

* feat(database): Added database testing.

* feat(database): Added api integration testing.

* feat(database): Added action integration testing.

* feat(database): Added download_client integration testing.

* feat(database): Added filter integration testing.

* test(database): initial tests model (WIP)

* chore(feed): handle error when nothing is deleted.

* tests(feed): added delete testing.

* chore(feed): handle error when nothing is updated.

* chore(feed): handle error when nothing is updated.

* chore(feed): handle error when nothing is updated.

* feat(database): Added feed integration testing.

* fix(feed_cache): This should be time.Time not time.Duration.

* chore(feed_cache): handle error when deleting fails.

* feat(database): Added feed_cache integration testing.

* chore: add EOL

* feat: added indexer_test.go

* feat: added mock irc data

* fix: the column is not pass anymore it's password.

* chore: added assertion.

* fix: This is password column not pass test is failing because of it.

* feat: added tests cases for irc.

* feat: added test cases for release.

* feat: added test cases for notifications.

* feat: added Delete to the User DB that way it can be used for testing.

* feat: added user database tests.

* refactor: Make setupLogger and setupDatabase private also renamed them.

Changed the visibility of `setupLogger` to private based on feedback. Also renamed the function to `setupLoggerForTest` and `setupDatabaseForTest` to make its purpose more descriptive.

* fix(database): tests postgres ssl mode disable

* refactor(database): setup and teardown

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2023-11-18 20:04:30 +01:00
Kuredant
14e12e7bc6
feat(indexers): add SugoiMusic (#1255)
* feat(indexers): add SugoiMusic

Regex tests: https://regex101.com/r/oRumE5/5

* fix(definitions): add tests to sugoimusic

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-11-18 16:15:22 +01:00
Frederick Robinson
7cb2aaa8a5
feat(irc): log connection errors (#1239)
* add logline for failed connection

* modify logging, change debug -> error

* don't surface "client called Quit" errors

* irc: don't retry Connect() while stopped

* fix issue number

* don't unlock until state-change complete

* Revert "don't unlock until state-change complete"

This reverts commit bf107db99bc2758b729a5995c63067f8fdf16aec.

---------

Co-authored-by: Shivaram Lingamneni <slingamn@cs.stanford.edu>
2023-11-18 15:44:46 +01:00
Frederick Robinson
fef0da5711
feat(definitions): add expectations for test lines (#1257)
* factor out test helpers

* refactor, add tests for animebytes

* revert test refactor

* better name

* change format, migrate some examples

* migrated remaining test cases

* add comment about `Test` vs `Tests`

* refactor

* reorder expectations to match vars

* generate

* turn on strict unmarshalling, remove old `Test` from schema

* start modifying actual definitions

* done with the As

* Bs

* C, D

* E, F

* G, H, I, ... L

* M, N

* O, P

* R

* bonus error. without this, pattern/vars disagreement can panic.

* S

* T, U

* X.. Now we know our ABCs next time won't you sing with meeeee

* fix another test

* another driveby change

* be less strict parsing custom definitions

* fix(definitions): load custom definitions

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-11-18 15:41:39 +01:00
stacksmash76
e842a7bd42
enhancement(web): ui overhaul (#1155)
* Various WebUI changes and fixes.

* feat(tooltip): make tooltip display upwards

* fix(tooltip): place tooltip to the right

* fix(web): add missing ml-px to SwitchGroup header

current: https://i.imgur.com/2WXstPV.png
new: https://i.imgur.com/QGQ49mP.png

* fix(web): collapse sections

* fix(web):  improve freeleech section

* fix(web): rename action to action_components

Renamed the 'action' folder to 'action_components' to resolve import issues due to case sensitivity.

* fix(web): align CollapsibleSection

Old Advanced tab: https://i.imgur.com/MXaJ5eJ.png
New Advanced tab: https://i.imgur.com/4nPJJRw.png
Music tab for comparison: https://i.imgur.com/I59X7ot.png

* fix(web): remove invalid CSS class

* revert: vertical padding on switchgroup

added py-0 on the freeleech part instead

* feat(settings): add back log files

* fix(settings): irc channels and font sizes

* fix(components): radio select roundness

* fix(styling): various minor changes

* fix(filters): remove jitter fields

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
Co-authored-by: soup <soup@r4tio.dev>
Co-authored-by: ze0s <ze0s@riseup.net>
2023-11-18 14:46:16 +01:00
ze0s
a274d9ddce fix(database): broken migrations 2023-11-17 23:23:55 +01:00
Steven Kreitzer
c5fb92ccf4
fix(filters): external webhook remove jitter (#1254)
* fix(filters): external webhook remove jitter

* fix: migrations

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-11-17 17:05:29 +01:00
Bogdan
0b7d9b5976
feat(indexers): update base url for Milkie (#1256)
This is needed to prevent redirects www to non-www.
2023-11-14 20:31:06 +01:00
Antoine
73e76c4214
feat(database): postgres set ssl mode (#1245)
* feat(database): postgres set ssl mode

* feat(database): postgres set extra params
2023-11-06 19:04:32 +01:00
Kyle Sanderson
8c89481d88
feat(sqlite): implement query planner (#1174)
* feat(sqlite): implement query planner

* implement Close on SQLite
2023-11-01 18:07:16 +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
568e41de24
feat(indexers): add ABNormal (#1232)
* feat(indexers): add Abnormal

* fix: casing

* fix: network name casing
2023-10-31 00:23:40 +01:00
soup
89d00d0986
fix(config): prevent overwriting default logPath (#1219)
* fix(config): prevent overwriting logPath default

* Fix duplication issue

* fix: Preserve non-empty logPath value in config
2023-10-30 23:04:53 +01:00
Kyle Sanderson
92659bca5f
fix(filters): external webhooks improve defaults (#1227)
* fix(external actions): retry

* mods

* wrap in bufio
2023-10-30 22:18:43 +01:00
ze0s
7c91d34cb4
fix(feeds): feed cache key (#1230)
* fix(feeds): feed cache sometimes missing key

* fix(feeds): feed cache use link as key if no guid
2023-10-30 22:10:03 +01:00
Daniel Williams
5225c1e956
feat(logs): sanitize basic auth in urls (#1188)
* Added regex pattern to capture credentials used to bypass auth

* Updated test case for log sanitisation

* Changed replacement pattern

* Update logs_sanitize_test.go

* fix: reorder regex patterns

---------

Co-authored-by: soup <soup@r4tio.dev>
2023-10-28 12:04:57 +02:00
Kyle Sanderson
19041de567
fix(indexers): capitalize TheOldSchool (#1222) 2023-10-28 12:01:25 +02:00
ze0s
0f943933a6
fix(database): migrations filter_external (#1221) 2023-10-27 19:10:19 +02:00
Steven Kreitzer
2080136669
feat(filters): external webhook retry on status codes (#1206)
* feat: external filter retry status codes

* chore: go mod tidy

* fix(database): migrations

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-10-27 17:37:57 +02:00
martylukyy
d1fa1b7cdf
feat(indexers): BHD freeleech announces (#1216)
* feat(indexers): BHD freeleech announces

* feat: parse and map bhd freeleech

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-10-26 22:30:28 +02:00
persuaded6414
367d8c8899
docs(definitions): MAM clarify cookie usage (#1199)
Update myanonamouse.yaml to have the right mam_id format

Autobrr's Discord had a user indicate that the format needs to be "mam_id=$id;"

The $id being the one created in the Preferences > Security in MAM website for the relevant IP.
2023-10-23 22:02:46 +02:00
ze0s
eb75714cf8
feat(indexers): add TheOldSchool (#1209)
* feat(indexers): add TheOldSchool

* change language code
remove unneeded lazy modifiers
account for empty parenthesis
account for miscellaneous character in usernames
make compatible with PCRE flavors

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2023-10-23 20:48:42 +02:00
ze0s
522f22db46
feat(clients): Transmission set label (#1204)
* feat(clients): Transmission set label

* fix(clients): Transmission fmt

* fix(clients): Transmission set label before reannounce
2023-10-23 19:02:04 +02:00
ze0s
d602b1e868
fix(clients): qBittorrent rules ignore slow (#1200)
fix(clients): qBit rules ignore slow
2023-10-23 18:36:50 +02:00
martylukyy
ee0d055743
fix(indexers): TorrentSeeds remove nickserv fields (#1205)
fix(indexers): removal of torrentseeds nickserv fields
2023-10-22 18:06:07 +02:00
ze0s
3ed44aff26
fix(clients): qBittorrent reject stalled reannounce (#1201)
fix(clients): qBit reannounce stalled rejection
2023-10-21 17:18:31 +02:00
ze0s
9793764905
feat(feeds): improve caching (#1191)
* feat(feeds): improve caching

* fix(feeds): put cache if not empty

* fix(feeds): reassign loop var

* fix(feeds): enable busy_timeout again

* fix(feeds): enable busy_timeout again
2023-10-21 17:03:52 +02:00
ze0s
0f9a3e439b
feat(indexers): PTP support freeleech (#1195) 2023-10-19 18:50:14 +02:00
martylukyy
706f95116e
feat(indexers): add OnlyEncodes (#1190)
feat(indexers): add onlyencodes
2023-10-18 18:45:17 +02:00
ze0s
06b864da4d
fix(releases): search with postgres (#1181)
* fix(releases): search with postgres

* fix: validate release push status from filters

* fix: add missing import

* fix: validate push status if not empty
2023-10-16 20:27:15 +02:00