A Dahsboard for SaltStack's Job Cache
Project description
Salt Dash
Read-only web interface to read from Salt's external job cache using the pgjsonb
returner.
Running Locally
Install Yarn for building the front-end.
Install Pipenv for the back-end.
make all
pipenv shell
saltdash migrate
saltdash runserver
Client-side Development
Currently using parcel. To start a development environment with live reloading, run:
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
. 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:
- DEBUG
Enable debugging.
type:
bool
- SECRET_KEY REQUIRED
a long random string you keep secret https://docs.djangoproject.com/en/2.0/ref/settings/#secret-key
type:
str
- DATABASE_URL
type:
str
default:postgres://localhost:5432/salt
- ALLOWED_HOSTS
Hosts allowed to serve the site https://docs.djangoproject.com/en/2.0/ref/settings/#allowed-hosts
type:
list
default:['*']
- GITHUB_TEAM_ID
type:
str
- GITHUB_CLIENT_ID
type:
str
- GITHUB_CLIENT_SECRET
type:
str
- SENTRY_DSN
type:
str
- LISTEN
Socket for webserver to listen on.
type:
str
default:127.0.0.1:8077
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:
- Create a token at GitHub
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 for saltdash
0.9.1 (2018-05-14)
- Packaging fixes
0.9 (2018-05-14)
- Initial PyPI release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file saltdash-0.9.1.tar.gz
.
File metadata
- Download URL: saltdash-0.9.1.tar.gz
- Upload date:
- Size: 23.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0344a8c199564685198f2ad3d976093c10a78334828582b9fbef59feff40505d |
|
MD5 | ac9045dce1889355447e53b25c0296a1 |
|
BLAKE2b-256 | 40dbf5e0fdae89bd87a268189b6d688b670e625e1ce2e2d1870de8235bc61d89 |
Provenance
File details
Details for the file saltdash-0.9.1-py2.py3-none-any.whl
.
File metadata
- Download URL: saltdash-0.9.1-py2.py3-none-any.whl
- Upload date:
- Size: 30.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 160bd4dcb85d8b82b196d2e9624d5466e426dea9a519cd90cfafd967e5665fe0 |
|
MD5 | 1e4899fbea3d2262b3d4626d79349483 |
|
BLAKE2b-256 | debcb02ba0ce4c09d90bbe4384c98a281c4a576457e3317947a5cff678d0ab93 |