You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gosuv/README.md

152 lines
3.1 KiB

9 years ago
# gosuv
9 years ago
[![Build Status](https://travis-ci.org/codeskyblue/gosuv.svg)](https://travis-ci.org/codeskyblue/gosuv)
8 years ago
## Should not use in production now (current is in alpha)
Process management writtern by golang, inspired by python-supervisor
8 years ago
Features
8 years ago
* [x] Realtime log view
* [x] Web control page
* [x] Start, Stop, Tail, Reload
* [x] Add program support
* [ ] Edit support
* [ ] Delete support
* [ ] Path auto complete <https://github.com/twitter/typeahead.js>
* [x] Memory and CPU monitor
* [x] HTTP Basic auth
* [x] Github webhook
* [ ] Single log page, include search support
8 years ago
* [ ] 中文文档
9 years ago
## Requirements
8 years ago
Go version at least `1.6+`
8 years ago
## Installation
8 years ago
Standalone binary can be download from one of the following addresses
8 years ago
| Branch | Source | Address |
|--------|--------|---------|
8 years ago
| stable | equinox| <https://dl.equinox.io/shengxiang/gosuv/stable> |
| stable | github | <https://github.com/codeskyblue/gosuv/releases/latest>|
8 years ago
| dev | equinox| <https://dl.equinox.io/shengxiang/gosuv/dev> |
Or if you have go enviroment, you can also build from source.
8 years ago
```sh
go get -d github.com/codeskyblue/gosuv
cd $GOPATH/src/github.com/codeskyblue/gosuv
8 years ago
go build
```
If you want to build a standalone binary, run the following command.
```sh
go get github.com/elazarl/go-bindata-assetfs/...
go-bindata-assetfs -tags bindata res/...
go build -tags bindata
8 years ago
```
9 years ago
## Usage
8 years ago
Start server in the background
```sh
gosuv start-server
```
Show server status
8 years ago
```sh
$ gosuv status
8 years ago
Server is running
```
Open web <http://localhost:11313> to see the manager page.
8 years ago
![gosuv web](docs/gosuv.gif)
8 years ago
## Configuration
Default config file stored in directory `$HOME/.gosuv/`, Set env-var `GOSUV_HOME_DIR` can change config file store directory.
- file `programs.yml` contains all program settings.
- file `config.yml` contains server config
File `config.yml` can be generated by `gosuv conftest`
Example config.yaml
```
server:
httpauth:
enabled: false
username: uu
password: pp
addr: :11313
client:
server_url: http://localhost:11313
```
Logs can be found in `$HOME/.gosuv/log/`
8 years ago
## Design
8 years ago
HTTP is follow the RESTFul guide.
Get or Update program
8 years ago
`<GET|PUT> /api/programs/:name`
8 years ago
Add new program
8 years ago
`POST /api/programs`
8 years ago
Del program
8 years ago
`DELETE /api/programs/:name`
## State
9 years ago
Only 4 states. [ref](http://supervisord.org/subprocess.html#process-states)
9 years ago
8 years ago
![states](docs/states.png)
9 years ago
8 years ago
## Notification (todo)
Configuration example
```yaml
8 years ago
- demo-program:
command: ...
notifications:
pushover:
api_key: [token]
users:
- [user1]
- [user2]
8 years ago
```
8 years ago
Now only support [pushover](https://pushover.net/api), and only status change to fatal will get notified.
8 years ago
8 years ago
# Plugin Design (todo)
9 years ago
Current plugins:
- [tailf](https://github.com/codeskyblue/gosuv-tailf)
All command plugin will store in `$HOME/.gosuv/cmdplugin`, gosuv will treat this plugin as a subcommand.
for example:
$HOME/.gosuv/cmdplugin/ --.
|- showpid/
|- run
There is a directory `showpid`
When run `gosuv showpid`, file `run` will be called.
9 years ago
## Use libs
* <https://github.com/ahmetalpbalkan/govvv>
9 years ago
## LICENSE
[MIT](LICENSE)