change url to js.org-hosted domain

This commit is contained in:
Tiago
2025-04-13 09:55:29 +01:00
parent 0182598682
commit 5d52f196c1
10 changed files with 21 additions and 14 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
<img alt="Cap logo" src="https://cap.tiagorangel.com/logo.png" width="70">
<img alt="Cap logo" src="https://capjs.js.org/logo.png" width="70">
# cap — modern, lightning-quick PoW captcha
Cap is a lightweight, modern open-source CAPTCHA alternative designed using SHA-256 PoW.
| [Learn more](https://cap.tiagorangel.com)
| [Learn more](https://capjs.js.org)
|----------|
[![npm @cap.js/server](https://img.shields.io/badge/@cap.js/-server-CB0200?logo=npm)](https://www.npmjs.com/package/@cap.js/server) [![npm @cap.js/widget](https://img.shields.io/badge/@cap.js/-widget-CB0200?logo=npm)](https://www.npmjs.com/package/@cap.js/widget) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9920/badge)](https://www.bestpractices.dev/projects/9920)
+6 -1
View File
@@ -29,4 +29,9 @@ Imagine I can send 10,000 emails to 10,000 random recipients for $1. If I can ea
By applying similar concepts to CAPTCHA, we make it costly for bots to spam, effectively discouraging them from trying.
If you want to read more about proof-of-work, I recommend reading [this whitepaper](https://www.researchgate.net/publication/374638786_Proof-of-Work_CAPTCHA_with_password_cracking_functionality)
If you want to read more about proof-of-work, I recommend reading [this whitepaper](https://www.researchgate.net/publication/374638786_Proof-of-Work_CAPTCHA_with_password_cracking_functionality)
## Why proof-of-work?
Every captcha is solvable by bots or by paid humans. The only question is how to make it costly for bots but invisible for users. Proof-of-work is the perfect balance for this problem.
+1 -1
View File
@@ -33,7 +33,7 @@ Then, you can access the dashboard at `http://localhost:3000`, log in, and creat
### Client-side
First, add the Cap widget to your website by following the [Cap docs](https://cap.tiagorangel.com/).
First, add the Cap widget to your website by following [this guide](widget.md).
Then, you need to configure the widget to use your self-hosted Cap Standalone server. To do this, set the widget's API endpoint option to:
+2 -1
View File
@@ -1,2 +1,3 @@
# Server solver for the Cap CAPTCHA
See [https://cap.tiagorangel.com](https://cap.tiagorangel.com)
See [https://capjs.js.org](https://capjs.js.org)
+2 -1
View File
@@ -3,7 +3,8 @@
"version": "1.0.6",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "bun run --watch src/index.js"
"dev": "bun run --watch src/index.js",
"docker:publish": "docker buildx build --platform linux/amd64,linux/arm64 -t tiago2/cap:latest . --push"
},
"dependencies": {
"@cap.js/server": "^1.0.6",
+2 -2
View File
@@ -186,7 +186,7 @@
<button type="submit" class="submit">Continue</button>
<p class="err"></p>
<p class="credits">
<a href="https://cap.tiagorangel.com" target="_blank">Powered by Cap</a>
<a href="https://capjs.js.org/" target="_blank">Powered by Cap</a>
</p>
</form>
</body>
@@ -209,7 +209,7 @@
"Content-Type": "application/json",
},
body: JSON.stringify({
password
password,
}),
})
).json();
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@cap.js/widget",
"version": "0.0.15",
"version": "0.0.16",
"description": "Cap widget",
"keywords": [
"captcha",
+3 -3
View File
@@ -225,8 +225,8 @@
const maxWorkers = Math.min(navigator.hardwareConcurrency || 8, 16);
this.#workersCount =
!isNaN(parsedWorkers) &&
parsedWorkers > 0 &&
parsedWorkers <= maxWorkers
parsedWorkers > 0 &&
parsedWorkers <= maxWorkers
? parsedWorkers
: navigator.hardwareConcurrency || 8;
}
@@ -236,7 +236,7 @@
this.#div.setAttribute("role", "button");
this.#div.setAttribute("tabindex", "0");
this.#div.setAttribute("disabled", "true");
this.#div.innerHTML = `<div class="checkbox"></div><p>I'm a human</p><a href="https://cap.tiagorangel.com/" class="credits" target="_blank" rel="follow noopener"><span>Secured by&nbsp;</span>Cap</a>`;
this.#div.innerHTML = `<div class="checkbox"></div><p>I'm a human</p><a href="https://capjs.js.org/" class="credits" target="_blank" rel="follow noopener"><span>Secured by&nbsp;</span>Cap</a>`;
this.#shadow.innerHTML = `<style>.captcha{background-color:var(--cap-background);border:1px solid var(--cap-border-color);border-radius:var(--cap-border-radius);width:var(--cap-widget-width);display:flex;align-items:center;padding:var(--cap-widget-padding);gap:var(--cap-gap);cursor:pointer;transition:filter var(--cap-transition-duration),transform var(--cap-transition-duration);position:relative;-webkit-tap-highlight-color:rgba(255,255,255,0);overflow:hidden;color:var(--cap-color)}.captcha:hover{filter:var(--cap-hover-filter)}.captcha:not([disabled]):active{transform:scale(var(--cap-active-scale))}.checkbox{width:var(--cap-checkbox-size);height:var(--cap-checkbox-size);border:var(--cap-checkbox-border);border-radius:var(--cap-checkbox-border-radius);background-color:var(--cap-checkbox-background);transition:opacity var(--cap-transition-duration);margin-top:var(--cap-checkbox-margin);margin-bottom:var(--cap-checkbox-margin)}.captcha *{font-family:var(--cap-font)}.captcha p{margin:0;font-weight:500;font-size:15px;user-select:none;transition:opacity var(--cap-transition-duration)}.captcha[data-state=verifying] .checkbox{background: none;display:flex;align-items:center;justify-content:center;transform: scale(1.1);border: none;border-radius: 50%;background: conic-gradient(var(--cap-spinner-color) 0%, var(--cap-spinner-color) var(--progress, 0%), var(--cap-spinner-background-color) var(--progress, 0%), var(--cap-spinner-background-color) 100%);position: relative;}.captcha[data-state=verifying] .checkbox::after {content: "";background-color: var(--cap-background);width: calc(100% - var(--cap-spinner-thickness));height: calc(100% - var(--cap-spinner-thickness));border-radius: 50%;margin:calc(var(--cap-spinner-thickness) / 2)}.captcha[data-state=done] .checkbox{border:1px solid transparent;background-image:var(--cap-checkmark);background-size:cover}.captcha[data-state=error] .checkbox{border:1px solid transparent;background-image:var(--cap-error-cross);background-size:cover}.captcha[disabled]{
cursor:not-allowed}.captcha[disabled][data-state=verifying]{cursor:progress}.captcha[disabled][data-state=done]{cursor:default}.captcha .credits{position:absolute;bottom:10px;right:10px;font-size:var(--cap-credits-font-size);color:var(--cap-color);opacity:var(--cap-opacity-hover)}.captcha .credits span{display:none;text-decoration:underline}.captcha .credits:hover span{display:inline-block}</style>`;