A new open source web interface for managing a SaltStack server. Built using vanilla ES6 and implemented as a wrapper around the rest_cherrypy server.
- Login via PAM or any other supported authentication by Salt
- View minions and easily copy IPs
- Run state.highstate for a particular minion
- View the seven most recent jobs run on Salt
- Manually run any Salt function and see the output
- View the values for grains for a particular minion
- View the schedules for a particular minion
- View the values for pillars for a particular minion
- View the beacons for a particular minion
- Install
salt-api
- this is available in the Salt PPA package which should already been installed if you're using Salt - Open the master config /etc/salt/master
- Find
external_auth
and configure as following (see the note below!):
external_auth:
pam:
saltuser:
- .*
- '@runner'
- '@wheel'
- '@jobs'
- See
docs/PERMISSIONS.md
for more restricted security configurations. saltuser
is a unix (PAM) user, make sure it exists or create a new one.- At the bottom of this file, also setup the rest_cherrypi server:
rest_cherrypy:
port: 3333
host: 0.0.0.0
disable_ssl: true
app: /srv/saltgui/index.html
static: /srv/saltgui/static
static_path: /static
- Replace
/srv/saltgui
in the above config with the directory containing the saltgui html/js source files. - Restart everything with
pkill salt-master && pkill salt-api && salt-master -d && salt-api -d
- You should be good to go. If you have any problems, open a GitHub issue. As always, SSL is recommended wherever possible but setup is beyond the scope of this guide.
Note: With this configuration, the saltuser
user has access to all salt modules available, maybe this is not what you want
Please read the Permissions page for more information.
SaltGUI supports the following authentication methods supported by salt:
- pam
- file
- ldap
- mysql
- yubico
See the EAUTH documentation and the Salt auth source code for more information.
SaltGUI supports entry of commands using the "command-box". Click on >_
in the top right corner to open it.
Enter salt-run
commands with the prefix runners.
. e.g. runners.jobs.last_run
. The target field can remain empty in that case as it is not used.
Enter salt-call
commands with the prefix wheel.
. e.g. wheel.key.finger
. The target field will be added as named parameter target
. But note that that parameter may not actually be used depending on the command.
Enter regular commands without special prefix. e.g. test.ping
. The command is sent to the minions specified in the target field.
Commands can be run normally, in which case the command runs to completion and shows the results. Alternatively, it can be started asynchronously, in which case only a small conformation is shown. Batch commands are not supported.
SaltGUI shows the data that is returned by the Salt API.
Some variation can be achieved by modifying salt master configuration file /etc/salt/master
.
e.g. (the default)
saltgui_output_formats: doc,saltguihighstate,json
doc
allows reformatting of documentation output into more readable format. Also implies that only the result from one minion is used.
saltguihighstate
allows reformatting of highstate data in a sorted and more readable format.
json
, yaml
and nested
specify how all other output should be formatted. Only the first available of these formats is used.
The time formats used by Salt are very detailed and by default have 6 decimal digits to specify as accurate as nano-seconds. For most uses that is not needed. The fraction can be truncated to less digits by modifying salt master configuration file /etc/salt/master
.
e.g.
saltgui_datetime_fraction_digits: 3
The value must be a number from 0 to 6. Note that the effect is achieved by string truncation only. This is equivalent to always rounding downwards.
SaltGUI supports command templates for easier command entry into the command-box.
The menu item for that becomes visible there when you define one or more templates
in salt master configuration file /etc/salt/master
.
The field targettype
supports the values glob
, list
, compound
and nodegroup
.
Entries will be sorted in the GUI based on their key.
You can leave out any detail field.
e.g.:
saltgui_templates:
template1:
description: First template
target: "*"
command: test.fib num=10
template2:
description: Second template
targettype: glob
target: dev*
command: test.version
SaltGUI shows a maximum of 7 jobs in on the right-hand-side of the screen. SaltGUI shows a maximum of 50 jobs on the dedicated jobs page. Commands that are used internally in SaltGUI are hidden.
Additional commands to hide can be configured
in salt master configuration file /etc/salt/master
.
e.g.:
saltgui_hide_jobs:
- test.ping
Commands that are normally hidden can be made visible using configuration
in salt master configuration file /etc/salt/master
.
e.g.:
saltgui_show_jobs:
- grains.items
Selected grains can be previewed on the Grains page.
The names of these grains can be configured
in salt master configuration file /etc/salt/master
.
e.g.:
saltgui_preview_grains:
- osrelease_info
Pillars potentially contain security senstitive information.
Therefore their values are initially hidden.
Values become visible by clicking on them.
This behavior can be changed by adjusting the values of the configuration
in salt master configuration file /etc/salt/master
.
The values for the pillar whose name match one of these regular expressions
are initially shown.
e.g.:
saltgui_public_pillars:
- pub_.*
SaltGUI does not have artificial restrictions.
But displaying all data may be slow when there is a lot of data.
Most notorious is the display of a highstate with hundreds of minions, each with douzens of states.
SaltGUI can be forced to use a slightly simpler output by setting a parameter in salt master configuration file /etc/salt/master
.
e.g.:
saltgui_tooltip_mode: simple
This parameter forces SaltGUI to use a very simple tooltip representation. This is then the built-in version from the brower. Typical effect is that it is shown slightly delayed and that is looks a bit primitive. The only other allowed value is "none", with the effect that no tooltips are shown at all.
In some specific environments you might not be able to serve SaltGUI directly from salt-api. In that case you might want to configure a web server (for example NGINX) to serve SaltGui and use it as proxy to salt-api so that requests are answered from the same origin from the browser point of view.
Sample NGINX configuration might look like this:
server {
listen 80;
server_name _;
root /data/www;
index index.html;
# handle internal api (proxy)
location /api/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://saltmaster-local:3333/;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_redirect off;
}
# handle saltgui web page
location / {
try_files $uri /index.html;
}
}
The value of the API_URL
in the config.js
file shall point to path where salt-api is exposed.
const config = {
API_URL: '/api'
};
Currenlty you can't use totally independent salt-api without proxy as support for CORS preflight request is not properly support.
To make life a bit easier for testing SaltGUI or setting up a local development environment you can use the provided docker-compose setup in this repository to run a saltmaster with three minions, including SaltGUI:
cd docker
docker-compose up
Then browse to http://localhost:3333/, you can login with salt:salt
.
We provide some functional tests and unit tests. They use the docker setup to run the functional tests. You will also need yarn and node.js to run them. When you have docker, yarn and node.js installed, you can run the tests from the root of the repository like this:
./runtests.sh
To show the browser window + a debugger while running the functional tests you can run:
NIGHTMARE_DEBUG=1 ./runtests.sh
We use the following testing libraries:
- nightmare.js, for functional/browser tests
- mocha, a well documented testing framework for javascript
- chai, the preferred assertion library for testing
You'll need at least:
docker-compose
1.12 or abovenodejs
8.11 or aboveyarn
1.7 or above
Open a PR! Try to use no dependencies where possible, as vanilla JS is the aim. Any libraries will need to be heavily considered first. Please see the section above as PR's won't be reviewed if they don't pass the tests.
This excellent frontend is originally written by Oliver Dunk.
- added missing openbsd icon (erwindon, thx hbonath)
- added support for orchestration output (erwindon, thx gnouts)
- clarified some documentation issues (erwindon)
- smarter placement of tooltips (erwindon)
- no inner-scrollbar for cmd box (erwindon)
- hide job details with data from many minions (erwindon)
- added menu option for state testing (erwindon)
- more code cleanups (erwindon)
- Added code and instructions to set up standalone SaltGUI (dawidmalina)
- Return to login on session timeout (erwindon)
- Improve showing where info is automatically updated (erwindon)
- Added an overview screen for options, ctrl-click logo to show (erwindon)
- Lots of code cleanups (erwindon)
- Added visual task summaries for hightstate output, suggested by elipsion (erwindon)
- Added search facility also on job output screen (erwindon)
- Show JOB-ids as links in job output (erwindon)
- Reduce highstate output by leaving out some more trivial details (erwindon)
- Better background for tooltips on top of dark backgrounds (erwindon)
- Added ability to reduce tooltip complexity/presence, suggested by elipsion (erwindon)
- Fixed handling of
args
andkwargs
for job definitions (erwindon) - Fixed exitcode for regular jobs (erwindon, thx elipsion)
- Fixed problem with job status fields not updating since 1.15.0 (erwindon)
- Fixed problem with job status fields not updating since 1.15.0 (erwindon)
- Choose number of jobs visible on Jobs page (erwindon, thx elipsion)
- Fixed problems with element ids (erwindon, thx lordfolken)
- Show beacon values (erwindon)
- Summary line for all pages (erwindon)
- Do not claim events after session timeout (erwindon)
- Properly handle details refresh of jobs that have now expired (erwindon)
- Add standard texts to table filter textfield (erwindon)
- Do not use getElementById for non-unique elements (erwindon)
- Use standard function for texts that apply 0, 1 or many times (erwindon)
- Use asynchronous updates for Keys page (erwindon)
- Prevent crash on NULL output (erwindon)
- Small layout fixes (erwindon)
- Implemented management of beacons (erwindon)
- Added search function for tables (erwindon)
- Major cleanup of js-promise handling (erwindon)
- Re-organized all menu item creations (erwindon)
- Better validations on url parameters (erwindon)
- js and css code cleanups (erwindon)
- Small layout fixes (erwindon)
- Additional testing (dawidmalina)
- Improved indication for sorted tables (erwindon)
- Display ip-number from likely common network (erwindon, thx jonathanuntalan-rfg)
- Enhanced display of in-progress jobs (erwindon)
- Introduced placeholders when suggesting incomplete commands (erwindon)
- Added term/kill/signal commands to jobs and processes (erwindon)
- Improved tooltips; added tooltips on more places (erwindon)
- Improved job summary: show number of succeeded/failed (erwindon)
- Fixed small issue with display of pillars (erwindon)
- Fixed small issue with display of schedules (erwindon)
- Added job-details column to jobs overview (erwindon)
- Code cleanup: use consistent callback names (erwindon)
- Code cleanup: better use of the page framework (erwindon)
- Fixed dates in changelog (dawidmalina)
- Completed historic overview in changelog (erwindon)
- Fixes for maximum text in columns (erwindon)
- Fixed datetime display; always obey set format (erwindon)
- Fixed missing summary of changes for SaltGuiHighstate (erwindon)
- Added original highstate output format (erwindon)
- Updated salt version to 2019.2.0 for docker images (erwindon)
- All js code is now in modules (erwindon)
- Some more small fixes (erwindon)
- Migrated from yarn to npm (smarletta)
- Separated unit tests and functional tests (smarletta)
- Standardized filenames (smarletta)
- Converted to JS modules (smarletta)
- Added coverage report for unit tests (smarletta)
- Close job details now returns to previous page (dawidmalina)
- Fixed small layout issues (erwindon)
- Standardized internal api functions (erwindon)
- Removed some unused functions (erwindon)
- Small bugfix for copy of ip-number (erwindon)
- Improved navigation: made rows clickable (erwindon)
- Fixed invisible menu in small width screens (dawidmalina/erwindon)
- Set display of keys to monospace (erwindon)
- Added more control over output format (erwindon)
- Added link to GitHub project on login page (dawidmalina)
- Added separate Jobs page (dawidmalina)
- Fixed some OS-icons (erwindon)
- Support more compact time notation (erwindon)
- Show popup menu's as early as possible (erwindon)
- Added separate Job Templates page (dawidmalina)
- Show which jobs are still running (erwindon)
- Added re-run functionality for jobs (erwindon/dawidmalina)
- Improved testing support (erwindon/dawidmalina)
- Allow most tables to be sorted (erwindon/dawidmalina)
- Added support for non-secret pillars (erwindon/dawidmalina)
- Removed sub-sections from keys page, unaccepted now sorts first (erwindon)
- Fixed auto-copy (erwindon)
- Fixed issues with ip-number when multiple available, reported by dawidmalina (erwindon)
- Improved the general design (dawidmalina)
- Added OS images with the OS names, suggested by dawidmalina (erwindon)
- Added sync-grains and sync-pillars commands, suggested by dawidmalina (erwindon)
- Allow some editing on grains info (erwindon)
- Allow some editing on schedules info (erwindon)
- Minimize handling of pillar values (erwindon)
- Fixes some text/html representation problems (erwindon)
- Added page for grain info (erwindon)
- Added page for schedules info (erwindon)
- Added page for pillars info (erwindon)
- Celebrating almost 100 stars on GitHub
- Added list of values for targetfield: minions+nodegroups, suggested by lostsnow (erwindon)
- Fixed named parameter issues reported by marceliq (erwindon)
- Fixed result display for wheel/runner functions (erwindon)
- Added command templates (erwindon)
- Added targettype nodegroups (lostsnow)
- Added selectable targettype (erwindon)
- Improved state output (erwindon)
- Various output improvements (erwindon)
- Improved (high)state output (erwindon)
- Added collapsable output (erwindon)
- Format jobs same as direct command output (erwindon)
- Jobs can now be started asynchronously (erwindon)
- Improved command parser (erwindon)
- Loads of ES6 code improvements and testing including linting (erwindon/maerteijn)
- Documentation view option in the command box (erwindon)
- Show job progress in job list (erwindon)
- Improved job detail (erwindon)
- Addition of menu bar; separation of minion vs keys (erwindon)
- Added mysql as authentication method and retired auto and sharedsecret (erwindon)
- Added some responsive improvements
- Support for several EAUTH authentication methods (erwindon)
- Shows inactive minions as well (erwindon)
- Switch to a more reliable grain indicating the ip-number (erwindon)
- Added a logout button (erwindon)
- Improved minion loading page: first the keys and update them according to their status (erwindon)
- Fixed issue with session timeout (erwindon)
- Added keymanagement functionality (erwindon)
- Created a nice dropdown menu (erwindon)
- Improved ES6 code (erwindon)
- Added a close button to the command popup (erwindon)
- Fixed position of popup when main window has scrolled (erwindon)
- Sort minions by hostname (erwindon)
- Fixed OS description in minion overview (No lsb_distrib_description)(erwindon)
- Now sort the jobs correctly on
StartDate
in the overview window
- Original release with some styling fixes and with enabled highstate functionality.
- New maintainer (maerteijn)
- Initial version (oliverdunk)