中文README 不是很全,能看懂英文的还是尽量看英文
Process management writtern by golang, inspired by python-supervisor
I have been using python-supervisor for many years and there are something uncomfortable feelings.
- Log can't contains ANSI color chars
- The configuration file can add on the web, often forgot some settings.
supervisorctl reload
will cause supervisord restarted- Hard to set status change to fatal notifications.
- No process performance monitor page.
- Program starts with no common environ, eg, missing HOME and USER variable
- Kill process default is not group kill which make sub process still running.
- More... will added when I think of it.
-
Web control page
- Start, Stop, Tail, Reload
- Realtime log
- Add program support
- Edit support
- Delete support
- Memory and CPU monitor
- Path auto complete https://github.com/twitter/typeahead.js
-
HTTP Basic auth
-
Github webhook
-
Single log page, include search support
-
中文文档
Go version at least 1.6+
Standalone binary can be download from one of the following addresses
Branch | Source | Address |
---|---|---|
latest | equinox | https://dl.equinox.io/shengxiang/gosuv/stable |
Or if you have go enviroment, you can also build from source.
go get -d github.com/codeskyblue/gosuv
cd $GOPATH/src/github.com/codeskyblue/gosuv
go build
If you want to build a standalone binary, run the following command.
go generate
go build -tags vfs
After you installed gosuv, the first thing is to start server.
gosuv start-server
Show server status
$ gosuv status
Server is running
Open web http://localhost:11313 to see the manager page. And follow the gif to add a program to gosuv.
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/
Edit config file(default located in $HOME/.gosuv/programs.yml
) and run gosuv reload
will take effect immediately.
HTTP is follow the RESTFul guide.
Get or Update program
<GET|PUT> /api/programs/:name
Add new program
POST /api/programs
Del program
DELETE /api/programs/:name
Only 4 states. ref
Configuration example
- demo-program:
command: ...
notifications:
pushover:
api_key: [token]
users:
- [user1]
- [user2]
Now only support pushover, and only status change to fatal will get notified.
This is feature that will helps update your deployment environment once your updated in the github.
This part is set in the programs.yml
, take look the example
- demo-program:
command: python app.py
directory: /opt/demo
webhook:
github:
secret: 123456
command: git pull origin master