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 41ba7cc
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build-lxd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
determine-runner:
env:
LXD_ARCH: "${{ inputs.arch || 'x86' }}"
runs-on: ubuntu-20.04
runs-on: [ubuntu-latest, x64]
outputs:
runner_label: ${{ steps.script.outputs.runner_label }}
steps:
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
if-no-files-found: error

build-previous:
runs-on: ubuntu-20.04
runs-on: [ubuntu-latest, x64]
if: ${{ inputs.arch == 'x86' || inputs.arch == '' }}
outputs:
artifact_name: "${{ env.ARTIFACT_NAME }}"
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
lxd_version: latest/stable
- name: Fix LXD
run: |
lxc profile create network
lxc profile list -f csv | grep 'network' || lxc profile create network
cat <<EOF | lxc profile edit network
devices:
eth0:
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
test-update:
needs:
- build-previous
runs-on: ubuntu-20.04
runs-on: [ubuntu-latest, x64]
outputs:
artifact_name: "${{ env.ARTIFACT_NAME }}"
artifact_file: "${{ steps.pack-lxd.outputs.artifact_file }}"
Expand Down Expand Up @@ -387,7 +387,7 @@ jobs:
convert-to-lxc-image:
needs:
- build-current
runs-on: ubuntu-20.04
runs-on: [ubuntu-latest, x64]
outputs:
artifact_name: "${{ steps.lxd-to-lxc.outputs.artifact_name }}"
artifact_file: "${{ steps.lxd-to-lxc.outputs.artifact_file }}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-sd-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: [ubuntu-latest, x64]
env:
VERSION: "${{ inputs.git_ref }}"
LOG_GUEST: "\\033[1;34mGUEST::\\033[0m"
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:

test:
needs: build
runs-on: ubuntu-20.04
runs-on: [ubuntu-latest, x64]
env:
VERSION: "${{ inputs.git_ref }}"
ARTIFACT_ID: ${{ needs.build.outputs.artifact_name }}
Expand Down
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 41ba7cc

Please sign in to comment.