Commit graph

26 commits

Author SHA1 Message Date
deeplow
d7be28ec2a
Remove openjdk-8 as a dependency.
default-jre and java dependencies dependencies had been added initially
[1] because of libreoffice-java-common, which is no longer present.
Then, when the image was changed from ubuntu to alpine [2], default-jre
was replaced with openjdk-8.

If java is still a dependency for libreoffice, then it should be pulled
automatically.

[1] 9ecdb9e995
[2] 650ae6eee1
2023-01-23 14:13:48 +00:00
deeplow
272d25aee0
Make pdf to ppm conversion dependent on num pages 2023-01-23 14:01:32 +00:00
deeplow
d28aa5a25b
Remove PDFtk dependency (replace w/ pdftoppm)
PDFtk actually isn't needed. It was being used for breaking a PDF
into pages but this is something that be replaced by the already present
'pdftoppm'. Furthermore, by removing this dependency we contribute to
reproducible builds and overall supply chain security because it was
obtained from gitlab with no signature verification or version pinning.

The replacement 'pdftoppm' enabled us to do a shortcut:
 - before: PDF -> PDF pages -> PNG images -> RGB images
 - after:  PDF -> PPM images -> RGB images

And this last conversion step is trivial since the RGB format we were
using is just a PPM file without the metadata in its header.
2023-01-23 14:00:57 +00:00
deeplow
642d86899b
Fix timeout message: replace pdfseparate with pdftk 2022-12-01 14:51:52 +00:00
Alex Pyrgiotis
57fdf06f0f
Bump global timeout to two minutes
Bump the global timeout used for various steps from 1 minute to 2
minutes. The reason is that we've seen several reports of operations
failing due to timeout reasons, that were otherwise legitimately
running.

Also, bump the timeout used for compression, which has been reported as
problematic as well.

Refs #146
Refs #149
2022-11-23 18:13:41 +02:00
Guthrie McAfee Armstrong
2085405d05
Remove redundant f-strings 2022-11-10 09:59:09 +00:00
deeplow
968fd20ac7
fix comma typo 2022-11-10 09:59:08 +00:00
deeplow
e4ff9801ee
make lint happy 2022-11-10 09:59:05 +00:00
Guthrie McAfee Armstrong
1bd8354228
simplify setting percentage to 0.0 2022-11-10 09:59:04 +00:00
Guthrie McAfee Armstrong
9989ffea37
catch ValueError, simplify try/except on top-level job runs
See https://github.com/freedomofpress/dangerzone/pull/167#discussion_r915757189
2022-11-10 09:59:02 +00:00
Guthrie McAfee Armstrong
6b44db9043
Update container/dangerzone.py
Co-authored-by: deeplow <47065258+deeplow@users.noreply.github.com>
2022-11-10 09:59:01 +00:00
Guthrie McAfee Armstrong
3ef8b183e2
Update container/dangerzone.py
Co-authored-by: deeplow <47065258+deeplow@users.noreply.github.com>
2022-11-10 09:58:59 +00:00
Guthrie McAfee Armstrong
2533eac4be
Rename ConversionJob back to DangerzoneConverter
Co-authored-by: deeplow <47065258+deeplow@users.noreply.github.com>
2022-11-10 09:58:57 +00:00
Guthrie McAfee Armstrong
5a4bf99211
Remove another "END OF FOR LOOP" comment 2022-11-10 09:58:54 +00:00
Guthrie McAfee Armstrong
c18f170caf
Remove "END OF FOR LOOP" comment
Co-authored-by: deeplow <47065258+deeplow@users.noreply.github.com>
2022-11-10 09:58:53 +00:00
Guthrie McAfee Armstrong
17939cb70c
Wrap dangerzone.py back into a class to keep track of percentage 2022-11-10 09:58:51 +00:00
Guthrie McAfee Armstrong
eaa08c9c3d
refactor dangerzone.py, raise exceptions instead of returning int
Standardize calls to subprocess.run to shrink file by about 100 lines
2022-11-10 09:58:50 +00:00
Guthrie McAfee Armstrong
7a84b89410
(container functions): Replace int return codes with raised exceptions 2022-11-10 09:58:48 +00:00
Guthrie McAfee Armstrong
c78b1ea71b
Flatten DangerzoneConverter methods into functions 2022-11-10 09:58:45 +00:00
deeplow
092456434b
don't type check dev scripts 2022-08-22 12:28:48 +01:00
deeplow
23e30ae40a
check that OCR_LANGUAGE has also been set 2022-08-22 12:28:46 +01:00
deeplow
463ff97b97
add type hints to container dz py code 2022-08-22 12:28:44 +01:00
deeplow
4d8e4c53e3
sort imports with isort linter 2022-08-22 10:15:26 +01:00
deeplow
21a9a6c98c
running dangerzone without root in container
There was previously a user created in the container but it was not
used via the dockerfile RUN directive (as pointed out by
gmarmstrong[1]).

Fixes #169

[1]: https://github.com/freedomofpress/dangerzone/issues/169#issue-1268399245
2022-08-22 08:43:58 +01:00
Micah Lee
8052220034
Get rid of wrapper scripts in the container 2021-11-29 15:39:24 -08:00
Micah Lee
2de2b6dca5
Rename dangerzone-converter to container 2021-11-29 15:30:21 -08:00