mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Merge pull request #73 from firstlookmedia/72_ubuntu-18.04
Add support for ubuntu 18.04
This commit is contained in:
commit
34f3bd4adf
8 changed files with 71 additions and 17 deletions
|
@ -2,6 +2,54 @@ version: 2.1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
build-ubuntu-bionic:
|
||||||
|
docker:
|
||||||
|
- image: ubuntu:18.04
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Install dependencies
|
||||||
|
command: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y git ssh ruby-dev rubygems python-all dh-python python3-stdeb docker.io python3 python3-pyqt5 python3-appdirs python3-click python3-xdg
|
||||||
|
gem install --no-ri --no-rdoc rake
|
||||||
|
gem install --no-ri --no-rdoc package_cloud
|
||||||
|
- checkout
|
||||||
|
- run:
|
||||||
|
name: Create the .deb package
|
||||||
|
command: |
|
||||||
|
./install/linux/build_deb.py
|
||||||
|
dpkg -i deb_dist/dangerzone_*-1_all.deb
|
||||||
|
- run:
|
||||||
|
name: Deploy to packagecloud.io
|
||||||
|
command: |
|
||||||
|
VERSION=$(cat dangerzone/__init__.py |grep "dangerzone_version = " |cut -d '"' -f2)
|
||||||
|
package_cloud push firstlookmedia/code/ubuntu/bionic deb_dist/dangerzone_${VERSION}-1_all.deb
|
||||||
|
package_cloud push firstlookmedia/code/ubuntu/bionic deb_dist/dangerzone_${VERSION}-1.dsc
|
||||||
|
|
||||||
|
build-ubuntu-cosmic:
|
||||||
|
docker:
|
||||||
|
- image: ubuntu:18.10
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Install dependencies
|
||||||
|
command: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y git ssh ruby-dev rubygems python-all dh-python python3-stdeb docker.io python3 python3-pyqt5 python3-appdirs python3-click python3-xdg
|
||||||
|
gem install --no-ri --no-rdoc rake
|
||||||
|
gem install --no-ri --no-rdoc package_cloud
|
||||||
|
- checkout
|
||||||
|
- run:
|
||||||
|
name: Create the .deb package
|
||||||
|
command: |
|
||||||
|
./install/linux/build_deb.py
|
||||||
|
dpkg -i deb_dist/dangerzone_*-1_all.deb
|
||||||
|
- run:
|
||||||
|
name: Deploy to packagecloud.io
|
||||||
|
command: |
|
||||||
|
VERSION=$(cat dangerzone/__init__.py |grep "dangerzone_version = " |cut -d '"' -f2)
|
||||||
|
package_cloud push firstlookmedia/code/ubuntu/cosmic deb_dist/dangerzone_${VERSION}-1_all.deb
|
||||||
|
package_cloud push firstlookmedia/code/ubuntu/cosmic deb_dist/dangerzone_${VERSION}-1.dsc
|
||||||
|
|
||||||
build-ubuntu-disco:
|
build-ubuntu-disco:
|
||||||
docker:
|
docker:
|
||||||
- image: ubuntu:19.04
|
- image: ubuntu:19.04
|
||||||
|
@ -146,6 +194,18 @@ workflows:
|
||||||
version: 2
|
version: 2
|
||||||
build-tags:
|
build-tags:
|
||||||
jobs:
|
jobs:
|
||||||
|
- build-ubuntu-bionic:
|
||||||
|
filters:
|
||||||
|
tags:
|
||||||
|
only: /^v.*/
|
||||||
|
branches:
|
||||||
|
ignore: /.*/
|
||||||
|
- build-ubuntu-cosmic:
|
||||||
|
filters:
|
||||||
|
tags:
|
||||||
|
only: /^v.*/
|
||||||
|
branches:
|
||||||
|
ignore: /.*/
|
||||||
- build-ubuntu-disco:
|
- build-ubuntu-disco:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
|
|
|
@ -52,7 +52,7 @@ def container_main():
|
||||||
|
|
||||||
@container_main.command()
|
@container_main.command()
|
||||||
@click.option("--container-name", default="flmcode/dangerzone")
|
@click.option("--container-name", default="flmcode/dangerzone")
|
||||||
def image_ls(container_name):
|
def ls(container_name):
|
||||||
"""docker image ls [container_name]"""
|
"""docker image ls [container_name]"""
|
||||||
sys.exit(exec_container(["image", "ls", container_name]))
|
sys.exit(exec_container(["image", "ls", container_name]))
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ def pull():
|
||||||
@click.option("--document-filename", required=True)
|
@click.option("--document-filename", required=True)
|
||||||
@click.option("--pixel-dir", required=True)
|
@click.option("--pixel-dir", required=True)
|
||||||
@click.option("--container-name", default="flmcode/dangerzone")
|
@click.option("--container-name", default="flmcode/dangerzone")
|
||||||
def document_to_pixels(document_filename, pixel_dir, container_name):
|
def documenttopixels(document_filename, pixel_dir, container_name):
|
||||||
"""docker run --network none -v [document_filename]:/tmp/input_file -v [pixel_dir]:/dangerzone [container_name] document-to-pixels"""
|
"""docker run --network none -v [document_filename]:/tmp/input_file -v [pixel_dir]:/dangerzone [container_name] document-to-pixels"""
|
||||||
sys.exit(
|
sys.exit(
|
||||||
exec_container(
|
exec_container(
|
||||||
|
@ -92,7 +92,7 @@ def document_to_pixels(document_filename, pixel_dir, container_name):
|
||||||
@click.option("--container-name", default="flmcode/dangerzone")
|
@click.option("--container-name", default="flmcode/dangerzone")
|
||||||
@click.option("--ocr", required=True)
|
@click.option("--ocr", required=True)
|
||||||
@click.option("--ocr-lang", required=True)
|
@click.option("--ocr-lang", required=True)
|
||||||
def pixels_to_pdf(pixel_dir, safe_dir, container_name, ocr, ocr_lang):
|
def pixelstopdf(pixel_dir, safe_dir, container_name, ocr, ocr_lang):
|
||||||
"""docker run --network none -v [pixel_dir]:/dangerzone -v [safe_dir]:/safezone [container_name] -e OCR=[ocr] -e OCR_LANGUAGE=[ocr_lang] pixels-to-pdf"""
|
"""docker run --network none -v [pixel_dir]:/dangerzone -v [safe_dir]:/safezone [container_name] -e OCR=[ocr] -e OCR_LANGUAGE=[ocr_lang] pixels-to-pdf"""
|
||||||
sys.exit(
|
sys.exit(
|
||||||
exec_container(
|
exec_container(
|
||||||
|
|
|
@ -33,7 +33,7 @@ def is_docker_installed(global_common):
|
||||||
|
|
||||||
def is_docker_ready(global_common):
|
def is_docker_ready(global_common):
|
||||||
# Run `docker image ls` without an error
|
# Run `docker image ls` without an error
|
||||||
with global_common.exec_dangerzone_container(["image-ls"]) as p:
|
with global_common.exec_dangerzone_container(["ls"]) as p:
|
||||||
p.communicate()
|
p.communicate()
|
||||||
|
|
||||||
# The user canceled, or permission denied
|
# The user canceled, or permission denied
|
||||||
|
|
|
@ -52,9 +52,7 @@ def gui_main(custom_container, filename):
|
||||||
|
|
||||||
if custom_container:
|
if custom_container:
|
||||||
# Do we have this container?
|
# Do we have this container?
|
||||||
with global_common.exec_dangerzone_container(
|
with global_common.exec_dangerzone_container(["ls", custom_container]) as p:
|
||||||
["image-ls", "--container-name", custom_container]
|
|
||||||
) as p:
|
|
||||||
stdout_data, stderr_data = p.communicate()
|
stdout_data, stderr_data = p.communicate()
|
||||||
|
|
||||||
# The user canceled, or permission denied
|
# The user canceled, or permission denied
|
||||||
|
|
|
@ -143,11 +143,7 @@ class SettingsWidget(QtWidgets.QWidget):
|
||||||
self.update_checkbox.hide()
|
self.update_checkbox.hide()
|
||||||
else:
|
else:
|
||||||
with self.global_common.exec_dangerzone_container(
|
with self.global_common.exec_dangerzone_container(
|
||||||
[
|
["ls", self.global_common.get_container_name(),]
|
||||||
"image-ls",
|
|
||||||
"--container-name",
|
|
||||||
self.global_common.get_container_name(),
|
|
||||||
]
|
|
||||||
) as p:
|
) as p:
|
||||||
stdout_data, stderror_data = p.communicate()
|
stdout_data, stderror_data = p.communicate()
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ class ConvertToPixels(TaskBase):
|
||||||
def run(self):
|
def run(self):
|
||||||
self.update_label.emit("Converting document to pixels")
|
self.update_label.emit("Converting document to pixels")
|
||||||
args = [
|
args = [
|
||||||
"document-to-pixels",
|
"documenttopixels",
|
||||||
"--document-filename",
|
"--document-filename",
|
||||||
self.common.document_filename,
|
self.common.document_filename,
|
||||||
"--pixel-dir",
|
"--pixel-dir",
|
||||||
|
@ -173,7 +173,7 @@ class ConvertToPDF(TaskBase):
|
||||||
]
|
]
|
||||||
|
|
||||||
args = [
|
args = [
|
||||||
"pixels-to-pdf",
|
"pixelstopdf",
|
||||||
"--pixel-dir",
|
"--pixel-dir",
|
||||||
self.common.pixel_dir.name,
|
self.common.pixel_dir.name,
|
||||||
"--safe-dir",
|
"--safe-dir",
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
/usr/bin/systemctl restart docker.service
|
/bin/systemctl restart docker.service
|
||||||
/usr/bin/systemctl enable docker.service
|
/bin/systemctl enable docker.service
|
|
@ -3,4 +3,4 @@ Package3: dangerzone
|
||||||
Depends3: docker.io | docker-ce, python3, python3-pyqt5, python3-appdirs, python3-click, python3-xdg, python3-requests
|
Depends3: docker.io | docker-ce, python3, python3-pyqt5, python3-appdirs, python3-click, python3-xdg, python3-requests
|
||||||
Build-Depends: python3, python3-all
|
Build-Depends: python3, python3-all
|
||||||
Suite: bionic
|
Suite: bionic
|
||||||
X-Python3-Version: >= 3.7
|
X-Python3-Version: >= 3.6
|
Loading…
Reference in a new issue