Commit graph

1336 commits

Author SHA1 Message Date
Inex Code ceee6e4db9 fix: Read auth token from the connection initialization payload
Websockets do not provide headers, and sending a token as a query param is also not good (it gets into server's logs),
As an alternative, we can provide a token in the first ws payload.

Read more: https://strawberry.rocks/docs/general/subscriptions#authenticating-subscriptions
2024-07-05 18:14:18 +04:00
Inex Code a7be03a6d3 refactor: Remove setting KEA
This is already done via NixOS config
2024-07-04 18:49:17 +04:00
Houkime 9accf861c5 fix(websockets): add websockets dep so that uvicorn works 2024-07-04 17:19:25 +03:00
Houkime 41f6d8b6d2 test(websocket): remove some duplication 2024-07-04 17:19:25 +03:00
Houkime 57378a7940 test(websocket): remove excessive sleeping 2024-07-04 17:19:25 +03:00
Houkime 05ffa036b3 refactor(jobs): offload job subscription logic to a separate file 2024-07-04 17:19:25 +03:00
Houkime ccf71078b8 feature(websocket): add auth to counter too 2024-07-04 17:19:25 +03:00
Houkime cb641e4f37 feature(websocket): add auth 2024-07-04 17:19:25 +03:00
Houkime 0fda29cdd7 test(devices): provide devices for a service test to fix conditional test fail. 2024-07-04 17:19:25 +03:00
Houkime 442538ee43 feature(jobs): UNSAFE endpoint to get job updates 2024-07-04 17:19:25 +03:00
Houkime 51ccde8b07 test(jobs): test simple counting 2024-07-04 17:19:25 +03:00
Houkime cbe5c56270 chore(jobs): shorter typehints and import sorting 2024-07-04 17:19:25 +03:00
Houkime ed777e3ebf feature(jobs): add subscription endpoint 2024-07-04 17:19:25 +03:00
Houkime f14866bdbc test(websocket): separate ping and init 2024-07-04 17:19:25 +03:00
Houkime a2a4b461e7 test(websocket): ping pong test 2024-07-04 17:19:25 +03:00
Houkime 9add0b1dc1 test(websocket) test connection init 2024-07-04 17:19:25 +03:00
Houkime 00c42d9660 test(jobs): subscription query generating function 2024-07-04 17:19:25 +03:00
Houkime 2d9f48650e test(jobs) test API job format 2024-07-04 17:19:25 +03:00
Houkime c4aa757ca4 test(jobs): test Graphql job getting 2024-07-04 17:19:25 +03:00
Houkime 63d2e48a98 feature(jobs): websocket connection 2024-07-04 17:19:25 +03:00
Houkime 9bfffcd820 feature(jobs): job update generator 2024-07-04 17:19:25 +03:00
Houkime 6510d4cac6 feature(redis): enable key space notifications by default 2024-07-04 17:19:25 +03:00
Houkime fff8a49992 refactoring(jobs): break out a function returning all jobs 2024-07-04 17:19:25 +03:00
Houkime 5558577927 test(redis): test key event notifications 2024-07-04 17:19:25 +03:00
Houkime f08dc3ad23 test(async): pubsub 2024-07-04 17:19:25 +03:00
Houkime 94386fc53d chore(nixos): add pytest-asyncio 2024-07-04 17:19:25 +03:00
Houkime b6118465a0 feature(redis): async connections 2024-07-04 17:19:25 +03:00
Inex Code 4066be38ec chore: Bump version to 3.2.2 2024-07-01 19:25:54 +04:00
Inex Code 7522c2d796 refactor: Change gitea to Forgejo 2024-06-30 23:02:07 +04:00
Maxim Leshchenko 5602c96056 feat(services): rename "sda1" to "system disk" and etc (#122)
Closes #51

Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api/pulls/122
Reviewed-by: Inex Code <inex.code@selfprivacy.org>
Co-authored-by: Maxim Leshchenko <cnmaks90@gmail.com>
Co-committed-by: Maxim Leshchenko <cnmaks90@gmail.com>
2024-06-27 17:41:46 +03:00
dettlaff f90eb3fb4c feat: add flake services manager (#113)
Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api/pulls/113
Reviewed-by: Inex Code <inex.code@selfprivacy.org>
Reviewed-by: houkime <houkime@protonmail.com>
Co-authored-by: dettlaff <dettlaff@riseup.net>
Co-committed-by: dettlaff <dettlaff@riseup.net>
2024-06-21 23:35:04 +03:00
Inex Code a742e66cc3 feat: Add "OTHER" as a server provider
We should allow manual SelfPrivacy installations on unsupported server providers. The ServerProvider enum is one of the gatekeepers that prevent this and we can change it easily as not much server-side logic rely on this.

The next step would be manual DNS management, but it would be much more involved than just adding the enum value.
2024-05-25 14:12:51 +03:00
Inex Code 4f1d44ce74 chore: Bump version to 3.2.1 2024-05-24 22:53:58 +03:00
Houkime 8e8e76a954 fix(backups): fix orphaned snapshots erroring out 2024-05-24 12:30:27 +00:00
Inex Code 5a100ec33a chore: Bump version to 3.2.0 2024-05-22 10:57:59 +03:00
Inex Code 524adaa8bc add nix-collect-garbage endpoint (#112)
Continuation of the broken #21

Co-authored-by: dettlaff <dettlaff@riseup.net>
Co-authored-by: def <dettlaff@riseup.net>
Co-authored-by: Houkime <>
Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api/pulls/112
Reviewed-by: houkime <houkime@protonmail.com>
2024-05-01 16:10:39 +03:00
houkime 5e93e6499f Merge pull request 'redis-huey' (#84) from redis-huey into master
Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api/pulls/84
Reviewed-by: Inex Code <inex.code@selfprivacy.org>
2024-03-20 14:19:07 +02:00
houkime 3302fe2818 Merge pull request 'Censor out secret keys from backup error messages' (#108) from censor-errors into master
Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api/pulls/108
Reviewed-by: Inex Code <inex.code@selfprivacy.org>
2024-03-20 14:18:39 +02:00
Houkime 9ee72c1fcb test(huey): make timeout more so that vm gets it in time 2024-03-20 09:02:10 +00:00
Houkime 28556bd22d test(backups): move errored job checker into common test utils 2024-03-18 17:40:48 +00:00
Houkime c5b227226c fix(backups): do not rely on obscure behaviour 2024-03-18 17:33:45 +00:00
Inex Code 5ec677339b Merge pull request 'docs(api): add a CI badge' (#107) from ci-badge into master
Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api/pulls/107
Reviewed-by: Inex Code <inex.code@selfprivacy.org>
2024-03-18 19:28:31 +02:00
Houkime f2446dcee2 docs(api): add missing dollar sign 2024-03-18 19:28:20 +02:00
Houkime 97960f77f2 docs(api): use title case in README 2024-03-18 19:28:20 +02:00
Houkime 677ed27773 docs(api): add a CI badge 2024-03-18 19:28:20 +02:00
Houkime b40df670f8 fix(backups): censor out keys from error messages
We do not have any automated sending of errors to Selfprivacy
but it was inconvenient for people who want to send a
screenshot of their error.
2024-03-18 17:15:40 +00:00
Houkime b36701e31c style(api): enable pydantic support in mypy 2024-03-18 17:11:27 +00:00
Houkime b39558ea1f fix(backups): report error in the error field of the job 2024-03-18 17:00:55 +00:00
Houkime 6f38b2309f fix(huey): adapt to new VM test environment 2024-03-18 12:18:55 +00:00
Houkime baf7843349 test(huey): only import test task if it is a test 2024-03-18 12:18:55 +00:00