Package: saltdash
Salt DashRead-only web interface to read from Salt'sexternal job cacheusing thepgjsonbreturner.DevelopmentPre-requisitesNode.js for building the front-end.Pipenvfor the back-end.A Postgresql databaseInstallationgitclonegit@github.com:lincolnloop/saltdash.gitcdsaltdash
makeall# download dependencies and build the world$EDITORsaltdash.yml# change settings as neededpipenvshell# activate the Python virtual environmentsaltdashmigrate# setup the databasesaltdashrunserver# run a development serverClient-sideUsesparcel. To start a development environment with live reloading, run:cdclient
yarnrunwatchRunning in Productionpipinstallsaltdashsaltdash runserveris not suitable for production. A production-level
webserver is included and can be started withsaltdash serve. If Docker is
more your speed, there's aDockerfileas well.⚠️ The built-in webserver does not handle HTTPS. The default settings assume the
app is deployed behind a proxy which is terminating HTTPS connections and
properly handling headers. If this is not the case,you should read thisand take appropriate actions.ConfigurationConfiguration can be done via environment variables, a file, or a combination
of both thanks toGoodconf. By default
it will look for a YAML file namedsaltdash.ymlin/etc/saltdash/or the current
directory. You can also specify a configuration file with the-Cor--configflags.saltdash-generate-configcan be used to generate a sample config file
containing the following variables:DEBUGEnable debugging.type:boolSECRET_KEYREQUIREDa long random string you keep secrethttps://docs.djangoproject.com/en/2.2/ref/settings/#secret-keytype:strDATABASE_URLtype:strdefault:postgres://localhost:5432/saltALLOWED_HOSTSHosts allowed to serve the sitehttps://docs.djangoproject.com/en/2.2/ref/settings/#allowed-hoststype:listdefault:['*']HIDE_OUTPUTList of modules to hide the output from in the web interface.type:listdefault:['pillar.*']GITHUB_TEAM_IDtype:strGITHUB_CLIENT_IDtype:strGITHUB_CLIENT_SECRETtype:strSENTRY_DSNtype:strLISTENSocket for webserver to listen on.type:strdefault:127.0.0.1:8077GitHub Team authentication is included by setting the relevantGITHUB_*variables.You'll need to setup an OAuth App athttps://github.com/organizations/<org>/settings/applicationswith a callback URL in the form:https://your-site.example.com/auth/complete/github-team/To retrieve your team IDs:Createa token at GitHubcurl -H "Authorization: token <token>" https://api.github.com/orgs/<org>/teamsSetting up SaltOnce you've setup a Postgresql database usingsaltdash migrate, connect Salt's external job cache to the database by adding the following lines to/etc/salt/master.d/job_cache.conf:# Replace items in brackets with actual valuesmaster_job_cache:pgjsonbreturner.pgjsonb.host:[db-host]returner.pgjsonb.pass:[db-password]returner.pgjsonb.db:[db-database-name]returner.pgjsonb.port:[db-port]returner.pgjsonb.user:[db-user]Restart yoursalt-masterand all future jobs should get stored in the database.If you havelotsof jobs, you'll probably want to purge the cache periodically. A helper command is provided to do just that, run:saltdashpurge_job_cache[days_older_than_to_purge]If you want to automate this, use the--no-inputflag to bypass the confirmation prompt.Protecting SecretsIt is very easy to accidentally expose secrets in Salt via the logs and/or
console output. The same applies for Saltdash. Since secrets are often stored
in encrypted pillar data, by default the output from anypillar.*calls is
hidden via theHIDE_OUTPUTsetting. If you have additional modules you know
expose secret data, they should be added to the list.There are many other ways secrets can leak, however. A few general tips (which
are good practice whether you use Saltdash or not).Setshow_changes: falseon anyfile.*actions which deal with sensitive data.Sethide_output: trueon anycmd.*state which may output sensitive data.When working with files, use templates orpillar_contentswhen appropriate.Avoid passing secrets as arguments to modules or states. Typically Salt can
read them from a pillar or config instead.AttributionsIcon byBornSymbolsused underCCBYlicense.Changelog0.9.9 (2020-05-06)Fix healthchecks after Django upgrade0.9.8 (2020-05-05)Fix PyPI packaging0.9.7 (2020-05-05)Upgrade dependenciesRemove yarn in favor of npmFix issue in result format with recent Salt version0.9.6 (2019-04-17)Dependency updates0.9.5 (2018-05-24)AddsHIDE_OUTPUTconfig to prevent showing secrets in web interface0.9.4 (2018-05-15)Fixes operation with systemd socket activation0.9.3 (2018-05-15)Adds proper SSL handling0.9.2 (2018-05-15)Fixes healthcheck middleware to avoidALLOWED_HOSTScheckingUpdate dependenciesDocumentation updates0.9.1 (2018-05-14)Packaging fixes0.9 (2018-05-14)Initial PyPI release