From ffccdc6b85680489a0881e1af80edb4f67361709 Mon Sep 17 00:00:00 2001 From: Cullum Smith Date: Mon, 16 Dec 2024 20:35:26 -0500 Subject: add webdav to dav_server role --- scripts/hostclass/dav_server | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'scripts/hostclass/dav_server') diff --git a/scripts/hostclass/dav_server b/scripts/hostclass/dav_server index fd3bdd4..9c5d9f9 100644 --- a/scripts/hostclass/dav_server +++ b/scripts/hostclass/dav_server @@ -10,6 +10,9 @@ : ${davical_awl_repo:='https://gitlab.com/davical-project/awl.git'} : ${davical_awl_branch:='master'} : ${davical_admins:=''} +: ${webdav_users:=''} +: ${webdav_user_quota:='2g'} +: ${webdav_upload_sizelimit:='104857600'} # 100 MB davical_dn="uid=${davical_username},${robots_basedn}" davical_repo_dir=/usr/local/www/davical @@ -21,6 +24,7 @@ davical_https_cacert="${nginx_conf_dir}/davical.ca.crt" davical_keytab="${keytab_dir}/davical.keytab" davical_client_keytab="${keytab_dir}/davical.client.keytab" davical_fpm_socket=/var/run/fpm-davical.sock +webdav_dir=/usr/local/www/webdav davical_psql(){ postgres_run --host="$davical_dbhost" --dbname="$davical_dbname" "$@" @@ -45,6 +49,15 @@ pkg install -y \ p5-DBI \ p5-YAML +# Create ZFS datasets for WebDAV files. +create_dataset -o "mountpoint=${webdav_dir}" "${state_dataset}/webdav" +install_directory -o root -g "$nginx_user" -m 0770 "$webdav_dir" + +for user in $webdav_users; do + create_dataset -o "refquota=${webdav_user_quota}" "${state_dataset}/webdav/${user}" + install_directory -o root -g "$nginx_user" -m 0770 "${webdav_dir}/${user}" +done + # Install davical from git. [ -d "$davical_repo_dir" ] || git clone "$davical_repo" "$davical_repo_dir" [ -d "$davical_awl_repo_dir" ] || git clone "$davical_awl_repo" "$davical_awl_repo_dir" -- cgit v1.2.3