From 4d29fb45572898139920b9dffe5370356b6bc267 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Fri, 12 Nov 2021 21:30:04 +0200
Subject: [PATCH] Rclone support for the library.shore.co.il.

Access to my media library.
---
 .bashrc                    | 12 ++++++++++++
 .bashrc.private.j2         |  1 +
 .config/rclone/rclone.conf |  6 ++++++
 3 files changed, 19 insertions(+)

diff --git a/.bashrc b/.bashrc
index 8972fe2..4a03142 100644
--- a/.bashrc
+++ b/.bashrc
@@ -223,6 +223,18 @@ match_ssl_pair () {
     return "$exitcode"
 }
 
+mnt_lib () {
+    mkdir -p "$HOME/Library"
+    rclone mount \
+        --allow-non-empty \
+        --daemon \
+        --gid "$(id -g)" \
+        --vfs-cache-mode full \
+        --uid "$(id -u)" \
+        library:/ \
+        "$HOME/Library"
+}
+
 new_experiment () {
     if [ "$#" -ne 1 ]
     then
diff --git a/.bashrc.private.j2 b/.bashrc.private.j2
index b0d3663..4225f4a 100644
--- a/.bashrc.private.j2
+++ b/.bashrc.private.j2
@@ -6,3 +6,4 @@ export GITHUB_TOKEN='{{ run(["ph", "show", "--field", "CLI token", "Web Sites/Gi
 export GITHUB_OAUTH_TOKEN="$GITHUB_TOKEN"
 {% set nc_password = run(["ph", "show", "--field", "Password", "shore.co.il/LDAP"])["stdout"] -%}
 export RCLONE_CONFIG_NEXTCLOUD_PASS='{{ run(["rclone", "obscure", nc_password])["stdout"]|trim }}'
+export RCLONE_CONFIG_LIBRARY_PASS="$RCLONE_CONFIG_NEXTCLOUD_PASS"
diff --git a/.config/rclone/rclone.conf b/.config/rclone/rclone.conf
index 53dbfdd..74975cb 100644
--- a/.config/rclone/rclone.conf
+++ b/.config/rclone/rclone.conf
@@ -3,3 +3,9 @@ type = webdav
 url = https://nextcloud.shore.co.il/remote.php/webdav/
 vendor = nextcloud
 user = nimrod
+
+[library]
+type = webdav
+url = https://library.shore.co.il/webdav/
+vendor = other
+user = nimrod
-- 
GitLab