82 Commits

Author SHA1 Message Date
Aravinth Manivannan
74364c4e17
chore: lint 2023-10-20 01:47:24 +05:30
Aravinth Manivannan
3d02f55241
fix: create psuedo id and setup publishing for those tht have opted in 2023-10-20 01:39:19 +05:30
Aravinth Manivannan
78d85ab9a9
feat: annotate license headers using reuse on text source files 2023-07-03 23:19:51 +05:30
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
Kian-Meng Ang
bb42841a66 Fix typos 2022-08-04 23:06:54 +08:00
realaravinth
249b6461ee
chore: migrate tests to also run with mariadb 2022-07-23 11:59:42 +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
098d0cfc24
feat: migrate fetching stats to use db_* 2022-05-27 17:11:15 +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
a6920f5f36
feat: migrate add user's traffic pattern sqlx postgres to use db_* 2022-05-14 18:22:50 +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
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
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
realaravinth
0d3d552ae0
feat: migrate create captcha to use db_* 2022-05-12 18:59:44 +05:30
realaravinth
a668fafa62
feat: migrate v1 api mod to use actix_auth_middleware 2022-05-07 12:29:37 +05:30
realaravinth
fc8a1670d2
update copyright notice 2022-01-08 22:16:05 +05:30
realaravinth
c46b3f4f4c
Implement easy edit view
When user tries to visit this view without an easy configuration
available, i.e, user had created the CAPTCHA using advance view and no
TrafficPattern is available in database, the user will be automatically
redirected to the advance edit page.

But the default edit link everywhere is to the easy edit view.
2021-12-18 21:01:19 +05:30
realaravinth
fe1fc3fb20
address clippy lints 2021-12-18 14:10:05 +05:30
realaravinth
73ce2d1cb1
refactor captcha.rs and levels.rs and rm duration routes 2021-12-16 20:46:50 +05:30
realaravinth
cf4a0f9b73
Update CAPTCHA configuration by updating user provided traffic pattern 2021-12-16 18:15:15 +05:30
realaravinth
05f7e81c21
rename from_user_provided_traffic_pattern to create_easy
isolate non-async test in separate module
2021-12-16 17:47:30 +05:30
realaravinth
54b14291ec
Implement CAPTCHA configuration estimation from avg, peak and
broke_my_site_traffic

The above metrics are sourced from the user and are stored in the
database to reuse at a later point in time when the mCaptcha instance's
admin changes suggested configuration.

I'm not sure if I want to recompute configuration every time the admin
updates suggested configurations or give the user an option to recompute
based on latest trends. If we recompute on every update, then should the
admin choose very high difficulty_factors then it would hold back the
user's visitors, which is not nice. But there should also be an option
to rerun estimates when older configuration no longer works properly.
2021-12-03 14:26:23 +05:30
realaravinth
53720ff740
frontend linting 2021-10-08 15:24:29 +05:30
realaravinth
f7afc72d81
update levels in cache when db is updated 2021-08-31 13:54:05 +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
a5558e4b6f
clippy fixes and env docs update 2021-08-08 18:29:17 +05:30
realaravinth
1d759fcb25
captcha stats 2021-07-27 15:28:21 +05:30
realaravinth
8830961e04
stats endpoint 2021-07-25 21:15:59 +05:30
realaravinth
4b18992f6a
settings page, clipboard component 2021-07-20 18:14:23 +05:30
realaravinth
00768cce34
delete captcha 2021-07-20 13:02:53 +05:30
realaravinth
f7c9217667
update and rename captcha plumbing 2021-07-19 17:12:56 +05:30
realaravinth
1b0a95e768
tests: get status code from err 2021-07-17 18:57:33 +05:30
realaravinth
8f87efeeb3
error correction, tests for err branches, rm get_token, get_token,
delete captcha
2021-07-17 17:43:53 +05:30
realaravinth
ea8264054a
edit sitekey, router pattern matching, sitekey update optimization, rm level delete and level err handling 2021-07-16 17:40:52 +05:30
realaravinth
b7ec1bca22
duplicate email check and address clippy warnings 2021-07-11 21:46:50 +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