-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce updates on login via dom0 launcher app #396
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
836fe11
Adds securedrop-workstation launcher
emkll a48e620
Fix progress/status bar
emkll 3c29276
Reboot AppVMs after updating their associated TemplateVMs
emkll 06f429a
Write flags to sd-svs and dom0
emkll 6eaa3f7
Reboot if updates to dom0 or fedora template
emkll 2a6a4a0
Powercycle vms after update
emkll 290595d
Adds python tests for sdw-launcher Updater script
emkll 4c6b9a8
CI: Add launcher tests
emkll c3774be
Add more tests, coverage, add tempfile for tests that write files to …
emkll 3719190
Write update status flag to dom0
emkll 2356a92
Add test coverage
emkll 34aecda
Fix reboot logic
emkll fe1ab6b
Use generator to iterate through update checks/upgrades
emkll 4bab247
Only use tempfiles for testing for dom0, sd-svs paths are not required.
emkll b938816
Use --skip-if-running when starting VMs
emkll f2abeab
Re-use shutdown function instead of calling qvm-shutdown
emkll e0a21c6
Address review comments:
emkll e3b3a3a
UI fixes: Remove redundant text box, hide buttons in-place, resize wi…
emkll ce048c7
Update text
emkll 3d4ce23
Address review comments
emkll 8ede5f4
Bug/UI fixes:
emkll 2728e59
Edits mainly for brevity, formatting, punctuation tweaks
eloquence 91efa24
Rename VMs based on latest changes
emkll d9a8d1f
Bugfix: Require a reboot if previous reboot was not performed
emkll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Desktop Entry] | ||
Version=1.0 | ||
Type=Application | ||
Terminal=false | ||
Icon=/usr/share/securedrop/icons/sd-logo.png | ||
Name=SecureDrop Workstation Launcher | ||
Exec=/opt/securedrop/launcher/sdw-launcher.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.PHONY: update-pip-requirements | ||
update-pip-requirements: ## Updates all Python requirements files via pip-compile. | ||
pip-compile --allow-unsafe --generate-hashes --output-file=test-requirements.txt test-requirements.in | ||
|
||
.PHONY: bandit | ||
bandit: | ||
bandit -ll --exclude ./.venv/ -r . | ||
|
||
.PHONY: test | ||
test: | ||
pytest --cov-report term-missing --cov=sdw_updater_gui/ -v tests/ | ||
|
||
# Explanation of the below shell command should it ever break. | ||
# 1. Set the field separator to ": ##" to parse lines for make targets. | ||
# 2. Check for second field matching, skip otherwise. | ||
# 3. Print fields 1 and 2 with colorized output. | ||
# 4. Sort the list of make targets alphabetically | ||
# 5. Format columns with colon as delimiter. | ||
.PHONY: help | ||
help: ## Prints this message and exits | ||
@printf "Makefile for developing and testing SecureDrop Workstation.\n" | ||
@printf "Subcommands:\n\n" | ||
@perl -F':.*##\s+' -lanE '$$F[1] and say "\033[36m$$F[0]\033[0m : $$F[1]"' $(MAKEFILE_LIST) \ | ||
| sort \ | ||
| column -s ':' -t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env python3 | ||
from logging.handlers import TimedRotatingFileHandler | ||
from PyQt4 import QtGui | ||
from sdw_updater_gui.UpdaterApp import UpdaterApp | ||
import logging | ||
import os | ||
import sys | ||
|
||
DEFAULT_HOME = os.path.join(os.path.expanduser("~"), ".securedrop_launcher") | ||
logger = "" | ||
|
||
|
||
def main(): | ||
configure_logging() | ||
logger = logging.getLogger(__name__) | ||
logger.info("Starting SecureDrop Launcher") | ||
app = QtGui.QApplication(sys.argv) | ||
form = UpdaterApp() | ||
form.show() | ||
sys.exit(app.exec_()) | ||
|
||
|
||
def configure_logging(): | ||
""" | ||
All logging related settings are set up by this function. | ||
""" | ||
log_folder = os.path.join(DEFAULT_HOME, "logs") | ||
if not os.path.exists(log_folder): | ||
os.makedirs(log_folder) | ||
|
||
log_file = os.path.join(DEFAULT_HOME, "logs", "launcher.log") | ||
|
||
# set logging format | ||
log_fmt = ( | ||
"%(asctime)s - %(name)s:%(lineno)d(%(funcName)s) " "%(levelname)s: %(message)s" | ||
) | ||
formatter = logging.Formatter(log_fmt) | ||
|
||
handler = TimedRotatingFileHandler(log_file) | ||
handler.setFormatter(formatter) | ||
handler.setLevel(logging.INFO) | ||
|
||
# set up primary log | ||
log = logging.getLogger() | ||
log.setLevel(logging.INFO) | ||
log.addHandler(handler) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ninavizz and I would recommend changing this icon label simply to "SecureDrop". The preflight updater will or will not run in some situations (particularly if we get to #402), and from the user's standpoint, at this stage, they simply want to launch the SecureDrop app.