Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring staging up to date with main #1505

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demos/client-bundle-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"main": "index.js",
"type": "module",
"engines": {
"node": ">=20",
"node": "20",
"npm": ">=9"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion demos/client-example-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "dist/app.js",
"type": "module",
"engines": {
"node": ">=20",
"node": "20",
"npm": ">=9"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion demos/client-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"type": "module",
"engines": {
"node": ">=20",
"node": "20",
"npm": ">=9"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion demos/cypress-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"type": "module",
"engines": {
"node": ">=20",
"node": "20",
"npm": ">=9"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion demos/provider-mock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "./dist/index.js",
"type": "module",
"engines": {
"node": ">=20",
"node": "20",
"npm": ">=9"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion dev/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"build:cjs": "vite build --config vite.cjs.config.ts"
},
"engines": {
"node": ">=20",
"node": "20",
"npm": ">=9"
},
"author": "Prosopo Limited",
Expand Down
2 changes: 1 addition & 1 deletion dev/flux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"type": "module",
"engines": {
"node": ">=20",
"node": "20",
"npm": ">=9"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion dev/gh-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"main": "dist/index.js",
"type": "module",
"engines": {
"node": ">=20",
"node": "20",
"npm": ">=9"
}
}
2 changes: 1 addition & 1 deletion dev/lint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"main": "dist/index.js",
"type": "module",
"engines": {
"node": ">=20",
"node": "20",
"npm": ">=9"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion dev/prosoponator-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"main": "dist/index.js",
"type": "module",
"engines": {
"node": ">=20",
"node": "20",
"npm": ">=9"
}
}
2 changes: 1 addition & 1 deletion dev/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "dist/index.js",
"type": "module",
"engines": {
"node": ">=20",
"node": "20",
"npm": ">=9"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion dev/ts-brand/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "./dist/index.js",
"type": "module",
"engines": {
"node": ">=20",
"node": "20",
"npm": ">=9"
},
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion dev/vite-plugin-watch-workspace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build:cjs": "npx vite --config vite.cjs.config.ts build"
},
"engines": {
"node": ">=20",
"node": "20",
"npm": ">=9"
},
"author": "Prosopo Limited",
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ services:
profiles:
- production
- staging
image: caddy:2
image: prosopo/caddy:latest
env_file:
- ../.env.${NODE_ENV}
labels:
Expand Down
2 changes: 1 addition & 1 deletion docker/images/provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@prosopo/provider-container",
"type": "module",
"engines": {
"node": ">=20",
"node": "20",
"npm": ">=9"
},
"version": "2.1.10"
Expand Down
37 changes: 35 additions & 2 deletions docker/provider.Caddyfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# usage: `caddy run --config ./docker/provider.Caddyfile --envfile docker/env.development`
{
# debug
http_port {$CADDY_HTTP_PORT:80}
auto_https {$CADDY_AUTO_HTTPS:disable_redirects}
admin {$CADDY_ADMIN_API::2020} # set the admin api to run on localhost:2020 (default is 2019 which can conflict with caddy daemon)

# Caddy must be told custom rate_limit module its order
order rate_limit before basicauth
order ja3 before rate_limit
servers {
listener_wrappers {
http_redirect
ja3
tls
}
timeouts {
read_body 15s
read_header 10s
Expand All @@ -24,12 +33,36 @@
# reverse proxy the metrics path to the metrics emitted by caddy on the admin api
# reverse_proxy /metrics {$CADDY_ADMIN_API}

rate_limit {
distributed

# Means that the rate limit is applied to all GET requests, with a limit of 100 requests per minute.
# zone get_rate_limit {
# match {
# method GET
# }
# key static
# events 100
# window 1m
# }

# The rate limit is applied to `remote_host` with a limit of 6 requests per 6 seconds (60 requests per minute).
zone dynamic_example {
key {remote_host}
events 6
window 6s
}
log_key
}

ja3 sort_ja3 true

# reverse proxy to the provider container
reverse_proxy {$CADDY_PROVIDER_CONTAINER_NAME:provider}:{$CADDY_PROVIDER_PORT:9229} {
# https://caddyserver.com/docs/caddyfile/concepts#placeholders
# https://caddyserver.com/docs/json/apps/http/#docs
header_up x-tls-version "{tls_version}"

header_up x-tls-version "{tls_version}"
header_up x-tls-version "^{tls_version}$" ""

header_up x-tls-client-subject "{tls_client_subject}"
Expand Down
Loading
Loading