Skip to content

Commit bcd850c

Browse files
committed
letsencrypt: fix invalid arithmetic operator error
Signed-off-by: nachoparker <nacho@ownyourbits.com>
1 parent 26a7778 commit bcd850c

10 files changed

Lines changed: 31 additions & 27 deletions

File tree

bin/ncp/CONFIG/nc-init.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ EOF
105105
# 4 Byte UTF8 support
106106
ncc config:system:set mysql.utf8mb4 --type boolean --value="true"
107107

108-
ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[nextcloudpi]}" --value="nextcloudpi"
109-
ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[nextcloudpi-local]}" --value="nextcloudpi.local"
110-
ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[nextcloudpi-lan]}" --value="nextcloudpi.lan"
111-
ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[nc_domain]}" --value="nextcloudpi.lan"
108+
ncc config:system:set trusted_domains 7 --value="nextcloudpi"
109+
ncc config:system:set trusted_domains 5 --value="nextcloudpi.local"
110+
ncc config:system:set trusted_domains 8 --value="nextcloudpi.lan"
111+
ncc config:system:set trusted_domains 3 --value="nextcloudpi.lan"
112112

113113
# email
114114
ncc config:system:set mail_smtpmode --value="sendmail"

bin/ncp/CONFIG/nc-trusted-domains.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
configure()
1212
{
13-
[[ "$DOMAIN1" != "" ]] && ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[trusted_domain_1]}" --value="$DOMAIN1"
14-
[[ "$DOMAIN2" != "" ]] && ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[trusted_domain_2]}" --value="$DOMAIN2"
15-
[[ "$DOMAIN3" != "" ]] && ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[trusted_domain_3]}" --value="$DOMAIN3"
13+
[[ "$DOMAIN1" != "" ]] && ncc config:system:set trusted_domains 20 --value="$DOMAIN1"
14+
[[ "$DOMAIN2" != "" ]] && ncc config:system:set trusted_domains 21 --value="$DOMAIN2"
15+
[[ "$DOMAIN3" != "" ]] && ncc config:system:set trusted_domains 22 --value="$DOMAIN3"
1616
}
1717

1818
install(){ :; }

bin/ncp/NETWORKING/dnsmasq.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ configure()
5050

5151
local IFACE IP
5252
IFACE=$( ip r | grep "default via" | awk '{ print $5 }' | head -1 )
53-
IP=$( ncc config:system:get trusted_domains "${TRUSTED_DOMAINS[docker_overwrite]}" | grep -oP '\d{1,3}(.\d{1,3}){3}' )
53+
IP=$( ncc config:system:get trusted_domains 6 | grep -oP '\d{1,3}(.\d{1,3}){3}' )
5454
[[ "$IP" == "" ]] && IP="$(get_ip)"
5555

5656
[[ "$IP" == "" ]] && { echo "could not detect IP"; return 1; }
@@ -74,7 +74,7 @@ EOF
7474
update-rc.d dnsmasq defaults
7575
update-rc.d dnsmasq enable
7676
service dnsmasq restart
77-
ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[dnsmasq]}" --value="$DOMAIN"
77+
ncc config:system:set trusted_domains 2 --value="$DOMAIN"
7878
set-nc-domain "$DOMAIN" --no-trusted-domain
7979
echo "dnsmasq enabled"
8080
}

bin/ncp/NETWORKING/letsencrypt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ EOF
121121
sed -i "s|SSLCertificateKeyFile.*|SSLCertificateKeyFile ${key_path}|" "${ncp_vhostcfg}"
122122

123123
# Configure Nextcloud
124-
local domain_index="${TRUSTED_DOMAINS[letsencrypt_1]}"
124+
local domain_index=11
125125
for dom in $DOMAIN "${OTHER_DOMAINS_ARRAY[@]}"; do
126126
[[ "$dom" != "" ]] && {
127127
[[ $domain_index -lt 20 ]] || {

bin/ncp/NETWORKING/nc-static-IP.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ EOF
8989
ifup "${IFACE}"
9090
}
9191

92-
ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[ip]}" --value="$IP"
92+
ncc config:system:set trusted_domains 1 --value="$IP"
9393
set-nc-domain "${IP}"
9494
echo "Static IP set to $IP"
9595
}

bin/nextcloud-domain.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ while :; do
1313
local_ip="$(get_ip)"
1414
pub_ip="$(curl -m4 icanhazip.com 2>/dev/null)"
1515

16-
[[ "$pub_ip" != "" ]] && ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[public_ip]}" --value="$pub_ip"
16+
[[ "$pub_ip" != "" ]] && ncc config:system:set trusted_domains 11 --value="$pub_ip"
1717
[[ "$local_ip" != "" ]] && break
1818

1919
sleep 3
2020
done
2121

22-
ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[ip]}" --value="${local_ip}"
23-
ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[hostname]}" --value="$(hostname -f)"
22+
ncc config:system:set trusted_domains 1 --value="${local_ip}"
23+
ncc config:system:set trusted_domains 14 --value="$(hostname -f)"
2424

2525
# we might need to retry if redis is not ready
2626
while :; do

build/build-SD-rpi.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ source build/buildlib.sh
1313

1414
echo -e "\e[1m\n[ Build NCP Raspberry Pi ]\e[0m"
1515

16-
URL="https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2020-08-24/2020-08-20-raspios-buster-arm64-lite.zip"
16+
URL="https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2021-11-08/2021-10-30-raspios-bullseye-arm64-lite.zip"
1717
SIZE=4G # Raspbian image size
1818
#CLEAN=0 # Pass this envvar to skip cleaning download cache
1919
IMG="NextCloudPi_RPi_$( date "+%m-%d-%y" ).img"

build/docker/nextcloud/020nextcloud

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ bash /usr/local/bin/nextcloud-domain.sh
7272

7373
# Trusted Domain (as an argument)
7474
[[ "$2" != "" ]] && \
75-
ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[docker_overwrite]}" --value="$2"
75+
ncc config:system:set trusted_domains 6 --value="$2"
7676

7777
echo "Nextcloud version $(nc_version). NextCloudPi version $(cat /usr/local/etc/ncp-version)"
7878

changelog.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11

2-
[v1.44.5](https://github.com/nextcloud/nextcloudpi/commit/0e15dc9) (2021-11-29) ncp-previewgenerator: fix app enable in NC22
2+
[v1.46.7](https://github.com/nextcloud/nextcloudpi/commit/0da8dcd) (2021-12-13) letsencrypt: fix invalid arithmetic operator error
33

4-
[v1.44.4](https://github.com/nextcloud/nextcloudpi/commit/0a4f8c1) (2021-11-19) ncp-web: fix spurious characters in power menu
4+
[v1.44.6 ](https://github.com/nextcloud/nextcloudpi/commit/26a7778) (2021-12-06) notify_push: fix service not restarting on binary update (#1398)
55

6-
[v1.44.3](https://github.com/nextcloud/nextcloudpi/commit/4717eb3) (2021-11-18) tweak ncc command
6+
[v1.44.5](https://github.com/nextcloud/nextcloudpi/commit/5a404c0) (2021-11-29) ncp-previewgenerator: fix app enable in NC22
7+
8+
[v1.44.4 ](https://github.com/nextcloud/nextcloudpi/commit/0a4f8c1) (2021-11-19) ncp-web: fix spurious characters in power menu
9+
10+
[v1.44.3 ](https://github.com/nextcloud/nextcloudpi/commit/4717eb3) (2021-11-18) tweak ncc command
711

812
[v1.44.2 ](https://github.com/nextcloud/nextcloudpi/commit/0c589ff) (2021-11-16) ncp-app: bump to NC22
913

etc/library.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ export BINDIR=/usr/local/bin/ncp
1414
export NCDIR=/var/www/nextcloud
1515
export ncc=/usr/local/bin/ncc
1616

17-
unset TRUSTED_DOMAINS
18-
declare -A TRUSTED_DOMAINS
19-
export TRUSTED_DOMAINS=(
20-
[ip]=1 [dnsmasq]=2 [nc_domain]=3 [nextcloudpi-local]=5 [docker_overwrite]=6
21-
[nextcloudpi]=7 [nextcloudpi-lan]=8 [public_ip]=11 [letsencrypt_1]=12
22-
[letsencrypt_2]=13 [hostname]=14 [trusted_domain_1]=20 [trusted_domain_2]=21 [trusted_domain_3]=22
23-
)
17+
#unset TRUSTED_DOMAINS
18+
#declare -A TRUSTED_DOMAINS
19+
#export TRUSTED_DOMAINS=(
20+
#[ip]=1 [dnsmasq]=2 [nc_domain]=3 [nextcloudpi-local]=5 [docker_overwrite]=6
21+
#[nextcloudpi]=7 [nextcloudpi-lan]=8 [public_ip]=11 [letsencrypt_1]=12
22+
#[letsencrypt_2]=13 [hostname]=14 [trusted_domain_1]=20 [trusted_domain_2]=21 [trusted_domain_3]=22
23+
#)
2424

2525
command -v jq &>/dev/null || {
2626
apt-get update
@@ -127,7 +127,7 @@ function set-nc-domain()
127127
proto="$(ncc config:system:get overwriteprotocol)" || true
128128
[[ "${proto}" == "" ]] && proto="https"
129129
local url="${proto}://${domain%*/}"
130-
[[ "$2" == "--no-trusted-domain" ]] || ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[nc-domain]}" --value="${domain%*/}"
130+
[[ "$2" == "--no-trusted-domain" ]] || ncc config:system:set trusted_domains 3 --value="${domain%*/}"
131131
ncc config:system:set overwrite.cli.url --value="${url}/"
132132
if is_ncp_activated && is_app_enabled notify_push; then
133133
ncc config:system:set trusted_proxies 11 --value="127.0.0.1"

0 commit comments

Comments
 (0)