Skip to content

Davis on Proxmox TrueNAS Scale SMB SQLite Docker-compose #164

@tikr7

Description

@tikr7

I switched to a Proxmox and TrueNAS Scale setup (as time of writing TrueNAS Charts got depricated) and was looking for a solution to manage WebDAV via GUI. Davis is really great for that because it separates users very well. Other WebDAV servers require one instance per user which is really in annoying.
In the past I used Nextcloud for it, but it is slow and updates were a huge pain. One day my Nextcloud instance got corrupted (the PostgreSQL to be more specific).

However, it took me some time to get it fully up and running, and therefore I want to write it down. Perhaps it helps somebody else in the future.

Some decisions I took:

  • I want TrueNAS for all data, since backup is very comfortable via ZFS and GUI. So I created a dataset, user, group and made SMB available.
  • I want to use docker-compose on Proxmox. Unfortunately, in order to bind a SMB, it needs to be a VM and not LXC on Proxmox.
  • I want a very lightweight database - so SQLite. It is easier to backup.

Mount SMB:

sudo apt-get install cifs-utils 

sudo mkdir /davis

vi /home/davis/.smbcredentials
username=davis
password=davispassword
chmod 600 /home/davis/.smbcredentials

#,nobrl ==> for fixing sqllite "database is locked"
sudo vi /etc/fstab
//192.168.XXX.XXX/Davis /davis cifs uid=82,gid=82,credentials=/home/davis/.smbcredentials,nobrl 0 0

sudo reboot now

I use the following folder structure:

sudo mkdir -p /davis/davis/data
sudo mkdir -p /davis/webdav/tmp
sudo mkdir -p /davis/webdav/public
sudo mkdir -p /davis/webdav/homes

Checkout repo:

git clone https://github.com/tchapi/davis.git
cd davis
git checkout -b v4.4.4 v4.4.4 # Use latest version

cd /home/davis/davis/docker

Fix Webdav Nginx: 413 Request Enity Too Large

vi configurations/davis.conf
server {
        client_max_body_size 100M;
...

Fix missing permissions on /var/www/davis:

vi Dockerfile
...
RUN chown -R ${FPM_USER} /var/www/davis

USER $FPM_USER
...

A bunch of configs:

vi .env
ADMIN_PASSWORD=<...>

#WEBDAV_ENABLED=false
WEBDAV_ENABLED=true

#WEBDAV_TMP_DIR='/tmp'
#WEBDAV_PUBLIC_DIR='/webdav'
WEBDAV_TMP_DIR='/webdav/tmp'
WEBDAV_PUBLIC_DIR='/webdav/public'
WEBDAV_HOMES_DIR='/webdav/homes'

Adjusting the docker-compose file:

vi docker-compose-sqlite.yml
    restart: always # VM restart safe
...
    restart: always # VM restart safe
...
    volumes:
      - davis_www:/var/www/davis
#      - davis_data:/data
      - /davis/davis/data:/data
      - /davis/webdav/tmp:/webdav/tmp
      - /davis/webdav/public:/webdav/public
      - /davis/webdav/homes:/webdav/homes
volumes:
  davis_www:
    name: davis_www
#  davis_data:
#    name: davis_data

Let's start it =)

cd /home/davis/davis/docker
sudo docker compose -f docker-compose-sqlite.yml up -d 

#⚠ Do not forget to run all the database migrations the first time you run the container :
sudo docker exec -it davis sh -c "APP_ENV=prod bin/console doctrine:migrations:migrate --no-interaction"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions