-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run clean-salt as part of securedrop-admin uninstall action
- Loading branch information
Showing
3 changed files
with
30 additions
and
12 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
# Utility script to clean Saltstack config | ||
# files for the SecureDrop Workstation. | ||
set -e | ||
set -u | ||
set -o pipefail | ||
|
||
|
||
# Hardcoded location of SecureDrop Workstation salt config files | ||
SDW_SALT_DIR="/srv/salt/sd" | ||
SALT_DIR="/srv/salt" | ||
|
||
echo "Purging Salt config..." | ||
|
||
# If SDW Salt config dir already exists, delete all SecureDrop Workstation | ||
# related Salt files. In production scenarios, most of these will be provisioned | ||
# by the RPM package, but the top files and configs will not, so we should use a | ||
# common script to ensure all config is removed. | ||
|
||
if [[ ! -d "$SDW_SALT_DIR" ]]; then | ||
sudo rm -rf ${SDW_SALT_DIR} | ||
sudo rm -rf ${SALT_DIR}/launcher | ||
sudo find ${SALT_DIR} -maxdepth 1 -type f -iname 'fpf*' -delete | ||
sudo find ${SALT_DIR} -maxdepth 1 -type f -iname 'sd*' -delete | ||
sudo find ${SALT_DIR} -maxdepth 1 -type f -iname 'securedrop*' -delete | ||
sudo find ${SALT_DIR}/_tops -lname '/srv/salt/sd-*' -delete | ||
fi |
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