Compare commits

..

22 Commits

Author SHA1 Message Date
3e80393235 Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2024-10-22 06:26:40 +02:00
ee41bb5562 Merge pull request #4078 from Guiorgy/patch-1
All checks were successful
Close stale issues and PRs / stale (push) Successful in 4s
normalize indentations in certbot-dns-plugins.json
2024-10-22 10:14:31 +10:00
0cf6b9caa4 Merge pull request #4084 from ttodua/patch-1
doc(site) - default credentials change
2024-10-22 10:14:11 +10:00
68a9baf206 minor 2024-10-18 15:35:15 +04:00
d92421d098 doc(site) - default credentials change 2024-10-18 15:33:32 +04:00
96c58b203e normalize indentations in certbot-dns-plugins.json 2024-10-17 15:34:04 +04:00
d499e2bfef Push PR and github branch builds to separate docker image
All checks were successful
Close stale issues and PRs / stale (push) Successful in 4s
2024-10-17 10:00:12 +10:00
ee03105358 Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2024-07-12 06:26:45 +02:00
e1698a903c Don't try copy templates if we are using environment variables for the configuration. 2024-05-10 09:07:52 +02:00
3a22a0c09c Fix environment variable for setting crowdsec bouncer, was broken due to slashes in path. 2024-05-09 19:09:49 +02:00
82d2476855 Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2024-05-03 12:19:11 +02:00
c56e64bce2 added support to use environment variables instead of set file in data drive. 2024-02-29 18:10:02 +02:00
58ae5a1559 Make sure script.sh is set to be executable. 2024-01-27 08:05:33 +02:00
2d490b01dc Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2024-01-25 06:45:08 +02:00
8fa3069a8d Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2024-01-20 09:53:01 +02:00
a108a5d316 Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2024-01-15 06:34:14 +02:00
9827c0b202 Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2023-08-28 06:23:59 +02:00
ca6d112ecb Merge branch 'NginxProxyManager:develop' into develop-crowdsec 2023-05-17 10:20:12 +02:00
cd882b07d0 Changed permissions on script.sh 2023-05-17 10:17:26 +02:00
4245e6231c made script executable. 2023-04-30 17:16:12 +02:00
6a035eaeab Removed file not required. 2023-04-26 13:08:27 +02:00
77057284d3 Added crowdsec to Nginx-Proxy-Manager 2023-04-26 13:04:02 +02:00
8 changed files with 82 additions and 11 deletions

10
Jenkinsfile vendored
View File

@ -43,7 +43,7 @@ pipeline {
steps {
script {
// Defaults to the Branch name, which is applies to all branches AND pr's
buildxPushTags = "-t docker.io/jc21/${IMAGE}:github-${BRANCH_LOWER}"
buildxPushTags = "-t docker.io/nginxproxymanager/${IMAGE}-dev:${BRANCH_LOWER}"
}
}
}
@ -203,7 +203,13 @@ pipeline {
}
steps {
script {
npmGithubPrComment("Docker Image for build ${BUILD_NUMBER} is available on [DockerHub](https://cloud.docker.com/repository/docker/jc21/${IMAGE}) as `jc21/${IMAGE}:github-${BRANCH_LOWER}`\n\n**Note:** ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.", true)
npmGithubPrComment("""Docker Image for build ${BUILD_NUMBER} is available on
[DockerHub](https://cloud.docker.com/repository/docker/nginxproxymanager/${IMAGE}-dev)
as `nginxproxymanager/${IMAGE}-dev:${BRANCH_LOWER}`
**Note:** ensure you backup your NPM instance before testing this image! Especially if there are database changes
**Note:** this is a different docker image namespace than the official image
""", true)
}
}
}

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

View File

@ -137,5 +137,13 @@ Email: admin@example.com
Password: changeme
```
Immediately after logging in with this default user you will be asked to modify your details and change your password.
Immediately after logging in with this default user you will be asked to modify your details and change your password. You can change defaults with:
```
environment:
INITIAL_ADMIN_EMAIL: my@example.com
INITIAL_ADMIN_PASSWORD: mypassword1
```