Development of Securedrop-Admin in the Admin Directory
admin directory in the SecureDrop repository root contains the
source of the
securedrop-admin script which is used in Tails to perform
various administrative tasks. It is a standalone python module which can be
tested on Debian GNU/Linux stretch with:
python3 bootstrap.py source .venv3/bin/activate pip3 install --no-deps --require-hashes -r requirements-dev.txt tox
A Docker helper
bin/dev-shell is provided to simplify the installation
and make it portable on various operating systems. From the
bin/dev-shell without any arguments to execute
other commands interactively in the container. If this is your first time
bin/dev-shell, it may take several minutes to build the image.
The SecureDrop repository contains two scripts named
admin/bin/dev-shell is used for
securedrop/bin/dev-shell is used for the server environment.
Run only flake8 with:
bin/dev-shell tox -e flake8
Run only one test foobar with:
bin/dev-shell tox -e py3 -- -k foobar
Docker has the admin directory mounted from the host into the container, at the same location to avoid any trouble with hardcoded absolute paths. It runs with the id of the host user so files created in the container are owned by the host user instead of root. If a script needs root access, it has passwordless sudo permissions.
Makefile targets are also provided for the most common
$ make Makefile for developing and testing securedrop-admin. Subcommands: help Print this message and exit. test Run tox update-pip-requirements Updates all Python requirements files via pip-compile.