Skip to content

Commit

Permalink
Update Nginx Proxy Manager to v2.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Dec 14, 2024
1 parent a398e20 commit 0948873
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 142 deletions.
2 changes: 1 addition & 1 deletion proxy-manager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COPY requirements.txt /tmp/
COPY patches/*.patch /usr/src/

# Setup base
ARG NGINX_PROXY_MANAGER_VERSION="v2.10.4"
ARG NGINX_PROXY_MANAGER_VERSION="v2.12.1"
# hadolint ignore=DL3003,DL3042
RUN \
apk add --no-cache \
Expand Down
101 changes: 55 additions & 46 deletions proxy-manager/patches/0001-patch-data-to-config-folder.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From ebe3b5a97cc52f1d75945b058df1e93ec92688ee Mon Sep 17 00:00:00 2001
From 51dca2dc89662447fd826ec62453ab56a05a0f97 Mon Sep 17 00:00:00 2001
From: Franck Nijhof <[email protected]>
Date: Fri, 12 Jan 2024 17:00:45 +0100
Subject: [PATCH] Patch /data to /config folder
Subject: [PATCH 1/3] Patch /data to /config folder

---
backend/internal/access-list.js | 2 +-
Expand All @@ -19,15 +19,16 @@ Subject: [PATCH] Patch /data to /config folder
backend/templates/stream.conf | 8 ++---
docker/rootfs/etc/nginx/conf.d/default.conf | 6 ++--
.../include/letsencrypt-acme-challenge.conf | 2 +-
.../rootfs/etc/nginx/conf.d/include/log.conf | 2 +-
docker/rootfs/etc/nginx/nginx.conf | 31 ++++++++++---------
global/certbot-dns-plugins.js | 2 +-
17 files changed, 51 insertions(+), 50 deletions(-)
global/certbot-dns-plugins.json | 2 +-
18 files changed, 52 insertions(+), 51 deletions(-)

diff --git a/backend/internal/access-list.js b/backend/internal/access-list.js
index 8457792..48415d2 100644
index 72326be..a7a122f 100644
--- a/backend/internal/access-list.js
+++ b/backend/internal/access-list.js
@@ -462,7 +462,7 @@ const internalAccessList = {
@@ -461,7 +461,7 @@ const internalAccessList = {
* @returns {String}
*/
getFilename: (list) => {
Expand All @@ -37,10 +38,10 @@ index 8457792..48415d2 100644

/**
diff --git a/backend/internal/certificate.js b/backend/internal/certificate.js
index 871a280..463bcfd 100644
index 34b8fdf..fb43205 100644
--- a/backend/internal/certificate.js
+++ b/backend/internal/certificate.js
@@ -520,7 +520,7 @@ const internalCertificate = {
@@ -515,7 +515,7 @@ const internalCertificate = {
writeCustomCert: (certificate) => {
logger.info('Writing Custom Certificate:', certificate);

Expand All @@ -49,7 +50,7 @@ index 871a280..463bcfd 100644

return new Promise((resolve, reject) => {
if (certificate.provider === 'letsencrypt') {
@@ -1151,7 +1151,7 @@ const internalCertificate = {
@@ -1143,7 +1143,7 @@ const internalCertificate = {
}

// Create a test challenge file
Expand All @@ -59,7 +60,7 @@ index 871a280..463bcfd 100644
fs.mkdirSync(testChallengeDir, {recursive: true});
fs.writeFileSync(testChallengeFile, 'Success', {encoding: 'utf8'});
diff --git a/backend/internal/nginx.js b/backend/internal/nginx.js
index 77933e7..47c3b60 100644
index 5f802c0..a86186d 100644
--- a/backend/internal/nginx.js
+++ b/backend/internal/nginx.js
@@ -126,9 +126,9 @@ const internalNginx = {
Expand All @@ -74,7 +75,7 @@ index 77933e7..47c3b60 100644
},

/**
@@ -276,7 +276,7 @@ const internalNginx = {
@@ -278,7 +278,7 @@ const internalNginx = {

return new Promise((resolve, reject) => {
let template = null;
Expand All @@ -83,7 +84,7 @@ index 77933e7..47c3b60 100644

try {
template = fs.readFileSync(__dirname + '/../templates/letsencrypt-request.conf', {encoding: 'utf8'});
@@ -338,7 +338,7 @@ const internalNginx = {
@@ -340,7 +340,7 @@ const internalNginx = {
* @returns {Promise}
*/
deleteLetsEncryptRequestConfig: (certificate) => {
Expand All @@ -106,7 +107,7 @@ index d4ac67d..a7c2a31 100644

// Configure nginx
diff --git a/backend/lib/config.js b/backend/lib/config.js
index caa57fc..a04b80b 100644
index f7fbdca..05fc95b 100644
--- a/backend/lib/config.js
+++ b/backend/lib/config.js
@@ -2,7 +2,7 @@ const fs = require('fs');
Expand Down Expand Up @@ -156,10 +157,10 @@ index 06ca7bb..654e5e4 100644
{% endif %}

diff --git a/backend/templates/dead_host.conf b/backend/templates/dead_host.conf
index d94dff5..3c18acd 100644
index 7a06469..4605a93 100644
--- a/backend/templates/dead_host.conf
+++ b/backend/templates/dead_host.conf
@@ -7,8 +7,8 @@ server {
@@ -10,8 +10,8 @@ server {
{% include "_hsts.conf" %}
{% include "_forced_ssl.conf" %}

Expand Down Expand Up @@ -210,10 +211,10 @@ index 676c8a6..6bb985b 100644
include conf.d/include/letsencrypt-acme-challenge.conf;

diff --git a/backend/templates/proxy_host.conf b/backend/templates/proxy_host.conf
index 81a542e..6e6ad83 100644
index d23ca46..0de6647 100644
--- a/backend/templates/proxy_host.conf
+++ b/backend/templates/proxy_host.conf
@@ -19,8 +19,8 @@ proxy_set_header Connection $http_connection;
@@ -22,8 +22,8 @@ proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
{% endif %}

Expand All @@ -224,7 +225,7 @@ index 81a542e..6e6ad83 100644

{{ advanced_config }}

@@ -45,6 +45,6 @@ proxy_http_version 1.1;
@@ -48,6 +48,6 @@ proxy_http_version 1.1;
{% endif %}

# Custom
Expand All @@ -233,10 +234,10 @@ index 81a542e..6e6ad83 100644
}
{% endif %}
diff --git a/backend/templates/redirection_host.conf b/backend/templates/redirection_host.conf
index 339fe72..957ecc7 100644
index 7dd3607..61ee0c2 100644
--- a/backend/templates/redirection_host.conf
+++ b/backend/templates/redirection_host.conf
@@ -9,8 +9,8 @@ server {
@@ -12,8 +12,8 @@ server {
{% include "_hsts.conf" %}
{% include "_forced_ssl.conf" %}

Expand All @@ -247,7 +248,7 @@ index 339fe72..957ecc7 100644

{{ advanced_config }}

@@ -27,6 +27,6 @@ server {
@@ -30,6 +30,6 @@ server {
{% endif %}

# Custom
Expand Down Expand Up @@ -319,8 +320,18 @@ index ff2a782..0225bc5 100644
}

# Hide /acme-challenge subdirectory and return 404 on all requests.
diff --git a/docker/rootfs/etc/nginx/conf.d/include/log.conf b/docker/rootfs/etc/nginx/conf.d/include/log.conf
index 0d74029..29f1a7a 100644
--- a/docker/rootfs/etc/nginx/conf.d/include/log.conf
+++ b/docker/rootfs/etc/nginx/conf.d/include/log.conf
@@ -1,4 +1,4 @@
log_format proxy '[$time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] "$http_user_agent" "$http_referer"';
log_format standard '[$time_local] $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] "$http_user_agent" "$http_referer"';

-access_log /data/logs/fallback_access.log proxy;
+access_log /config/logs/fallback_access.log proxy;
diff --git a/docker/rootfs/etc/nginx/nginx.conf b/docker/rootfs/etc/nginx/nginx.conf
index 8261833..8d3ca91 100644
index 3a31e14..ae96614 100644
--- a/docker/rootfs/etc/nginx/nginx.conf
+++ b/docker/rootfs/etc/nginx/nginx.conf
@@ -1,5 +1,6 @@
Expand All @@ -330,7 +341,7 @@ index 8261833..8d3ca91 100644
pid /run/nginx/nginx.pid;
user npm;

@@ -9,13 +10,13 @@ worker_processes auto;
@@ -9,16 +10,16 @@ worker_processes auto;
# Enables the use of JIT for regular expressions to speed-up their processing.
pcre_jit on;

Expand All @@ -340,13 +351,17 @@ index 8261833..8d3ca91 100644
# Includes files with directives to load dynamic modules.
include /etc/nginx/modules/*.conf;

# Custom
-include /data/nginx/custom/root_top[.]conf;
+include /config/nginx/custom/root_top[.]conf;

events {
- include /data/nginx/custom/events[.]conf;
+ include /config/nginx/custom/events[.]conf;
}

http {
@@ -40,13 +41,13 @@ http {
@@ -43,8 +44,8 @@ http {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "";
proxy_cache off;
Expand All @@ -355,15 +370,9 @@ index 8261833..8d3ca91 100644
+ proxy_cache_path /tmp/nginx/cache/public levels=1:2 keys_zone=public-cache:30m max_size=192m;
+ proxy_cache_path /tmp/nginx/cache/private levels=1:2 keys_zone=private-cache:5m max_size=1024m;

log_format proxy '[$time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] "$http_user_agent" "$http_referer"';
log_format standard '[$time_local] $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] "$http_user_agent" "$http_referer"';

- access_log /data/logs/fallback_access.log proxy;
+ access_log /config/logs/fallback_access.log proxy;

# Dynamically generated resolvers file
include /etc/nginx/conf.d/include/resolvers.conf;
@@ -69,27 +70,27 @@ http {
# Log format and fallback log file
include /etc/nginx/conf.d/include/log.conf;
@@ -70,27 +71,27 @@ http {
real_ip_recursive on;

# Custom
Expand Down Expand Up @@ -401,19 +410,19 @@ index 8261833..8d3ca91 100644
# Custom
-include /data/nginx/custom/root[.]conf;
+include /config/nginx/custom/root[.]conf;
diff --git a/global/certbot-dns-plugins.js b/global/certbot-dns-plugins.js
index 78c67ed..f695cca 100644
--- a/global/certbot-dns-plugins.js
+++ b/global/certbot-dns-plugins.js
@@ -27,7 +27,7 @@ module.exports = {
version_requirement: '~=0.1.0',
dependencies: '',
credentials: `dns_acmedns_api_url = http://acmedns-server/
-dns_acmedns_registration_file = /data/acme-registration.json`,
+dns_acmedns_registration_file = /config/acme-registration.json`,
full_plugin_name: 'dns-acmedns',
diff --git a/global/certbot-dns-plugins.json b/global/certbot-dns-plugins.json
index 6729842..82cbd78 100644
--- a/global/certbot-dns-plugins.json
+++ b/global/certbot-dns-plugins.json
@@ -4,7 +4,7 @@
"package_name": "certbot-dns-acmedns",
"version": "~=0.1.0",
"dependencies": "",
- "credentials": "dns_acmedns_api_url = http://acmedns-server/\ndns_acmedns_registration_file = /data/acme-registration.json",
+ "credentials": "dns_acmedns_api_url = http://acmedns-server/\ndns_acmedns_registration_file = /config/acme-registration.json",
"full_plugin_name": "dns-acmedns"
},
aliyun: {
"active24":{
--
2.39.2
2.42.0

Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
From 01d546e60304dd2fbe83d447886443b492d87724 Mon Sep 17 00:00:00 2001
From 58a397ae6160c8f91721d54dea789097a56b8bf9 Mon Sep 17 00:00:00 2001
From: Franck Nijhof <[email protected]>
Date: Fri, 12 Jan 2024 17:14:53 +0100
Subject: [PATCH] Patch redirect logs to docker output
Subject: [PATCH 2/3] Patch redirect logs to docker output

---
backend/templates/dead_host.conf | 4 ++--
backend/templates/default.conf | 4 ++--
backend/templates/letsencrypt-request.conf | 4 ++--
backend/templates/proxy_host.conf | 4 ++--
backend/templates/redirection_host.conf | 4 ++--
docker/rootfs/etc/nginx/conf.d/default.conf | 6 +++---
docker/rootfs/etc/nginx/nginx.conf | 4 ++--
7 files changed, 15 insertions(+), 15 deletions(-)
backend/templates/dead_host.conf | 4 ++--
backend/templates/default.conf | 4 ++--
backend/templates/letsencrypt-request.conf | 4 ++--
backend/templates/proxy_host.conf | 4 ++--
backend/templates/redirection_host.conf | 4 ++--
docker/rootfs/etc/nginx/conf.d/default.conf | 6 +++---
docker/rootfs/etc/nginx/conf.d/include/log.conf | 2 +-
docker/rootfs/etc/nginx/nginx.conf | 2 +-
8 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/backend/templates/dead_host.conf b/backend/templates/dead_host.conf
index 3c18acd..72ecea5 100644
index 4605a93..8149261 100644
--- a/backend/templates/dead_host.conf
+++ b/backend/templates/dead_host.conf
@@ -7,8 +7,8 @@ server {
@@ -10,8 +10,8 @@ server {
{% include "_hsts.conf" %}
{% include "_forced_ssl.conf" %}

Expand Down Expand Up @@ -59,10 +60,10 @@ index 6bb985b..675b874 100644
include conf.d/include/letsencrypt-acme-challenge.conf;

diff --git a/backend/templates/proxy_host.conf b/backend/templates/proxy_host.conf
index 6e6ad83..a5853f1 100644
index 0de6647..c3c7490 100644
--- a/backend/templates/proxy_host.conf
+++ b/backend/templates/proxy_host.conf
@@ -19,8 +19,8 @@ proxy_set_header Connection $http_connection;
@@ -22,8 +22,8 @@ proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
{% endif %}

Expand All @@ -74,10 +75,10 @@ index 6e6ad83..a5853f1 100644
{{ advanced_config }}

diff --git a/backend/templates/redirection_host.conf b/backend/templates/redirection_host.conf
index 957ecc7..a1d6bc4 100644
index 61ee0c2..3377364 100644
--- a/backend/templates/redirection_host.conf
+++ b/backend/templates/redirection_host.conf
@@ -9,8 +9,8 @@ server {
@@ -12,8 +12,8 @@ server {
{% include "_hsts.conf" %}
{% include "_forced_ssl.conf" %}

Expand Down Expand Up @@ -112,8 +113,18 @@ index a3dcfbd..4a6108a 100644
error_log /dev/null crit;
include conf.d/include/ssl-ciphers.conf;
ssl_reject_handshake on;
diff --git a/docker/rootfs/etc/nginx/conf.d/include/log.conf b/docker/rootfs/etc/nginx/conf.d/include/log.conf
index 29f1a7a..1877713 100644
--- a/docker/rootfs/etc/nginx/conf.d/include/log.conf
+++ b/docker/rootfs/etc/nginx/conf.d/include/log.conf
@@ -1,4 +1,4 @@
log_format proxy '[$time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] "$http_user_agent" "$http_referer"';
log_format standard '[$time_local] $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] "$http_user_agent" "$http_referer"';

-access_log /config/logs/fallback_access.log proxy;
+access_log /proc/1/fd/1 proxy;
diff --git a/docker/rootfs/etc/nginx/nginx.conf b/docker/rootfs/etc/nginx/nginx.conf
index 8d3ca91..fdd4138 100644
index ae96614..522a699 100644
--- a/docker/rootfs/etc/nginx/nginx.conf
+++ b/docker/rootfs/etc/nginx/nginx.conf
@@ -10,7 +10,7 @@ worker_processes auto;
Expand All @@ -125,15 +136,6 @@ index 8d3ca91..fdd4138 100644

# Includes files with directives to load dynamic modules.
include /etc/nginx/modules/*.conf;
@@ -47,7 +47,7 @@ http {
log_format proxy '[$time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] "$http_user_agent" "$http_referer"';
log_format standard '[$time_local] $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] "$http_user_agent" "$http_referer"';

- access_log /config/logs/fallback_access.log proxy;
+ access_log /proc/1/fd/1 proxy;

# Dynamically generated resolvers file
include /etc/nginx/conf.d/include/resolvers.conf;
--
2.39.2
2.42.0

29 changes: 0 additions & 29 deletions proxy-manager/patches/0002-patch-sass-version-in-frontend.patch

This file was deleted.

Loading

0 comments on commit 0948873

Please sign in to comment.