Compare commits

..

3 Commits

Author SHA1 Message Date
jc21
b4f49969d6 Merge pull request #4261 from NginxProxyManager/develop
v2.12.2
2024-12-29 14:40:05 +10:00
jc21
5084cb7296 Merge pull request #4077 from NginxProxyManager/develop
v2.12.1
2024-10-17 09:49:07 +10:00
jc21
e677bfa2e8 Merge pull request #4073 from NginxProxyManager/develop
v2.12.0
2024-10-16 15:41:55 +10:00
11 changed files with 18 additions and 145 deletions

6
Jenkinsfile vendored
View File

@@ -128,7 +128,7 @@ pipeline {
sh 'docker-compose down --remove-orphans --volumes -t 30 || true'
}
unstable {
dir(path: 'test/results') {
dir(path: 'testing/results') {
archiveArtifacts(allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml')
}
}
@@ -161,7 +161,7 @@ pipeline {
sh 'docker-compose down --remove-orphans --volumes -t 30 || true'
}
unstable {
dir(path: 'test/results') {
dir(path: 'testing/results') {
archiveArtifacts(allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml')
}
}
@@ -199,7 +199,7 @@ pipeline {
sh 'docker-compose down --remove-orphans --volumes -t 30 || true'
}
unstable {
dir(path: 'test/results') {
dir(path: 'testing/results') {
archiveArtifacts(allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml')
}
}

View File

@@ -258,7 +258,6 @@ const internalAccessList = {
})
.where('access_list.is_deleted', 0)
.andWhere('access_list.id', data.id)
.groupBy('access_list.id')
.allowGraph('[owner,items,clients,proxy_hosts.[certificate,access_list.[clients,items]]]')
.first();

View File

@@ -5,20 +5,6 @@ const config = require('../lib/config');
const utils = require('../lib/utils');
const error = require('../lib/error');
/**
*
* @param {int} user_port
* @param {int} default_port
* @returns {int} port
*/
const validatePort = (user_port, default_port) => {
if (isNaN(user_port) || user_port < 1 || user_port > 65535) {
console.error(`Environment variable HTTP_PORT must be an integer between 1 and 65535 (got: ${user_port}). Using default port ${default_port}`);
return default_port;
}
return user_port;
};
const internalNginx = {
/**
@@ -246,10 +232,8 @@ const internalNginx = {
locationsPromise = Promise.resolve();
}
// Set the IPv6 and port setting for the host
host.ipv6 = internalNginx.ipv6Enabled();
host.http_port = internalNginx.httpPort();
host.https_port = internalNginx.httpsPort();
// Set the IPv6 setting for the host
host.ipv6 = internalNginx.ipv6Enabled();
locationsPromise.then(() => {
renderEngine
@@ -303,9 +287,7 @@ const internalNginx = {
return;
}
certificate.ipv6 = internalNginx.ipv6Enabled();
certificate.http_port = internalNginx.httpPort();
certificate.https_port = internalNginx.httpsPort();
certificate.ipv6 = internalNginx.ipv6Enabled();
renderEngine
.parseAndRender(template, certificate)
@@ -450,30 +432,7 @@ const internalNginx = {
}
return true;
},
/**
* @returns {integer}
*/
httpPort: function () {
if (typeof process.env.HTTP_PORT !== 'undefined') {
let httpPort = parseInt(process.env.HTTP_PORT);
return validatePort(httpPort, 443);
}
return 80;
},
/**
* @returns {integer}
*/
httpsPort: function () {
if (typeof process.env.HTTPS_PORT !== 'undefined') {
let httpPort = parseInt(process.env.HTTPS_PORT);
return validatePort(httpPort, 443);
}
return 80;
}
};
module.exports = internalNginx;

View File

@@ -1,15 +1,15 @@
listen {{ http_port }};
listen 80;
{% if ipv6 -%}
listen [::]:{{ http_port }};
listen [::]:80;
{% else -%}
#listen [::]:{{ http_port }};
#listen [::]:80;
{% endif %}
{% if certificate -%}
listen {{ https_port }} ssl;
listen 443 ssl;
{% if ipv6 -%}
listen [::]:{{ https_port }} ssl;
listen [::]:443 ssl;
{% else -%}
#listen [::]:{{ https_port }};
#listen [::]:443;
{% endif %}
{% endif %}
server_name {{ domain_names | join: " " }};

View File

@@ -40,7 +40,7 @@ services:
- ca.internal
pdns:
image: pschiffe/pdns-mysql:4.8
image: pschiffe/pdns-mysql
volumes:
- '/etc/localtime:/etc/localtime:ro'
environment:

View File

@@ -39,8 +39,6 @@ services:
DB_POSTGRES_NAME: 'npm'
# DB_SQLITE_FILE: "/data/database.sqlite"
# DISABLE_IPV6: "true"
# HTTP_PORT: "1234"
# HTTPS_PORT: "5678"
# Required for DNS Certificate provisioning testing:
LE_SERVER: 'https://ca.internal/acme/acme/directory'
REQUESTS_CA_BUNDLE: '/etc/ssl/certs/NginxProxyManager.crt'
@@ -134,7 +132,7 @@ services:
- 8128:3128
pdns:
image: pschiffe/pdns-mysql:4.8
image: pschiffe/pdns-mysql
container_name: npm2dev.pdns
volumes:
- '/etc/localtime:/etc/localtime:ro'
@@ -220,7 +218,7 @@ services:
env_file:
- ci.env
ports:
- 9000:9000
- 9000:9000
depends_on:
- authentik-redis
- db-postgres

View File

@@ -18,6 +18,5 @@ fi
. /etc/s6-overlay/s6-rc.d/prepare/30-ownership.sh
. /etc/s6-overlay/s6-rc.d/prepare/40-dynamic.sh
. /etc/s6-overlay/s6-rc.d/prepare/50-ipv6.sh
. /etc/s6-overlay/s6-rc.d/prepare/55-http-https-port.sh
. /etc/s6-overlay/s6-rc.d/prepare/60-secrets.sh
. /etc/s6-overlay/s6-rc.d/prepare/90-banner.sh

View File

@@ -1,62 +0,0 @@
#!/command/with-contenv bash
# shellcheck shell=bash
# This command reads the `HTTP_PORT` and `HTTPS_PORT` env vars and will rerender
# the nginx files to the port defined in these variables
set -e
log_info 'HTTP_PORT ...'
DEFAULT_HTTP_PORT="80"
DEFAULT_HTTPS_PORT="443"
# Make sure HTTP_PORT and HTTPS_PORT are set correctly
case "$HTTP_PORT" in
''|*[!0-9]*)
echo "Could not parse HTTP_PORT as integer (got \"$HTTP_PORT\")."
echo "Using default http port \"$DEFAULT_HTTP_PORT\""
HTTP_PORT="$DEFAULT_HTTP_PORT"
;;
*) true ;;
esac
if [ "$HTTP_PORT" -lt "1" ] || [ "$HTTP_PORT" -gt "65535" ]; then
echo "HTTP_PORT must be between 1 and 65535 (got \"$HTTP_PORT\")."
echo "Using default http port \"$DEFAULT_HTTP_PORT\""
HTTP_PORT="$DEFAULT_HTTP_PORT"
fi
case "$HTTPS_PORT" in
''|*[!0-9]*)
echo "Could not parse HTTPS_PORT as integer (got \"$HTTPS_PORT\")."
echo "Using default https port \"$DEFAULT_HTTPS_PORT\""
HTTPS_PORT="$DEFAULT_HTTPS_PORT"
;;
*) true ;;
esac
if [ "$HTTPS_PORT" -lt "1" ] || [ "$HTTPS_PORT" -gt "65535" ]; then
echo "HTTPS_PORT must be between 1 and 65535 (got \"$HTTPS_PORT\")."
echo "Using default https port \"$DEFAULT_HTTPS_PORT\""
HTTPS_PORT="$DEFAULT_HTTPS_PORT"
fi
process_folder () {
FILES=$(find "$1" -type f -name "*.conf")
HTTP_SED_REGEX='/ssl/! s/listen (\[::\]:)?[0-9]+/listen \1'$HTTP_PORT'/g'
HTTPS_SED_REGEX='/ssl/ s/listen (\[::\]:)?[0-9]+/listen \1'$HTTPS_PORT'/g'
echo "Setting HTTP listen port to $HTTP_PORT and HTTPS listen port to $HTTPS_PORT in: $1"
for FILE in $FILES
do
echo "- ${FILE}"
echo "$(sed -E "$HTTP_SED_REGEX" "$FILE")" > $FILE
echo "$(sed -E "$HTTPS_SED_REGEX" "$FILE")" > $FILE
done
# ensure the files are still owned by the npm user
chown -R "$PUID:$PGID" "$1"
}
process_folder /etc/nginx/conf.d
process_folder /data/nginx

View File

@@ -161,18 +161,6 @@ The easy fix is to add a Docker environment variable to the Nginx Proxy Manager
DISABLE_IPV6: 'true'
```
## Chaning the HTTP and HTTPS Listen Port
If you are unable to configure the port mapping within Docker (eg. when using
`hostNetwork: true`) you can change the port that proxy-hosts and
redirection-hosts listen on by setting the environment variables `HTTP_PORT` and
`HTTPS_PORT`:
```yml
environment:
HTTP_PORT: "1234"
HTTPS_PORT: "5678"
```
## Custom Nginx Configurations

View File

@@ -1065,9 +1065,9 @@ vfile@^6.0.0:
vfile-message "^4.0.0"
vite@^5.4.8:
version "5.4.14"
resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.14.tgz#ff8255edb02134df180dcfca1916c37a6abe8408"
integrity sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==
version "5.4.8"
resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.8.tgz#af548ce1c211b2785478d3ba3e8da51e39a287e8"
integrity sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==
dependencies:
esbuild "^0.21.3"
postcss "^8.4.43"

View File

@@ -215,14 +215,6 @@
"credentials": "# Gandi personal access token\ndns_gandi_token=PERSONAL_ACCESS_TOKEN",
"full_plugin_name": "dns-gandi"
},
"gcore": {
"name": "Gcore DNS",
"package_name": "certbot-dns-gcore",
"version": "~=0.1.8",
"dependencies": "",
"credentials": "dns_gcore_apitoken = 0123456789abcdef0123456789abcdef01234567",
"full_plugin_name": "dns-gcore"
},
"godaddy": {
"name": "GoDaddy",
"package_name": "certbot-dns-godaddy",