Skip to main content

A Dahsboard for SaltStack's Job Cache

Project description

Salt Dash logo

tests PyPI Python Versions

Salt Dash

Read-only web interface to read from Salt's external job cache using the pgjsonb returner.

screenshot

Development

Pre-requisites

  • Yarn for building the front-end.
  • Pipenv for the back-end.
  • A Postgresql database

Installation

git clone git@github.com:lincolnloop/saltdash.git
cd saltdash
make all              # download dependencies and build the world
$EDITOR saltdash.yml  # change settings as needed
pipenv shell          # activate the Python virtual environment
saltdash migrate      # setup the database
saltdash runserver    # run a development server

Client-side

Uses parcel. To start a development environment with live reloading, run:

cd client
yarn run watch

Running in Production

pip install saltdash

saltdash runserver is not suitable for production. A production-level webserver is included and can be started with saltdash serve. If Docker is more your speed, there's a Dockerfile as 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 this and take appropriate actions.

Configuration

Configuration can be done via environment variables, a file, or a combination of both thanks to Goodconf. By default it will look for a YAML file named saltdash.yml in /etc/saltdash/ or the current directory. You can also specify a configuration file with the -C or --config flags. saltdash-generate-config can be used to generate a sample config file containing the following variables:

GitHub Team authentication is included by setting the relevant GITHUB_* variables.

You'll need to setup an OAuth App at https://github.com/organizations/<org>/settings/applications with a callback URL in the form: https://your-site.example.com/auth/complete/github-team/

To retrieve your team IDs:

  1. Create a token at GitHub
  2. curl -H "Authorization: token <token>" https://api.github.com/orgs/<org>/teams

Setting up Salt

Once you've setup a Postgresql database using saltdash 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 values
master_job_cache: pgjsonb
returner.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 your salt-master and all future jobs should get stored in the database.

If you have lots of jobs, you'll probably want to purge the cache periodically. A helper command is provided to do just that, run:

saltdash purge_job_cache [days_older_than_to_purge]

If you want to automate this, use the --no-input flag to bypass the confirmation prompt.

Attributions

Icon by BornSymbols used under CCBY license.

Changelog

0.9.4 (2018-05-15)

  • Fixes operation with systemd socket activation

0.9.3 (2018-05-15)

  • Adds proper SSL handling

0.9.2 (2018-05-15)

  • Fixes healthcheck middleware to avoid ALLOWED_HOSTS checking
  • Update dependencies
  • Documentation updates

0.9.1 (2018-05-14)

  • Packaging fixes

0.9 (2018-05-14)

  • Initial PyPI release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

saltdash-0.9.4.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

saltdash-0.9.4-py2.py3-none-any.whl (31.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file saltdash-0.9.4.tar.gz.

File metadata

  • Download URL: saltdash-0.9.4.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for saltdash-0.9.4.tar.gz
Algorithm Hash digest
SHA256 7974e65d13e415b14377fe80d6d8cbb0e7fc438c525ac54eec63b68b777202b6
MD5 86838ed41c315c117128a33eb0454c4c
BLAKE2b-256 17cfa4a5e01048a8d7603d86de6abe9c704f27fc16cd878aef5751d741d1c047

See more details on using hashes here.

Provenance

File details

Details for the file saltdash-0.9.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for saltdash-0.9.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ac2579410520883d13dc62ed7280016bc0a589b8688a2e5fbb3f95ae48c45c90
MD5 1a6a48a89c15afa55d21e00e0f02f440
BLAKE2b-256 93c67299334f8f0c129503ed51d129e5307661b35902c0b845e0914d6fa3f3f7

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page