Skip to content

Commit 546f862

Browse files
authored
Merge pull request #429 from jc21/develop
v2.3.0
2 parents 7084473 + f105e29 commit 546f862

23 files changed

+222
-147
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
.idea
33
._*
44
.vscode
5-
5+
certbot-help.txt

.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.4
1+
2.3.0

Jenkinsfile

+44-55
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pipeline {
55
options {
66
buildDiscarder(logRotator(numToKeepStr: '5'))
77
disableConcurrentBuilds()
8+
ansiColor('xterm')
89
}
910
environment {
1011
IMAGE = "nginx-proxy-manager"
@@ -55,50 +56,44 @@ pipeline {
5556
}
5657
stage('Frontend') {
5758
steps {
58-
ansiColor('xterm') {
59-
sh './scripts/frontend-build'
60-
}
59+
sh './scripts/frontend-build'
6160
}
6261
}
6362
stage('Backend') {
6463
steps {
65-
ansiColor('xterm') {
66-
echo 'Checking Syntax ...'
67-
// See: https://github.com/yarnpkg/yarn/issues/3254
68-
sh '''docker run --rm \\
69-
-v "$(pwd)/backend:/app" \\
70-
-w /app \\
71-
node:latest \\
72-
sh -c "yarn install && yarn eslint . && rm -rf node_modules"
73-
'''
64+
echo 'Checking Syntax ...'
65+
// See: https://github.com/yarnpkg/yarn/issues/3254
66+
sh '''docker run --rm \\
67+
-v "$(pwd)/backend:/app" \\
68+
-w /app \\
69+
node:latest \\
70+
sh -c "yarn install && yarn eslint . && rm -rf node_modules"
71+
'''
7472

75-
echo 'Docker Build ...'
76-
sh '''docker build --pull --no-cache --squash --compress \\
77-
-t "${IMAGE}:ci-${BUILD_NUMBER}" \\
78-
-f docker/Dockerfile \\
79-
--build-arg TARGETPLATFORM=linux/amd64 \\
80-
--build-arg BUILDPLATFORM=linux/amd64 \\
81-
--build-arg BUILD_VERSION="${BUILD_VERSION}" \\
82-
--build-arg BUILD_COMMIT="${BUILD_COMMIT}" \\
83-
--build-arg BUILD_DATE="$(date '+%Y-%m-%d %T %Z')" \\
84-
.
85-
'''
86-
}
73+
echo 'Docker Build ...'
74+
sh '''docker build --pull --no-cache --squash --compress \\
75+
-t "${IMAGE}:ci-${BUILD_NUMBER}" \\
76+
-f docker/Dockerfile \\
77+
--build-arg TARGETPLATFORM=linux/amd64 \\
78+
--build-arg BUILDPLATFORM=linux/amd64 \\
79+
--build-arg BUILD_VERSION="${BUILD_VERSION}" \\
80+
--build-arg BUILD_COMMIT="${BUILD_COMMIT}" \\
81+
--build-arg BUILD_DATE="$(date '+%Y-%m-%d %T %Z')" \\
82+
.
83+
'''
8784
}
8885
}
8986
stage('Test') {
9087
steps {
91-
ansiColor('xterm') {
92-
// Bring up a stack
93-
sh 'docker-compose up -d fullstack'
94-
sh './scripts/wait-healthy $(docker-compose ps -q fullstack) 120'
88+
// Bring up a stack
89+
sh 'docker-compose up -d fullstack'
90+
sh './scripts/wait-healthy $(docker-compose ps -q fullstack) 120'
9591

96-
// Run tests
97-
sh 'rm -rf test/results'
98-
sh 'docker-compose up cypress'
99-
// Get results
100-
sh 'docker cp -L "$(docker-compose ps -q cypress):/results" test/'
101-
}
92+
// Run tests
93+
sh 'rm -rf test/results'
94+
sh 'docker-compose up cypress'
95+
// Get results
96+
sh 'docker cp -L "$(docker-compose ps -q cypress):/results" test/'
10297
}
10398
post {
10499
always {
@@ -121,18 +116,16 @@ pipeline {
121116
}
122117
}
123118
steps {
124-
ansiColor('xterm') {
125-
dir(path: 'docs') {
126-
sh 'yarn install'
127-
sh 'yarn build'
128-
}
129-
130-
dir(path: 'docs/.vuepress/dist') {
131-
sh 'tar -czf ../../docs.tgz *'
132-
}
119+
dir(path: 'docs') {
120+
sh 'yarn install'
121+
sh 'yarn build'
122+
}
133123

134-
archiveArtifacts(artifacts: 'docs/docs.tgz', allowEmptyArchive: false)
124+
dir(path: 'docs/.vuepress/dist') {
125+
sh 'tar -czf ../../docs.tgz *'
135126
}
127+
128+
archiveArtifacts(artifacts: 'docs/docs.tgz', allowEmptyArchive: false)
136129
}
137130
}
138131
stage('MultiArch Build') {
@@ -142,12 +135,10 @@ pipeline {
142135
}
143136
}
144137
steps {
145-
ansiColor('xterm') {
146-
withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) {
147-
sh "docker login -u '${duser}' -p '${dpass}'"
148-
// Buildx with push
149-
sh "./scripts/buildx --push ${BUILDX_PUSH_TAGS}"
150-
}
138+
withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) {
139+
sh "docker login -u '${duser}' -p '${dpass}'"
140+
// Buildx with push
141+
sh "./scripts/buildx --push ${BUILDX_PUSH_TAGS}"
151142
}
152143
}
153144
}
@@ -193,17 +184,15 @@ pipeline {
193184
}
194185
}
195186
steps {
196-
ansiColor('xterm') {
197-
script {
198-
def comment = pullRequest.comment("Docker Image for build ${BUILD_NUMBER} is available on [DockerHub](https://cloud.docker.com/repository/docker/jc21/${IMAGE}) as `jc21/${IMAGE}:github-${BRANCH_LOWER}`")
199-
}
187+
script {
188+
def comment = pullRequest.comment("Docker Image for build ${BUILD_NUMBER} is available on [DockerHub](https://cloud.docker.com/repository/docker/jc21/${IMAGE}) as `jc21/${IMAGE}:github-${BRANCH_LOWER}`")
200189
}
201190
}
202191
}
203192
}
204193
post {
205194
always {
206-
sh 'docker-compose down --rmi all --remove-orphans --volumes -t 30'
195+
//sh 'docker-compose down --rmi all --remove-orphans --volumes -t 30'
207196
sh 'echo Reverting ownership'
208197
sh 'docker run --rm -v $(pwd):/data ${DOCKER_CI_TOOLS} chown -R $(id -u):$(id -g) /data'
209198
}

README.md

+131-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
<p align="center">
2-
<img src="https://nginxproxymanager.com/github.png">
3-
<br><br>
4-
<img src="https://img.shields.io/badge/version-2.2.4-green.svg?style=for-the-badge">
5-
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
6-
<img src="https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge">
7-
</a>
8-
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
9-
<img src="https://img.shields.io/docker/pulls/jc21/nginx-proxy-manager.svg?style=for-the-badge">
10-
</a>
11-
<a href="https://ci.nginxproxymanager.com/blue/organizations/jenkins/nginx-proxy-manager/branches/">
12-
<img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.nginxproxymanager.com%2Fjob%2Fnginx-proxy-manager%2Fjob%2Fmaster&style=for-the-badge">
13-
</a>
2+
<img src="https://nginxproxymanager.com/github.png">
3+
<br><br>
4+
<img src="https://img.shields.io/badge/version-2.3.0-green.svg?style=for-the-badge">
5+
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
6+
<img src="https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge">
7+
</a>
8+
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
9+
<img src="https://img.shields.io/docker/pulls/jc21/nginx-proxy-manager.svg?style=for-the-badge">
10+
</a>
11+
<a href="https://ci.nginxproxymanager.com/blue/organizations/jenkins/nginx-proxy-manager/branches/">
12+
<img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.nginxproxymanager.com%2Fjob%2Fnginx-proxy-manager%2Fjob%2Fmaster&style=for-the-badge">
13+
</a>
14+
<a href="https://gitter.im/nginx-proxy-manager/community">
15+
<img alt="Gitter" src="https://img.shields.io/gitter/room/nginx-proxy-manager/community?style=for-the-badge">
16+
</a>
1417
</p>
1518

1619
This project comes as a pre-built docker image that enables you to easily forward to your websites
@@ -48,3 +51,119 @@ I won't go in to too much detail here but here are the basics for someone new to
4851
2. Add port forwarding for port 80 and 443 to the server hosting this project
4952
3. Configure your domain name details to point to your home, either with a static ip or a service like DuckDNS or [Amazon Route53](https://github.com/jc21/route53-ddns)
5053
4. Use the Nginx Proxy Manager as your gateway to forward to your other web based services
54+
55+
56+
## Contributors
57+
58+
Special thanks to the following contributors:
59+
60+
<!-- prettier-ignore-start -->
61+
<!-- markdownlint-disable -->
62+
<table>
63+
<tr>
64+
<td align="center">
65+
<a href="https://github.com/Subv">
66+
<img src="https://avatars1.githubusercontent.com/u/357072?s=460&u=d8adcdc91d749ae53e177973ed9b6bb6c4c894a3&v=4" width="80px;" alt=""/>
67+
<br /><sub><b>Sebastian Valle</b></sub>
68+
</a>
69+
</td>
70+
<td align="center">
71+
<a href="https://github.com/Indemnity83">
72+
<img src="https://avatars3.githubusercontent.com/u/35218?s=460&u=7082004ff35138157c868d7d9c683ccebfce5968&v=4" width="80px;" alt=""/>
73+
<br /><sub><b>Kyle Klaus</b></sub>
74+
</a>
75+
</td>
76+
<td align="center">
77+
<a href="https://github.com/theraw">
78+
<img src="https://avatars1.githubusercontent.com/u/32969774?s=460&u=6b359971e15685fb0359e6a8c065a399b40dc228&v=4" width="80px;" alt=""/>
79+
<br /><sub><b>ƬHE ЯAW</b></sub>
80+
</a>
81+
</td>
82+
<td align="center">
83+
<a href="https://github.com/spalger">
84+
<img src="https://avatars2.githubusercontent.com/u/1329312?s=400&u=565223e38f1c052afb4c5dcca3fcf1c63ba17ae7&v=4" width="80px;" alt=""/>
85+
<br /><sub><b>Spencer</b></sub>
86+
</a>
87+
</td>
88+
<td align="center">
89+
<a href="https://github.com/Xantios">
90+
<img src="https://avatars3.githubusercontent.com/u/1507836?s=460&v=4" width="80px;" alt=""/>
91+
<br /><sub><b>Xantios Krugor</b></sub>
92+
</a>
93+
</td>
94+
<td align="center">
95+
<a href="https://github.com/dpanesso">
96+
<img src="https://avatars2.githubusercontent.com/u/2687121?s=460&v=4" width="80px;" alt=""/>
97+
<br /><sub><b>David Panesso</b></sub>
98+
</a>
99+
</td>
100+
<td align="center">
101+
<a href="https://github.com/IronTooch">
102+
<img src="https://avatars3.githubusercontent.com/u/27360514?s=460&u=69bf854a6647c55725f62ecb8d39249c6c0b2602&v=4" width="80px;" alt=""/>
103+
<br /><sub><b>IronTooch</b></sub>
104+
</a>
105+
</td>
106+
</tr>
107+
<tr>
108+
<td align="center">
109+
<a href="https://github.com/damianog">
110+
<img src="https://avatars1.githubusercontent.com/u/2786682?s=460&u=76c6136fae797abb76b951cd8a246dcaecaf21af&v=4" width="80px;" alt=""/>
111+
<br /><sub><b>Damiano</b></sub>
112+
</a>
113+
</td>
114+
<td align="center">
115+
<a href="https://github.com/tfmm">
116+
<img src="https://avatars3.githubusercontent.com/u/6880538?s=460&u=ce0160821cc4aa802df8395200f2d4956a5bc541&v=4" width="80px;" alt=""/>
117+
<br /><sub><b>Russ</b></sub>
118+
</a>
119+
</td>
120+
<td align="center">
121+
<a href="https://github.com/margaale">
122+
<img src="https://avatars3.githubusercontent.com/u/20794934?s=460&v=4" width="80px;" alt=""/>
123+
<br /><sub><b>Marcelo Castagna</b></sub>
124+
</a>
125+
</td>
126+
<td align="center">
127+
<a href="https://github.com/Steven-Harris">
128+
<img src="https://avatars2.githubusercontent.com/u/7720242?s=460&v=4" width="80px;" alt=""/>
129+
<br /><sub><b>Steven Harris</b></sub>
130+
</a>
131+
</td>
132+
<td align="center">
133+
<a href="https://github.com/jlesage">
134+
<img src="https://avatars0.githubusercontent.com/u/1791123?s=460&v=4" width="80px;" alt=""/>
135+
<br /><sub><b>Jocelyn Le Sage</b></sub>
136+
</a>
137+
</td>
138+
<td align="center">
139+
<a href="https://github.com/cmer">
140+
<img src="https://avatars0.githubusercontent.com/u/412?s=460&u=67dd8b2e3661bfd6f68ec1eaa5b9821bd8a321cd&v=4" width="80px;" alt=""/>
141+
<br /><sub><b>Carl Mercier</b></sub>
142+
</a>
143+
</td>
144+
<td align="center">
145+
<a href="https://github.com/the1ts">
146+
<img src="https://avatars1.githubusercontent.com/u/84956?s=460&v=4" width="80px;" alt=""/>
147+
<br /><sub><b>Paul Mansfield</b></sub>
148+
</a>
149+
</td>
150+
</tr>
151+
<tr>
152+
<td align="center">
153+
<a href="https://github.com/OhHeyAlan">
154+
<img src="https://avatars0.githubusercontent.com/u/11955126?s=460&u=fbaa5a1a4f73ef8960132c703349bfd037fe2630&v=4" width="80px;" alt=""/>
155+
<br /><sub><b>OhHeyAlan</b></sub>
156+
</a>
157+
</td>
158+
</tr>
159+
<tr>
160+
<td align="center">
161+
<a href="https://github.com/dogmatic69">
162+
<img src="https://avatars2.githubusercontent.com/u/94674?s=460&u=ca7647de53145c6283b6373ade5dc94ba99347db&v=4" width="80px;" alt=""/>
163+
<br /><sub><b>Carl Sutton</b></sub>
164+
</a>
165+
</td>
166+
</tr>
167+
</table>
168+
<!-- markdownlint-enable -->
169+
<!-- prettier-ignore-end -->

backend/internal/access-list.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const internalAccessList = {
7171
// re-fetch with expansions
7272
return internalAccessList.get(access, {
7373
id: data.id,
74-
expand: ['owner', 'items', 'clients', 'proxy_hosts.access_list.clients']
74+
expand: ['owner', 'items', 'clients', 'proxy_hosts.access_list.clients', 'proxy_hosts.access_list.items']
7575
}, true /* <- skip masking */);
7676
})
7777
.then((row) => {
@@ -216,7 +216,7 @@ const internalAccessList = {
216216
// re-fetch with expansions
217217
return internalAccessList.get(access, {
218218
id: data.id,
219-
expand: ['owner', 'items', 'clients', 'proxy_hosts.access_list.clients']
219+
expand: ['owner', 'items', 'clients', 'proxy_hosts.access_list.clients', 'proxy_hosts.access_list.items']
220220
}, true /* <- skip masking */);
221221
})
222222
.then((row) => {
@@ -254,7 +254,7 @@ const internalAccessList = {
254254
.joinRaw('LEFT JOIN `proxy_host` ON `proxy_host`.`access_list_id` = `access_list`.`id` AND `proxy_host`.`is_deleted` = 0')
255255
.where('access_list.is_deleted', 0)
256256
.andWhere('access_list.id', data.id)
257-
.allowEager('[owner,items,clients,proxy_hosts,proxy_hosts.access_list.clients]')
257+
.allowEager('[owner,items,clients,proxy_hosts,proxy_hosts.access_list.clients,proxy_hosts.access_list.items]')
258258
.omit(['access_list.is_deleted'])
259259
.first();
260260

backend/internal/proxy-host.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const internalProxyHost = {
7373
// re-fetch with cert
7474
return internalProxyHost.get(access, {
7575
id: row.id,
76-
expand: ['certificate', 'owner', 'access_list.clients']
76+
expand: ['certificate', 'owner', 'access_list.clients', 'access_list.items']
7777
});
7878
})
7979
.then((row) => {
@@ -186,7 +186,7 @@ const internalProxyHost = {
186186
.then(() => {
187187
return internalProxyHost.get(access, {
188188
id: data.id,
189-
expand: ['owner', 'certificate', 'access_list.clients']
189+
expand: ['owner', 'certificate', 'access_list.clients', 'access_list.items']
190190
})
191191
.then((row) => {
192192
// Configure nginx
@@ -219,7 +219,7 @@ const internalProxyHost = {
219219
.query()
220220
.where('is_deleted', 0)
221221
.andWhere('id', data.id)
222-
.allowEager('[owner,access_list,access_list.clients,certificate]')
222+
.allowEager('[owner,access_list,access_list.clients,access_list.items,certificate]')
223223
.first();
224224

225225
if (access_data.permission_visibility !== 'all') {

backend/templates/proxy_host.conf

+2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ server {
2323
location / {
2424

2525
{% if access_list_id > 0 %}
26+
{% if access_list.items.length > 0 %}
2627
# Authorization
2728
auth_basic "Authorization required";
2829
auth_basic_user_file /data/access/{{ access_list_id }};
30+
{% endif %}
2931

3032
# Access Rules
3133
{% for client in access_list.clients %}

docker/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ ENV S6_FIX_ATTRS_HIDDEN=1
1616
ENV NODE_ENV=production
1717

1818
RUN echo "fs.file-max = 65535" > /etc/sysctl.conf \
19-
&& rm -rf /etc/nginx \
2019
&& apk update \
2120
&& apk add python2 certbot jq \
2221
&& rm -rf /var/cache/apk/*

docker/dev/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ ENV SUPPRESS_NO_CONFIG_WARNING=1
66
ENV S6_FIX_ATTRS_HIDDEN=1
77

88
RUN echo "fs.file-max = 65535" > /etc/sysctl.conf \
9-
&& rm -rf /etc/nginx \
109
&& apk update \
1110
&& apk add python2 certbot jq \
1211
&& rm -rf /var/cache/apk/*

0 commit comments

Comments
 (0)