Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lets-encrypt/test-new-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ then
fi

# Set trusted domains
run_script NETWORK trusted
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 -f)"
nextcloud_occ config:system:set overwrite.cli.url --value="https://$(hostname --fqdn)"
nextcloud_occ maintenance:update:htaccess

# Add crontab
cat << CRONTAB > "$SCRIPTS/letsencryptrenew.sh"
Expand Down
32 changes: 9 additions & 23 deletions network/trusted.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
#!/bin/bash

# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

true
SCRIPT_NAME="Trusted"
SCRIPT_NAME="Set trusted domain"
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh

# Check for errors + debug code and abort if something isn't right
# 1 = ON
# 0 = OFF
DEBUG=0
debug_mode

download_script NETWORK update-config
if [ -f $SCRIPTS/update-config.php ]
then
# Change config.php
php $SCRIPTS/update-config.php $NCPATH/config/config.php 'trusted_domains[]' localhost "${ADDRESS[@]}" "$(hostname)" "$(hostname --fqdn)" >/dev/null 2>&1
php $SCRIPTS/update-config.php $NCPATH/config/config.php overwrite.cli.url https://"$(hostname --fqdn)"/ >/dev/null 2>&1
source <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)

# Change .htaccess accordingly
sed -i "s|RewriteBase /nextcloud|RewriteBase /|g" $NCPATH/.htaccess
# Removed in NC 26.0.0.

# Cleanup
rm -f $SCRIPTS/update-config.php
fi
# Set trusted domains
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 -f)"
nextcloud_occ config:system:set overwrite.cli.url --value="https://$(hostname --fqdn)"
nextcloud_occ maintenance:update:htaccess
53 changes: 0 additions & 53 deletions network/update-config.php

This file was deleted.

7 changes: 6 additions & 1 deletion nextcloud-startup-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,12 @@ mesg n
ROOTNEWPROFILE

# Set trusted domain in config.php
run_script NETWORK trusted
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 trusted_domains 3 --value="$(hostname --fqdn)"
nextcloud occ config:system:set overwrite.cli.url --value="https://$(hostname --fqdn)"
nextcloud_occ maintenance:update:htaccess

# Upgrade system
print_text_in_color "$ICyan" "System will now upgrade..."
Expand Down
12 changes: 0 additions & 12 deletions static/trusted.sh

This file was deleted.