User Tools

Site Tools


linux:sharepoint

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:sharepoint [2021/11/22 13:39] Wulf Rajeklinux:sharepoint [2023/05/29 11:55] (current) – external edit 127.0.0.1
Line 125: Line 125:
 Then use Then use
 <code> <code>
-gdrive: /mnt/gdrive fuse.rclonefspy user,noauto,x-systemd.automount,_netdev,x-systemd.mount-timeout=30,x-systemd.idle-timeout=10min,rc.allow-other,rc.fast-list,rc.drive-export-formats=.link.html,rc.config=/home/user/.config/rclone/rclone.conf,rc.allow-other 0 0+gdrive: /mnt/gdrive fuse.rclonefspy user,noauto,x-systemd.automount,_netdev,x-systemd.mount-timeout=30,x-systemd.idle-timeout=10min,rc.allow-other,rc.fast-list,rc.drive-export-formats=.link.html,rc.config=/home/user/.config/rclone/rclone.conf 0 0
 </code> </code>
 For troubleshooting use: For troubleshooting use:
Line 132: Line 132:
 </code> </code>
  
 +====== systemd service ======
 +
 +https://gist.github.com/kabili207/2cd2d637e5c7617411a666d8d7e97101
 +
 +Fuse config required for user systemd service:
 +<code - /etc/fuse.conf>
 +# Allow non-root users to specify the allow_other or allow_root mount options.
 +user_allow_other
 +</code>
 +
 +<code - rclone@.service>
 +# User service for Rclone mounting
 +#
 +# Place in ~/.config/systemd/user/
 +# File must include the '@' (ex rclone@.service)
 +# As your normal user, run 
 +#   systemctl --user daemon-reload
 +# You can now start/enable each remote by using rclone@<remote>
 +#   systemctl --user enable rclone@dropbox
 +#   systemctl --user start rclone@dropbox
 +
 +[Unit]
 +Description=rclone: Remote FUSE filesystem for cloud storage config %i
 +Documentation=man:rclone(1)
 +After=network-online.target
 +Wants=network-online.target 
 +AssertPathIsDirectory=%h/mnt/%i
 +
 +[Service]
 +Type=notify
 +ExecStart= \
 +  /usr/bin/rclone mount \
 +    --config=%h/.config/rclone/rclone.conf \
 +    --fast-list \
 +    --vfs-cache-mode writes \
 +    --vfs-cache-max-size 100M \
 +    --log-level INFO \
 +    --log-file /tmp/rclone-%i.log \
 +    --umask 022 \
 +    --allow-other \
 +    %i: %h/mnt/%i
 +ExecStop=/bin/fusermount -u %h/mnt/%i
 +
 +[Install]
 +WantedBy=default.target
 +</code>
 +
 +To hide Sharepoint's Forms directories, add:
 +<code>
 +    --exclude "/Forms/" \
 +</code>
 +
 +
 +====== WebDAV2 process ======
 +
 +#https://shui.azurewebsites.net/2018/01/13/mount-onedrive-for-business-on-headless-linux-vps-through-webdav/
 +
 +<code>
 +sudo apt-get install -y davfs2
 +#unprivileged users: yes
 +sudo chmod 777 /etc/davfs2/davfs2.conf
 +echo "use_locks 0" >> /etc/davfs2/davfs2.conf
 +
 +wget https://raw.githubusercontent.com/yulahuyed/test/master/get-sharepoint-auth-cookie.py
 +
 +python get-sharepoint-auth-cookie.py https://SHAREPOINTSITE USERNAME PASSWORD > cookie.txt
 +
 +sed -i "s/ //g" cookie.txt
 +COOKIE=$(cat cookie.txt)
 +sudo chmod 777 /etc/davfs2/davfs2.conf
 +for MPATH in {Funds/Funds,IT/IT,Research/Research,SalesSP/Sales}
 +do
 +  echo "[${MPATH}]" >> /etc/davfs2/davfs2.conf
 +  echo "add_header Cookie ${COOKIE}" >> /etc/davfs2/davfs2.conf
 +  echo "" >> /etc/davfs2/davfs2.conf
 +done
 +
 +for MPATH in {Funds/Funds,IT/IT,Research/Research,SalesSP/Sales};
 +do
 +  echo "https://SITENAME.sharepoint.com/sites/${MPATH} USERNAME PASSWORD" >> /etc/davfs2/secrets
 +done
 +
 +sudo chmod 755 /etc/davfs2/davfs2.conf
 +
 +sudo usermod -a -G davfs2 $USER
 +
 +#apply the new group in the shell
 +su - $USER
 +
 +for PATH in {funds,it,research,sales};
 +do
 +  mkdir -p ~/sharepoint/SITE-${PATH}
 +  mount ~/sharepoint/SITE-${PATH}/
 +done;
 +</code>
 +
 +The cookie will become invalid after about 3 weeks of inactivity.
 +
 +fstab entry example
 +<code>
 +https://SITENAME.sharepoint.com/sites/sitename/foldername /home/USER/sharepoint/SITE-SITENAME davfs users,rw,_netdev 0 0
 +</code>
 +
 +https://wiki.archlinux.org/title/Davfs2
linux/sharepoint.1637588396.txt.gz · Last modified: (external edit)