Skip to content

Commit

Permalink
Merge pull request #149 from freedomofpress/127-fix-feedback-on-sd-jo…
Browse files Browse the repository at this point in the history
…urnalist

Fixes GUI feedback in sd-journalist
  • Loading branch information
redshiftzero authored Sep 14, 2018
2 parents 956a351 + 50c2d10 commit 21baa3a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
11 changes: 8 additions & 3 deletions dom0/sd-journalist.sls
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,14 @@ require:
- group: root
- mode: 644

# Temporary workaround to bootstrap Salt support on target.
qvm-run -a whonix-ws-14 "sudo apt-get install -qq python-futures":
cmd.run
# Temporary workarounds for sd-journalist:
#
# * python-futures required bootstrap Salt support
# * python-qt4 required for sd-process-feedback GUI integration
#
install python-qt4 and python-futures:
cmd.run:
- name: qvm-run -a whonix-ws-14 'sudo apt-get update && sudo apt-get install -qq python-futures python-qt4'

# When our Qubes bug is fixed, this will *not* be used
sd-journalist-dom0-qubes.OpenInVM:
Expand Down
2 changes: 1 addition & 1 deletion sd-decrypt/decrypt-sd-submission
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def send_progress(msg):
"sd-process.Feedback"],
close_fds=True,
stdin=subprocess.PIPE)
p.communicate(msg)
p.communicate(bytes(msg.encode('utf-8')))


input = sys.argv[1]
Expand Down
4 changes: 2 additions & 2 deletions sd-journalist/sd-process-download
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ wait_for_sigfile(sigfile)
if os.path.isfile(fn) is False:
c = subprocess.Popen(["/usr/local/bin/sd-process-feedback"],
stdin=subprocess.PIPE)
c.communicate('DOWNLOAD_FILE_MISSING\n')
c.communicate(bytes("DOWNLOAD_FILE_MISSING\n".encode('utf-8')))
sys.exit()

fh = tempfile.NamedTemporaryFile(suffix=".sd-xfer", delete=False)
Expand All @@ -81,7 +81,7 @@ fh.close()
# from the same machine? This can only happen on sd-journalist.
c = subprocess.Popen(["/usr/local/bin/sd-process-feedback"],
stdin=subprocess.PIPE)
c.communicate(input="DOWNLOAD_BUNDLE_CREATED\n")
c.communicate(bytes("DOWNLOAD_BUNDLE_CREATED\n".encode('utf-8')))

# ship this to the next phase
subprocess.call(["qvm-open-in-vm", "sd-decrypt", fh.name])
Expand Down
2 changes: 1 addition & 1 deletion sd-journalist/sd-process-feedback
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import posix
import sys
import os

arg = sys.stdin.readline()
arg = sys.stdin.readline().encode('utf-8')

try:
fifo = os.open('/home/user/sdfifo', posix.O_WRONLY | posix.O_NONBLOCK)
Expand Down
2 changes: 1 addition & 1 deletion sd-svs/accept-sd-xfer-extracted
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def send_progress(msg):
"sd-process.Feedback"],
close_fds=True,
stdin=subprocess.PIPE)
p.communicate(msg)
p.communicate(bytes(msg.encode('utf-8')))


send_progress("DECRYPTED_BUNDLE_ON_SVS")
Expand Down

0 comments on commit 21baa3a

Please sign in to comment.