Commit graph

1263 commits

Author SHA1 Message Date
soup
2a4fb7750b
feat(actions): deluge v2 add skip recheck (#1321)
* feat(actions): add skip recheck for deluge v2

* chore(deps): update go-deluge to v1.2.0
2023-12-28 16:59:17 +01:00
soup
ebbd851a2e
feat(autobrrctl): add db migrate/seed/reset functionality (#934)
* add db seed/reset functionality

* speculative db migration support

* update postgresSchema

* refactor: only migrate data, no schema

* implement transaction in db migration function

* refactor db:seed and db:reset

added transaction to both and updated help message

* change table order

* skip on foreign key constraint violations

* skip feed_cache

* set constraints to null

* fix seed and reset

* simplify migrate func

This version of the function should behave similarly to the previous version, but with less repetition and by relying on PostgreSQL's automatic transaction handling, which starts a new transaction for each separate statement when not in a transaction block. Also, it prepares the insert statement only once for each table, which can significantly improve performance when there are many rows to insert.

* fixed release_action_status

* refactor db:seed and db:reset

* minor adjustment to const usage

* fixed usage examples

* refactor seed/migrate

* refactor(database): seed and convert

* refactor(database): make tables list sorted a-z

* chore(deps): go mod tidy

* refactor(database): convert improve log output

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-12-28 14:05:51 +01:00
Kyle Sanderson
6a94ecacca
refactor(http): auth handlers (#1311)
* fix(auth): implement invalid cookie handling

* that escalated quickly

* refactor(http): auth handlers

* add tests for auth handler
* refactor methods

* chore(tests): add header and build tag

* add build tag integration

* chore(tests): run in ci

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-12-28 02:04:25 +01:00
KaiserBh
df2612602b
feat(auth): change password and username (#1295)
* feat(backend): added change password api endpoint.

* feat(web): added profile UI to change password.

I think we can change the username too, but I don't know if we should for now disabled the username field.

* refactor: don't leak username or password.

* refactor: protect the route.

* generic

* feat: add ChangeUsername

* fix(tests): speculative fix for TestUserRepo_Update

* Revert "feat: add ChangeUsername"

This reverts commit d4c1645002883a278aa45dec3c8c19fa1cc75d9b.

* refactor into 1 endpoint that handles both

* feat: added option to change username as well. :pain:

* refactor: frontend

* refactor: function names in backend

I think this makes it more clear what their function is

* fix: change to 2 cols with separator

* refactor: update user

* fix: test db create user

---------

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
Co-authored-by: soup <soup@r4tio.dev>
Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
Co-authored-by: ze0s <ze0s@riseup.net>
2023-12-26 15:50:57 +01:00
Frederick Robinson
d898b3cd8d
refactor(filters): checkMaxDownloads (#1285)
* refactor

* fix: comment

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2023-12-25 22:54:52 +01:00
soup
c6122dbc41
feat(actions): qBittorrent add priority handling (#1315)
* feat(qbittorrent): add priority handling

* fix: check if torrent queueing is enabled

* fix: only check for torrent queueing if priority is set

* fix: improve tooltip message

* feat: enable torrent queueing if disabled

* change to SetPreferencesQueueingEnabled

* feat(actions): rename field

* chore: bump pkg go-qbittorrent to v1.8.0

* chore(deps): update go-qbittorrent to v1.8.1

* chore(deps): go mod tidy

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-12-25 22:39:31 +01:00
soup
0ab404f81a
fix(filters): hide tooltip when actions are active (#1318) 2023-12-25 19:50:58 +01:00
soup
4884fec89c
builds(ci): containers build additional architectures (#1265)
* refactor(dockerfile): optimize Docker builds

Combined multiple run commands into single statements in both main and CI dockerfiles, leveraging Docker's caching mechanism more effectively. This change aims to reduce image size and build time.

* hmm.

* Update ci.Dockerfile

* newline

* what about this

* three quorum members, three opinions

* true believer, right?

* when needed

* it sounds like music

* equals what

* really though, what?

* which one of you is the captain

* is that Kwejian whiskey

* ARG

* ARGH

* k.

* take me to your leader

* asd

* Update ci.Dockerfile

* try cache

* Revert

* Run Seperate platforms

* docker_build

* mother

* aggressive elephant

* leave me to my bath

* introduce buildx cache

* czechout manifests

* front left paw

* kill tags

* dealing with a child

* Update release.yml

* try outputs

* consolidation

* - =

* oxygen depleted

* where's the soup

* thanks buildx

* what's a little avx among friends

* Fine, I'll bring my own matches

* zenuuuu

* space, the final frontier

* but why

* ARE YOU HAPPY NOW

* link those binaries

* fast fail

* just the time killer you need

* add back generic arm

* ruthless dictator barbie

* kat

* build: docker add more labels

---------

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2023-12-25 19:41:33 +01:00
Rohit Vardam
1563ce5e9f
fix(filters): do not split commas inside valid Regexp (#1212)
* fix(filter): matchRegex

* fix(filter): matchRegex use new splitter
2023-12-25 15:45:50 +01:00
KaiserBh
db7ab7c99a
feat(web): migrate Tanstack Query to v5 (#1277)
* feat: migrate to v5

* refactor: Revise error handling in QueryClient for compatibility with React Query v5

The `useErrorBoundary` option has been renamed to `throwOnError` and suspense have been removed: more on suspense more on suspense.
https://tanstack.com/query/v5/docs/react/guides/migrating-to-v5#new-hooks-for-suspense

* refactor: Callbacks on useQuery (and QueryObserver) have been removed

onSuccess, onError and onSettled have been removed from Queries. They haven't been touched for Mutations. Please see this https://github.com/TanStack/query/discussions/5279 for motivations behind this change and what to do instead.

* refactor: change to isPending, isLoading have been renamed for mutations.

Also, they are using object now:
- useQuery(key, fn, options)
+ useQuery({ queryKey, queryFn, ...options })

* refactor: change to placeHolderData.

Removed keepPreviousData in favor of placeholderData identity function
https://tanstack.com/query/v5/docs/react/guides/migrating-to-v5#removed-keeppreviousdata-in-favor-of-placeholderdata-identity-function

* fix: useSuspenseQuery instead of useQuery.

* fix(web): more useSuspenseQuery substitutions

* whoops - nobody saw that okay?

* fix pnpm lockfile

* fix pnpm lockfile again

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
Co-authored-by: soup <soup@r4tio.dev>
2023-12-25 15:37:29 +01:00
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
soup
3fd939b531
fix(web): improve tooltip responsiveness and click-through (#1314)
* fix(web): prevent tooltip click-through on mobile

* fix: adjust tooltip placement based on screen size
2023-12-25 13:38:29 +01:00
soup
6815c67e0c
build(ci): integrate ESLint with CodeQL (#1273)
* ci: integrate ESLint with CodeQL

* specualtive fix

* always upload sarif

* make lint.ci exit with 0 so sarif is generated

* fix: exit with 0

* exit 0 on error

* correction

* revert to default with sarif

* see what pnpm run lint --fix does

* reset codeql

* egg

* actually setup pnpm

* checking out the mall

* reimplement lint

* run lint:ci

* anyone home?

* category

* fix?

* try cats

* damage

* TRY IT ONE MORE TIME

* on an atm

* no way?

* test

* test2

* test3

* test4

* revert change in context.ts

* attempt to update lockfile

* reset and update pnpm-lock

* speculative fix

* allow it to fail

* update eslint.yml

* correct path helps

* bring lint:ci back into the fold

* revert eslint.yml

* embed sarif

* is it really this

* k. great.

---------

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2023-12-25 13:37:46 +01:00
Kyle Sanderson
aa6ac6d4db
build(ci): setup Golang linter nilaway (#1310)
* feat(ci): add golang linter

* continue-on-error
2023-12-25 13:32:56 +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
martylukyy
8ef8bc6003
enchancement(web): IRC settings layout (#1312)
* enchancement(web): IRC settings layout

* consolidate some css
2023-12-25 13:16:17 +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
Kyle Sanderson
95cd053db5
chore(build): update go and node (#1301)
* chore(build): sync go and node

* node20

* golang:1.20-alpine3.19

* 20.10.0-alpine3.19 golang:1.20-alpine3.19
2023-12-16 11:52:24 -08:00
dependabot[bot]
3d9e3f1cd0
build(deps): bump the github group with 3 updates (#1308) 2023-12-16 19:48:36 +00:00
KaiserBh
92646dacc8
build(web): bump vite and cjs node api refactor (#1276)
* refactor: use ES module.

To maintain compatibility with vite 6 and since that's where the web are heading too.
Also moved some deps to devDeps, better optimized production builds. Changed some of the script command to match how others run or preview it, I think it was still using CRA.

* chore: update-lock.yaml

* refactor: since we are using ESM now, .cjs .ts required.

Changed the file extensions and refactored the .eslintrc.cjs I think there was a lot of bloat from the previous version and removed most of them and keep it simple for now, we can always expand from here a clean slate.

* refactor: added .node.json and refactored.

* fix(build): APIClient.ts had few error.

ESLint: Unexpected lexical declaration in case block.(no-case-declarations)

and TS2554: Expected  0-1  arguments, but got  2
we passed the cause to the constructor which it only takes 1 argument so removed it instead, since it's already in the string "Offline".

* fix(build): import never used.

* fix(build): add the types for react-dom/client.

* fix(build): use ESNext instead.

* fix(build): hmm why are we missing the types for the import?

Added @types/react-table.

* chore(lint): fix lint warnings

Don't use * for export.

* chore(lint): missing deps.

React Hook useEffect has a missing dependency: 'validateForm'. Either include it or remove the dependency array

* chore(lint): fix import.

* chore(lint): fix import.

* chore(lint): fix react hook.

error  React Hook "useMutation" is called conditionally. React Hooks must be called in the exact same order in every component render  react-hooks/rules-of-hooks

* chore(lint): value never used.

  52:10  error    '_regexPattern' is assigned a value but never used

* chore(lint): add missing dependency to useEffect

* chore(lint): fix imports.

* chore(lint): add deps to array.

* chore(lint): error  Unexpected lexical declaration in case block  no-case-declarations

* chore(lint): remove any and add types.

I am not sure about type CompleteFilterType I know it's being used for JSON so might need to use any?? dunno just test it and see if works.

* chore(lint): react-hooks/exhaustive-deps

* chore(lint): react-hooks/exhaustive-deps

* chore(lint): use type guard instead of any.

* chore(lint): react-hooks/exhaustive-deps

* Revert "chore(lint): remove any and add types."

This reverts commit 7b9168fe7826d63cb00e44df8e15fbde49b59174.

* chore(web): ignore sourcemap warnings

* chore(web): update vite to 5.0.4

* chore: add the new script `pnpm dev` to start the dev env.

* chore: add the curly braces.

more info: https://eslint.org/docs/latest/rules/no-case-declarations

* chore: remove the extra spaces

* chore: remove the extra spaces

* chore: add the curly braces.

* chore: add curly braces

* remove text-shadow property and comment

* revert switch case braces for Actions.tsx

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2023-12-15 23:36:16 +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
soup
da365da17c
feat(releases): incognito mode (#1282)
* feat(web): incognito mode

* removed unused variable

* move RandomLinuxIsos into utils/index
2023-12-14 22:20:36 +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
dependabot[bot]
fef1af08c4
build(deps): bump the github group with 1 update (#1299) 2023-12-13 21:53:08 +00: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
dependabot[bot]
df5fb37c9c
build(deps): bump the golang group with 6 updates (#1290) 2023-12-01 16:47:52 +00: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
soup
4d13d08c87
feat(filters): auto-expand used sections (#1278)
feat(web): auto-expand sections with data
2023-11-26 12:58:46 +01:00
soup
e6b3d6117e
fix(web): improve responsiveness on settings pages (#1270)
* fix(web): truncate feed name and adjust margins

This is to avoid clipping on narrow screens.
Bug: https://i.imgur.com/Aw3FzRK.png

* fix(web): fix boundaries and layout on feed page
fix(web): align switches on download client, feed and notification page

* fix(web): add truncate and margin to feed names

* correct truncate
change margin to padding

* inherit text styles

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
Co-authored-by: Fabricio Silva <hi@fabricio.dev>
2023-11-22 20:12:18 +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
martylukyy
c6c74c7f3b
fix(web): revert package versions causing errors (#1274) 2023-11-20 21:20:26 +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
b7a8f6e6ed
build(deps): bump pnpm to 8.10.5 (#1271) 2023-11-20 18:36:15 +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
martylukyy
cb036ac538
enhancement(web): releases description for narrow screens (#1234)
fix(web): description alignment for narrower screens
2023-11-19 22:21:41 +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
70a2f2d713
fix(filters): validate external filters (#1250)
* fix(filters): Set webhook method default to POST

* fix: details.tsx

* feat(filters): validate external filters

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2023-11-19 21:32:09 +01:00
soup
f35d10d7c0
docs: add coc to readme (#1268) 2023-11-19 21:31:16 +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
Kyle Sanderson
76d749b301
build: build rpm and deb (#963)
* build: build rpm and deb

* Update .goreleaser.yml

* upload the formats.

* duplication...
2023-11-19 15:24:15 +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
ze0s
ff70a341ad
fix(codeql): empty node cache error (#1267)
fix(codeql): speculative fix for empty node cache error
2023-11-18 20:09:14 +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