Skip to main content

A Dahsboard for SaltStack's Job Cache

Project description

![Salt Dash logo](https://cldup.com/pjjyyptW69.png)

# Salt Dash

Read-only web interface to read from Salt’s [external job cache](https://docs.saltstack.com/en/latest/topics/jobs/external_cache.html) using the [pgjsonb](https://docs.saltstack.com/en/latest/ref/returners/all/salt.returners.pgjsonb.html) returner.

![screenshot](https://cldup.com/8TTHBPfhyu.png)

## Running Locally

Install [Yarn](https://yarnpkg.com/lang/en/docs/install/) for building the front-end.

Install [Pipenv](https://docs.pipenv.org/) for the back-end.

`bash make all pipenv shell saltdash migrate saltdash runserver `

## Client-side Development

Currently using [parcel](https://parceljs.org/). To start a development environment with live reloading, run:

`bash cd client yarn run watch `

## Running in Production

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.

### Configuration

Configuration can be done via environment variables, a file, or a combination of both thanks to [Goodconf](https://pypi.org/project/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](https://github.com/settings/tokens)

  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:

`ini # 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:

`bash 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](https://thenounproject.com/term/salt/705369) used under CCBY license.

# Changelog for saltdash

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.tar.gz (22.5 kB view hashes)

Uploaded Source

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