fix: remove sudo commands from WebDAV setup for RunPod root user
This commit is contained in:
25
arty.yml
25
arty.yml
@@ -338,25 +338,32 @@ scripts:
|
||||
echo "========================================="
|
||||
echo ""
|
||||
|
||||
# Install davfs2 if not present
|
||||
if ! command -v mount.davfs >/dev/null 2>&1; then
|
||||
echo "Installing davfs2..."
|
||||
apt update && apt install -y davfs2
|
||||
fi
|
||||
|
||||
# Create mount point
|
||||
echo "Creating mount point..."
|
||||
sudo mkdir -p /mnt/hidrive
|
||||
mkdir -p /mnt/hidrive
|
||||
|
||||
# Create davfs2 secrets file
|
||||
echo "Configuring WebDAV credentials..."
|
||||
sudo mkdir -p /etc/davfs2
|
||||
echo "https://webdav.hidrive.ionos.com/ valknar MwRTW4hR.eRbipQ" | sudo tee -a /etc/davfs2/secrets > /dev/null
|
||||
sudo chmod 600 /etc/davfs2/secrets
|
||||
mkdir -p /etc/davfs2
|
||||
echo "https://webdav.hidrive.ionos.com/ valknar MwRTW4hR.eRbipQ" | tee /etc/davfs2/secrets > /dev/null
|
||||
chmod 600 /etc/davfs2/secrets
|
||||
|
||||
# Configure davfs2 to allow non-root users
|
||||
sudo sed -i 's/# use_locks 1/use_locks 0/' /etc/davfs2/davfs2.conf 2>/dev/null || true
|
||||
# Configure davfs2
|
||||
sed -i 's/# use_locks 1/use_locks 0/' /etc/davfs2/davfs2.conf 2>/dev/null || true
|
||||
|
||||
# Mount WebDAV
|
||||
echo "Mounting HiDrive WebDAV..."
|
||||
if sudo mount -t davfs https://webdav.hidrive.ionos.com/ /mnt/hidrive -o uid=$(id -u),gid=$(id -g); then
|
||||
if mount -t davfs https://webdav.hidrive.ionos.com/ /mnt/hidrive; then
|
||||
echo "✓ HiDrive mounted successfully"
|
||||
else
|
||||
echo "⚠ Warning: Mount failed, you may need to mount manually"
|
||||
echo " Try: mount -t davfs https://webdav.hidrive.ionos.com/ /mnt/hidrive"
|
||||
fi
|
||||
|
||||
# Create ComfyUI output directory
|
||||
@@ -374,8 +381,8 @@ scripts:
|
||||
echo "ComfyUI output: /mnt/hidrive/users/valknar/Pictures/AI/ComfyUI"
|
||||
echo "ComfyUI symlink: /workspace/ComfyUI/output_hidrive"
|
||||
echo ""
|
||||
echo "To unmount: sudo umount /mnt/hidrive"
|
||||
echo "To remount: sudo mount -t davfs https://webdav.hidrive.ionos.com/ /mnt/hidrive"
|
||||
echo "To unmount: umount /mnt/hidrive"
|
||||
echo "To remount: mount -t davfs https://webdav.hidrive.ionos.com/ /mnt/hidrive"
|
||||
|
||||
#
|
||||
# Utility Scripts
|
||||
|
||||
Reference in New Issue
Block a user