Skip to content

Commit

Permalink
rename nextcloud.conf to 001-nextcloud.conf to force it to be conside…
Browse files Browse the repository at this point in the history
…red before ncp.conf

Signed-off-by: Tobias K <[email protected]>
  • Loading branch information
theCalcaholic committed Jan 25, 2024
1 parent 641685f commit 3b1e437
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bin/ncp-provisioning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ BKP="$( ls -1t /var/www/nextcloud-bkp_*.tar.gz 2>/dev/null | head -1 )"
## Check for encrypted data and ask for password
if needs_decrypt; then
echo "Detected encrypted instance"
a2dissite ncp nextcloud
a2dissite ncp 001-nextcloud
a2ensite ncp-activation
apache2ctl -k graceful
fi
Expand Down
4 changes: 2 additions & 2 deletions bin/ncp/CONFIG/nc-nextcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ EOF

## SET APACHE VHOST
echo "Setting up Apache..."
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf --allow-fallback || {
install_template nextcloud.conf.sh /etc/apache2/sites-available/001-nextcloud.conf --allow-fallback || {
echo "ERROR: Parsing template failed. Nextcloud will not work."
exit 1
}
a2ensite nextcloud
a2ensite 001-nextcloud

cat > /etc/apache2/sites-available/000-default.conf <<'EOF'
<VirtualHost _default_:80>
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/CONFIG/nc-passwd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ configure()
sudo -u www-data php /var/www/nextcloud/cron.php

a2dissite ncp-activation
a2ensite ncp nextcloud
a2ensite ncp 001-nextcloud
apachectl -k graceful

# Trusted Domain (local/public IP), also configures notify_push
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/NETWORKING/letsencrypt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


ncdir=/var/www/nextcloud
nc_vhostcfg=/etc/apache2/sites-available/nextcloud.conf
nc_vhostcfg=/etc/apache2/sites-available/001-nextcloud.conf
ncp_vhostcfg=/etc/apache2/sites-available/ncp.conf
letsencrypt=/usr/bin/letsencrypt

Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/SECURITY/nc-encrypt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ configure()
echo "${PASSWORD?}" | gocryptfs -allow_other -q "${encdir}" "${datadir}" 2>&1 | sed /^Switch/d

# switch to the regular virtual hosts after we decrypt, so we can access NC and ncp-web
a2ensite ncp nextcloud
a2ensite ncp 001-nextcloud
a2dissite ncp-activation
apache2ctl -k graceful

Expand Down
8 changes: 4 additions & 4 deletions bin/ncp/SYSTEM/metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ configure() {
if [[ "$ACTIVE" != yes ]]
then

install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf || {
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf --allow-fallback
install_template nextcloud.conf.sh /etc/apache2/sites-available/001-nextcloud.conf || {
install_template nextcloud.conf.sh /etc/apache2/sites-available/001-nextcloud.conf --allow-fallback
echo -e "ERROR while generating nextcloud.conf! Exiting..."
return 1
}
Expand Down Expand Up @@ -248,8 +248,8 @@ configure() {
echo "done."


install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf || {
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf --allow-fallback
install_template nextcloud.conf.sh /etc/apache2/sites-available/001-nextcloud.conf || {
install_template nextcloud.conf.sh /etc/apache2/sites-available/001-nextcloud.conf --allow-fallback
echo -e "ERROR while generating nextcloud.conf! Exiting..."
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion ncp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ EOF

$APTINSTALL libapache2-mod-authnz-external pwauth
a2enmod authnz_external authn_core auth_basic
a2dissite nextcloud
a2dissite 001-nextcloud
a2ensite ncp-activation

## NCP USER FOR AUTHENTICATION
Expand Down
3 changes: 3 additions & 0 deletions updates/1.53.1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ set -e
source /usr/local/etc/library.sh

install_template apache2/ncp.conf.sh /etc/apache2/sites-available/ncp.conf --defaults
a2dissite nextcloud
mv /etc/apache2/sites-available/nextcloud.conf /etc/apache2/sites-available/001-nextcloud.conf
a2ensite 001-nextcloud
bash -c "sleep 2 && service apache2 reload" &>/dev/null &

0 comments on commit 3b1e437

Please sign in to comment.