Skip to content

v2.9.14 #1716

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

Merged
merged 31 commits into from
Jan 2, 2022
Merged

v2.9.14 #1716

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3dfe238
Add two new headers to proxy.conf
the1ts Nov 29, 2021
bb422d4
Update default.conf
weedpump Dec 21, 2021
ac23c66
Fixes custom certificate upload modal
chaptergy Dec 23, 2021
40b1521
Merge pull request #1677 from jc21/fixes-custom-certificate-modal
jc21 Dec 27, 2021
adc5a20
Merge pull request #1666 from TobiasKneidl/patch-1
jc21 Dec 27, 2021
5aae8cd
Fixed the access log path to match the HTTP one. This also fixes its…
jlesage Dec 27, 2021
849bdcd
Fixed generation of resolvers.conf.
jlesage Dec 27, 2021
b78c7e1
Fixes dnspod credentials template
chaptergy Nov 20, 2021
2ac1026
Hack for python binary in newer node images
jc21 Dec 22, 2021
5d106c4
Bump version
jc21 Dec 22, 2021
ab80fe1
Fixes custom certificate upload modal
chaptergy Dec 23, 2021
7800938
Update default.conf
weedpump Dec 21, 2021
747de51
Sets certbot official dns plugin version requirement to match certbot…
chaptergy Dec 29, 2021
5a8028a
Adds FAQ entry for acl plus login
chaptergy Dec 29, 2021
9dd5644
Correctly escape backslashes in dns plugin credentials
chaptergy Dec 29, 2021
7e67f33
fetch cloudflare ipv4/ipv6 fail #1405
Dec 30, 2021
c803ec7
Adds delay after reloading nginx before requesting ssl certificate us…
chaptergy Dec 30, 2021
4e17fb4
Adds tencent cloud as dns challenge provider
chaptergy Jan 1, 2022
2d23bed
Merge pull request #1713 from jc21/adds-tencentcloud-dns-challenge
jc21 Jan 2, 2022
abe53a4
Merge pull request #1704 from jc21/letsencrypt-cert-request-delay
jc21 Jan 2, 2022
29ee485
Merge pull request #1703 from luoweihua7/develop
jc21 Jan 2, 2022
d7e0ae0
Merge pull request #1701 from jc21/escape-credential-backslashes
jc21 Jan 2, 2022
9146ca6
Merge pull request #1698 from jc21/adds-faq-acl-with-login
jc21 Jan 2, 2022
74d610d
Merge pull request #1697 from jc21/official-dns-version-requirement
jc21 Jan 2, 2022
0d8dd03
Merge pull request #1687 from jlesage/fallback-access-fix
jc21 Jan 2, 2022
b9ef11e
Merge pull request #1614 from the1ts/feature/proxy-header-additions
jc21 Jan 2, 2022
e81cc45
Updates dnspod challenge credentials
chaptergy Jan 2, 2022
1ec9509
Ensure backend build is pulling node:latest first
jc21 Jan 2, 2022
973a10a
Bump version
jc21 Jan 2, 2022
a082ec0
Merge pull request #1600 from jc21/updates-dnspod-dns-challenge
jc21 Jan 2, 2022
7e451bc
Merge pull request #1688 from jlesage/resolvers-fix
jc21 Jan 2, 2022
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 .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.9.13
2.9.14
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pipeline {
stage('Backend') {
steps {
echo 'Checking Syntax ...'
sh 'docker pull node:latest'
// See: https://github.com/yarnpkg/yarn/issues/3254
sh '''docker run --rm \\
-v "$(pwd)/backend:/app" \\
Expand Down
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center">
<img src="https://nginxproxymanager.com/github.png">
<br><br>
<img src="https://img.shields.io/badge/version-2.9.13-green.svg?style=for-the-badge">
<img src="https://img.shields.io/badge/version-2.9.14-green.svg?style=for-the-badge">
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
<img src="https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge">
</a>
Expand Down Expand Up @@ -110,9 +110,9 @@ Special thanks to the following contributors:
<table>
<tr>
<td align="center">
<a href="https://github.com/Subv">
<img src="https://avatars1.githubusercontent.com/u/357072?s=460&u=d8adcdc91d749ae53e177973ed9b6bb6c4c894a3&v=4" width="80" alt=""/>
<br /><sub><b>Sebastian Valle</b></sub>
<a href="https://github.com/chaptergy">
<img src="https://avatars2.githubusercontent.com/u/26956711?s=460&u=7d9adebabb6b4e7af7cb05d98d751087a372304b&v=4" width="80" alt=""/>
<br /><sub><b>chaptergy</b></sub>
</a>
</td>
<td align="center">
Expand Down Expand Up @@ -242,9 +242,9 @@ Special thanks to the following contributors:
</tr>
<tr>
<td align="center">
<a href="https://github.com/chaptergy">
<img src="https://avatars2.githubusercontent.com/u/26956711?s=460&u=7d9adebabb6b4e7af7cb05d98d751087a372304b&v=4" width="80" alt=""/>
<br /><sub><b>chaptergy</b></sub>
<a href="https://github.com/Subv">
<img src="https://avatars1.githubusercontent.com/u/357072?s=460&u=d8adcdc91d749ae53e177973ed9b6bb6c4c894a3&v=4" width="80" alt=""/>
<br /><sub><b>Sebastian Valle</b></sub>
</a>
</td>
<td align="center">
Expand Down Expand Up @@ -491,6 +491,26 @@ Special thanks to the following contributors:
<br /><sub><b>bergi9</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/luoweihua7">
<img src="https://avatars.githubusercontent.com/u/3157520?v=4" width="80" alt=""/>
<br /><sub><b>luoweihua7</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/TobiasKneidl">
<img src="https://avatars.githubusercontent.com/u/26301707?v=4" width="80" alt=""/>
<br /><sub><b>Tobias Kneidl</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/piuswalter">
<img src="https://avatars.githubusercontent.com/u/64539242?v=4" width="80" alt=""/>
<br /><sub><b>Pius Walter</b></sub>
</a>
</td>
</tr>
</table>
<!-- markdownlint-enable -->
Expand Down
7 changes: 5 additions & 2 deletions backend/internal/certificate.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ const internalCertificate = {
// 3. Generate the LE config
return internalNginx.generateLetsEncryptRequestConfig(certificate)
.then(internalNginx.reload)
.then(async() => await new Promise((r) => setTimeout(r, 5000)))
.then(() => {
// 4. Request cert
return internalCertificate.requestLetsEncryptSsl(certificate);
Expand Down Expand Up @@ -870,8 +871,10 @@ const internalCertificate = {
logger.info(`Requesting Let'sEncrypt certificates via ${dns_plugin.display_name} for Cert #${certificate.id}: ${certificate.domain_names.join(', ')}`);

const credentialsLocation = '/etc/letsencrypt/credentials/credentials-' + certificate.id;
const credentialsCmd = 'mkdir -p /etc/letsencrypt/credentials 2> /dev/null; echo \'' + certificate.meta.dns_provider_credentials.replace('\'', '\\\'') + '\' > \'' + credentialsLocation + '\' && chmod 600 \'' + credentialsLocation + '\'';
const prepareCmd = 'pip install ' + dns_plugin.package_name + (dns_plugin.version_requirement || '') + ' ' + dns_plugin.dependencies;
// Escape single quotes and backslashes
const escapedCredentials = certificate.meta.dns_provider_credentials.replaceAll('\'', '\\\'').replaceAll('\\', '\\\\');
const credentialsCmd = 'mkdir -p /etc/letsencrypt/credentials 2> /dev/null; echo \'' + escapedCredentials + '\' > \'' + credentialsLocation + '\' && chmod 600 \'' + credentialsLocation + '\'';
const prepareCmd = 'pip install ' + dns_plugin.package_name + (dns_plugin.version_requirement || '') + ' ' + dns_plugin.dependencies;

// Whether the plugin has a --<name>-credentials argument
const hasConfigArg = certificate.meta.dns_provider !== 'route53';
Expand Down
7 changes: 5 additions & 2 deletions backend/internal/ip_ranges.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const CLOUDFRONT_URL = 'https://ip-ranges.amazonaws.com/ip-ranges.json';
const CLOUDFARE_V4_URL = 'https://www.cloudflare.com/ips-v4';
const CLOUDFARE_V6_URL = 'https://www.cloudflare.com/ips-v6';

const regIpV4 = /^(\d+\.?){4}\/\d+/;
const regIpV6 = /^(([\da-fA-F]+)?:)+\/\d+/;

const internalIpRanges = {

interval_timeout: 1000 * 60 * 60 * 6, // 6 hours
Expand Down Expand Up @@ -74,14 +77,14 @@ const internalIpRanges = {
return internalIpRanges.fetchUrl(CLOUDFARE_V4_URL);
})
.then((cloudfare_data) => {
let items = cloudfare_data.split('\n');
let items = cloudfare_data.split('\n').filter((line) => regIpV4.test(line));
ip_ranges = [... ip_ranges, ... items];
})
.then(() => {
return internalIpRanges.fetchUrl(CLOUDFARE_V6_URL);
})
.then((cloudfare_data) => {
let items = cloudfare_data.split('\n');
let items = cloudfare_data.split('\n').filter((line) => regIpV6.test(line));
ip_ranges = [... ip_ranges, ... items];
})
.then(() => {
Expand Down
4 changes: 3 additions & 1 deletion backend/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ const setupCertbotPlugins = () => {

// Make sure credentials file exists
const credentials_loc = '/etc/letsencrypt/credentials/credentials-' + certificate.id;
const credentials_cmd = '[ -f \'' + credentials_loc + '\' ] || { mkdir -p /etc/letsencrypt/credentials 2> /dev/null; echo \'' + certificate.meta.dns_provider_credentials.replace('\'', '\\\'') + '\' > \'' + credentials_loc + '\' && chmod 600 \'' + credentials_loc + '\'; }';
// Escape single quotes and backslashes
const escapedCredentials = certificate.meta.dns_provider_credentials.replaceAll('\'', '\\\'').replaceAll('\\', '\\\\');
const credentials_cmd = '[ -f \'' + credentials_loc + '\' ] || { mkdir -p /etc/letsencrypt/credentials 2> /dev/null; echo \'' + escapedCredentials + '\' > \'' + credentials_loc + '\' && chmod 600 \'' + credentials_loc + '\'; }';
promises.push(utils.exec(credentials_cmd));
}
});
Expand Down
4 changes: 2 additions & 2 deletions backend/templates/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
server {
listen 80 default;
{% if ipv6 -%}
listen [::]:80;
listen [::]:80 default;
{% else -%}
#listen [::]:80;
#listen [::]:80 default;
{% endif %}
server_name default-host.localhost;
access_log /data/logs/default-host_access.log combined;
Expand Down
2 changes: 1 addition & 1 deletion docker/rootfs/etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ server {
set $port "443";

server_name localhost;
access_log /data/logs/fallback-access.log standard;
access_log /data/logs/fallback_access.log standard;
error_log /dev/null crit;
ssl_certificate /data/nginx/dummycert.pem;
ssl_certificate_key /data/nginx/dummykey.pem;
Expand Down
2 changes: 2 additions & 0 deletions docker/rootfs/etc/nginx/conf.d/include/proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ add_header X-Served-By $host;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $port;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass $forward_scheme://$server:$port$request_uri;
Expand Down
2 changes: 1 addition & 1 deletion docker/rootfs/etc/services.d/nginx/run
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ chown root /tmp/nginx

# Dynamically generate resolvers file, if resolver is IPv6, enclose in `[]`
# thanks @tfmm
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf);" > /etc/nginx/conf.d/include/resolvers.conf
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" { sub(/%.*$/,"",$2); print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf);" > /etc/nginx/conf.d/include/resolvers.conf

# Generate dummy self-signed certificate.
if [ ! -f /data/nginx/dummycert.pem ] || [ ! -f /data/nginx/dummykey.pem ]
Expand Down
3 changes: 3 additions & 0 deletions docs/faq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ Your best bet is to ask the [Reddit community for support](https://www.reddit.co

Gitter is best left for anyone contributing to the project to ask for help about internals, code reviews etc.

## When adding username and password access control to a proxy host, I can no longer login into the app.

Having an Access Control List (ACL) with username and password requires the browser to always send this username and password in the `Authorization` header on each request. If your proxied app also requires authentication (like Nginx Proxy Manager itself), most likely the app will also use the `Authorization` header to transmit this information, as this is the standardized header meant for this kind of information. However having multiples of the same headers is not allowed in the [internet standard](https://www.rfc-editor.org/rfc/rfc7230#section-3.2.2) and almost all apps do not support multiple values in the `Authorization` header. Hence one of the two logins will be broken. This can only be fixed by either removing one of the logins or by changing the app to use other non-standard headers for authorization.
8 changes: 5 additions & 3 deletions frontend/js/app/nginx/certificates/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,11 @@ module.exports = Mn.View.extend({
this.ui.credentials_file_content.hide();
this.ui.loader_content.hide();
this.ui.le_error_info.hide();
const domainNames = this.ui.domain_names[0].value.split(',');
if (!domainNames || domainNames.length === 0 || (domainNames.length === 1 && domainNames[0] === "")) {
this.ui.test_domains_button.prop('disabled', true);
if (this.ui.domain_names[0]) {
const domainNames = this.ui.domain_names[0].value.split(',');
if (!domainNames || domainNames.length === 0 || (domainNames.length === 1 && domainNames[0] === "")) {
this.ui.test_domains_button.prop('disabled', true);
}
}
},

Expand Down
Loading