Commit graph

50 commits

Author SHA1 Message Date
Alex Pyrgiotis
f5242078a9
macos: Remove some stale entitlements
Remove some macOS entitlements that are not necessary for the current
iteration of Dangerzone. Those are the ability to run as a hypervisor,
and the ability to accept network connections. They are a relic from
when we were experimenting with VMs, instead of relying on Docker
Desktop.
2024-10-21 19:16:03 +03:00
Alex Pyrgiotis
e11aaec3ac
Always use sys.exit when exiting the application
The `exit()` [1] function is not necessarily present in every Python
environment, as it's added by the `site` module. Also, this function is
"[...] useful for the interactive interpreter shell and should not be
used in programs"

For this reason, we replace all such occurrences with `sys.exit()` [2],
which is the canonical function to exit Python programs.

[1]: https://docs.python.org/3/library/constants.html#exit
[2]: https://docs.python.org/3/library/sys.html#sys.exit
2024-05-09 15:57:42 +03:00
deeplow
250d8356cd
Hash-verify container pip install & merge build-image
Ensure that when the container image is installing pymupdf (unavailable
in the repos) with verified hashes. To do so, it has the pymupdf
dependency declared in a "container" group in `pyproject.toml`, which
then gets exported into a requirements.txt, which is then used for
hash-verification when building the container.

Because this required modifying the container image build scripts, they
were all merged to avoid duplicate code. This was an overdue change
anyways.
2024-01-03 12:58:35 +00:00
Alex Pyrgiotis
03df60db5f
Always pull base image when building ours
Always pull the base container image (alpine:latest) before building our
own container image. Else, in an environments that we haven't touched
for a while, an older image may be used.
2023-08-02 13:47:59 +03:00
deeplow
814d533c3b
Restructure container code
The files in `container/` no longer make sense to have that name since
the "document to pixels" part will run in Qubes OS in its own virtual
machine.

To adapt to this, this PR does the following:
- Moves all the files in `container` to `dangerzone/conversion`
- Splits the old `container/dangerzone.py` into its two components
  `dangerzone/conversion/{doc_to_pixels,pixels_to_pdf}.py` with a
  `common.py` file for shared functions
- Moves the Dockerfile to the project root and adapts it to the new
  container code location
- Updates the CircleCI config to properly cache Docker images.
- Updates our install scripts to properly build Docker images.
- Adds the new conversion module to the container image, so that it can
  be imported as a package.
- Adapts the container isolation provider to use the new way of calling
  the code.

NOTE: We have made zero changes to the conversion code in this commit,
except for necessary imports in order to factor out some common parts.
Any changes necessary for Qubes integration follow in the subsequent
commits.
2023-06-21 11:44:47 +03:00
Erik Moeller
8bdafce660
Appease linter 2023-04-24 11:50:58 +03:00
Alex Pyrgiotis
1ae7581df6
Use a different certificate for MacOS
Replace our reference to an Apple development certificate with a
Developer ID Application certificate. The former is not accepted during
the code notarization phase, whereas the latter is.
2023-04-24 11:50:58 +03:00
deeplow
592009d4d1
Fix build_app_bundle() (missing arguments) 2023-04-14 08:50:48 +01:00
deeplow
18557f88fc
Allow "create-dmg" to be in other places
If installed with homebrew, create-dmg will be installed at a different
location. It makes more sense to use the 'which' utility to find where
it is.
2023-04-14 08:48:07 +01:00
deeplow
21875714b8
Update apple development key ID 2023-04-14 08:48:05 +01:00
deeplow
1c0dfb45f5
Update Apple account to FPF's Developer ID 2023-04-10 10:41:03 +01:00
deeplow
3f23010394
Redo macOS build-app.py and add --codesign-only opt
Redoes the build-app.py script to add an option to sign only an already-
produced app bundle.
2023-04-10 10:40:01 +01:00
Alex Pyrgiotis
d768099912
Grab just the image ID
When building the image, grab the image id using `-q`, which removes all
the decorations in the output and just keeps the image ID.
2023-03-09 19:04:59 +02:00
Alex Pyrgiotis
a33dcfbb51
Replace First Look Media references
Update several references to First Look Media in the code, to better
reflect the current status, where Freedom of the Press Foundation has
taken over the stewardship of the project.

Fixes #343
2023-03-08 18:40:55 +02:00
Alex Pyrgiotis
4668443be6
install: Use the full image tag
Use the full image tag (dangerzone.rocks/dangerzone:latest) when
building the image. Else, we risk creating a `share/image-id.txt` file
with multiple IDs in it, if we have another
`dangerzone.rocks/dangerzone` image (with a different tag) in our dev
environment.
2023-03-08 17:40:26 +02:00
deeplow
9b3d98b20b
Build arm64 docker image for arm-based Macs
Remove --patform args completely so that by default we build natively
on each platform.

Partial fix for #50
2023-02-16 10:59:00 +00:00
Alex Pyrgiotis
4eead90c00
install: Fail early when image build fails 2023-01-16 18:48:09 +02:00
Alex Pyrgiotis
624d480cca
install: Do not create intermediate tarfile for container
Skip the creation of the `share/container.tar` file, since it's not used
anywhere. Instead, pipe our `docker/podman save` invocations to `gzip`
directly, which will compress the tarfile on the fly. This saves both
time and disk space.
2023-01-16 18:48:08 +02:00
Micah Lee
383bd5dbed
Enforce code style 2022-08-26 14:12:01 -07:00
Micah Lee
6713cce503
Updates to the macOS and Windows build scripts and documentation 2022-08-26 14:06:06 -07:00
deeplow
4d8e4c53e3
sort imports with isort linter 2022-08-22 10:15:26 +01:00
Micah Lee
433639d51f
Explicitly build linux/amd64 container 2021-11-29 15:51:18 -08:00
Micah Lee
2de2b6dca5
Rename dangerzone-converter to container 2021-11-29 15:30:21 -08:00
Micah Lee
edbd3aa88a
Set the path in macOS, so it can find /usr/local/bin/docker 2021-11-23 16:16:55 -08:00
Micah Lee
b3b52c3963
Rename build scripts 2021-11-23 15:47:25 -08:00
Micah Lee
9acfd2764e
Make the new code work in linux 2021-11-22 18:51:47 -05:00
Micah Lee
83759d1a33
Delete vm-builder folder, and make build-image.sh build the dangerzone image 2021-11-22 14:23:17 -08:00
Micah Lee
8248d58f21
Copy vpnkit from Docker Desktop instead of compiling on M1 Macs 2021-11-18 16:25:12 -08:00
Micah Lee
f1cbbdf43c
Start to support building for M1 chips, using Docker Desktop instead of vagrant 2021-11-18 15:53:00 -08:00
Micah Lee
47d6eb0d8b
Build vpnkit and hyperkit from source, remove Docker Desktop dependency to build, and add --allow-vm-login flag 2021-11-18 11:47:51 -08:00
Micah Lee
fd1dec7438
Move vm-builder up a dir, and start replacing Docker Desktop with building hyperkit and vpnkit manually 2021-11-17 13:41:45 -08:00
Micah Lee
1c39895206
Refactor how VM image is created to split it into different files, and write ssh-to-host.py script 2021-07-01 11:02:08 -07:00
Micah Lee
9158d02669
Successfully boot VM 2021-06-30 14:27:26 -07:00
Micah Lee
720810da5d
Enable the sandbox 2021-06-30 12:03:09 -07:00
Micah Lee
e8f7d96f90
Fix building VM ISO, and start implementing start_vm 2021-06-29 17:37:00 -07:00
Micah Lee
7b2211fc1f
Rename rip_docker to install/vm-builder, and start making a build script that uses it 2021-06-29 17:01:47 -07:00
Micah Lee
cf28d47ffc
Merge branch 'master' into 118_rip_docker_desktop 2021-06-29 16:52:25 -07:00
Micah Lee
f4739e749a
Start adding systray 2021-06-29 16:52:10 -07:00
Micah Lee
2d53acfe07
Make CLI symlink in macOS build 2021-06-16 14:29:46 -07:00
Micah Lee
ffb622c183
Fix codesigning 2020-12-30 14:17:03 -08:00
Micah Lee
d7e79385d2
Use python 3.9 for macOS, because of PyInstaller update, and make build_app.py executable 2020-12-28 15:27:35 -08:00
Micah Lee
ee215a4870
Update macOS instructions for installing python, and fix how DMG gets created 2020-10-29 15:54:12 -07:00
Micah Lee
0067f37494
Fix macOS build script, and install create-dmg from homebrew instead of npm 2020-10-29 14:16:04 -07:00
Micah Lee
b46ad704e4
When making macOS app bundle, make symlink with relative path instead of absolute 2020-03-16 17:26:18 -07:00
Micah Lee
1f7f29a456
Create dangerzone-container symlink when building the Mac app bundle 2020-03-16 15:11:26 -07:00
Micah Lee
8974afa2b5
Working on making pyinstaller work for Windows as well as Mac, sharing the same pyinstaller.spec 2020-02-12 16:50:21 -08:00
Micah Lee
fa524d78b6
Finish making macOS installer 2020-02-10 14:50:24 -08:00
Micah Lee
b6696dab52
Commit the pyinstaller.spec, including CFBundleDocumentTypes array to open all document formats 2020-01-13 14:16:21 -08:00
Micah Lee
e6752a9aec
Add dangerzone document icon 2020-01-13 14:10:02 -08:00
Micah Lee
810fa31a69
Start adding Mac app bundle packaging 2020-01-13 12:41:14 -08:00