Commit Graph

75 Commits

Author SHA1 Message Date
Aravinth Manivannan
239e0bfd47 feat: easy captcha update job runner 2024-01-05 01:03:38 +05:30
Aravinth Manivannan
e0d6188853 fix: terminate demo user job cleanly 2024-01-04 23:24:36 +05:30
Aravinth Manivannan
960283324d feat: schedule mCaptcha/survey registration and uploads 2023-10-20 01:48:59 +05:30
Aravinth Manivannan
f933a30e7e feat: load survey keystore 2023-10-19 09:59:29 +05:30
Aravinth Manivannan
61729c5fae fix: set logging var, only if one is not provided 2023-10-18 13:21:33 +05:30
Aravinth Manivannan
30dc51e8e1 debug: allow warnings 2023-10-16 22:04:34 +05:30
Aravinth Manivannan
78d85ab9a9 feat: annotate license headers using reuse on text source files 2023-07-03 23:19:51 +05:30
realaravinth
912b342e0e feat: conditionally init postgres/mariadb connection 2022-07-23 11:59:42 +05:30
realaravinth
4cd4605266 chore: use local app ctx 2022-05-27 15:25:10 +05:30
realaravinth
04b0073d7c feat: migrate DB migrations to use db_* 2022-05-14 16:44:42 +05:30
realaravinth
a971d4209d fix and chore: refactor tests to minimize initializing DB connections
SUMMARY
    The test suite was spinning up way too many database connections that what's
    strictly needed and so the test suite was failing with[0]:
	code: "53300", message: "sorry, too many clients already"

EXPERIMENTS
    Tried sharing database connection pool across all tests with
    async_once[0] but faced:
	- IO errors
	    The connections were probably getting dropped in between tests
	- actix Actor errors
	    The actor was probably not getting initialized before a
	    a reference to the async_once initialized app
	    context(crate::data::Data) is retrieved and used

FIX
    crate::tests was spinning up an App context
    instance(crate::data::Data) for most utility functions, which was
    unnecessarily excessive.

    Each test now creates an instance of the application context at the
    beginning and shared a reference with all test utility functions. So
    number of database connections/app context instance = number of unit
    tests.

[0]: permanently fixes #22
[1]: https://docs.rs/async_once/latest/async_once/
2022-05-14 12:55:56 +05:30
realaravinth
56225ae2e4 chore: actix-web updates: replace deprecated methods 2022-05-11 13:33:28 +05:30
realaravinth
6d6b494c6f feat: rm middleware mod and migrate codebase to use actix_auth_middleware 2022-05-07 12:30:00 +05:30
realaravinth
fc8a1670d2 update copyright notice 2022-01-08 22:16:05 +05:30
realaravinth
855dbc60ef Fixes #8
```
$ cargo test
<--- snip --->
 thread panicked while panicking. aborting.
     Running unittests (target/debug/deps/tests_migrate-7d90f83f506b1b25)
 ```

gdb revealed that demo::demo_account_works receives a SIGKILL due to a
failed test. No idea why it didn't fail the usual way. The part where
the test fails hits an endpoint with the wrong datatype payload, it
should have failed with a 404 when the status was asserted but it
didn't. Fixing that fixed #8.

Additionally, all demo user functionality was restructured to include an
abort functionality, which can be used to kill the loop that deletes and
creates demo user throughout the runtime of the app.
2021-12-18 13:53:05 +05:30
realaravinth
5afa531bb8 build sass using dart-sass, bypassing css extractor 2021-12-10 06:16:03 +05:30
realaravinth
b5af9ee259 it appears actix-web's scope behaviour has changed in the latest beta
release:

Routes 404'd when scope contained trailing slash like so:
let scope = "/api/v1/pow/";
web::scope(scope)//

So had to rm trailing slash in scope
2021-11-29 17:33:08 +05:30
realaravinth
9afb63c738 use yaml directly for displaying open api spec 2021-10-08 15:36:42 +05:30
realaravinth
a65b1c219c username update 2021-08-12 17:13:17 +05:30
realaravinth
147f563ec8 demo user task 2021-08-09 11:56:25 +05:30
realaravinth
8830961e04 stats endpoint 2021-07-25 21:15:59 +05:30
realaravinth
189510c008 lazy init asset paths, store asset alt and prep svg for embedding 2021-07-22 12:35:25 +05:30
realaravinth
e9e6aac770 sitemap 2021-07-21 22:15:52 +05:30
realaravinth
69de0aaeef notifications styling 2021-07-14 20:09:00 +05:30
realaravinth
67a35a6e43 clear cookie after account deletion and CI: skip build 2021-07-09 11:49:01 +05:30
realaravinth
bfebca6e0e widget static resources are now built locally 2021-07-07 00:28:32 +05:30
realaravinth
574efc2252 email verification 2021-06-30 20:57:26 +05:30
realaravinth
9f940c317a upgrading to actix-v4-beta 2021-06-30 20:13:12 +05:30
realaravinth
804c81da38 read SMTP configuration 2021-06-29 21:08:40 +05:30
realaravinth
c581d8d0a3 error handling in auth 2021-06-28 23:03:15 +05:30
realaravinth
cc17f2048f errorable and seperated runner methods for auth 2021-06-28 19:16:59 +05:30
realaravinth
2162d32455 block floc fmt 2021-06-16 19:42:04 +05:30
realaravinth
6a56ff8ea9 block floc 2021-06-15 20:23:39 +05:30
realaravinth
dcfba60c86 addressing clippy lints 2021-06-11 23:39:38 +05:30
realaravinth
f5624947b9 redis storage for captcha mech 2021-06-11 19:31:03 +05:30
realaravinth
9e70f8f756 rename guard -> mcaptcha 2021-06-01 17:33:47 +05:30
realaravinth
2ea818591e cache control 2021-05-30 17:55:11 +05:30
realaravinth
fd67a9fa42 widget noscript and styling 2021-05-29 13:40:11 +05:30
realaravinth
c873d152c3 rearranged static files 2021-05-29 12:22:31 +05:30
realaravinth
417e008c27 favicons 2021-05-29 00:04:11 +05:30
realaravinth
2c209bf8d5 widget template 2021-05-28 21:26:36 +05:30
realaravinth
50234435ec footer: link to src of build version 2021-05-28 13:07:58 +05:30
realaravinth
fcdbe66b26 captcha stats 2021-05-27 14:47:29 +05:30
realaravinth
80352fb390 mobile css setup 2021-05-25 20:40:57 +05:30
realaravinth
91ca00ea79 get notifications 2021-05-10 15:38:09 +05:30
realaravinth
6184fe7efe build tools: webpack with typescript and scss compilation 2021-05-05 23:21:59 +05:30
realaravinth
f0254b3b77 static assets caching 2021-05-04 23:27:58 +05:30
realaravinth
0531a26274 docs use const routes 2021-05-02 18:36:39 +05:30
realaravinth
9d6b27a95b pages use const routes 2021-05-02 18:11:56 +05:30
realaravinth
0829ee1c74 pow uses const routes 2021-05-02 17:13:04 +05:30