mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
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>
This commit is contained in:
parent
641685f5c7
commit
b54d332a09
50
.github/workflows/build-lxd.yml
vendored
50
.github/workflows/build-lxd.yml
vendored
@ -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:
|
||||
@ -65,6 +65,10 @@ jobs:
|
||||
ref: "${{ env.VERSION }}"
|
||||
- name: Cleanup lxd
|
||||
run: test -z "$(lxc profile device show default | grep eth0)" || lxc profile device remove default eth0
|
||||
- name: Fix LXD
|
||||
run: |
|
||||
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
|
||||
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||
- uses: whywaita/setup-lxd@v1
|
||||
with:
|
||||
lxd_version: latest/stable
|
||||
@ -86,7 +90,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 }}"
|
||||
@ -95,7 +99,6 @@ jobs:
|
||||
env:
|
||||
VERSION: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
|
||||
ARTIFACT_NAME: "${{ github.run_id }}-lxd-${{ inputs.arch || 'x86' }}-image-previous"
|
||||
LXD_EXTRA_PROFILE: network
|
||||
LXD_ARCH: "${{ inputs.arch || 'x86' }}"
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@ -135,20 +138,8 @@ jobs:
|
||||
lxd_version: latest/stable
|
||||
- name: Fix LXD
|
||||
run: |
|
||||
lxc profile create network
|
||||
cat <<EOF | lxc profile edit network
|
||||
devices:
|
||||
eth0:
|
||||
name: eth0
|
||||
parent: lxdbr0
|
||||
nictype: bridged
|
||||
type: nic
|
||||
EOF
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Enable qemu SUID
|
||||
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes
|
||||
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
|
||||
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||
- name: Download qemu binaries
|
||||
run: |
|
||||
wget -nv https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-aarch64-static -O qemu-aarch64-static
|
||||
@ -175,7 +166,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 }}"
|
||||
@ -188,15 +179,8 @@ jobs:
|
||||
lxd_version: latest/stable
|
||||
- name: Fix LXD
|
||||
run: |
|
||||
lxc profile create network
|
||||
cat <<EOF | lxc profile edit network
|
||||
devices:
|
||||
eth0:
|
||||
name: eth0
|
||||
parent: lxdbr0
|
||||
nictype: bridged
|
||||
type: nic
|
||||
EOF
|
||||
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
|
||||
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
@ -314,14 +298,8 @@ jobs:
|
||||
- name: Fix LXD
|
||||
continue-on-error: true
|
||||
run: |
|
||||
lxc profile create network
|
||||
cat <<EOF | lxc profile edit network
|
||||
devices:
|
||||
eth0:
|
||||
name: eth0
|
||||
network: lxdbr0
|
||||
type: nic
|
||||
EOF
|
||||
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
|
||||
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||
- name: Setup Firefox
|
||||
uses: browser-actions/setup-firefox@latest
|
||||
continue-on-error: true
|
||||
@ -387,7 +365,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 }}"
|
||||
|
||||
4
.github/workflows/build-sd-images.yml
vendored
4
.github/workflows/build-sd-images.yml
vendored
@ -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"
|
||||
@ -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 }}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
|
||||
2
ncp.sh
2
ncp.sh
@ -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
|
||||
|
||||
@ -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 &
|
||||
Loading…
x
Reference in New Issue
Block a user