mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-17 05:44:57 +00:00
Compare commits
3 Commits
Xe/double-
...
Xe/preact-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db0a5809d3 | ||
|
|
ce1d877012 | ||
|
|
d51d32726c |
@@ -212,14 +212,10 @@ thresholds:
|
|||||||
- weight < 20
|
- weight < 20
|
||||||
action: CHALLENGE
|
action: CHALLENGE
|
||||||
challenge:
|
challenge:
|
||||||
# https://anubis.techaro.lol/docs/admin/configuration/challenges/preact
|
# https://anubis.techaro.lol/docs/admin/configuration/challenges/proof-of-work
|
||||||
#
|
algorithm: fast
|
||||||
# This challenge proves the client can run a webapp written with Preact.
|
difficulty: 2 # two leading zeros, very fast for most clients
|
||||||
# The preact webapp simply loads, calculates the SHA-256 checksum of the
|
report_as: 2
|
||||||
# challenge data, and forwards that to the client.
|
|
||||||
algorithm: preact
|
|
||||||
difficulty: 1
|
|
||||||
report_as: 1
|
|
||||||
- name: mild-proof-of-work
|
- name: mild-proof-of-work
|
||||||
expression:
|
expression:
|
||||||
all:
|
all:
|
||||||
@@ -229,8 +225,8 @@ thresholds:
|
|||||||
challenge:
|
challenge:
|
||||||
# https://anubis.techaro.lol/docs/admin/configuration/challenges/proof-of-work
|
# https://anubis.techaro.lol/docs/admin/configuration/challenges/proof-of-work
|
||||||
algorithm: fast
|
algorithm: fast
|
||||||
difficulty: 2 # two leading zeros, very fast for most clients
|
difficulty: 4
|
||||||
report_as: 2
|
report_as: 4
|
||||||
# For clients that are browser like and have gained many points from custom rules
|
# For clients that are browser like and have gained many points from custom rules
|
||||||
- name: extreme-suspicion
|
- name: extreme-suspicion
|
||||||
expression: weight >= 30
|
expression: weight >= 30
|
||||||
@@ -238,5 +234,5 @@ thresholds:
|
|||||||
challenge:
|
challenge:
|
||||||
# https://anubis.techaro.lol/docs/admin/configuration/challenges/proof-of-work
|
# https://anubis.techaro.lol/docs/admin/configuration/challenges/proof-of-work
|
||||||
algorithm: fast
|
algorithm: fast
|
||||||
difficulty: 4
|
difficulty: 6
|
||||||
report_as: 4
|
report_as: 6
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Update OpenRC service to truncate the runtime directory before starting Anubis.
|
- Update OpenRC service to truncate the runtime directory before starting Anubis.
|
||||||
- Allow multiple consecutive slashes in a row in application paths ([#754](https://github.com/TecharoHQ/anubis/issues/754)).
|
- Allow multiple consecutive slashes in a row in application paths ([#754](https://github.com/TecharoHQ/anubis/issues/754)).
|
||||||
- Add option to set `targetSNI` to special keyword 'auto' to indicate that it should be automatically set to the request Host name ([424](https://github.com/TecharoHQ/anubis/issues/424)).
|
- Add option to set `targetSNI` to special keyword 'auto' to indicate that it should be automatically set to the request Host name ([424](https://github.com/TecharoHQ/anubis/issues/424)).
|
||||||
|
- The Preact challenge has been removed from the default configuration. It will be deprecated in the future.
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import (
|
|||||||
"github.com/TecharoHQ/anubis/lib/localization"
|
"github.com/TecharoHQ/anubis/lib/localization"
|
||||||
"github.com/TecharoHQ/anubis/lib/policy"
|
"github.com/TecharoHQ/anubis/lib/policy"
|
||||||
"github.com/TecharoHQ/anubis/web"
|
"github.com/TecharoHQ/anubis/web"
|
||||||
|
"github.com/TecharoHQ/anubis/xess"
|
||||||
"github.com/a-h/templ"
|
"github.com/a-h/templ"
|
||||||
"github.com/golang-jwt/jwt/v5"
|
"github.com/golang-jwt/jwt/v5"
|
||||||
"golang.org/x/net/publicsuffix"
|
"golang.org/x/net/publicsuffix"
|
||||||
@@ -282,6 +283,9 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
if strings.HasPrefix(r.URL.Path, anubis.BasePrefix+anubis.StaticPath) {
|
if strings.HasPrefix(r.URL.Path, anubis.BasePrefix+anubis.StaticPath) {
|
||||||
s.mux.ServeHTTP(w, r)
|
s.mux.ServeHTTP(w, r)
|
||||||
return
|
return
|
||||||
|
} else if strings.HasPrefix(r.URL.Path, anubis.BasePrefix+xess.BasePrefix) {
|
||||||
|
s.mux.ServeHTTP(w, r)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
s.maybeReverseProxyOrPage(w, r)
|
s.maybeReverseProxyOrPage(w, r)
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ var (
|
|||||||
//go:embed *.css static
|
//go:embed *.css static
|
||||||
Static embed.FS
|
Static embed.FS
|
||||||
|
|
||||||
URL = "/.within.website/x/xess/xess.css"
|
BasePrefix = "/.within.website/x/xess/"
|
||||||
|
URL = "/.within.website/x/xess/xess.css"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|||||||
Reference in New Issue
Block a user