Skip to content

Commit

Permalink
0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ovx committed Jun 17, 2024
1 parent 58eeb58 commit 29c0b9b
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 15 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@ https://altcha.org

- __Friction-less__ - Using PoW instead of visual puzzles.
- __Cookie-less__ - GDPR compliant by design.
- __Self-hosted__ - Without reliance on external providers.
- __Self-hosted__ - Without reliance on external providers in self-hosted mode.
- __SaaS available__ - Visit [altcha.org](https://altcha.org/docs/api) to get started with the SaaS API.

## Integrations

- [WordPress plugin](https://github.com/altcha-org/wordpress-plugin)
- [Other libraries and plugins](https://altcha.org/docs/integrations/)

## More anti-spam solutions

- [Spam Filter](https://altcha.org/anti-spam) - stop sophisticated attacks and human-generated spam by classifying data.
- [ALTCHA lib](https://github.com/altcha-org/altcha-lib) - invisible Captcha, custom components and server-side M2M ALTCHA.

## Usage

Expand Down Expand Up @@ -165,7 +176,7 @@ document.querySelector('#altcha').addEventListener('statechange', (ev) => {
## Spam Filter

The widget integrates with ALTCHA's [Spam Filter API](https://altcha.org/docs/api/spam-filter-api) to allow checking submitted form data for potential spam.
The widget integrates with ALTCHA's [Anti-Spam solution](https://altcha.org/anti-spam) to allow checking submitted form data for potential spam.

The Spam Filter API analyzes various signals in the submitted data to determine if it exhibits characteristics of spam. This non-invasive filtering helps reduce spam submissions without frustrating legitimate users.

Expand Down Expand Up @@ -193,6 +204,8 @@ SpamFilter configuration options:
- __ipAddress__ - The user's IP is detected automatically but can be overridden or disabled with `false`.
- __timeZone__ - The user's timezone is detected automatically but can be overridden or disabled with `false`.

To include the email field into `fields` (for easier server-side verification), configure the list of input names using the `spamfilter.fields: string[]` option.

### Exclude Inputs from Spam Checking

By default, all text inputs and textareas within the parent form are spam-checked. To exclude a specific input, add the `data-no-spamfilter` attribute. Alternatively, explicitly list the checked fields using the `fields` config option.
Expand Down
1 change: 0 additions & 1 deletion dist/altcha.iife.js

This file was deleted.

4 changes: 2 additions & 2 deletions dist/altcha.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ function Ht(t, e, r) {
wt(() => {
g && (g.removeEventListener("submit", we), g.removeEventListener("reset", _e), g.removeEventListener("focusin", ve), g = null), G && (clearTimeout(G), G = null);
}), vt(() => {
L("mounted", "0.5.0"), L("workers", d), m && L("using test mode"), C && ie(C), s !== void 0 && L("auto", s), g = ne.closest("form"), g && (g.addEventListener("submit", we), g.addEventListener("reset", _e), s === "onfocus" && g.addEventListener("focusin", ve)), s === "onload" && Y();
L("mounted", "0.5.1"), L("workers", d), m && L("using test mode"), C && ie(C), s !== void 0 && L("auto", s), g = ne.closest("form"), g && (g.addEventListener("submit", we), g.addEventListener("reset", _e), s === "onfocus" && g.addEventListener("focusin", ve)), s === "onload" && Y();
});
function L(...n) {
(j || n.some((h) => h instanceof Error)) && console[n[0] instanceof Error ? "error" : "log"]("ALTCHA", ...n);
Expand Down Expand Up @@ -1017,7 +1017,7 @@ function Ht(t, e, r) {
}
function et(n) {
return [
...(g == null ? void 0 : g.querySelectorAll(n != null && n.length ? n.map((w) => `input[name="${w}"]`).join(", ") : 'input[type="email"]:not([data-no-spamfilter]), input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')) || []
...(g == null ? void 0 : g.querySelectorAll(n != null && n.length ? n.map((w) => `input[name="${w}"]`).join(", ") : 'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')) || []
].reduce(
(w, z) => {
const A = z.name, Z = z.value.trim();
Expand Down
2 changes: 1 addition & 1 deletion dist/altcha.umd.cjs

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist_external/altcha.iife.js

This file was deleted.

4 changes: 2 additions & 2 deletions dist_external/altcha.js
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ function Vt(r, e, t) {
ht(() => {
m && (m.removeEventListener("submit", ye), m.removeEventListener("reset", ve), m.removeEventListener("focusin", we), m = null), H && (clearTimeout(H), H = null);
}), at(() => {
L("mounted", "0.5.0"), L("workers", d), g && L("using test mode"), C && ie(C), s !== void 0 && L("auto", s), m = ne.closest("form"), m && (m.addEventListener("submit", ye), m.addEventListener("reset", ve), s === "onfocus" && m.addEventListener("focusin", we)), s === "onload" && X();
L("mounted", "0.5.1"), L("workers", d), g && L("using test mode"), C && ie(C), s !== void 0 && L("auto", s), m = ne.closest("form"), m && (m.addEventListener("submit", ye), m.addEventListener("reset", ve), s === "onfocus" && m.addEventListener("focusin", we)), s === "onload" && X();
});
function L(...n) {
(N || n.some((h) => h instanceof Error)) && console[n[0] instanceof Error ? "error" : "log"]("ALTCHA", ...n);
Expand Down Expand Up @@ -969,7 +969,7 @@ function Vt(r, e, t) {
}
function Ke(n) {
return [
...(m == null ? void 0 : m.querySelectorAll(n != null && n.length ? n.map((w) => `input[name="${w}"]`).join(", ") : 'input[type="email"]:not([data-no-spamfilter]), input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')) || []
...(m == null ? void 0 : m.querySelectorAll(n != null && n.length ? n.map((w) => `input[name="${w}"]`).join(", ") : 'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')) || []
].reduce(
(w, R) => {
const T = R.name, S = R.value.trim();
Expand Down
2 changes: 1 addition & 1 deletion dist_external/altcha.umd.cjs

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "altcha",
"description": "GDPR compliant, self-hosted CAPTCHA alternative.",
"version": "0.5.0",
"version": "0.5.1",
"license": "MIT",
"author": {
"name": "Daniel Regeci"
"name": "Daniel Regeci",
"url": "https://altcha.org"
},
"homepage": "https://github.com/altcha-org/altcha",
"homepage": "https://altcha.org",
"repository": {
"type": "git",
"url": "https://github.com/altcha-org/altcha"
Expand Down
2 changes: 1 addition & 1 deletion src/Altcha.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@
...(elForm?.querySelectorAll(
names?.length
? names.map((name) => `input[name="${name}"]`).join(', ')
: 'input[type="email"]:not([data-no-spamfilter]), input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'
: 'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'
) || []),
] as HTMLInputElement[];
return elInputs.reduce(
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default defineConfig({
? 'src/entry-external.ts'
: 'src/entry.ts',
name: 'altcha',
formats: ['iife', 'es', 'umd'],
formats: ['es', 'umd'],
},
outDir: EXTERNAL ? 'dist_external' : 'dist',
minify: 'esbuild',
Expand Down

0 comments on commit 29c0b9b

Please sign in to comment.