Skip to content
Merged

v2.9.20 #2686

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
9866eec
Bump postcss from 8.2.10 to 8.2.13 in /docs
dependabot[bot] Mar 14, 2022
4251157
Bump ansi-html from 0.0.7 to 0.0.8 in /docs
dependabot[bot] Mar 14, 2022
edf369a
Bump node-forge from 1.0.0 to 1.3.0 in /docs
dependabot[bot] Mar 23, 2022
6f281fe
Workaround for cloudflare plugin install (#2381)
jc21 Nov 14, 2022
fd30cfe
Fix linting
jc21 Nov 14, 2022
452838b
Bump loader-utils from 2.0.3 to 2.0.4 in /docs
dependabot[bot] Nov 18, 2022
6349cb6
Fix cerbot plugin installation issues
i-strelnikov Nov 18, 2022
8dee139
Fix linter issues
i-strelnikov Nov 20, 2022
3c23aa9
Load events configuration from custom file
Blooym Dec 2, 2022
99d73a2
Update certbot desec plugin fixes #2485
LEDfan Dec 28, 2022
b69e493
Bump json5 from 2.1.3 to 2.2.3 in /backend
dependabot[bot] Jan 6, 2023
35aba13
Add Online (online.net) DNS provider
gromez Jan 9, 2023
c80d099
ACL changes should not blow away cert config
jmerdich Jan 10, 2023
7ca3a9e
Bump knex from 0.20.15 to 2.4.0 in /backend
dependabot[bot] Jan 11, 2023
a9e84f1
Bump ua-parser-js from 0.7.28 to 0.7.33 in /frontend
dependabot[bot] Jan 27, 2023
a7f0c3b
Use ssl_reject_handshake to reject requests to default https site
TheBeeZee Feb 3, 2023
d2f707b
Bump http-cache-semantics from 4.1.0 to 4.1.1 in /docs
dependabot[bot] Feb 3, 2023
2332689
Bump http-cache-semantics from 4.1.0 to 4.1.1 in /backend
dependabot[bot] Feb 3, 2023
8864960
Bump http-cache-semantics from 4.1.0 to 4.1.1 in /frontend
dependabot[bot] Feb 3, 2023
7fe7e94
Mitigate CVE-2023-23596 by changing child_process.exec to child_proce…
skarlcf Feb 26, 2023
b0fd976
Make sure to lowercase email address entered by the user during login.
jlesage Feb 27, 2023
1ac2841
Bump dns-packet from 5.2.2 to 5.4.0 in /docs
dependabot[bot] Mar 2, 2023
2aa6e55
Update certbot-dns-ionos plugin
campingwoelfe Mar 6, 2023
9b35e7c
Merge pull request #2644 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
4ad9e68
Merge pull request #2585 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
ef6da1b
Merge pull request #2584 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
93f57ae
Merge pull request #2583 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
7597515
Merge pull request #2564 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
634cfe1
Merge pull request #2534 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
448c8a2
Merge pull request #2523 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
cf6cc7d
Bump jsonwebtoken from 8.5.1 to 9.0.0 in /backend
dependabot[bot] Mar 7, 2023
f3b3072
Bump async from 3.2.0 to 3.2.2 in /docs
dependabot[bot] Mar 7, 2023
88fa7cd
Bump liquidjs from 9.15.0 to 10.0.0 in /backend
dependabot[bot] Mar 7, 2023
e227f41
Bump minimist from 1.2.5 to 1.2.8 in /backend
dependabot[bot] Mar 7, 2023
331da38
Bump minimist from 1.2.5 to 1.2.8 in /frontend
dependabot[bot] Mar 7, 2023
52e013d
Merge pull request #2410 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
9f192ab
Bump decode-uri-component from 0.2.0 to 0.2.1 in /docs
dependabot[bot] Mar 7, 2023
abe6493
Bump express from 4.17.1 to 4.17.3 in /docs
dependabot[bot] Mar 7, 2023
ebf07a7
Bump json5 from 2.1.3 to 2.2.2 in /docs
dependabot[bot] Mar 7, 2023
2addc48
Merge pull request #2649 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
09d6cf7
Merge pull request #2648 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
95665ca
Merge pull request #2513 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
32a3bb1
Bump ajv from 6.10.2 to 6.12.6 in /test
dependabot[bot] Mar 7, 2023
2706454
Bump minimist from 1.2.5 to 1.2.6 in /docs
dependabot[bot] Mar 7, 2023
b77d916
Merge pull request #2498 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
edba369
Merge pull request #2497 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
3f6ad0d
Merge pull request #2471 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
7b48488
Bump express from 4.17.1 to 4.17.3 in /backend
dependabot[bot] Mar 7, 2023
5f435b6
Merge pull request #2454 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
b1e904d
Merge pull request #2031 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
06453e9
Bump decode-uri-component from 0.2.0 to 0.2.2 in /frontend
dependabot[bot] Mar 7, 2023
09349ef
Merge pull request #1934 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
f0513d3
Merge pull request #1851 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
a06e960
Merge pull request #1947 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
6e500c3
Merge pull request #1958 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
d9a1701
Bump qs from 6.9.7 to 6.10.3 in /docs
dependabot[bot] Mar 7, 2023
d5c950a
Merge pull request #2659 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
abdaac8
Merge pull request #2470 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
589ab87
Merge pull request #1933 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
b08ef17
Merge pull request #2453 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
579c32a
Bump qs from 6.5.2 to 6.5.3 in /frontend
dependabot[bot] Mar 7, 2023
d2becc0
Merge pull request #2469 from NginxProxyManager/dependabot/npm_and_ya…
jc21 Mar 7, 2023
9d60b4a
Add Google Domains DNS provider
ttocsr Mar 3, 2023
2ff66ee
Add style required by linter
skarlcf Mar 7, 2023
40c2683
Merge pull request #2655 from campingwoelfe/campingwoelfe-patch-1
jc21 Mar 7, 2023
cc4891d
Merge pull request #2647 from ttocsr/google_domains_dns
jc21 Mar 7, 2023
42bd391
Merge pull request #2638 from jlesage/case-insensitive-email-login
jc21 Mar 7, 2023
30076a0
Merge pull request #2635 from skarlcf/security/CVE-2023-23596
jc21 Mar 7, 2023
2142e25
Merge pull request #2582 from TheBeeZee/ssl_reject_handshake
jc21 Mar 7, 2023
c371b2e
Merge pull request #2527 from gromez/certbot-dns-online
jc21 Mar 7, 2023
86e6319
Merge pull request #2507 from LEDfan/update-desec
jc21 Mar 7, 2023
c812b67
Update cypress
jc21 Mar 7, 2023
9b40bb2
Improvements to CI: comment on PR when syntax checking fails
jc21 Mar 8, 2023
546ce8d
Merge pull request #2444 from BitsOfAByte/develop
jc21 Mar 8, 2023
84e0b30
Merge pull request #2411 from plantysnake/fix-certbot-plugins
jc21 Mar 8, 2023
09d1d37
Merge pull request #2530 from jmerdich/jmerdich/fix-acl-edit-ssl
jc21 Mar 8, 2023
6a28701
Moved base images docker repo back to jc21, as docker is sunsetting f…
jc21 Mar 15, 2023
44bebf3
Bump version
jc21 Mar 15, 2023
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.19
2.9.20
88 changes: 34 additions & 54 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import groovy.transform.Field

@Field
def shOutput = ""
def buildxPushTags = ""

pipeline {
agent {
label 'docker-multiarch'
Expand All @@ -16,6 +22,8 @@ pipeline {
COMPOSE_FILE = 'docker/docker-compose.ci.yml'
COMPOSE_INTERACTIVE_NO_CLI = 1
BUILDX_NAME = "${COMPOSE_PROJECT_NAME}"
DOCS_BUCKET = 'jc21-npm-site'
DOCS_CDN = 'EN1G6DEWZUTDT'
}
stages {
stage('Environment') {
Expand All @@ -26,7 +34,7 @@ pipeline {
}
steps {
script {
env.BUILDX_PUSH_TAGS = "-t docker.io/jc21/${IMAGE}:${BUILD_VERSION} -t docker.io/jc21/${IMAGE}:${MAJOR_VERSION} -t docker.io/jc21/${IMAGE}:latest"
buildxPushTags = "-t docker.io/jc21/${IMAGE}:${BUILD_VERSION} -t docker.io/jc21/${IMAGE}:${MAJOR_VERSION} -t docker.io/jc21/${IMAGE}:latest"
}
}
}
Expand All @@ -39,7 +47,7 @@ pipeline {
steps {
script {
// Defaults to the Branch name, which is applies to all branches AND pr's
env.BUILDX_PUSH_TAGS = "-t docker.io/jc21/${IMAGE}:github-${BRANCH_LOWER}"
buildxPushTags = "-t docker.io/jc21/${IMAGE}:github-${BRANCH_LOWER}"
}
}
}
Expand All @@ -54,35 +62,28 @@ pipeline {
}
}
}
stage('Frontend') {
stage('Build and Test') {
steps {
sh './scripts/frontend-build'
script {
// Frontend and Backend
def shStatusCode = sh(label: 'Checking and Building', returnStatus: true, script: '''
set -e
./scripts/ci/frontend-build > ${WORKSPACE}/tmp-sh-build 2>&1
./scripts/ci/test-and-build > ${WORKSPACE}/tmp-sh-build 2>&1
''')
shOutput = readFile "${env.WORKSPACE}/tmp-sh-build"
if (shStatusCode != 0) {
error "${shOutput}"
}
}
}
}
stage('Backend') {
steps {
echo 'Checking Syntax ...'
sh 'docker pull nginxproxymanager/nginx-full:certbot-node'
// See: https://github.com/yarnpkg/yarn/issues/3254
sh '''docker run --rm \\
-v "$(pwd)/backend:/app" \\
-v "$(pwd)/global:/app/global" \\
-w /app \\
nginxproxymanager/nginx-full:certbot-node \\
sh -c "yarn install && yarn eslint . && rm -rf node_modules"
'''

echo 'Docker Build ...'
sh '''docker build --pull --no-cache --squash --compress \\
-t "${IMAGE}:ci-${BUILD_NUMBER}" \\
-f docker/Dockerfile \\
--build-arg TARGETPLATFORM=linux/amd64 \\
--build-arg BUILDPLATFORM=linux/amd64 \\
--build-arg BUILD_VERSION="${BUILD_VERSION}" \\
--build-arg BUILD_COMMIT="${BUILD_COMMIT}" \\
--build-arg BUILD_DATE="$(date '+%Y-%m-%d %T %Z')" \\
.
'''
post {
always {
sh 'rm -f ${WORKSPACE}/tmp-sh-build'
}
failure {
npmGithubPrComment("CI Error:\n\n```\n${shOutput}\n```", true)
}
}
}
stage('Integration Tests Sqlite') {
Expand Down Expand Up @@ -164,10 +165,8 @@ pipeline {
}
steps {
withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) {
// Docker Login
sh "docker login -u '${duser}' -p '${dpass}'"
// Buildx with push from cache
sh "./scripts/buildx --push ${BUILDX_PUSH_TAGS}"
sh 'docker login -u "${duser}" -p "${dpass}"'
sh "./scripts/buildx --push ${buildxPushTags}"
}
}
}
Expand All @@ -181,26 +180,7 @@ pipeline {
}
}
steps {
withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'npm-s3-docs', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
sh """docker run --rm \\
--name \${COMPOSE_PROJECT_NAME}-docs-upload \\
-e S3_BUCKET=jc21-npm-site \\
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \\
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \\
-v \$(pwd):/app \\
-w /app \\
jc21/ci-tools \\
scripts/docs-upload /app/docs/.vuepress/dist/
"""

sh """docker run --rm \\
--name \${COMPOSE_PROJECT_NAME}-docs-invalidate \\
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \\
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \\
jc21/ci-tools \\
aws cloudfront create-invalidation --distribution-id EN1G6DEWZUTDT --paths '/*'
"""
}
npmDocsRelease("$DOCS_BUCKET", "$DOCS_CDN")
}
}
stage('PR Comment') {
Expand All @@ -214,7 +194,7 @@ pipeline {
}
steps {
script {
def comment = pullRequest.comment("This is an automated message from CI:\n\nDocker 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.")
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)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions backend/internal/access-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const internalAccessList = {
// re-fetch with expansions
return internalAccessList.get(access, {
id: data.id,
expand: ['owner', 'items', 'clients', 'proxy_hosts.access_list.[clients,items]']
expand: ['owner', 'items', 'clients', 'proxy_hosts.[certificate,access_list.[clients,items]]']
}, true /* <- skip masking */);
})
.then((row) => {
Expand Down Expand Up @@ -256,7 +256,7 @@ const internalAccessList = {
.joinRaw('LEFT JOIN `proxy_host` ON `proxy_host`.`access_list_id` = `access_list`.`id` AND `proxy_host`.`is_deleted` = 0')
.where('access_list.is_deleted', 0)
.andWhere('access_list.id', data.id)
.allowEager('[owner,items,clients,proxy_hosts.[*, access_list.[clients,items]]]')
.allowEager('[owner,items,clients,proxy_hosts.[certificate,access_list.[clients,items]]]')
.omit(['access_list.is_deleted'])
.first();

Expand Down Expand Up @@ -507,7 +507,7 @@ const internalAccessList = {
if (typeof item.password !== 'undefined' && item.password.length) {
logger.info('Adding: ' + item.username);

utils.exec('/usr/bin/htpasswd -b "' + htpasswd_file + '" "' + item.username + '" "' + item.password + '"')
utils.execFile('/usr/bin/htpasswd', ['-b', htpasswd_file, item.username, item.password])
.then((/*result*/) => {
next();
})
Expand Down
3 changes: 2 additions & 1 deletion backend/internal/certificate.js
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,8 @@ const internalCertificate = {
// 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;
// we call `. /opt/certbot/bin/activate` (`.` is alternative to `source` in dash) to access certbot venv
let prepareCmd = '. /opt/certbot/bin/activate && pip install ' + dns_plugin.package_name + (dns_plugin.version_requirement || '') + ' ' + dns_plugin.dependencies + ' && deactivate';

// Whether the plugin has a --<name>-credentials argument
const hasConfigArg = certificate.meta.dns_provider !== 'route53';
Expand Down
2 changes: 1 addition & 1 deletion backend/internal/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {

return userModel
.query()
.where('email', data.identity)
.where('email', data.identity.toLowerCase().trim())
.andWhere('is_deleted', 0)
.andWhere('is_disabled', 0)
.first()
Expand Down
19 changes: 18 additions & 1 deletion backend/lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const exec = require('child_process').exec;
const exec = require('child_process').exec;
const execFile = require('child_process').execFile;

module.exports = {

Expand All @@ -16,5 +17,21 @@ module.exports = {
}
});
});
},

/**
* @param {Array} cmd
* @returns {Promise}
*/
execFile: function (cmd) {
return new Promise((resolve, reject) => {
execFile(cmd, function (err, stdout, /*stderr*/) {
if (err && typeof err === 'object') {
reject(err);
} else {
resolve(stdout.trim());
}
});
});
}
};
8 changes: 4 additions & 4 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"body-parser": "^1.19.0",
"compression": "^1.7.4",
"config": "^3.3.1",
"express": "^4.17.1",
"express": "^4.17.3",
"express-fileupload": "^1.1.9",
"gravatar": "^1.8.0",
"json-schema-ref-parser": "^8.0.0",
"jsonwebtoken": "^8.5.1",
"knex": "^0.20.13",
"liquidjs": "^9.11.10",
"jsonwebtoken": "^9.0.0",
"knex": "^2.4.0",
"liquidjs": "^10.0.0",
"lodash": "^4.17.21",
"moment": "^2.29.4",
"mysql": "^2.18.1",
Expand Down
12 changes: 6 additions & 6 deletions backend/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ const setupCertbotPlugins = () => {

certificates.map(function (certificate) {
if (certificate.meta && certificate.meta.dns_challenge === true) {
const dns_plugin = dns_plugins[certificate.meta.dns_provider];
const packages_to_install = `${dns_plugin.package_name}${dns_plugin.version_requirement || ''} ${dns_plugin.dependencies}`;
const dns_plugin = dns_plugins[certificate.meta.dns_provider];

const packages_to_install = `${dns_plugin.package_name}${dns_plugin.version_requirement || ''} ${dns_plugin.dependencies}`;
if (plugins.indexOf(packages_to_install) === -1) plugins.push(packages_to_install);

// Make sure credentials file exists
const credentials_loc = '/etc/letsencrypt/credentials/credentials-' + certificate.id;
const credentials_loc = '/etc/letsencrypt/credentials/credentials-' + certificate.id;
// 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 + '\'; }';
Expand All @@ -189,14 +189,14 @@ const setupCertbotPlugins = () => {
});

if (plugins.length) {
const install_cmd = 'pip install ' + plugins.join(' ');
const install_cmd = '. /opt/certbot/bin/activate && pip install ' + plugins.join(' ') + ' && deactivate';
promises.push(utils.exec(install_cmd));
}

if (promises.length) {
return Promise.all(promises)
.then(() => {
logger.info('Added Certbot plugins ' + plugins.join(', '));
.then(() => {
logger.info('Added Certbot plugins ' + plugins.join(', '));
});
}
}
Expand Down
Loading