Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sierrasoftworks/chieftan-server
The Chieftan server implementation
https://github.com/sierrasoftworks/chieftan-server
api golang task-automation
Last synced: 13 days ago
JSON representation
The Chieftan server implementation
- Host: GitHub
- URL: https://github.com/sierrasoftworks/chieftan-server
- Owner: SierraSoftworks
- Created: 2016-07-15T05:49:35.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2020-06-14T13:01:59.000Z (over 4 years ago)
- Last Synced: 2024-06-21T01:56:03.098Z (7 months ago)
- Topics: api, golang, task-automation
- Language: Go
- Size: 367 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chieftan [![Build Status](https://drone.sierrasoftworks.com/api/badges/SierraSoftworks/chieftan-server/status.svg)](https://drone.sierrasoftworks.com/SierraSoftworks/chieftan-server)
**A task automation framework driven through an HTTP API**Chieftan was designed to simplify the process of creating, managing and triggering tasks
on your infrastructure. It is driven through an HTTP API, making it trivially easy to
automate and consume - while the simple API ensures you won't be left reading docs.Its primary goal is to provide a data-defined task framework, enabling rich interactions
with other systems such as build and deployment tools.## Administration
The `chieftan` executable provides a command line interface which allows you to interact
with the database to perform various administrative functions such as creating users,
generating access tokens etc.This functionality is all available through the API as well, however the command line
offers a convenient way to bootstrap your server.**CAUTION** Changes made through the command line interface will not be logged to the
standard Audit Log provided by Chieftan as there is no way to determine their source.
As the command line is required to be run on the same server as your database, we assume
this will not be an issue, however you should put things in place to prevent unauthorized
access to your data nodes nonetheless.### Users
#### Creating a User
```sh
chieftan user create --admin "Benjamin Pannell" [email protected]
```#### Get a User's Details
```sh
chieftan user info [email protected]
```#### Removing a User
```sh
chieftan user remove [email protected]
```### Permissions
#### Changing a User's Permissions
```sh
chieftan permissions set [email protected] project/:project project/:project/admin admin admin/users
```#### Granting a User Permissions
```sh
chieftan permissions add [email protected] admin admin/users
```#### Removing a User's Permissions
```sh
chieftan permissions remove [email protected] project/:project
```### Access Tokens
#### Creating an Access Token```sh
chieftan token create [email protected]
```#### Getting a User's Access Tokens
```sh
chieftan token list [email protected]
```#### Revoking an Access Token
```sh
chieftan token remove 54e81577954376dac6ed9d8b134a790b
```#### Revoking a User's Access Tokens
```sh
chieftan token remove --user [email protected]
```#### Revoking All Access Tokens
```sh
chieftan token remove --global
```## Development
Development is conducted using standard Go and `gvt` for dependency management. Tests
are written using `gocheck` to help keep things a bit more succinct.You are expected to have a MongoDB database available at `$MONGODB_URL` or
`mongodb://localhost/chieftan` for all tests and executions.### Environment Setup
You just need to restore the correct versions of the various dependencies using `gvt`.```sh
go get -u github.com/FiloSottile/gvt
gvt restore
```### Automated Tests
You can run the automated test suite by executing the following:```sh
goconvey
```Alternatively, you may make use of the standard `gotest` binary if you wish to run the
tests on a headless server.```sh
go test ./ ./api ./executors ./models ./tasks ./tools ./utils
```### Building
Creating a build requires you to run `go build`. You can provide additional linker
flags to embed version information in the binary, specifically the git commit and
semantic version of the release.```sh
go build -o chieftan -ldflags "-X main.version=$(git describe --abbrev=0 --tags)-$(git log --pretty=format:'%h' -n 1) -X main.sentry_dsn=$SENTRY_DSN"
```