Commit graph

130 commits

Author SHA1 Message Date
Moon Sungjoon
fa22e96af7
Clean up HWP/HWPX MIME types
Use the MIME types actually used by the `file` command, which was
recently changed for the detection of the HWPX format [1].

application/hwp+zip -> application/x-hwp+zip

But the HWPX format includes a 'mimetype' file, which contains the
MIME type string "application/hwp+zip", so that was left so because
it may be possible to detect it as "application/hwp+zip".

[1]: ceef7ead3a
2023-08-01 14:35:28 +01:00
Moon Sungjoon
3e895adbab
Add hwp hwpx support
hwp/hwpx has several custom MIME types

.hwp:
 - application/x-hwp
 - application/haansofthwp
 - application/vnd.hancom.hwp

.hwpx:
 - application/haansofthwpx
 - application/vnd.hancom.hwpx,
 - application/hwp+zip

Fixes #243
2023-08-01 14:27:18 +01:00
Alex Pyrgiotis
5ae8b871b6
Add UpdaterThread class
Add a new Python module called "updater", which contains the logic for
prompting the user to enable updates, and checking our GitHub releases
for new updates.

This class has some light dependency to Qt functionality, since it needs
to:

* Show a prompt to the user,
* Run update checks asynchronously in a Qt thread,
* Provide the main window with the result of the update check

Refs #189
2023-07-24 14:22:27 +03:00
deeplow
206c262554
Bump python version on Windows to 3.11
Python 3.10.12 fixes some CVEs for which Dangerzone does not appear to be
affected, however its binaries are not made available by the python
foundation. Moving to 3.11 should be trivial since this was already
deployed in Fedora 37+.
2023-07-06 14:32:31 +01:00
deeplow
a1d40fde78
Create an RPM for Qubes
Allow creating an RPM package that is to be installed specifically on
Qubes. This package has the following extra properties from our regular
RPM packages:

1. Make `python3-magic`, `libreoffice` and `tesseract` requirements
   for installing Dangerzone, since the conversion takes place in a
   disposable qube that needs these packages.
2. Ignore the container.tar.gz file, if it exists.
3. Add our RPC calls under `/etc/qubes-rpc`
2023-06-21 11:46:43 +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
7fe01d6470
install/windows: Remove -rc identifiers from version
Remove any -rc identifiers (e.g., 0.4.1-rc3) from the Dangerzone
version, if it includes them. If we don't remove them, then building
the MSI for Windows will fail as follows:

    error CNDL0108: The Product/@Version attribute's value, '0.4.1-rc3',
    is not a valid version. Legal version values should look like
    'x.x.x.x' where x is an integer from 0 to 65534.
2023-04-03 19:35:19 +03: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
fb85421db8
Fix Windows build for PySide6 (illegal file names)
Building the `.msi` on Windows was failing in the `candle.exe` step due
to some files in the PySide6 library being too long (PySide6/examples)
or having illegal character (`+`) in their file names
(PySide6/qml/QtQuick).

Skipping copying these files to the `.msi` fixes the issue. Skipping
`examples/` should be of no impact since they're just examples and
skipping `qml/QtQuick` shouldn't cause issues because we don't use QML.

Reverts commit `bbbf822` and adapts it from PySide2 to PySide6.
2023-02-23 09:12:02 +00: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
Maeve Andrews
c26326450b
Add a --distro option to build-deb.py
Add an optional --distro argument to build-deb.py, to specify the Debian
version in the package name, which currently is "1". This option may
prove useful when publishing packages to freedomofpress/apt-tools-prod,
where packages from different distros with the same names but different
contents are not accepted.
2023-02-14 15:49:51 +02:00
deeplow
bbbf8224f1
install: Remove PySide2-related code for Windows 2023-01-30 11:42:24 +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
Alex Pyrgiotis
a0503c8c40
install: Do not create Debian source package twice 2023-01-16 18:48:08 +02:00
deeplow
5761255b56
Fix Python version in Windows build scripts
Windows python build scripts were still referencing the old python 3.9
version, whereas 3.10 is the currently used one in the dev environment.
2022-12-01 14:58:29 +00:00
Alex Pyrgiotis
1daaafe2a3
install: Introduce a script for installing Podman
Introduce a script for installing Podman in Ubuntu Focal, in
environments that may, or may not, have sudo installed.

Also, update our CircleCI configuration to use this script when
installing Podman.
2022-11-10 16:35:48 +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
Guthrie McAfee Armstrong
395eba0a74
Remove requests dependency 2022-08-19 15:16:14 +01:00
Micah Lee
0cf514eba7
Fix version path 2021-12-13 15:32:35 -08:00
Micah Lee
a710178d75
Add package scripts for windows 2021-12-13 15:25:41 -08:00
Micah Lee
bc8b9d62b4
Switch Windows package from pyinstaller to cx_freeze 2021-12-13 15:23:45 -08:00
Micah Lee
42f8fb9e2f
Rename the container in CircleCI 2021-11-29 16:04:20 -08: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
387a742487
Delete the .tar after compressing in Windows, and fix Windows installer 2021-11-24 16:38:15 -08:00
Micah Lee
65a66b78cd
Remove indent line, this function is deprecated 2021-11-24 12:36:18 -08:00
Micah Lee
61839f5b24
Change multistep windows build into one step 2021-11-24 12:21:38 -08:00
Micah Lee
4572922042
Update Windows code signing 2021-11-24 11:42:02 -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
7441796fbe
Support Windows 2021-11-23 15:39:23 -08:00
Micah Lee
9acfd2764e
Make the new code work in linux 2021-11-22 18:51:47 -05:00
Micah Lee
a54e19fe11
Get WaitingWidget to properly check for and install the image 2021-11-22 14:37:53 -08: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