2.9 KiB
2.9 KiB
Nextcloud AIO
Prereq
- Have a reverse proxy pointing at your server
- Have a valid certificate
Iscsi
We can use iscsi to give nextcloud a large block store.
On Nextcloud:
- Create an iscsi initiator in Truenas named
iqn.2024-02.com.reeselink:nextcloud-aio. - Create a new authorized access with username
iqn.2024-02.com.reeselink:nextcloud-aioand password. - Create a new target called
iqn.2024-02.com.reeselink:nextcloud-aio-data- Create an alias called
Nextcloud AIO Data - Select the exposed portal
- Select the
iqn.2024-02.com.reeselink:nextcloud-aioinitiator group - Select CHAP Auth method
- Select auth group containing
iqn.2024-02.com.reeselink:nextcloud-aio
- Create an alias called
- Create a new extent called
nextcloud-aio-data, leave all settings alone - Create a new associated target with
iqn.2024-02.com.reeselink:nextcloud-aio-datatarget andnextcloud-aio-dataextent
On Nextcloud AIO:
Edit /etc/iscsi/initiatorname.iscsi and set your initiatorname.
Edit /etc/iscsi/iscsid.conf
node.session.auth.username = iqn.2024-02.com.reeselink:nextcloud-aio
node.session.auth.password = <password>
# Discover targets
iscsiadm -m discovery -t st -p driveripper.reeselink.com
# Login to the nextcloud-data target
iscsiadm -m node -T iqn.2023-01.driveripper.reeselink.com:nextcloud-aio-data -l
# Automatically login on startup
iscsiadm -m node -T iqn.2023-01.driveripper.reeselink.com:nextcloud-aio-data -o update -n node.startup -v automatic
Setup
IPV6 (Optional)
Add to /etc/docker/daemon.json
{
"ipv6": true,
"fixed-cidr-v6": "fd12:3456:789a:1::/64",
"experimental": true,
"ip6tables": true
}
# Enable IPV6
docker network create --subnet="fd12:3456:789a:2::/64" --driver bridge --ipv6 nextcloud-aio
Install
docker run \
--init \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 8080:8080 \
--env APACHE_PORT=11000 \
--env APACHE_IP_BINDING=0.0.0.0 \
--env NEXTCLOUD_DATADIR="/mnt/ncdata" \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
nextcloud/all-in-one:latest
Trusted Proxy
docker exec --user www-data -it nextcloud-aio-nextcloud php occ config:system:set trusted_proxies 2 --value="10.1.0.0/16"
Uninstall
docker stop $(docker ps -a -q)
docker system prune
docker volume prune -a -f
defaults,_netdev,x-systemd.requires=iscsid.service 0 1
Edit QCOW
sudo modprobe nbd
sudo qemu-nbd -c /dev/nbd0 --read-only /path/to/image.qcow2
udisksctl mount -b /dev/nbd0p1