Skip to content
s15hPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

61 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

Dotfiles for debian and arch Tested on debian and omarchy

installation

Step 0: insert yubikey step 1: git clone https://github.com/s15h/dotfiles.git step 2: dotfiles/initial-startup/preperation.sh

todo

  • Add dotfiles for openvpn
  • ~/.openvpn/template-vpn.sh

Project structure

  • private
    • dotfiles
    • home-server
    • curriculum-vitae
    • zettelkasten
    • homelab
  • dignitas
    • own git config
  • s15h
    • open-gtd

Git identities

~/.gitconfig (stowed from configs/.gitconfig) sets your global identity and switches to the Dignitas identity for anything under ~/project/dignitas/.

The Dignitas work email is intentionally not committed to this public repository. It lives in the untracked local file ~/.config/git/dignitas-identity.gitconfig, which the stowed ~/project/dignitas/.gitconfig includes:

mkdir -p ~/.config/git
cat > ~/.config/git/dignitas-identity.gitconfig <<'EOF'
[user]
	email = you@dignitas.nl
EOF

preparation.sh creates this file for you — set DIGNITAS_GIT_EMAIL or answer the prompt. If it is missing, git safely falls back to your global identity.

Yubikey ssh

To use yubikey as ssh the GPG agent is configured via two scripts:

  • ~/.config/shell/gpg-agent.sh — sourced from ~/.bashrc and ~/.oh-my-zsh/custom/gpg.zsh for interactive shells.
  • ~/.config/shell/gpg-agent-profile.sh — sourced from ~/.bash_profile and ~/.profile so the graphical login session exports SSH_AUTH_SOCK for GUI apps.

remaining setup

automated service logins

initial-startup/preparation.sh can optionally bootstrap supported service logins with the Bitwarden CLI after the install finishes.

  1. Add the services you want to automate to ~/.config/dotfiles/login-bootstrap.conf
  2. Run the preparation script and confirm the Bitwarden bootstrap prompt
  3. Log in to or unlock the Bitwarden CLI when asked

Supported automated services:

  • GitHub CLI via gh auth login
  • Docker registries via docker login

The bootstrap config file supports these entry types:

gh|<hostname>|<bitwarden item with token in the password field>
docker|<registry>|<username>|<bitwarden item with password or token in the password field>

manual logins

These services still require manual sign-in after installation:

  • Bitwarden desktop
  • Firefox / Firefox Sync
  • Bruno
  • Obsidian
  • Zed
  • Spotify

ssh in jetbrains ui

To enable use of gpg agent in ssh actions in jetbrains ui elements we need the SSH_AUTH_SOCK variable set.

The graphical login session already exports SSH_AUTH_SOCK (see Yubikey ssh), so IDEs launched from the desktop work too. The aliases below are a convenience/fallback for launching from a shell.

Aliases that launch JetBrains IDEs with the correct environment are available in:

  • bash: ~/.config/shell/jetbrains.sh (sourced from ~/.bashrc)
  • zsh: ~/.oh-my-zsh/custom/aliases.zsh

Available aliases: intellij-ssh, goland-ssh, phpstorm-ssh, pycharm-ssh, webstorm-ssh, datagrip-ssh

To make them work you need the toolbox to create shell scripts. Make sure the toolbox has writing permissions on the selected folder.

GPG key

For Git commit signing with the YubiKey setup, point user.signingkey at the active signing subkey fingerprint with a trailing !, not at the primary certify key fingerprint.

initial-startup/preparation.sh now refreshes the smartcard state and writes ~/.config/git/signingkey.gitconfig with the newest usable signing subkey automatically on install.

If signing starts failing with Unusable secret key, refresh the smartcard state first:

gpg --card-status
# or
yubikey-switch

subkey renewal

estimated Time required: 15 minutes. subkey renewal only pushes expiration date forward. There is no need to adjust keys on remote hosts and the yubikeys can remain the same.

  1. Insert usb drive and check label with sudo dmesg | tail
  2. decrypt and mount usb drive
sudo cryptsetup luksOpen /dev/sda1 gnupg-secrets
# Check if the device label is correct (/dev/sdaX)

sudo mkdir -p /mnt/encrypted-storage

sudo mount /dev/mapper/gnupg-secrets /mnt/encrypted-storage
  1. Create new temporary working directory and copy gpg keys to it
export GNUPGHOME=$(mktemp -d -t $(date +%Y.%m.%d)-XXXX)

cp -avi /mnt/encrypted-storage/gnupg_202112191956_CsF/* $GNUPGHOME/
  1. Set the identity env variable and set the key variables
export IDENTITY="Sietze van den Bergh <sietze@s15h.nl>"
export KEYID=$(gpg -k --with-colons "$IDENTITY" | \
    awk -F: '/^pub:/ { print $5; exit }')

export KEYFP=$(gpg -k --with-colons "$IDENTITY" | \
    awk -F: '/^fpr:/ { print $10; exit }')

echo $KEYID $KEYFP
  1. Set the certify pass. It's in bitwarden
export CERTIFY_PASS=ABCD-0123-IJKL-4567-QRST-UVWX
  1. Set the new expiration date
export EXPIRATION=2027-02-01
  1. Do the renewal
echo "$CERTIFY_PASS" | \
    gpg --batch --pinentry-mode=loopback \
        --passphrase-fd 0 --quick-set-expire "$KEYFP" "$EXPIRATION" \
    $(gpg -K --with-colons | awk -F: '/^fpr:/ { print $10 }' | tail -n "+2" | tr "\n" " ")
  1. Export the updated public key:
gpg --armor --export $KEYID | sudo tee ~/$KEYID-$(date +%F).asc

Copy it from the home folder to this repo and commit it.

  1. Then on every machine where the key is used, import it
gpg --import ~/dotfiles/*.asc
  1. (optional) Upload the key
gpg --send-key $KEYID
  1. unmount and close usb drive
sudo umount /mnt/encrypted-storage
sudo cryptsetup luksClose gnupg-secrets

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages