Skip to content

Commit 287fe06

Browse files
committed
rename nextcloud.conf to 001-nextcloud.conf to force it to be considered before ncp.conf
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
1 parent 641685f commit 287fe06

10 files changed

Lines changed: 37 additions & 31 deletions

File tree

.github/workflows/build-lxd.yml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
determine-runner:
3232
env:
3333
LXD_ARCH: "${{ inputs.arch || 'x86' }}"
34-
runs-on: ubuntu-20.04
34+
runs-on: [ubuntu-latest, x64]
3535
outputs:
3636
runner_label: ${{ steps.script.outputs.runner_label }}
3737
steps:
@@ -86,7 +86,7 @@ jobs:
8686
if-no-files-found: error
8787

8888
build-previous:
89-
runs-on: ubuntu-20.04
89+
runs-on: [ubuntu-latest, x64]
9090
if: ${{ inputs.arch == 'x86' || inputs.arch == '' }}
9191
outputs:
9292
artifact_name: "${{ env.ARTIFACT_NAME }}"
@@ -95,7 +95,7 @@ jobs:
9595
env:
9696
VERSION: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
9797
ARTIFACT_NAME: "${{ github.run_id }}-lxd-${{ inputs.arch || 'x86' }}-image-previous"
98-
LXD_EXTRA_PROFILE: network
98+
#LXD_EXTRA_PROFILE: network
9999
LXD_ARCH: "${{ inputs.arch || 'x86' }}"
100100
steps:
101101
- name: Checkout code
@@ -135,20 +135,23 @@ jobs:
135135
lxd_version: latest/stable
136136
- name: Fix LXD
137137
run: |
138-
lxc profile create network
139-
cat <<EOF | lxc profile edit network
140-
devices:
141-
eth0:
142-
name: eth0
143-
parent: lxdbr0
144-
nictype: bridged
145-
type: nic
146-
EOF
147138
148-
- name: Set up QEMU
149-
uses: docker/setup-qemu-action@v2
150-
- name: Enable qemu SUID
151-
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes
139+
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
140+
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
141+
# lxc profile list -f csv | grep 'network' || lxc profile create network
142+
# cat <<EOF | lxc profile edit network
143+
# devices:
144+
# eth0:
145+
# name: eth0
146+
# parent: lxdbr0
147+
# nictype: bridged
148+
# type: nic
149+
# EOF
150+
151+
# - name: Set up QEMU
152+
# uses: docker/setup-qemu-action@v2
153+
# - name: Enable qemu SUID
154+
# run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes
152155
- name: Download qemu binaries
153156
run: |
154157
wget -nv https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-aarch64-static -O qemu-aarch64-static
@@ -175,7 +178,7 @@ jobs:
175178
test-update:
176179
needs:
177180
- build-previous
178-
runs-on: ubuntu-20.04
181+
runs-on: [ubuntu-latest, x64]
179182
outputs:
180183
artifact_name: "${{ env.ARTIFACT_NAME }}"
181184
artifact_file: "${{ steps.pack-lxd.outputs.artifact_file }}"
@@ -387,7 +390,7 @@ jobs:
387390
convert-to-lxc-image:
388391
needs:
389392
- build-current
390-
runs-on: ubuntu-20.04
393+
runs-on: [ubuntu-latest, x64]
391394
outputs:
392395
artifact_name: "${{ steps.lxd-to-lxc.outputs.artifact_name }}"
393396
artifact_file: "${{ steps.lxd-to-lxc.outputs.artifact_file }}"

.github/workflows/build-sd-images.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323

2424
jobs:
2525
build:
26-
runs-on: ubuntu-20.04
26+
runs-on: [ubuntu-latest, x64]
2727
env:
2828
VERSION: "${{ inputs.git_ref }}"
2929
LOG_GUEST: "\\033[1;34mGUEST::\\033[0m"
@@ -130,7 +130,7 @@ jobs:
130130

131131
test:
132132
needs: build
133-
runs-on: ubuntu-20.04
133+
runs-on: [ubuntu-latest, x64]
134134
env:
135135
VERSION: "${{ inputs.git_ref }}"
136136
ARTIFACT_ID: ${{ needs.build.outputs.artifact_name }}

bin/ncp-provisioning.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ BKP="$( ls -1t /var/www/nextcloud-bkp_*.tar.gz 2>/dev/null | head -1 )"
6767
## Check for encrypted data and ask for password
6868
if needs_decrypt; then
6969
echo "Detected encrypted instance"
70-
a2dissite ncp nextcloud
70+
a2dissite ncp 001-nextcloud
7171
a2ensite ncp-activation
7272
apache2ctl -k graceful
7373
fi

bin/ncp/CONFIG/nc-nextcloud.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ EOF
194194

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

203203
cat > /etc/apache2/sites-available/000-default.conf <<'EOF'
204204
<VirtualHost _default_:80>

bin/ncp/CONFIG/nc-passwd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ configure()
2727
sudo -u www-data php /var/www/nextcloud/cron.php
2828

2929
a2dissite ncp-activation
30-
a2ensite ncp nextcloud
30+
a2ensite ncp 001-nextcloud
3131
apachectl -k graceful
3232

3333
# Trusted Domain (local/public IP), also configures notify_push

bin/ncp/NETWORKING/letsencrypt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
ncdir=/var/www/nextcloud
12-
nc_vhostcfg=/etc/apache2/sites-available/nextcloud.conf
12+
nc_vhostcfg=/etc/apache2/sites-available/001-nextcloud.conf
1313
ncp_vhostcfg=/etc/apache2/sites-available/ncp.conf
1414
letsencrypt=/usr/bin/letsencrypt
1515

bin/ncp/SECURITY/nc-encrypt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ configure()
6060
echo "${PASSWORD?}" | gocryptfs -allow_other -q "${encdir}" "${datadir}" 2>&1 | sed /^Switch/d
6161

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

bin/ncp/SYSTEM/metrics.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ configure() {
196196
if [[ "$ACTIVE" != yes ]]
197197
then
198198

199-
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf || {
200-
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf --allow-fallback
199+
install_template nextcloud.conf.sh /etc/apache2/sites-available/001-nextcloud.conf || {
200+
install_template nextcloud.conf.sh /etc/apache2/sites-available/001-nextcloud.conf --allow-fallback
201201
echo -e "ERROR while generating nextcloud.conf! Exiting..."
202202
return 1
203203
}
@@ -248,8 +248,8 @@ configure() {
248248
echo "done."
249249

250250

251-
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf || {
252-
install_template nextcloud.conf.sh /etc/apache2/sites-available/nextcloud.conf --allow-fallback
251+
install_template nextcloud.conf.sh /etc/apache2/sites-available/001-nextcloud.conf || {
252+
install_template nextcloud.conf.sh /etc/apache2/sites-available/001-nextcloud.conf --allow-fallback
253253
echo -e "ERROR while generating nextcloud.conf! Exiting..."
254254
return 1
255255
}

ncp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ EOF
7474

7575
$APTINSTALL libapache2-mod-authnz-external pwauth
7676
a2enmod authnz_external authn_core auth_basic
77-
a2dissite nextcloud
77+
a2dissite 001-nextcloud
7878
a2ensite ncp-activation
7979

8080
## NCP USER FOR AUTHENTICATION

updates/1.53.1.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ set -e
44
source /usr/local/etc/library.sh
55

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

0 commit comments

Comments
 (0)