-
-
Notifications
You must be signed in to change notification settings - Fork 656
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add script for trusted domains (#2482)
- Loading branch information
Showing
3 changed files
with
40 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
true | ||
SCRIPT_NAME="Set trusted domain" | ||
# shellcheck source=lib.sh | ||
source /var/scripts/fetch_lib.sh | ||
|
||
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/ | ||
|
||
# Check for errors + debug code and abort if something isn't right | ||
# 1 = ON | ||
# 0 = OFF | ||
DEBUG=0 | ||
debug_mode | ||
|
||
# Set trusted domains default | ||
if [ -n "$ADDRESS" ] | ||
then | ||
nextcloud_occ config:system:set trusted_domains 0 --value="localhost" | ||
nextcloud_occ config:system:set trusted_domains 1 --value="$ADDRESS" | ||
nextcloud_occ config:system:set trusted_domains 2 --value="$(hostname)" | ||
nextcloud_occ config:system:set overwrite.cli.url --value="https://$(hostname --fqdn)" | ||
# Also set WAN address if it exists | ||
if [ -n "$WANIP4" ] | ||
then | ||
nextcloud_occ config:system:set trusted_domains 3 --value="$WANIP4" | ||
fi | ||
else | ||
nextcloud_occ config:system:set trusted_domains 0 --value="localhost" | ||
nextcloud_occ config:system:set trusted_domains 1 --value="$(hostname)" | ||
nextcloud_occ config:system:set overwrite.cli.url --value="https://$(hostname --fqdn)" | ||
# Also set WAN address if it exists | ||
if [ -n "$WANIP4" ] | ||
then | ||
nextcloud_occ config:system:set trusted_domains 2 --value="$WANIP4" | ||
fi | ||
fi |