2
1
Fork
You've already forked streams-addons
0
Page: Debug_webdav_client
4 Debug_webdav_client
ojrandom edited this page 2022年11月14日 17:05:08 +01:00

Tested under Debian 11

Run

Prepare webDAV

Mount the cloud directory using webDAV.

You could use this script.

nano install_davfs2.sh

Copy

#!/bin/bash
#
# Your local user name (not root > open a terminal and type "id")
user_dav=user_name
#
# Login for WebDAV
url_webdav=https://your-domain.org/dav/nick-name
user_webdav=nick-name@your-domain.org
pass_webdav=your-password
#
#############################
# Do not edit below this line
#############################
#
echo "check if the user wants to use WebDAV"
if [ -z "$url_webdav" ]
then
	echo "backup to internet (WebDAV) not enabled - missing 'url_webdav' in 'start.sh'"
 return
fi
if [ -z "$user_webdav" ]
then
	echo "backup to internet (WebDAV) not enabled - missing 'user_webdav' in 'start.sh'"
 return
fi
if [ -z "$pass_webdav" ]
then
	echo "backup to internet (WebDAV) not enabled - missing 'pass_webdav' in 'start.sh'"
 return
fi
echo "yes, the user wants to use WebDAV (user defined: url, login, pass)"
echo "configure backup to WebDAV ..."
echo "install davfs2 ..."
DEBIAN_FRONTEND=noninteractive apt-get -q -y install davfs2
echo "making WebDAV available for users other then root"
chmod u+s /usr/sbin/mount.davfs # or sudo dpkg-reconfigure davfs2
echo "add $user_dav to group davfs2"
#usermod -a -G davfs2 $user_dav
adduser $user_dav davfs2
echo "make some configurations for WebDAV"
mkdir -p /home/$user_dav/webdav
if [ -z "`grep 'davfs' /etc/fstab`" ]
then
 echo "$url_webdav/ /home/$user_dav/webdav davfs rw,noauto,user 0 0" >> /etc/fstab
fi
echo "reload fstab with 'mount -a' ..."
mount -a
mkdir -p /home/$user_dav/.davfs2
echo /home/$user_dav/webdav $user_webdav $pass_webdav > /home/$user_dav/.davfs2/secrets
chown -R $user_dav /home/$user_dav/.davfs2
chmod 600 /home/$user_dav/.davfs2/secrets
cp /etc/davfs2/davfs2.conf /home/$user_dav/.davfs2/
# optional in /home/$user_dav/.davfs2/.davfs2/davfs2.conf
# if_match_bug 1
# use_locks 0
# cache_size 1 
# table_size 4096
# delay_upload 1
# gui_optimize 1
echo "Finished."
echo " "
echo "Usage:"
echo " to mount type 'mount /home/$user_dav/webdav'"
echo " to unmount type 'umount /home/$user_dav/webdav'"
########################
# doc
########################
# http://skripta.de/Davfs2.html
# http://ajclarkson.co.uk/blog/auto-mount-webdav-raspberry-pi/

Run as root

chmod +x install_davfs2.sh
su -
./install_davfs2.sh

Install Python

apt-get -y install python3-pip
pip --version
pip install deepface mediapipe fastparquet pyarrow
apt-get install libimage-exiftool-perl perl-doc

Download Script and Check

git clone https://codeberg.org/streams/streams-addons.git
cd streams-addons/faces/py

Check if the script works

python3 availability.py

Run the Script

Mount the webdav directory. If you used the script above

mount /home/user_name/webdav

Run the script

python3 availability.py --dir /home/your_name/webdav

Debug

Install vscodium or pycharm to debug the python script. Both are available with flatpak for example.

Example vscodium... Execute run.py. You will get errors like "deepface not found". Import some python modules inside the console of vscodium

pip install deepface mediapipe fastparquet pyarrow