Vagrantfile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # set this to choose the starting prefix of the onion name
  2. filter = "prefix"
  3. Vagrant.configure("2") do |config|
  4. config.vm.box = "debian/bullseye64"
  5. config.vm.provider :libvirt do |libvirt|
  6. libvirt.cpus = 2
  7. end
  8. config.vm.synced_folder '.', '/vagrant', disabled: true
  9. config.vm.provision :shell, inline: <<-SHELL
  10. set -ex
  11. sed -i s,http:,https:, /etc/apt/sources.list
  12. apt-get update
  13. apt-get -qy dist-upgrade
  14. apt-get -qy install --no-install-recommends git gcc libc-dev libsodium-dev make autoconf htop screen
  15. SHELL
  16. config.vm.provision :shell, privileged: false, inline: <<-SHELL
  17. git clone https://github.com/cathugger/mkp224o.git /home/vagrant/mkp224o
  18. SHELL
  19. # disable internet access
  20. config.vm.provision "shell",
  21. run: "always",
  22. inline: "ip route del default || true"
  23. # disable root
  24. config.vm.provision "shell", inline: "passwd --lock root"
  25. config.vm.provision "shell", inline: "SUDO_FORCE_REMOVE=yes dpkg --purge sudo"
  26. config.vm.provision :shell, privileged: false, inline: <<-SHELL
  27. set -ex
  28. cd mkp224o
  29. ./autogen.sh
  30. ./configure
  31. make
  32. ./mkp224o -h
  33. mkdir ~/#{filter}
  34. cd ~/#{filter}
  35. screen -d -m -L -Logfile #{filter}.log -S run-#{filter} nice ~/mkp224o/mkp224o -S 300 #{filter}
  36. SHELL
  37. end