Syncing your Obsidian vault to Android via an encrypted GitHub repository

Because privacy matters

Photo by Yancy Min on Unsplash

Frontmatter

Motivation

  • my Chromebook is my private laptop
  • my Linux desktop at home with the big screen
  • my work laptop under Linux
  • occasionally my same work laptop booted into Windows
  • my mobile phone running Android

Why not use BoxCryptor / Cryptomator and DropBox?

Boxcryptor

  • it is paid software
  • there is a clear focus on Windows and Mac
  • it has subpar Linux support: no longer supporting Linux as a first-class citizen

Cryptomator

  • it is free
  • it is open source
  • it supports Linux, Windows, Mac, Android, iOS
  • independent security audits exist

Why I don’t like cloud encryption software for my Zettelkasten

Why I prefer git and GitHub

  • I work on my local copy.
  • I can refresh the local copy to the state of the cloud repository (git pull)
  • I can make changes locally
  • I stage the changes that I want to keep and commit them locally (git add and git commit)
  • When I’m happy with it, I push the changes to the cloud repository (git push)
  • Chromebook
  • Linux desktop
  • Work laptop
  • Android phone

Git and git-crypt

(Re-) Initialize your Repo

Set up .gitignore and .gitattributes

  • all .md markdown files in all subfolders
  • all files in all subfolders
  • this will exclude dotfiles like .gitattributes

Add your files

TEST YOUR .gitattributes

Commit and push

Set up a remote repo for testing your config

Cleaning up local test repos

Push to GitHub

Checking it out on a different machine

  • install git-crypt
  • clone the repository
  • unlock the repository

Obsidian

Android

Installing termux

GitHub

  • we sign in to Github
  • we click our photo
  • we select settings
  • we click on “SSH and GPG keys.”
  • we click on “New SSH key.”
  • we go to termux and type cat .ssh/id_ed25519.pub
  • we copy the key
  • we paste it into the “key” field of the browser
  • we click “Add SSH key.”

git-crypt

Shortcuts for committing, pushing, and pulling

Adding shortcuts to the home screen

  • one shows a little text menu
  • the other one allows you to place an icon per script

--

--

Software engineer turned researcher, AI heavy data scientist with strong computer science and electronics skills.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rene Schallner

Software engineer turned researcher, AI heavy data scientist with strong computer science and electronics skills.