Skip to content

Commit

Permalink
docker: allow domains in command line, not only IPs
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Sep 21, 2018
1 parent 41f21fa commit 7443425
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions docker-common/nextcloud/020nextcloud
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,8 @@ IP=$( ip a show dev "$IFACE" | grep global | grep -oP '\d{1,3}(.\d{1,3}){3}' | h
sudo -u www-data php "$OCC" config:system:set trusted_domains 1 --value="$IP"

# Trusted Domain ( as an argument )
[[ "$@" != "" ]] && {
IP=$( grep -oP '\d{1,3}(\.\d{1,3}){3}' <<< "$2" ) # validate that the first argument is a valid IP
if [[ "$IP" != "" ]]; then
sudo -u www-data php "$OCC" config:system:set trusted_domains 6 --value="$IP"
else
echo "First argument must be an IP address to include as a Trusted domain. Ignoring"
fi
}
[[ "$@" != "" ]] && \
sudo -u www-data php "$OCC" config:system:set trusted_domains 6 --value="$@"

# Display NC logs in the docker logs
tail -f -n0 /data/app/data/nextcloud.log &
Expand Down

0 comments on commit 7443425

Please sign in to comment.