mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-10 18:48:44 +00:00
chore: set up commitlint, husky, and prettier (#1451)
* chore: add prettier configuration Signed-off-by: Xe Iaso <me@xeiaso.net> * format: run prettier tree-wide Signed-off-by: Xe Iaso <me@xeiaso.net> * chore(prettier): ignore intentionally ungrammatical files Signed-off-by: Xe Iaso <me@xeiaso.net> * ci: add PR title lint rule Signed-off-by: Xe Iaso <me@xeiaso.net> * ci: add DCO check Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: add commitlint and husky Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: add CONTRIBUTING guidelines Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: set SKIP_INTEGRATION in precommit tests Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: update spelling Signed-off-by: Xe Iaso <me@xeiaso.net> * ci(dco): remove reopened trigger Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: remove dead file Signed-off-by: Xe Iaso <me@xeiaso.net> * chore(prettier): don't format nginx includes Signed-off-by: Xe Iaso <me@xeiaso.net> --------- Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
2
lib/config/testdata/bad/badregexes.json
vendored
2
lib/config/testdata/bad/badregexes.json
vendored
@@ -18,4 +18,4 @@
|
||||
"action": "DENY"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
12
lib/config/testdata/bad/badregexes.yaml
vendored
12
lib/config/testdata/bad/badregexes.yaml
vendored
@@ -1,7 +1,7 @@
|
||||
bots:
|
||||
- name: path-bad
|
||||
path_regex: "a(b"
|
||||
action: DENY
|
||||
- name: user-agent-bad
|
||||
user_agent_regex: "a(b"
|
||||
action: DENY
|
||||
- name: path-bad
|
||||
path_regex: "a(b"
|
||||
action: DENY
|
||||
- name: user-agent-bad
|
||||
user_agent_regex: "a(b"
|
||||
action: DENY
|
||||
|
||||
2
lib/config/testdata/bad/import_and_bot.json
vendored
2
lib/config/testdata/bad/import_and_bot.json
vendored
@@ -7,4 +7,4 @@
|
||||
"action": "CHALLENGE"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
10
lib/config/testdata/bad/import_and_bot.yaml
vendored
10
lib/config/testdata/bad/import_and_bot.yaml
vendored
@@ -1,6 +1,6 @@
|
||||
bots:
|
||||
- import: (data)/bots/ai-catchall.yaml
|
||||
name: generic-browser
|
||||
user_agent_regex: >
|
||||
Mozilla|Opera
|
||||
action: CHALLENGE
|
||||
- import: (data)/bots/ai-catchall.yaml
|
||||
name: generic-browser
|
||||
user_agent_regex: >
|
||||
Mozilla|Opera
|
||||
action: CHALLENGE
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
"import": "(data)/does-not-exist-fake-file.yaml"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
bots:
|
||||
- import: (data)/does-not-exist-fake-file.yaml
|
||||
- import: (data)/does-not-exist-fake-file.yaml
|
||||
|
||||
6
lib/config/testdata/bad/invalid.json
vendored
6
lib/config/testdata/bad/invalid.json
vendored
@@ -1,5 +1,3 @@
|
||||
{
|
||||
"bots": [
|
||||
{}
|
||||
]
|
||||
}
|
||||
"bots": [{}]
|
||||
}
|
||||
|
||||
2
lib/config/testdata/bad/invalid.yaml
vendored
2
lib/config/testdata/bad/invalid.yaml
vendored
@@ -1 +1 @@
|
||||
bots: []
|
||||
bots: []
|
||||
|
||||
@@ -8,10 +8,8 @@
|
||||
"userAgent.startsWith(\"git/\") || userAgent.contains(\"libgit\")",
|
||||
"\"Git-Protocol\" in headers && headers[\"Git-Protocol\"] == \"version=2\"\n"
|
||||
],
|
||||
"any": [
|
||||
"userAgent.startsWith(\"evilbot/\")"
|
||||
]
|
||||
"any": ["userAgent.startsWith(\"evilbot/\")"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
bots:
|
||||
- name: multiple-expression-types
|
||||
action: ALLOW
|
||||
expression:
|
||||
all:
|
||||
- userAgent.startsWith("git/") || userAgent.contains("libgit")
|
||||
- >
|
||||
"Git-Protocol" in headers && headers["Git-Protocol"] == "version=2"
|
||||
any:
|
||||
- userAgent.startsWith("evilbot/")
|
||||
- name: multiple-expression-types
|
||||
action: ALLOW
|
||||
expression:
|
||||
all:
|
||||
- userAgent.startsWith("git/") || userAgent.contains("libgit")
|
||||
- >
|
||||
"Git-Protocol" in headers && headers["Git-Protocol"] == "version=2"
|
||||
any:
|
||||
- userAgent.startsWith("evilbot/")
|
||||
|
||||
2
lib/config/testdata/bad/nobots.json
vendored
2
lib/config/testdata/bad/nobots.json
vendored
@@ -1 +1 @@
|
||||
{}
|
||||
{}
|
||||
|
||||
2
lib/config/testdata/bad/nobots.yaml
vendored
2
lib/config/testdata/bad/nobots.yaml
vendored
@@ -1 +1 @@
|
||||
{}
|
||||
{}
|
||||
|
||||
32
lib/config/testdata/bad/regex_ends_newline.yaml
vendored
32
lib/config/testdata/bad/regex_ends_newline.yaml
vendored
@@ -1,17 +1,17 @@
|
||||
bots:
|
||||
- name: user-agent-ends-newline
|
||||
# Subtle bug: this ends with a newline
|
||||
user_agent_regex: >
|
||||
Mozilla
|
||||
action: CHALLENGE
|
||||
- name: path-ends-newline
|
||||
# Subtle bug: this ends with a newline
|
||||
path_regex: >
|
||||
^/evil/.*$
|
||||
action: CHALLENGE
|
||||
- name: headers-ends-newline
|
||||
# Subtle bug: this ends with a newline
|
||||
headers_regex:
|
||||
CF-Worker: >
|
||||
.*
|
||||
action: CHALLENGE
|
||||
- name: user-agent-ends-newline
|
||||
# Subtle bug: this ends with a newline
|
||||
user_agent_regex: >
|
||||
Mozilla
|
||||
action: CHALLENGE
|
||||
- name: path-ends-newline
|
||||
# Subtle bug: this ends with a newline
|
||||
path_regex: >
|
||||
^/evil/.*$
|
||||
action: CHALLENGE
|
||||
- name: headers-ends-newline
|
||||
# Subtle bug: this ends with a newline
|
||||
headers_regex:
|
||||
CF-Worker: >
|
||||
.*
|
||||
action: CHALLENGE
|
||||
|
||||
8
lib/config/testdata/bad/status-codes-0.yaml
vendored
8
lib/config/testdata/bad/status-codes-0.yaml
vendored
@@ -1,8 +1,8 @@
|
||||
bots:
|
||||
- name: everything
|
||||
user_agent_regex: .*
|
||||
action: DENY
|
||||
- name: everything
|
||||
user_agent_regex: .*
|
||||
action: DENY
|
||||
|
||||
status_codes:
|
||||
CHALLENGE: 0
|
||||
DENY: 0
|
||||
DENY: 0
|
||||
|
||||
7
lib/config/testdata/good/allow_everyone.json
vendored
7
lib/config/testdata/good/allow_everyone.json
vendored
@@ -2,11 +2,8 @@
|
||||
"bots": [
|
||||
{
|
||||
"name": "everyones-invited",
|
||||
"remote_addresses": [
|
||||
"0.0.0.0/0",
|
||||
"::/0"
|
||||
],
|
||||
"remote_addresses": ["0.0.0.0/0", "::/0"],
|
||||
"action": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
10
lib/config/testdata/good/allow_everyone.yaml
vendored
10
lib/config/testdata/good/allow_everyone.yaml
vendored
@@ -1,6 +1,6 @@
|
||||
bots:
|
||||
- name: everyones-invited
|
||||
remote_addresses:
|
||||
- "0.0.0.0/0"
|
||||
- "::/0"
|
||||
action: ALLOW
|
||||
- name: everyones-invited
|
||||
remote_addresses:
|
||||
- "0.0.0.0/0"
|
||||
- "::/0"
|
||||
action: ALLOW
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
}
|
||||
],
|
||||
"dnsbl": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@ bots:
|
||||
- name: cloudflare-workers
|
||||
headers_regex:
|
||||
CF-Worker: .*
|
||||
action: DENY
|
||||
action: DENY
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
"action": "CHALLENGE"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
bots:
|
||||
- name: generic-browser
|
||||
user_agent_regex: Mozilla
|
||||
action: CHALLENGE
|
||||
- name: generic-browser
|
||||
user_agent_regex: Mozilla
|
||||
action: CHALLENGE
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
}
|
||||
],
|
||||
"dnsbl": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
bots:
|
||||
- name: everything
|
||||
user_agent_regex: .*
|
||||
action: DENY
|
||||
- name: everything
|
||||
user_agent_regex: .*
|
||||
action: DENY
|
||||
|
||||
2
lib/config/testdata/good/git_client.json
vendored
2
lib/config/testdata/good/git_client.json
vendored
@@ -11,4 +11,4 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
14
lib/config/testdata/good/git_client.yaml
vendored
14
lib/config/testdata/good/git_client.yaml
vendored
@@ -1,8 +1,8 @@
|
||||
bots:
|
||||
- name: allow-git-clients
|
||||
action: ALLOW
|
||||
expression:
|
||||
all:
|
||||
- userAgent.startsWith("git/") || userAgent.contains("libgit")
|
||||
- >
|
||||
"Git-Protocol" in headers && headers["Git-Protocol"] == "version=2"
|
||||
- name: allow-git-clients
|
||||
action: ALLOW
|
||||
expression:
|
||||
all:
|
||||
- userAgent.startsWith("git/") || userAgent.contains("libgit")
|
||||
- >
|
||||
"Git-Protocol" in headers && headers["Git-Protocol"] == "version=2"
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
"import": "./testdata/hack-test.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
bots:
|
||||
- import: ./testdata/hack-test.yaml
|
||||
- import: ./testdata/hack-test.yaml
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
"import": "(data)/common/keep-internet-working.yaml"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
bots:
|
||||
- import: (data)/common/keep-internet-working.yaml
|
||||
- import: (data)/common/keep-internet-working.yaml
|
||||
|
||||
2
lib/config/testdata/good/old_xesite.json
vendored
2
lib/config/testdata/good/old_xesite.json
vendored
@@ -76,4 +76,4 @@
|
||||
"action": "CHALLENGE"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
bots:
|
||||
- name: everything
|
||||
user_agent_regex: .*
|
||||
action: DENY
|
||||
- name: everything
|
||||
user_agent_regex: .*
|
||||
action: DENY
|
||||
|
||||
status_codes:
|
||||
CHALLENGE: 200
|
||||
DENY: 200
|
||||
DENY: 200
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
bots:
|
||||
- name: everything
|
||||
user_agent_regex: .*
|
||||
action: DENY
|
||||
- name: everything
|
||||
user_agent_regex: .*
|
||||
action: DENY
|
||||
|
||||
status_codes:
|
||||
CHALLENGE: 403
|
||||
DENY: 403
|
||||
DENY: 403
|
||||
|
||||
6
lib/config/testdata/hack-test.json
vendored
6
lib/config/testdata/hack-test.json
vendored
@@ -2,8 +2,6 @@
|
||||
{
|
||||
"name": "ipv6-ula",
|
||||
"action": "ALLOW",
|
||||
"remote_addresses": [
|
||||
"fc00::/7"
|
||||
]
|
||||
"remote_addresses": ["fc00::/7"]
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
2
lib/config/testdata/hack-test.yaml
vendored
2
lib/config/testdata/hack-test.yaml
vendored
@@ -1,3 +1,3 @@
|
||||
- name: well-known
|
||||
path_regex: ^/.well-known/.*$
|
||||
action: ALLOW
|
||||
action: ALLOW
|
||||
|
||||
Reference in New Issue
Block a user