mirror of
https://github.com/fscotto/infra.git
synced 2026-05-31 07:49:57 +00:00
Mount pCloud with turnstile rclone service
This commit is contained in:
@@ -11,6 +11,7 @@ void_packages_base:
|
|||||||
- elogind
|
- elogind
|
||||||
- fastfetch
|
- fastfetch
|
||||||
- flatpak
|
- flatpak
|
||||||
|
- fuse3
|
||||||
- gcc
|
- gcc
|
||||||
- gdb
|
- gdb
|
||||||
- gnome-keyring
|
- gnome-keyring
|
||||||
@@ -30,6 +31,7 @@ void_packages_base:
|
|||||||
- pkg-config
|
- pkg-config
|
||||||
- podman
|
- podman
|
||||||
- podman-compose
|
- podman-compose
|
||||||
|
- rclone
|
||||||
- seahorse
|
- seahorse
|
||||||
- socklog
|
- socklog
|
||||||
- socklog-void
|
- socklog-void
|
||||||
|
|||||||
@@ -380,15 +380,44 @@
|
|||||||
mode: "0755"
|
mode: "0755"
|
||||||
- path: "{{ user_home }}/.local/state"
|
- path: "{{ user_home }}/.local/state"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
- path: "{{ user_home }}/.cache"
|
||||||
|
mode: "0755"
|
||||||
|
- path: "{{ user_home }}/.cache/rclone"
|
||||||
|
mode: "0755"
|
||||||
- path: "{{ user_home }}/.local/state/ssh-agent"
|
- path: "{{ user_home }}/.local/state/ssh-agent"
|
||||||
mode: "0700"
|
mode: "0700"
|
||||||
- path: "{{ user_home }}/.local/share"
|
- path: "{{ user_home }}/.local/share"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
- path: "{{ user_home }}/.local/share/keyrings"
|
- path: "{{ user_home }}/.local/share/keyrings"
|
||||||
mode: "0700"
|
mode: "0700"
|
||||||
|
- path: "{{ user_home }}/Remotes"
|
||||||
|
mode: "0755"
|
||||||
- path: /usr/src
|
- path: /usr/src
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: Check whether Org home path already exists
|
||||||
|
tags: [dotfiles, dotfiles:desktop]
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "{{ user_home }}/Org"
|
||||||
|
follow: false
|
||||||
|
register: org_home_path
|
||||||
|
|
||||||
|
- name: Fail when Org home path conflicts with managed symlink
|
||||||
|
tags: [dotfiles, dotfiles:desktop]
|
||||||
|
ansible.builtin.fail:
|
||||||
|
msg: "{{ user_home }}/Org already exists and is not the managed symlink to {{ user_home }}/Remotes/pCloud/Org"
|
||||||
|
when:
|
||||||
|
- org_home_path.stat.exists | default(false)
|
||||||
|
- not (org_home_path.stat.islnk | default(false) and org_home_path.stat.lnk_source | default('') == user_home + '/Remotes/pCloud/Org')
|
||||||
|
|
||||||
|
- name: Ensure Org home path points to pCloud Org directory
|
||||||
|
tags: [dotfiles, dotfiles:desktop]
|
||||||
|
ansible.builtin.file:
|
||||||
|
src: "{{ user_home }}/Remotes/pCloud/Org"
|
||||||
|
dest: "{{ user_home }}/Org"
|
||||||
|
state: link
|
||||||
|
force: true
|
||||||
|
|
||||||
- name: Ensure maildir directories exist
|
- name: Ensure maildir directories exist
|
||||||
tags: [dotfiles, dotfiles:desktop]
|
tags: [dotfiles, dotfiles:desktop]
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
|||||||
3
dotfiles/desktop/.config/service/rclone-pcloud/log/run
Executable file
3
dotfiles/desktop/.config/service/rclone-pcloud/log/run
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
exec svlogd -tt ./main
|
||||||
33
dotfiles/desktop/.config/service/rclone-pcloud/run
Executable file
33
dotfiles/desktop/.config/service/rclone-pcloud/run
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
mountpoint="$HOME/Remotes/pCloud"
|
||||||
|
cache_dir="$HOME/.cache/rclone/pcloud"
|
||||||
|
config_path="$HOME/.config/rclone/rclone.conf"
|
||||||
|
|
||||||
|
mkdir -p "$cache_dir" "$mountpoint"
|
||||||
|
|
||||||
|
if mountpoint -q "$mountpoint"; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${TURNSTILE_ENV_DIR:-}" ]; then
|
||||||
|
exec chpst -e "$TURNSTILE_ENV_DIR" rclone mount \
|
||||||
|
pcloud: "$mountpoint" \
|
||||||
|
--config "$config_path" \
|
||||||
|
--cache-dir "$cache_dir" \
|
||||||
|
--vfs-cache-mode writes \
|
||||||
|
--dir-cache-time 10m \
|
||||||
|
--poll-interval 1m \
|
||||||
|
--log-level INFO
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec rclone mount \
|
||||||
|
pcloud: "$mountpoint" \
|
||||||
|
--config "$config_path" \
|
||||||
|
--cache-dir "$cache_dir" \
|
||||||
|
--vfs-cache-mode writes \
|
||||||
|
--dir-cache-time 10m \
|
||||||
|
--poll-interval 1m \
|
||||||
|
--log-level INFO
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
org-return-follows-link t
|
org-return-follows-link t
|
||||||
org-startup-folded 'content
|
org-startup-folded 'content
|
||||||
org-todo-keywords '((sequence "🆕(t)" "▶️(s)" "⏳(w)" "🔎(p)" "|" "✅(d)" "🗑(c)" "👨(g)"))
|
org-todo-keywords '((sequence "🆕(t)" "▶️(s)" "⏳(w)" "🔎(p)" "|" "✅(d)" "🗑(c)" "👨(g)"))
|
||||||
org-export-backends '(html latex odt markdown ascii icalendar)
|
org-export-backends '(html latex odt md ascii icalendar)
|
||||||
org-latex-pdf-process '("pdflatex -interaction nonstopmode %f"
|
org-latex-pdf-process '("pdflatex -interaction nonstopmode %f"
|
||||||
"pdflatex -interaction nonstopmode %f")
|
"pdflatex -interaction nonstopmode %f")
|
||||||
org-latex-default-class "article"
|
org-latex-default-class "article"
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
|
|
||||||
;; Setting default directory for Org files
|
;; Setting default directory for Org files
|
||||||
(setq org-directory "~/Remotes/pCloud/Org")
|
(setq org-directory "~/Org")
|
||||||
|
|
||||||
(provide 'org)
|
(provide 'org)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user