• This repository has been archived on 19/Dec/2023
  • Stars
    star
    643
  • Rank 70,000 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 9 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Deprecated!!! Process managerment writtern by golang, inspired by python-supervisor

gosuv

Build Status

中文README 不是很全,能看懂英文的还是尽量看英文

current is in beta

Process management writtern by golang, inspired by python-supervisor

So why write another supervisor?

I have been using python-supervisor for many years and there are something uncomfortable feelings.

  1. Log can't contains ANSI color chars
  2. The configuration file can add on the web, often forgot some settings.
  3. supervisorctl reload will cause supervisord restarted
  4. Hard to set status change to fatal notifications.
  5. No process performance monitor page.
  6. Program starts with no common environ, eg, missing HOME and USER variable
  7. Kill process default is not group kill which make sub process still running.
  8. More... will added when I think of it.

Features

  • Web control page

  • HTTP Basic auth

  • Github webhook

  • Single log page, include search support

  • 中文文档

Requirements

Go version at least 1.6+

Installation

Binaries

The fastest way is run with. Default install location is /usr/local/bin, change env-var BINDIR will also change install location.

curl https://raw.githubusercontent.com/codeskyblue/gosuv/master/get.sh | bash

Or just download binaries

https://github.com/codeskyblue/gosuv/releases

Thanks to goreleaser which makes publish binaries automaticly.

Build from source

go get -d github.com/codeskyblue/gosuv
cd $GOPATH/src/github.com/codeskyblue/gosuv
go generate # package html resources into go
go build -tags vfs

Quick start

After you installed gosuv, the first thing is to start server.

gosuv start-server

Basic operations

$ gosuv status
PROGRAM NAME            STATUS
test                    running
test_again              stopped

$ gosuv stop test
$ gosuv start test

Open web http://localhost:11313 to see the manager page. And follow the gif to add a program to gosuv.

gosuv web

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: true
    username: admin
    password: admin
  addr: :8083
  name: 10.10.99.177
  master: ""
notifications:
  dingtalk:
    groups:
    - secret: c1b8032******************aa736a
      mobile:
      - "153********"
client:
  server_url: http://admin:admin@localhost:8083

master 的支持来自 https://github.com/ihaiker/distributed-gosuv 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.

Design

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

State

Only 4 states. ref

states

Notification

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.

Integrate with github (todo)

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

Alternative

LICENSE

MIT

More Repositories

1

gohttpserver

The best HTTP Static File Server, write with golang+vue
JavaScript
2,527
star
2

go-sh

like python-sh, for easy call shell with golang.
Go
1,072
star
3

fswatch

Watch file change, and trigger commands. (Cross platform)
Go
342
star
4

gohttp

HTTP file server written by golang + reactjs, not maintained, move to https://github.com/codeskyblue/gohttpserver
JavaScript
240
star
5

gobuild

not maintained, moved to https://github.com/gobuild/gobuild
Go
200
star
6

tidevice3

wrapper for pymobiledevice3 to make it more easy to use.
Python
183
star
7

webcron

A new crontab that have a web page in order to replace the original crontab. Now it can try on test.
Go
161
star
8

uiautodev

Mobile UI viewer in browser, view the UI in a tree view, and generate XPath automatically.
Python
101
star
9

go-reactjs-example

This is an exmple web use Golang And ReactJS
Go
54
star
10

docker-gogs

docker file for gogits
Shell
49
star
11

fa

FA(fast adb) helps you win at ADB(Android Debug Bridge).
Go
48
star
12

audiowire

Transfer PC Audio(Sound) to Browser (Beta)
JavaScript
37
star
13

heartbeat

heart beat for process status check. (心跳检测,UDP协议)
Go
23
star
14

kexec

Killable os/exec for golang library.
Go
21
star
15

kproc

go lib. offer a better way to kill all child process. [cross platform]
Go
21
star
16

proxylocal

Proxy local server to public network. (include server and client)
Go
15
star
17

netcat

example program, only for study golang.
Go
15
star
18

dockerignore

go library parse gitignore file, source code most from docker
Go
13
star
19

airfps

For mobile phone game to get FPS: frame per second.
C
10
star
20

dingrobot

DingTake Robot API
Go
9
star
21

node-python-rpc

Node modules which helps call python code in node
Python
9
star
22

apkinfo

get apkinfo use pure go code. (packageName, mainActivty etc...)
Go
8
star
23

sshg

ssh client with quick search and remote config
Python
7
star
24

go-image-encode-benchmark

Golang Image encode bench mark
Go
7
star
25

GoHello

Sample Android Project With Golang1.4 (AndroidStudioIDE)
Java
6
star
26

beelog

A simple log for Debug Trace Warn Error Critacal, extract code from astaxie/beego.
Go
6
star
27

adb

adb for docker armhf
Dockerfile
5
star
28

klog

Simple log extention for golang official log, ^_^ I like simple.
Go
5
star
29

gossh

command: wraper of ssh, save passwords for users.
Go
5
star
30

gochm

Golang chm version 1.3
5
star
31

httpfs

Go Library for open http file like local file
Go
5
star
32

pngdiff

Golang library png format file diff and patch.
Go
5
star
33

imutils2

another imutils for opencv simple use
Python
4
star
34

sshgo

通过使用sshpass进行机器间的调整,支持机器名的简写
Python
4
star
35

pm25

get city pm2.5. (I hope one day we will not care about the pm2.5)
JavaScript
4
star
36

adbx

ADB的加强版本,Make ADB more stronger
Go
4
star
37

meet-cars

Capture vehicle license plate with ML on the way to work.
Python
3
star
38

docker-goandroid

Dockerfile for golang1.4 android development environment
Go
3
star
39

realip

Get real IP behide nginx (Do not ignore private address)
Go
3
star
40

goshare

share file in current machine.
Go
3
star
41

filedist

智能文件分发工具(smart file distribution)
Go
3
star
42

gen_movie_article

通过提供的电影名列表,结合豆瓣提供的API,生成Markdown文章
Python
3
star
43

bootstrap-tornado

Write a tornado app from a template
Python
3
star
44

monitor

linux系统的监控
Go
3
star
45

github-mirror

For fast get github resource without block.
Go
2
star
46

AutoStock

个人研究和学习股票算法的仓库
Jupyter Notebook
2
star
47

dotfiles

my own dotfiles for linux and mac
Shell
2
star
48

cloudmusic_test_demo

演示教学用
Python
2
star
49

go-websocket

fork of code.google.com/p/go.net/websocket
Go
2
star
50

exec

An implement of os/exec, but add timeout option
Go
2
star
51

shweb

Writing web using shell.
Go
2
star
52

webtail

Tail log into web (experimental)
JavaScript
2
star
53

grget

simple online go build
Go
2
star
54

jshunter

javascript static check, based on jslint, output html report
JavaScript
2
star
55

pyignore

Python
2
star
56

muuid

Machine UUID, port of github.com/mhzed/machine-uuid
Go
2
star
57

imageautodemo

Demo of automation based on Image template match
Python
2
star
58

unsafessh

exec remote command easily.
Go
1
star
59

baidu-prompt-crawler

检查百度关键词
Python
1
star
60

keeprun

Keep console program running.
Go
1
star
61

fibonacci

python simple fibonacci for study of publish python lib
Python
1
star
62

raspi-car

little car controlled by raspberry
Python
1
star
63

shxsun.github.io

Vim Script
1
star
64

pydefer

golang defer implements in python
Python
1
star
65

simple_tornado

为了方便tornado使用的一个库
Python
1
star
66

macaron-jade

Jade template engine for macaron
Go
1
star
67

scripts

scripts of for devop
Shell
1
star
68

gogen

study project. like rails, this is named gails. for quickly golang web develop.
Go
1
star
69

android-snapshot-with-golang

screencap implements with golang
Go
1
star
70

fire

a new project that will replace jetfire
Go
1
star
71

apkdig

Inspect android package information
Go
1
star
72

findme

This program help me to find my raspberrypi IP address
Python
1
star
73

travelexec

(golang binary bool) travel file tree and call exec (like find + xargs, but offers more functions)
Go
1
star
74

py3toolkit

toolkit for my common use
Python
1
star
75

codeskyblue

1
star