Commit graph

272 commits

Author SHA1 Message Date
Aravinth Manivannan
468752f691
feat: advance siteey create now allows setting publication status 2023-06-30 16:49:35 +05:30
Aravinth Manivannan
22edb04ce2
feat: advance sitekey edit now allows modifying publication status 2023-06-30 16:48:53 +05:30
Aravinth Manivannan
6834e555d8
chore: use db util method to check publication status 2023-06-30 16:33:20 +05:30
Aravinth Manivannan
56dba7b77f
feat: option to publish pow performance numbers. Can un/publish from edit page too. 2023-06-30 07:55:12 +05:30
Aravinth Manivannan
2b82af9a0c
feat: update novice captcha creation form to include publish_benchmarks
preference
2023-06-30 03:20:57 +05:30
Aravinth Manivannan
2cf5e48d8e
feat: log pow performance stats while pow verification 2023-06-30 03:19:38 +05:30
Gusted
8dc690ca01
Remove redunant format 2022-10-24 16:22:10 +02:00
Gusted
8826f6df8f
Fix compiling
- I made some mistakes while checking my two previous PRs(Seems like I
don't understand Rust that great after all).
- Do the url encoding only on the password part, not only the whole URL.
- Fix `temporary value dropped while borrowed` compile error.
2022-10-22 21:28:58 +02:00
Gusted
9fd8ffd666
Add more logging for configuration/env 2022-10-17 19:49:42 +02:00
Gusted
b3e0ff6769
Allow PORT environment to be not set
- It's quite weird to require the `PORT` environment to be set, when it
already can be set via the config file.
2022-10-16 23:07:10 +02:00
realaravinth
b3d00c89a6
feat: increase demo test waint time 2022-08-09 17:08:26 +05:30
realaravinth
8c9587ad65
feat: set custom runers and queue length 2022-08-09 16:30:04 +05:30
realaravinth
21825582e5
feat: fallabck to localhost when running tests 2022-08-09 16:29:24 +05:30
realaravinth
8c576d2b07
feat: queue length and IP runner config 2022-08-09 16:28:30 +05:30
realaravinth
c377cf431e
feat & fix: ip queues 2022-08-09 02:52:17 +05:30
Kian-Meng Ang
bb42841a66 Fix typos 2022-08-04 23:06:54 +08:00
realaravinth
a040b39558
fix: set db type when overriding with DATABASE_URL 2022-07-23 16:46:49 +05:30
realaravinth
249b6461ee
chore: migrate tests to also run with mariadb 2022-07-23 11:59:42 +05:30
realaravinth
912b342e0e
feat: conditionally init postgres/mariadb connection 2022-07-23 11:59:42 +05:30
realaravinth
f9efb062e0
feat: accept alt DB configuration 2022-07-23 11:59:42 +05:30
realaravinth
9371416398
fix: normalize username during login process too
credits: @gusted
2022-07-23 02:24:30 +05:30
realaravinth
7d0e4c6be4
fix: prevent sitekey abuse with account secret authentication for access token validation
SUMMARY
    At present, sitekey can be abused by installing it on a third-party
    site as verifying the access token returned from CAPTCHA validation
    doesn't require any authentication.

    This fix uses account secret authentication to verify access tokens

credits: by @gusted
2022-07-22 19:44:35 +05:30
realaravinth
5daeffd6fb
chore: tests to verify mCaptcha counter 2022-05-31 12:46:09 +05:30
realaravinth
be9c6b757e
fix: invert debug flag to set DB logging flag 2022-05-30 16:56:55 +05:30
realaravinth
b30bc67bd4
feat: conditional SQL statements logging for db-sqlx-postgres 2022-05-30 15:48:54 +05:30
realaravinth
629c841e2d
chore: cleanup and addressing clippy lints 2022-05-27 18:37:59 +05:30
realaravinth
d7fd23f565
chore: get rid of direct DB init and use db_* 2022-05-27 18:25:27 +05:30
realaravinth
cd72ae6ffe
feat: migrate fetch captcha config to use db_* 2022-05-27 18:16:47 +05:30
realaravinth
a15d963c3e
feat: migrate get_levels to use db_* 2022-05-27 17:24:40 +05:30
realaravinth
098d0cfc24
feat: migrate fetching stats to use db_* 2022-05-27 17:11:15 +05:30
realaravinth
bbc8873762
feat: migrate record_stats to use db_* 2022-05-27 16:23:33 +05:30
realaravinth
851874f8cf
feat: load config to make captcha stats optional 2022-05-27 15:25:33 +05:30
realaravinth
4cd4605266
chore: use local app ctx 2022-05-27 15:25:10 +05:30
realaravinth
12edac7915
feat: migrate get_email to use db_* 2022-05-27 03:08:37 +05:30
realaravinth
aad49dbb94
feat: migrate notifications add, mark_read and get to use db_* traits 2022-05-26 20:03:05 +05:30
realaravinth
e4cf625d48
feat: migrate del traffic pattern to use db_* interface 2022-05-14 18:57:58 +05:30
realaravinth
2dd18897b0
feat: migrate getting traffic pattern to use db_* interface 2022-05-14 18:45:59 +05:30
realaravinth
a6920f5f36
feat: migrate add user's traffic pattern sqlx postgres to use db_* 2022-05-14 18:22:50 +05:30
realaravinth
04b0073d7c
feat: migrate DB migrations to use db_* 2022-05-14 16:44:42 +05:30
realaravinth
d061824660
feat: migrate get captcha cooldown period to use db_* 2022-05-14 16:27:44 +05:30
realaravinth
9d7bb3c0be
feat: use cache busting bin and load assets generated by it 2022-05-14 16:00:22 +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
176df3c7a7
feat: migrate get captcha levels to use db_* 2022-05-13 19:09:29 +05:30
realaravinth
ddb6d336f7
feat: implement accountnotfound and captcha notfound err vals for sqlx postgres 2022-05-13 19:09:00 +05:30
realaravinth
2dff139ae2
feat: migrate update_key to use db_* 2022-05-12 20:22:43 +05:30
realaravinth
add7271531
feat: migrate updating captcha metadata to use db_* 2022-05-12 20:09:56 +05:30
realaravinth
b6445000fe
feat: migrate delete captcha to use db_* interface 2022-05-12 19:56:23 +05:30
realaravinth
0c1a82b4c5
feat: migrate tests utils to use db_* interface 2022-05-12 19:33:26 +05:30
realaravinth
81ad030338
feat: migrate captcha exists to use db_* interface 2022-05-12 19:32:08 +05:30
realaravinth
bd75fc625c
feat: migrate adding captcha to use db_* interface 2022-05-12 19:10:04 +05:30