Skip to content

Commit 356eaa0

Browse files
authored
Merge pull request #4653 from NginxProxyManager/develop
v2.12.6
2 parents 307cb94 + 54d463a commit 356eaa0

File tree

6 files changed

+58
-38
lines changed

6 files changed

+58
-38
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.12.5
1+
2.12.6

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<p align="center">
22
<img src="https://nginxproxymanager.com/github.png">
33
<br><br>
4-
<img src="https://img.shields.io/badge/version-2.12.5-green.svg?style=for-the-badge">
4+
<img src="https://img.shields.io/badge/version-2.12.6-green.svg?style=for-the-badge">
55
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
66
<img src="https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge">
77
</a>

docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/30-ownership.sh

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,53 @@ log_info 'Setting ownership ...'
88
# root
99
chown root /tmp/nginx
1010

11-
# npm user and group
12-
chown -R "$PUID:$PGID" /data
13-
chown -R "$PUID:$PGID" /etc/letsencrypt
14-
chown -R "$PUID:$PGID" /run/nginx
15-
chown -R "$PUID:$PGID" /tmp/nginx
16-
chown -R "$PUID:$PGID" /var/cache/nginx
17-
chown -R "$PUID:$PGID" /var/lib/logrotate
18-
chown -R "$PUID:$PGID" /var/lib/nginx
19-
chown -R "$PUID:$PGID" /var/log/nginx
20-
21-
# Don't chown entire /etc/nginx folder as this causes crashes on some systems
22-
chown -R "$PUID:$PGID" /etc/nginx/nginx
23-
chown -R "$PUID:$PGID" /etc/nginx/nginx.conf
24-
chown -R "$PUID:$PGID" /etc/nginx/conf.d
25-
26-
# Certbot directories - optimized approach
27-
CERT_INIT_FLAG="/opt/certbot/.ownership_initialized"
28-
29-
if [ ! -f "$CERT_INIT_FLAG" ]; then
30-
# Prevents errors when installing python certbot plugins when non-root
31-
if [ "$SKIP_CERTBOT_OWNERSHIP" != "true" ]; then
32-
log_info 'Changing ownership of /opt/certbot directories ...'
33-
chown "$PUID:$PGID" /opt/certbot /opt/certbot/bin
11+
locations=(
12+
"/data"
13+
"/etc/letsencrypt"
14+
"/run/nginx"
15+
"/tmp/nginx"
16+
"/var/cache/nginx"
17+
"/var/lib/logrotate"
18+
"/var/lib/nginx"
19+
"/var/log/nginx"
20+
"/etc/nginx/nginx"
21+
"/etc/nginx/nginx.conf"
22+
"/etc/nginx/conf.d"
23+
)
24+
25+
chownit() {
26+
local dir="$1"
27+
local recursive="${2:-true}"
28+
29+
local have
30+
have="$(stat -c '%u:%g' "$dir")"
31+
echo "- $dir ... "
32+
33+
if [ "$have" != "$PUID:$PGID" ]; then
34+
if [ "$recursive" = 'true' ] && [ -d "$dir" ]; then
35+
chown -R "$PUID:$PGID" "$dir"
36+
else
37+
chown "$PUID:$PGID" "$dir"
38+
fi
39+
echo " DONE"
40+
else
41+
echo " SKIPPED"
3442
fi
43+
}
44+
45+
for loc in "${locations[@]}"; do
46+
chownit "$loc"
47+
done
48+
49+
if [ "$(is_true "${SKIP_CERTBOT_OWNERSHIP:-}")" = '1' ]; then
50+
log_info 'Skipping ownership change of certbot directories'
51+
else
52+
log_info 'Changing ownership of certbot directories, this may take some time ...'
53+
chownit "/opt/certbot" false
54+
chownit "/opt/certbot/bin" false
3555

3656
# Handle all site-packages directories efficiently
3757
find /opt/certbot/lib -type d -name "site-packages" | while read -r SITE_PACKAGES_DIR; do
38-
chown -R "$PUID:$PGID" "$SITE_PACKAGES_DIR"
58+
chownit "$SITE_PACKAGES_DIR"
3959
done
40-
41-
# Create a flag file to skip this step on subsequent runs
42-
touch "$CERT_INIT_FLAG"
43-
chown "$PUID:$PGID" "$CERT_INIT_FLAG"
4460
fi

docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/40-dynamic.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@ set -e
55

66
log_info 'Dynamic resolvers ...'
77

8-
DISABLE_IPV6=$(echo "${DISABLE_IPV6:-}" | tr '[:upper:]' '[:lower:]')
9-
108
# Dynamically generate resolvers file, if resolver is IPv6, enclose in `[]`
119
# thanks @tfmm
12-
if [ "$DISABLE_IPV6" == "true" ] || [ "$DISABLE_IPV6" == "on" ] || [ "$DISABLE_IPV6" == "1" ] || [ "$DISABLE_IPV6" == "yes" ];
13-
then
10+
if [ "$(is_true "$DISABLE_IPV6")" = '1' ]; then
1411
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" { sub(/%.*$/,"",$2); print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf) ipv6=off valid=10s;" > /etc/nginx/conf.d/include/resolvers.conf
1512
else
1613
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" { sub(/%.*$/,"",$2); print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf) valid=10s;" > /etc/nginx/conf.d/include/resolvers.conf

docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/50-ipv6.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ set -e
88

99
log_info 'IPv6 ...'
1010

11-
# Lowercase
12-
DISABLE_IPV6=$(echo "${DISABLE_IPV6:-}" | tr '[:upper:]' '[:lower:]')
13-
1411
process_folder () {
1512
FILES=$(find "$1" -type f -name "*.conf")
1613
SED_REGEX=
1714

18-
if [ "$DISABLE_IPV6" == "true" ] || [ "$DISABLE_IPV6" == "on" ] || [ "$DISABLE_IPV6" == "1" ] || [ "$DISABLE_IPV6" == "yes" ]; then
15+
if [ "$(is_true "$DISABLE_IPV6")" = '1' ]; then
1916
# IPV6 is disabled
2017
echo "Disabling IPV6 in hosts in: $1"
2118
SED_REGEX='s/^([^#]*)listen \[::\]/\1#listen [::]/g'

docker/rootfs/usr/bin/common.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,13 @@ get_group_id () {
5656
getent group "$1" | cut -d: -f3
5757
fi
5858
}
59+
60+
# param $1: value
61+
is_true () {
62+
VAL=$(echo "${1:-}" | tr '[:upper:]' '[:lower:]')
63+
if [ "$VAL" == 'true' ] || [ "$VAL" == 'on' ] || [ "$VAL" == '1' ] || [ "$VAL" == 'yes' ]; then
64+
echo '1'
65+
else
66+
echo '0'
67+
fi
68+
}

0 commit comments

Comments
 (0)