Commit graph

56 commits

Author SHA1 Message Date
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
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
dependabot[bot]
69f7cce116
build(deps): bump the github group with 1 update (#1223) 2023-10-28 10:02:05 +00:00
dependabot[bot]
ed3b6d5dcb
build(deps): bump the github group with 1 update (#1158) 2023-10-01 13:16:45 +00:00
Kyle Sanderson
98df0c9040
chore(build): enable CodeQL (#1026)
* Create codeql.yml

* setup pnpm

* sq.Eq{"ras.status": params.Filters.PushStatus}

* enable extended and quality

* fix: code scanning alert #58 #57

https://github.com/autobrr/autobrr/security/code-scanning/58
https://github.com/autobrr/autobrr/security/code-scanning/57

* fix: linting issues for code scanning 60, 59, 56

https://github.com/autobrr/autobrr/security/code-scanning/60
https://github.com/autobrr/autobrr/security/code-scanning/59
https://github.com/autobrr/autobrr/security/code-scanning/56

---------

Co-authored-by: Fabricio Silva <hi@fabricio.dev>
2023-09-26 21:24:59 +02:00
stacksmash76
25c3f02c72
fix(filters): importer (#1149)
fix(web): early exit on filter import
chore(readme): add new pic to readme
2023-09-26 20:30:23 +02:00
dependabot[bot]
816753f0da
build(deps): bump the github group with 6 updates (#1124) 2023-09-19 16:19:57 +00:00
ze0s
93f96e9758
ci(docker): change docker metadata tag to {{raw}} from {{version}} (#1115)
ci(docker): change docker tag to raw

* version was missing the v prefix
2023-09-11 21:18:12 +02:00
Fabricio Silva
996519cbae
ci: fix docker metadata to parse semver tags (#1110)
ci: fix docker metadata to parse semVer tags
2023-09-11 13:09:48 +02:00
dependabot[bot]
087471a1f7
build(deps): bump the github group with 1 update (#1091) 2023-09-09 10:33:56 +00:00
Kyle Sanderson
3d64ed150a
ci: goreleaser lower parallelism to mitigate OOM issues (#1086)
ci: clamp parallelism to reality
2023-09-07 23:52:37 +02:00
Kyle Sanderson
b3957ac447
ci: build Goreleaser binaries on windows (#1040)
try windows again
2023-09-03 15:48:31 +02:00
Kyle Sanderson
c6c260ce31
ci: back-off Dependabot to monthly due to spam (#1076)
ci: back-off Dependabot to monthly due to bugs
2023-09-03 12:41:00 +02:00
Kyle Sanderson
82ffd3645b
ci: dependabot back-off scheduled runs (#1042) 2023-08-10 21:31:57 +02:00
dependabot[bot]
dc8ad9c813
build(deps): bump the chore-dependabot-github group with 1 update (#1032)
Bumps the chore-dependabot-github group with 1 update: [docker/build-push-action](https://github.com/docker/build-push-action).

- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: chore-dependabot-github
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-07 00:25:11 +02:00
Kyle Sanderson
58b294e3cf
ci: enable dependabot (#1028)
* Create dependabot.yml

* flip day + time

* add gomod

* pnpm web

* huzzah - the walrus is here

* lines lines lines

* do you want to climb a mountain

* singing spock

* I'M IN SPACE

* what's a little / among friends
2023-08-04 00:04:32 +02:00
Kyle Sanderson
daa4bf9a0f
chore(deps): update build and packages (#1009)
* chore: update golang deps

* bump node and golang

* update node

* tell that to mel gibson.

* build: update go version

* chore: update deps

* chore: go mod tidy

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2023-07-21 18:00:03 +02:00
Kyle Sanderson
b1eae6e980
build: goreleaser parallel builds (#956)
* chore(goreleaser): parallel builds

* 8 seems like a good number

* 99 problems but a goreleaser... is one.

* fine?

* fine.

* Update release.yml

* Windows??

* bill

* flip to zip on Windows

* 4 minutes to zstd on windows... mac should be faster.

* long switch for clarity

* revert none hack

* flip web to mac

* bad touch

* mac web is a loss

* add zip
2023-05-24 12:56:12 +02:00
Fabricio Silva
1f76aa38f4
build(web): use pnpm from corepack (#935)
* feat(web): use pnpm packageManager on package.json

* build(web): add frozen-lockfile to Makefile

* build(docker): use the same node version as Docker image

* build(docker): enable corepack

* build(makefile): use --dir instead of cd for pnpm
2023-05-21 17:05:53 +02:00
Kyle Sanderson
762a0bb36b
chore(build): change to pnpm from yarn (#919)
* flip to npm

* try pnpm

* nothing good started with p anyway

* I want to go outside.

* Split out deps and build

* 30 seconds on the fetch, reintroduce the p

* lock it in

* flip lock file to pnpm

* nuke yarn.lock

* kirby no longer has yarn

* flip goreleaser to v4, was using node12.

* snapshots don't have tags

* Update README.md

* pin offline dockerfile

* Delete .yarnrc.yml

* Delete web/.yarn directory

* fix: update scripts

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-05-08 20:28:43 +02:00
ze0s
fbdeedc74c
build(ci): goreleaser optimize uploads (#896)
ci: optimize uploads
2023-05-01 15:13:57 +02:00
ze0s
6e5385a490
refactor(web): replace pkg react-query with tanstack/react-query (#868)
* refactor: move to tanstack/react-query and fix cache

* refactor(releases): move to tanstack/react-query

* refactor(logs): move to tanstack/react-query

* refactor(base): move to tanstack/react-query

* refactor(base): move to tanstack/react-query

* refactor(dashboard): move to tanstack/react-query

* refactor(auth): move to tanstack/react-query

* refactor(filters): move to tanstack/react-query

* refactor(settings): move to tanstack/react-query

* chore(pkg): add tanstack/react-query

* refactor(filters): move to tanstack/react-query

* refactor: move to tanstack/react-query

* refactor: invalidate queries

* chore(pkg): remove old react-query

* chore: change imports to root prefixes

* build: remove needs web from test

* set enableReinitialize to true to fix formik caching issues

* fix all property for apiKeys const

* fix toast when enabling/disabling feed

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2023-04-27 21:26:27 +02:00
Kyle Sanderson
0be92bef65
build: only push docker images for autobrr org (#873)
* build: speculative fix for develop push

* 🐝

* 🦀
2023-04-27 11:42:36 +02:00
Kyle Sanderson
7cbcc2e14c
build: do not push container images from forks (#869)
* fix(prs): don't push if not sourced from autobrr org

* when literals are strings, and strings are nothing.

* some say the beginning is like the end.

* Update release.yml?

* Update release.yml

* 🍺
2023-04-23 18:06:52 +02:00
Kyle Sanderson
d546288c2a
build: make ci 2-3x faster (#859)
* Create scratch.Dockerfile

* "best practices"

* even faster?

* too fast. change outdir

* flip to 1.20.3 + v4 + setup go on docker

* download deps

* debug

* Update ci.Dockerfile

* Update goreleaser.Dockerfile

* enable web caching

* Update release.yml

* Update ci.Dockerfile

* revert goreleaser

* cleanup

* set GOCACHE

* Update ci.Dockerfile

* Delete scratch.Dockerfile
2023-04-23 01:48:25 +02:00
KaiserBh
1cdbbe5bf3
refactor(web): migrate create-react-app to vite (#823)
* fix(build): dockerignore add exclusions

* fix: baseurl and build

* chore: removed react-app-env instead use vite

* chore: updated server and embedding static files.

* commented because conflict I believe, and not needed.

* docs: updated readme

* chore: updated json and added vite

* chore: import fix

* chore: updated yarn.lock and package json

* build: add empty dist to compile backend

* fix: use / as default baseurl

---------

Co-authored-by: KaiserBh <kaiserbh@proton.me>
Co-authored-by: ze0s <ze0s@riseup.net>
2023-04-10 14:28:24 +02:00
ze0s
33897b04a1
Revert #787 (#821)
Revert "refactor(web): migrate create-react-app to vite (#787)"

This reverts commit edae1bbf4b.
2023-04-07 19:08:42 +02:00
KaiserBh
edae1bbf4b
refactor(web): migrate create-react-app to vite (#787)
* removed react-app type instead use vite.

* removed index.html from public since vite uses it from root: read more: https://vitejs.dev/guide/#index-html-and-project-root

* yarn.lock update.

* added vite config file. With commented rollUp option if we want the build to be called build but using default stuff for now.

* updated tsconfig to use vite and include vite.config.ts

* changed package json build commands to use vite.

* for some reason there is an error in vite config when we put project as tsconfig.json.

* build.go updated to use the new dist folder.

* refactored as well updated to use dist and web.AssetHandler again.

* Fixed issue forcing the frontend to be reloaded for all routes to work if logged in fresh without reloading it will always go back to dashboard.

* updated it to use the new function; need to fix the Index for baseUrl I believe, if enabled it works except logs route will crash due to cors.

* refactored and default port to 7474, don't think we need the rollUpOptions.

* added tmp/ to ignore .

* init air.toml, for dev hot reloading both app and backend. https://github.com/cosmtrek/air run it using air but make sure it's in PATH

* updated the start command to build and watch for changes, works great with air.

* revert

* added proxy for vite config. To be used for dev.

* refactor: I think this should fix it, when logs route etc getting accessed usually it throws error but by getting rid of the catch-all it should work as intended, since web.RegisterHandler(r) will catch the unmatched ones.

* fix: baseurl and build

* fix(build): docker ignore !web/dist

* fix(build): dockerignore add exclusions

* docs: update README.md

* build: update postcss config

---------

Co-authored-by: KaiserBh <kaiserbh@proton.me>
Co-authored-by: ze0s <ze0s@riseup.net>
2023-04-07 16:04:10 +02:00
ze0s
fb6cbc775a
chore: update FUNDING.yml 2023-03-30 23:44:10 +02:00
ze0s
6ac3cc79c2
build: always run test job (#739)
build: always run tests
2023-03-05 17:41:57 +01:00
ze0s
65f51da68e
build: run tests before build (#737)
* build: run Go tests before build
2023-03-04 22:22:39 +01:00
Kyle Sanderson
b2d93d50c5
chore(deps): update Go to 1.20 (#726)
* chore(github): Update to go 1.20

* chore(go): enable language functionality in 1.20

* build: update go versions and rename dockerfile.ci
2023-02-28 23:29:51 +01:00
ze0s
33aa21fc15
build(ci): move back to hosted-runners (#547)
build(release): revert to hosted-runners
2022-11-18 21:03:56 +01:00
ze0s
19c9b79496
chore: update issue templates 2022-11-12 14:26:08 +01:00
ze0s
2cc08bed71
build: revert to old way of docker job (#508)
build: try old way for docker build
2022-10-19 22:17:45 +02:00
Kyle Sanderson
2d8f7aeb4e
feat(releases): retry failed downloads (#491)
* feat(download): implement parsing and retry

* feat: retry torrent file downloads

* refactor: error handling downloadtorrentfile

* feat: add tests for download torrent file

* build: add runs-on self-hosted

* build: add runs-on self-hosted
2022-10-19 21:52:31 +02:00
ze0s
bc335ccf1f
build: images with goreleaser (#496)
* build: images with goreleaser

* build: cleanup workflow
2022-10-13 20:31:43 +02:00
Kyle Sanderson
47eaeaa635
feat(rss): implement relative URL support (#484)
* feat(rss): implement relative URL support

* bp had some words

* feat(gh): uplift golang to 1.19.1

* feat(docker): uplift golang to 1.19

* feat(docker): uplift to go 1.19

* cleanup

* chore: update go version in go.mod

* feat: refactor and add test feed process item

* unescape query params after join
* break out logic into separate method
* add tests
2022-10-04 12:59:29 +02:00
ze0s
b4c3734bbd
chore: add issue templates (#434) 2022-08-31 15:58:42 +02:00
shapechecker
22829b194f
build(docker): add multiarch build for ARM, ARM64 and AMD64 (#378)
* Update Docker workflow

add buildx and qemu to support mulitarch builds
configure arm, arm64 and amd64 builds

* Change yarn timeout

fixes issue with yarn install timing out

* chore: update gitignore

* chore: add gitignore for web dir

* chore(web): upgrade to yarn2

* build: update actions and push docker hub

* build: add yarnrc and network-timeout

* build: unifi workflow

* build: depend on web to build first

* build: store artifacts between jobs

* build: store artifacts between jobs

* build: store artifacts between jobs

* build: store artifacts between jobs

* build: adjust dockerignore

* build: conditional extract metadata

* build: conditional extract metadata

* build: always push docker hub

* build: skip docker hub for now

* build: fix metadata
2022-08-03 19:38:32 +02:00
Kyle Sanderson
98ae6da6ca
build: add darwin macos (#387)
* enable apple
2022-08-03 14:29:53 +02:00
Ludvig Lundgren
c0f1037af0
docs: improve readme (#364)
* docs: improve readme

* docs: update feature list
2022-07-20 22:47:34 +02:00
Ludvig Lundgren
f961115dac
build: pr upload binary artifacts (#358)
* build: upload artifacts on pr

* build: use head sha for docker revision
2022-07-17 18:55:38 +02:00
Ludvig Lundgren
41eef4e8be
chore(build): update to Go 18 (#321) 2022-06-26 18:46:35 +02:00
Ludvig Lundgren
d4d864cd2c
build(actions): update docker workflow (#254) 2022-04-23 15:27:50 +02:00
Ludvig Lundgren
4b7a6d4419
build: run ci and build on pr (#244) 2022-04-13 12:19:29 +02:00
Ludvig Lundgren
1374dd150c
fix(build): actions docker build-args (#165)
* fix(build): actions docker build-args
2022-03-05 16:51:11 +01:00
Ludvig Lundgren
0878790232
build: set version in docker build (#164) 2022-03-04 23:01:12 +01:00
Ludvig Lundgren
bdbdab1f18
build: run docker release on branches (#130) 2022-02-09 19:11:49 +01:00