Compare commits

...

24 Commits

Author SHA1 Message Date
Brian Munro
2a98f98272
Merge 0fc86ea99d3a08c0ef01ad513f0bf2c8621a588c into 79d28f03d035114b80dcd04845306ecb98175074 2025-02-07 06:47:49 -06:00
jc21
79d28f03d0
Merge pull request #4346 from Sander0542/feature/security-schemes-component
All checks were successful
Close stale issues and PRs / stale (push) Successful in 4s
API Schema Improvements
2025-02-07 12:39:49 +10:00
Sander Jochems
df48b835c4
Update order to match others 2025-02-05 22:20:21 +01:00
Sander Jochems
8a1557154a
Add certificate fields to boolFields 2025-02-05 22:15:12 +01:00
Sander Jochems
a6af5ec2c7
Remove certificate as required from proxy host 2025-02-05 18:18:50 +01:00
Sander Jochems
14d7c35fd7
Fix whitespaces 2025-02-05 17:31:09 +01:00
Sander Jochems
cfcf78aaee
Set bearer auth security component 2025-02-05 17:29:40 +01:00
Brian Munro
0fc86ea99d
Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2024-12-28 08:54:22 +02:00
Brian Munro
3e80393235
Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2024-10-22 06:26:40 +02:00
Brian Munro
ee03105358
Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2024-07-12 06:26:45 +02:00
LePresidente
e1698a903c Don't try copy templates if we are using environment variables for the configuration. 2024-05-10 09:07:52 +02:00
LePresidente
3a22a0c09c Fix environment variable for setting crowdsec bouncer, was broken due to slashes in path. 2024-05-09 19:09:49 +02:00
Brian Munro
82d2476855
Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2024-05-03 12:19:11 +02:00
LePresidente
c56e64bce2 added support to use environment variables instead of set file in data drive. 2024-02-29 18:10:02 +02:00
LePresidente
58ae5a1559 Make sure script.sh is set to be executable. 2024-01-27 08:05:33 +02:00
Brian Munro
2d490b01dc
Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2024-01-25 06:45:08 +02:00
Brian Munro
8fa3069a8d
Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2024-01-20 09:53:01 +02:00
Brian Munro
a108a5d316
Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2024-01-15 06:34:14 +02:00
Brian Munro
9827c0b202
Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2023-08-28 06:23:59 +02:00
Brian Munro
ca6d112ecb
Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2023-05-17 10:20:12 +02:00
lepresidente
cd882b07d0 Changed permissions on script.sh 2023-05-17 10:17:26 +02:00
lepresidente
4245e6231c made script executable. 2023-04-30 17:16:12 +02:00
LePresidente
6a035eaeab Removed file not required. 2023-04-26 13:08:27 +02:00
LePresidente
77057284d3 Added crowdsec to Nginx-Proxy-Manager 2023-04-26 13:04:02 +02:00
9 changed files with 72 additions and 3 deletions

View File

@ -12,7 +12,11 @@ Model.knex(db);
const boolFields = [
'is_deleted',
'ssl_forced',
'http2_support',
'enabled',
'hsts_enabled',
'hsts_subdomains',
];
class DeadHost extends Model {

View File

@ -8,8 +8,8 @@ const now = require('./now_helper');
Model.knex(db);
const boolFields = [
'enabled',
'is_deleted',
'enabled',
'tcp_forwarding',
'udp_forwarding',
];

View File

@ -22,8 +22,7 @@
"enabled",
"locations",
"hsts_enabled",
"hsts_subdomains",
"certificate"
"hsts_subdomains"
],
"additionalProperties": false,
"properties": {

View File

@ -9,6 +9,15 @@
"url": "http://127.0.0.1:81/api"
}
],
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
},
"paths": {
"/": {
"get": {

View File

@ -0,0 +1,54 @@
#!/command/with-contenv bash
set -e # Exit immediately if a command exits with a non-zero status.
function set_properties() {
sed -i "s,^$1=.*,$1=$2,g" "${3}"
}
echo "Deploy Crowdsec Openresty Bouncer.."
if [ -n "${CROWDSEC_OPENRESTY_BOUNCER}" ]; then
while IFS= read -r line
do
if ! [[ "$line" != "^#" ]] || [[ "$line" != "^\n" ]]; then
name=$(echo "$line" | cut -d "=" -f1)
value=$(echo "$line" | cut -d "=" -f2)
if grep -q "${name}" /defaults/crowdsec/crowdsec-openresty-bouncer.conf ; then
set_properties "${name}" "${value}" "/defaults/crowdsec/crowdsec-openresty-bouncer.conf"
fi
fi
done <<< "${CROWDSEC_OPENRESTY_BOUNCER}"
else
mkdir -p /data/crowdsec/templates
sed -i 's|/defaults/crowdsec|/data/crowdsec|' /etc/nginx/conf.d/crowdsec_openresty.conf
if [ -f /data/crowdsec/crowdsec-openresty-bouncer.conf ]; then
echo "Patch crowdsec-openresty-bouncer.conf .."
sed "s/=.*//g" /data/crowdsec/crowdsec-openresty-bouncer.conf > /tmp/crowdsec.conf.raw
sed "s/=.*//g" /defaults/crowdsec/crowdsec-openresty-bouncer.conf > /tmp/crowdsec-openresty-bouncer.conf.raw
if grep -vf /tmp/crowdsec.conf.raw /tmp/crowdsec-openresty-bouncer.conf.raw ; then
grep -vf /tmp/crowdsec.conf.raw /tmp/crowdsec-openresty-bouncer.conf.raw > /tmp/config.newvals
cp /data/crowdsec/crowdsec-openresty-bouncer.conf /data/crowdsec/crowdsec-openresty-bouncer.conf.bak
grep -f /tmp/config.newvals /defaults/crowdsec/crowdsec-openresty-bouncer.conf >> /data/crowdsec/crowdsec-openresty-bouncer.conf
fi
else
echo "Deploy new crowdsec-openresty-bouncer.conf .."
cp /defaults/crowdsec/crowdsec-openresty-bouncer.conf /data/crowdsec/crowdsec-openresty-bouncer.conf
fi
#Make sure the config location is where we get the config from instead of /default/
sed -i 's|/defaults/crowdsec|/data/crowdsec|' /data/crowdsec/crowdsec-openresty-bouncer.conf
fi
#Make sure we only copy files that don't exist in /data/crowdsec.
if [ -d "/data/crowdsec/templates" ]; then
echo "Deploy Crowdsec Templates .."
cd /defaults/crowdsec/templates/
for file in *.html
do
if [ ! -e "/data/crowdsec/templates/${file}" ]
then
cp -r "/defaults/crowdsec/templates/${file}" "/data/crowdsec/templates/"
fi
done
fi

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,2 @@
# shellcheck shell=bash
/etc/s6-overlay/s6-rc.d/cs-crowdsec-bouncer/script.sh