Skip to content

Commit 0c84f28

Browse files
authored
Merge pull request #1520 from freedomofpress/make-run-app
Add `make run-app`
2 parents 3ede5d2 + a5cb68d commit 0c84f28

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ test-gpg: test-prereqs ## Runs tests for SD GPG functionality
143143
# Client autologin variables
144144
XDOTOOL_PATH=$(shell command -v xdotool)
145145
OATHTOOL_PATH=$(shell command -v oathtool)
146-
PHONY: run-client
147-
run-client: assert-dom0 ## Run client application (automatic login)
146+
.PHONY: run-deps
147+
run-deps:
148148
ifeq ($(XDOTOOL_PATH),)
149149
@echo $(XDOTOOL_PATH)
150150
@echo 'please install xdotool with "sudo qubes-dom0-update xdotool"'
@@ -154,6 +154,9 @@ ifeq ($(OATHTOOL_PATH),)
154154
@echo 'please install oathtool with "sudo qubes-dom0-update oathtool"'
155155
@false
156156
endif
157+
158+
PHONY: run-client
159+
run-client: assert-dom0 run-deps ## Run client application (automatic login)
157160
qvm-run --service sd-app qubes.StartApp+press.freedom.SecureDropClient
158161
@sleep 3
159162
@xdotool type "journalist"
@@ -164,6 +167,17 @@ endif
164167
@xdotool type $(shell oathtool --totp --base32 JHCOGO7VCER3EJ4L)
165168
@xdotool key Return
166169

170+
PHONY: run-app
171+
run-app: assert-dom0 run-deps ## Run SecureDrop App (automatic login)
172+
qvm-run --service sd-app qubes.StartApp+press.freedom.SecureDropApp
173+
@sleep 5
174+
@xdotool type "journalist"
175+
@xdotool key Tab
176+
@xdotool type "correct horse battery staple profanity oil chewy"
177+
@xdotool key Tab
178+
@xdotool type $(shell oathtool --totp --base32 JHCOGO7VCER3EJ4L)
179+
@xdotool key Return
180+
167181
# Not requiring dom0 for linting as that requires extra packages, which we're
168182
# not installing on dom0, so are only in the developer environment, i.e. Work VM
169183

scripts/try-client-pr.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ def main():
163163
).splitlines()
164164
subprocess.check_call(["qvm-shutdown", "--wait"] + all_vms)
165165
print(f"\n\nYour workstation is provisioned with PR #{args.pr_id}.")
166-
print("\n\nYou can start the client with `make run-client`.")
166+
target = "app" if args.app else "client"
167+
print(f"\n\nYou can start the {target} with `make run-{target}`.")
167168

168169

169170
if __name__ == "__main__":

0 commit comments

Comments
 (0)