Commit Graph

440 Commits

Author SHA1 Message Date
realaravinth
b7a8716a82 feat: define checking routine 2022-05-11 13:33:29 +05:30
realaravinth
dba1f662a7 feat: init postgres implementation via sqlx 2022-05-11 13:33:29 +05:30
realaravinth
02abffd63a feat: init and define database ops as interfaces to support multiple DBs 2022-05-11 13:33:29 +05:30
realaravinth
246dcfddb7 feat: mv db migrations to workspace 2022-05-11 13:33:29 +05:30
realaravinth
56225ae2e4 chore: actix-web updates: replace deprecated methods 2022-05-11 13:33:28 +05:30
realaravinth
6550266aef feat: don't run cache busting routines during debug build 2022-05-11 13:33:28 +05:30
realaravinth
100fb4d5ab feat: document .env 2022-05-11 13:33:28 +05:30
Aravinth Manivannan
8b7164635d Merge pull request #26 from ChocoMilkWithoutSugar/master
Update README.md
2022-05-11 12:00:14 +05:30
Aravinth Manivannan
76230eed9e Update README.md
Formatting default credentials
2022-05-11 06:28:06 +00:00
Luca
e2d126da30 Update README.md
add default credentials
2022-05-10 20:35:09 -03:00
realaravinth
2592b7a113 fix: use pre-built images in docker-compose 2022-05-10 22:33:26 +05:30
realaravinth
a00823544e hotfix: run tests one at a time
SUMMARY
    The test suite messy and inefficient in every imaginable way. It
    creates a DB connection pool for every unit test and Postgres failed
    with the following error:

    code: "53300", message: "sorry, too many clients already

    This hotfix runs tests via scripts/tests.sh, which executes one test
    at a time.

    Ideally, the connection pool must be shared across the whole test
    suite but this requires a major refactor of the test suite and even
    the app code. A refactor towards this is in progress in the
    `db-abstract` branch, which I hope to complete within this week.

fixes #22
2022-05-09 11:33:28 +05:30
realaravinth
5160e210f3 chore: upgrade sailfish 2022-05-08 17:57:29 +05:30
realaravinth
87f09b6bfb chore: migrate dart-sass to sass 2022-05-08 17:36:49 +05:30
realaravinth
91c6f77cab chore: update actix-* deps 2022-05-07 16:10:14 +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
a668fafa62 feat: migrate v1 api mod to use actix_auth_middleware 2022-05-07 12:29:37 +05:30
realaravinth
b057e48d72 feat: migrate pages mod to use actix_auth_middleware 2022-05-07 12:29:02 +05:30
realaravinth
abe494b6e5 feat: upadte cache-busted 2022-05-07 12:28:37 +05:30
realaravinth
fdf94f1f06 feat: CI: run build every day at 0900 2022-05-06 17:14:09 +05:30
realaravinth
fc8a1670d2 update copyright notice 2022-01-08 22:16:05 +05:30
realaravinth
53e966958b update sqlx offline compilation schema data 2021-12-18 21:04:35 +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
ebde9775fc use easy edit option by default in list view 2021-12-18 20:55:01 +05:30
realaravinth
56b05ec901 include link to easy edit option 2021-12-18 20:53:47 +05:30
realaravinth
7b0fe7c4b2 break view form into multiple parts 2021-12-18 20:53:10 +05:30
realaravinth
708a157ee1 rm comments 2021-12-18 19:39:59 +05:30
realaravinth
7a76214701 mark avg_traffic and peak_sustainable_traffic in
mcaptcha_sitekey_user_provided_avg_traffic as non-nullable
2021-12-18 19:09:59 +05:30
realaravinth
784aa26dbb mv edit sitekey into advance edit sitekey 2021-12-18 18:19:23 +05:30
realaravinth
ff3f5504dd update sqlx offline compilation schema data 2021-12-18 17:44:07 +05:30
realaravinth
a73542cf18 implement easy sitekey addition 2021-12-18 16:42:27 +05:30
realaravinth
081cdcc803 use crates::PAGES.panel.sitekey.get_edit_easy to get edit route 2021-12-18 16:41:30 +05:30
realaravinth
fa9762200e mv sitekey edit to easy edit 2021-12-18 16:41:00 +05:30
realaravinth
e874d1477d link easy variant from advance sitekey add form 2021-12-18 16:40:25 +05:30
realaravinth
fc40593c5d split sitekey add and edit routes into easy and advance variants 2021-12-18 16:39:20 +05:30
realaravinth
5a49940b89 Get sitekey routes using methods on pages::panel::sitekey::routes::Sitekey
for consistency purposes
2021-12-18 16:00:09 +05:30
realaravinth
f15df541c1 rm url field from DatabaseBuilder 2021-12-18 15:33:17 +05:30
realaravinth
fe1fc3fb20 address clippy lints 2021-12-18 14:10:05 +05:30
realaravinth
e3ff7278a9 update coverage workflow's rust version and tarpaulin version 2021-12-18 14:03:18 +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
9999bd887a migrate mcaptcha-glue to @mcaptcha/vanilla-glue 2021-12-16 20:57:39 +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
5ac0b36255 update dockerfile to make config 2021-12-16 15:55:46 +05:30
realaravinth
b2297eab6d mv add form into advance 2021-12-10 06:16:38 +05:30
realaravinth
5afa531bb8 build sass using dart-sass, bypassing css extractor 2021-12-10 06:16:03 +05:30
realaravinth
e399f82ac4 Load pow-sha256 polyfill to support browsers that aren't capable of
executing WASM
2021-12-08 14:52:06 +05:30
realaravinth
a075607bae Document pow section being renamed to captcha 2021-12-03 14:50:55 +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