Merge pull request #72 from eighthave/master

Vagrantfile for fully automated, secure runs
This commit is contained in:
cathugger 2022-05-17 13:45:31 +00:00 committed by GitHub
commit ef71219c2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

46
contrib/vagrant/Vagrantfile vendored Normal file
View File

@ -0,0 +1,46 @@
# set this to choose the starting prefix of the onion name
filter = "prefix"
Vagrant.configure("2") do |config|
config.vm.box = "debian/bullseye64"
config.vm.provider :libvirt do |libvirt|
libvirt.cpus = 2
end
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.provision :shell, inline: <<-SHELL
set -ex
sed -i s,http:,https:, /etc/apt/sources.list
apt-get update
apt-get -qy dist-upgrade
apt-get -qy install --no-install-recommends git gcc libc-dev libsodium-dev make autoconf htop screen
SHELL
config.vm.provision :shell, privileged: false, inline: <<-SHELL
git clone https://github.com/cathugger/mkp224o.git /home/vagrant/mkp224o
SHELL
# disable internet access
config.vm.provision "shell",
run: "always",
inline: "ip route del default || true"
# disable root
config.vm.provision "shell", inline: "passwd --lock root"
config.vm.provision "shell", inline: "SUDO_FORCE_REMOVE=yes dpkg --purge sudo"
config.vm.provision :shell, privileged: false, inline: <<-SHELL
set -ex
cd mkp224o
./autogen.sh
./configure
make
./mkp224o -h
mkdir ~/#{filter}
cd ~/#{filter}
screen -d -m -L -Logfile #{filter}.log -S run-#{filter} nice ~/mkp224o/mkp224o -S 300 #{filter}
SHELL
end