Skip to content

Instantly share code, notes, and snippets.

@tatumroaquin
Last active December 17, 2022 22:04
Show Gist options
  • Save tatumroaquin/2626e145363711fe20889b95fca67d28 to your computer and use it in GitHub Desktop.
Save tatumroaquin/2626e145363711fe20889b95fca67d28 to your computer and use it in GitHub Desktop.
general instructions to setting up a local password-store server

Password Store Setup

  1. create bare git repo to push and pull from all devices.
    mkdir ~/.config/.password-serve.git

  2. initialise the empty bare git repository
    cd ~/.config/.password-serve.git git init --bare --initial-branch=master

  • note: may output, 'fatal: This operation must be done in a work tree' ignore this.
  1. visit the .password-store directory and set .password-serve.git as remote.
  • server machine: pass git remote add origin ~/.config/.password-serve.git
  • client machine: pass git remote add origin ssh://user@hostname.local/<absolute path to password-serve.git
  • note: avahi-daemon is required for mDNS resolution as well as dbus for concurrency and SSH
  1. setup merge options on both machines to fast-forward only, using the rebase model to avoid conflicts.
    pass git config --local --add branch.master.mergeoptions --ff-only

  2. visit .password-serve.git/hooks and setup a post-update hook with the following contents.

  • this is an automatic pull to the origin password-store if the repository is hosted in the same device as one of the clients of the server.
  • if the password-serve.git repository is not on the same device, then automatic pulling from any changes made is should be done manually.

touch post-update
chmod +x post-update

#!/bin/sh

echo
echo "*** pulling changes into password store ***"
echo

cd ~/.config/.password-store/ || exit
unset GIT_DIR
git pull origin master

exec git-update-server-info
  1. finally push all the contents of your password-store directory to the new server made.
    pass git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment