mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 09:52:37 +02:00
Fix building VM ISO, and start implementing start_vm
This commit is contained in:
parent
7b2211fc1f
commit
e8f7d96f90
4 changed files with 21 additions and 6 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -135,5 +135,6 @@ deb_dist
|
|||
install/windows/Dangerzone.wxs
|
||||
test_docs/sample-safe.pdf
|
||||
share/bin
|
||||
share/vm
|
||||
install/vm-builder/vm
|
||||
install/vm-builder/.vagrant
|
2
BUILD.md
2
BUILD.md
|
@ -56,7 +56,7 @@ If you don't have it already, install poetry (`pip3 install --user poetry`). The
|
|||
poetry install
|
||||
```
|
||||
|
||||
Make sure [Docker Desktop](https://www.docker.com/products/docker-desktop) and vagrant (`brew install vagrant`) are installed and run this to collect the binaries:
|
||||
Make sure [Docker Desktop](https://www.docker.com/products/docker-desktop) and vagrant (`brew install vagrant`) are installed and run this to collect the binaries from Docker Desktop and then build a custom Alpine Linux ISO for Dangerzone, and copy them into the `share` folder:
|
||||
|
||||
```
|
||||
./install/macos/get-vm.sh
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from PySide2 import QtCore, QtGui, QtWidgets
|
||||
import os
|
||||
from PySide2 import QtWidgets
|
||||
|
||||
|
||||
class SysTray(QtWidgets.QSystemTrayIcon):
|
||||
|
@ -22,11 +23,20 @@ class SysTray(QtWidgets.QSystemTrayIcon):
|
|||
self.setContextMenu(menu)
|
||||
self.show()
|
||||
|
||||
# Processes for the Dangerzone VM
|
||||
# Dangerzone VM
|
||||
self.vpnkit_p = None
|
||||
self.hyperkit_p = None
|
||||
|
||||
# Start the VM
|
||||
self.hyperkit_path = self.global_common.get_resource_path("bin/hyperkit")
|
||||
self.vpnkit_path = self.global_common.get_resource_path("bin/vpnkit")
|
||||
self.vm_iso_path = self.global_common.get_resource_path(
|
||||
"vm/alpine-dangerzone-v3.14-x86_64.iso"
|
||||
)
|
||||
self.vm_kernel_path = self.global_common.get_resource_path("vm/vmlinuz-virt")
|
||||
self.vm_initramfs_path = self.global_common.get_resource_path(
|
||||
"vm/initramfs-virt"
|
||||
)
|
||||
self.vm_state_dir = os.path.join(self.global_common.appdata_path, "vm-state")
|
||||
os.makedirs(self.vm_state_dir, exist_ok=True)
|
||||
self.vm_start()
|
||||
|
||||
def vm_start(self):
|
||||
|
@ -38,6 +48,10 @@ class SysTray(QtWidgets.QSystemTrayIcon):
|
|||
if self.hyperkit_p is not None:
|
||||
self.hyperkit_p.terminate()
|
||||
|
||||
# Run VPNKit
|
||||
|
||||
# Run Hyperkit
|
||||
|
||||
def restart_clicked(self):
|
||||
self.status_action.setText("Restarting Dangerzone ...")
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ cp /Applications/Docker.app/Contents/Resources/bin/com.docker.vpnkit share/bin/v
|
|||
cd install/vm-builder
|
||||
vagrant up
|
||||
vagrant ssh -- /vagrant/build-iso.sh
|
||||
vagrant down
|
||||
vagrant halt
|
||||
cd ../..
|
||||
|
||||
# Copy the ISO to resources
|
||||
|
|
Loading…
Reference in a new issue