This commit is contained in:
Aravinth Manivannan 2021-03-02 18:02:06 +05:30
parent 1d5a731812
commit 94f224ef0f
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
6 changed files with 72 additions and 25 deletions

28
Cargo.lock generated
View file

@ -187,20 +187,6 @@ dependencies = [
"byte-tools", "byte-tools",
] ]
[[package]]
name = "browser"
version = "0.1.0"
dependencies = [
"console_error_panic_hook",
"pow_sha256",
"serde",
"serde_derive",
"serde_json",
"wasm-bindgen",
"wasm-bindgen-test",
"wee_alloc",
]
[[package]] [[package]]
name = "bumpalo" name = "bumpalo"
version = "3.6.1" version = "3.6.1"
@ -678,6 +664,20 @@ dependencies = [
"linked-hash-map", "linked-hash-map",
] ]
[[package]]
name = "mCaptcha-browser"
version = "0.1.0"
dependencies = [
"console_error_panic_hook",
"pow_sha256",
"serde",
"serde_derive",
"serde_json",
"wasm-bindgen",
"wasm-bindgen-test",
"wee_alloc",
]
[[package]] [[package]]
name = "m_captcha" name = "m_captcha"
version = "0.1.0" version = "0.1.0"

View file

@ -12,17 +12,47 @@
</div> </div>
## Features ### STATUS: ACTIVE DEVELOPMENT (fancy word for unusable)
TODO
mCaptcha uses SHA256 based proof-of-work(PoW) to rate limit users.
**If someone wants to hammer your site, they will have to do more work to
send requests than your server will have to do to respond to their
request.**
## Why use mCaptcha?
- Free software, privacy focused
- Seamless UX - No more annoying captchas!
- IP address independent(sort of) - your users are behind a NAT? We got you covered!
- Automatic bot throttling
- Resistant to replay attacks - bye-bye captcha farms!
## Demo
I'll try to write a dedicated demo server but until then you can try
[Shuttlecraft/identity](github.com/shuttlecraft/identity)'s sign up page
available at https://accounts.shuttlecraft.io/signup. Feel free to
provide bogus information while signing up(project under development,
database frequently wiped).
Be sure to open dev tools' network tab to witness the magic!
## Usage: ## Usage:
Add this to your `Cargo.toml`: mCaptcha is made up of three components:
```toml #### 1. Front-end library
mCaptcha = { version = "0.1", git = "https://github.com/mcaptcha/mCaptcha" } We have a WASM library now, Android and iOS libraries soon
```
## Examples: #### 2. Back-end library
We have Rust library, other languages will have support soon
TODO #### 3. Rate limiting service
Under development.
A paid, managed service will be made available soon but
I([@realaravinth](https://batsense.net)) encourage you guys to
self-host. Go decentralisation!
## Contributing
yes please!

View file

@ -1,5 +1,5 @@
[package] [package]
name = "browser" name = "mCaptcha-browser"
version = "0.1.0" version = "0.1.0"
authors = ["realaravinth <realaravinth@batsense.net>"] authors = ["realaravinth <realaravinth@batsense.net>"]
edition = "2018" edition = "2018"

View file

@ -2,7 +2,7 @@
<h1>PoW JavaScript library</h1> <h1>PoW JavaScript library</h1>
<strong>JavaScript library to generate PoW for Shuttlecraft</strong> <strong>JavaScript library to generate PoW for mCaptcha</strong>
</div> </div>
@ -15,7 +15,10 @@ for more information.
``` ```
$ /path/to/wasm-opt pkg/pow_bg.wasm -o pkg/pow_bg.wasm -O --enable-mutable-globals $ /path/to/wasm-opt pkg/pow_bg.wasm -o pkg/pow_bg.wasm -O --enable-mutable-globals
``` ```
My /path/to/wasm-opt is `~/.cache/.wasm-pack/wasm-opt-4d7a65327e9363b7/wasm-opt` My `/path/to/wasm-opt` is `~/.cache/.wasm-pack/wasm-opt-4d7a65327e9363b7/wasm-opt`
----
<h2> Default documentation provided by Rust wasm: </h2> <h2> Default documentation provided by Rust wasm: </h2>

View file

@ -1,3 +1,16 @@
//! mCaptcha is a proof of work based Denaial-of-Service attack protection system.
//! This is is a WASM library that you can embed in your frontend code to protect your
//! service.
//!
//! A commercial managed solution is in the works but I'd much rather prefer
//! folks host their own instances as it will make the more decentralized and free.
//!
//! ## Workflow:
//! mCaptcha workflow in the frontend is simple.
//! 1. Call service to get a proof of work(PoW) configuration
//! 2. Call into mCaptcha to get PoW
//! 3. Send PoW to your service
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global

View file

@ -3,6 +3,7 @@
<p> <p>
<strong>mCaptcha - PoW based DoS protection</strong> <strong>mCaptcha - PoW based DoS protection</strong>
</p> </p>
</div>
## Usage ## Usage