Screencasts: implement the remoteserver example

This commit is contained in:
Andrey Bienkowski 2022-02-20 11:51:07 +03:00
parent 904897bce1
commit ccf48ade3d
2 changed files with 17 additions and 4 deletions

View File

@ -2,15 +2,29 @@ Vagrant.configure("2") do |config|
config.vm.box = "debian/bullseye64"
config.vm.provision "install dependencies", type: "shell", inline: <<-SHELL
apt-get update
apt-get install -y wget expect gpg asciinema
apt-get install -y wget expect gpg asciinema ssh adduser
SHELL
config.vm.provision "record install", type: "shell", inline: <<-SHELL
gpg --recv-keys "6D5B EF9A DD20 7580 5747 B70F 9F88 FB52 FAF7 B393"
asciinema rec -c 'expect /vagrant/install.tcl' --overwrite /vagrant/install.json
SHELL
config.vm.provision "record basic usage", type: "shell", inline: <<-SHELL
rm -r /media/backup/borgdemo || true
# `rm` below allows quick re-exec via:
# vagrant vagrant provision --provision-with "record basic usage"
# this is useful when testing changes
rm -r /media/backup/borgdemo || true
rm -r ~/.ssh/ || true
deluser --remove-home borgdemo || true
mkdir -p /media/backup/borgdemo
adduser borgdemo
echo '127.0.0.1 remoteserver.example' >> /etc/hosts
ssh-keygen -f ~/.ssh/id_rsa -N ''
ssh-keyscan remoteserver.example > ~/.ssh/known_hosts
runuser -u borgdemo mkdir ~borgdemo/.ssh
runuser -u borgdemo tee ~borgdemo/.ssh/authorized_keys < ~/.ssh/id_rsa.pub
asciinema rec -c 'expect /vagrant/basic.tcl' --overwrite /vagrant/basic.json
SHELL
end

View File

@ -58,8 +58,7 @@ borg extract /media/backup/borgdemo::backup3 Wallpaper/deer.jpg
diff -s Wallpaper/deer.jpg Wallpaper.orig/deer.jpg
# And, of course, we can also create remote repos via ssh when borg is setup there. This command creates a new remote repo in a subdirectory called "demo":
# TODO: remote repo
# borg init --encryption=repokey borgdemo@remoteserver.example:./demo
borg init --encryption=repokey borgdemo@remoteserver.example:./demo
# Easy, isn't it? That's all you need to know for basic usage.
# If you want to see more, have a look at the screencast showing the "advanced usage".