Skip to content

Instantly share code, notes, and snippets.

@cfm
cfm / widgets.patch
Last active December 21, 2022 01:01
ReplyWidget state-tracing
--- a/securedrop_client/gui/widgets.py
+++ b/securedrop_client/gui/widgets.py
@@ -1852,6 +1852,7 @@ class SpeechBubble(QWidget):
signal matches the uuid of this speech bubble.
"""
if self.uuid == uuid:
+ logger.debug(uuid)
self.message.setText(text)
self.set_normal_styles()
@cfm
cfm / README.md
Created September 27, 2022 00:56
stress-test the SecureDrop submission flow with Locust for stress and profit
$ pip install faker locust  # Then go nuts:
$ locust --headless --users 10 --run-time 60s --host http://localhost:8080

Setup

$ docker build -f python3.7.Dockerfile -t sddp-350-py3.7 .
$ docker build -f python3.9.Dockerfile -t sddp-350-py3.9 .

Expected results

| Command | Python | Result

Gist file Target file
rc.local sys-net:/rw/config/rc.local
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="IE=edge">
<meta name="referrer" content="no-referrer" />
<meta name="generator" content="diffoscope" />
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAADdgAAA3YBfdWCzAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAM8SURBVFiF7dZdaJZlGAfw3/O+e9XNjy3XllZzWImBxIpifqTgsmUHBSIeBNFBdRh0UHQ0xGdb66CFBIERZEFRQRRUw0HkQkLMYQSBdpCFWdgSP6jpNn2393k68Nn2bj3vXtb6UOh/cl/39b/u67mem/913zf/4z9GUDw5xNI8n5WIzW9m/QF2YluJmI8203mALzEvLWAerRs4Pz6vSIkZSlsYk0/GkaB0zEgyDgWMlijyWsJuS2fkQwu8pqpMTA0ypeiShG71Bp0rU8Q+A47MWEDgvHZbZl/Av4SpIgxVYB3IqwZDmoUuYkzosDaNchpAoFqkSmgjGPWzLieF1k3JHVsjvCJQHBYaSy9g1E3m+QImQiK9SbNGqJDzuiDZ0lggQJCsyelDq8BB47sbCWTsnvhG3kqcLL833eqF4hk1EOoTOjZjnnaRdq2l6KtMAyl4/g23bKJrun+Mt9uOq7nvqOVbebWYy9Adc1fM/R/3CO780dONbIeFPHsPw+ULeM5ZHTbXHfUtXpxOZzgT5z02UGsZThRzF/ilht9G+fr4zfbfccIxXIa7uVTup69i7LJXaEEqF3on1d9ludB
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cfm
cfm / commentary.md
Last active April 27, 2022 19:43
[DRAFT] SecureDrop Client: grand unified state machine

[DRAFT] SecureDrop Client: grand unified state machine

Goal: To able to reason about the SecureDrop Client as a single application-level state machine, in which each global state is composed of (in order from left to right):

  1. an authentication state or state machine;
  2. a synchronization state or state machine; and
  3. a job-queue state or state machine.

Notes:

  • This diagram is both descriptive and prescriptive. It describes what I read the SecureDrop Client codebase and supporting specifications as wanting to do. It prescribes (or implies) some changes that might help realize those design intentions. (And, inevitably, it makes some assumptions that may no longer hold or serve us.)
  • Refer to the Mermaid state-diagram syntax if you have questions about how to read this diagram.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.