arch-private-installation.sh (1725B)
1 #!/bin/bash 2 3 cd ~/gitRepos 4 5 for REPO in keys personal-notes passwords; do 6 git clone ssh://brgr:/srv/git/private-repos/$REPO 7 done 8 9 cd 10 11 gpg --import gitRepos/keys/passwords/public-key.asc 12 gpg --import gitRepos/keys/passwords/private-key.asc 13 14 echo "default-cache-ttl 288000" > ~/.gnupg/gpg-agent.conf 15 echo "max-cache-ttl 288000">> ~/.gnupg/gpg-agent.conf 16 17 # TODO: Should this go in my .config dir? 18 git config --global user.email "andrew@laack.co" 19 git config --global user.name "Andrew Laack" 20 git config --global credential.helper store 21 22 cd ~ 23 mv .git-credentials git-credentials.old 24 ln -s ~/gitRepos/keys/git/credentials.txt .git-credentials 25 ln -s ~/personal-files/sensitive-configs/thunderbird ~/.thunderbird 26 ln -s ~/.config/gitconfig ~/.gitconfig 27 28 # As a rule, any data I want to persist but doesn't need versioning / is binary, stuff like that, should go in 29 # ~/personal-files 30 31 # since .config is in git, this will be done automatically. 32 # ln -s ~/personal-files/sensitive-configs/brave ~/.config/BraveSoftware 33 34 cp ~/gitRepos/keys/ssh/id_ed25519* ~/.ssh/ 35 chmod 600 ~/.ssh/id_ed25519* 36 37 sudo mkdir -p /home/backup 38 sudo chown andrew /home/backup 39 40 # CRON (backups scripts) 41 echo "0 8,14 * * * andrew /home/andrew/bin/backup.sh" | sudo tee -a /etc/crontab 42 echo "0 9,15 * * * andrew /home/andrew/bin/backups/restic.sh" | sudo tee -a /etc/crontab 43 44 # This is quite the slow backup process... 45 echo "0 24 * * * andrew /home/andrew/bin/backups/encrypted-backup.sh" | sudo tee -a /etc/crontab 46 47 # TODO: Is there a way to automatically trust fully this key? 48 # Locally, I ran: 49 gpg --list-secret-keys 50 51 echo 52 echo "Run: gpg --edit-key {KEY_ID}" 53 echo "Then do: " 54 55 echo "gpg> trust" 56 echo " Your decision? 5 (this is trusting ultimately)"