diff --git a/Dockerfile b/Dockerfile index 545ad95b..ed646709 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,6 @@ ENV RTMP_PORT 1935 ENV HTTP_FLV_PORT 7001 ENV HLS_PORT 7002 ENV HTTP_OPERATION_PORT 8090 -COPY --from=builder /app/config ./config COPY --from=builder /app/livego . EXPOSE ${RTMP_PORT} EXPOSE ${HTTP_FLV_PORT} diff --git a/README.md b/README.md index c8e772ea..0b07b6c4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ -# livego +![Test](https://github.com/gwuhaolin/livego/workflows/Test/badge.svg) + + + Simple and efficient live broadcast server: - Very simple to install and use; - Pure Golang, high performance, cross-platform; @@ -23,7 +26,7 @@ Simple and efficient live broadcast server: After directly downloading the compiled [binary file](https://github.com/gwuhaolin/livego/releases), execute it on the command line. #### Boot from Docker -Run `docker run -p 1935:1935 -p 7001:7001 -p 7002:7002 -d --name livego gnurub/livego` to start +Run `docker run -p 1935:1935 -p 7001:7001 -p 7002:7002 -d --name livego gwuhaolin/livego` to start #### Compile from source 1. Download the source code `git clone https://github.com/gwuhaolin/livego.git` diff --git a/configure/liveconfig.go b/configure/liveconfig.go index 6bdcc225..77d5ff62 100644 --- a/configure/liveconfig.go +++ b/configure/liveconfig.go @@ -41,28 +41,30 @@ type ServerCfg struct { Server []Application `json:"server"` } -var RtmpServercfg ServerCfg +// default config +var RtmpServercfg = ServerCfg{ + Server: []Application{{ + Appname: "livego", + Liveon: "on", + Hlson: "on", + StaticPush: nil, + }}, +} -func LoadConfig(configfilename string) error { +func LoadConfig(configfilename string) { log.Printf("starting load configure file %s", configfilename) data, err := ioutil.ReadFile(configfilename) if err != nil { log.Printf("ReadFile %s error:%v", configfilename, err) - return err } - // log.Printf("loadconfig: \r\n%s", string(data)) - err = json.Unmarshal(data, &RtmpServercfg) if err != nil { log.Printf("json.Unmarshal error:%v", err) - return err } log.Printf("get config json data:%v", RtmpServercfg) Init() - - return nil } func GetRedisAddr() *string { diff --git a/config/livego.json b/livego.json similarity index 73% rename from config/livego.json rename to livego.json index 47bab74c..5a6e195a 100644 --- a/config/livego.json +++ b/livego.json @@ -1,7 +1,7 @@ { "server": [ { - "appname": "live", + "appname": "livego", "liveon": "on", "hlson": "on" } diff --git a/logo.png b/logo.png new file mode 100644 index 00000000..cd578a6a Binary files /dev/null and b/logo.png differ diff --git a/main.go b/main.go index 52c61dee..ce648465 100755 --- a/main.go +++ b/main.go @@ -19,7 +19,7 @@ var ( httpFlvAddr = flag.String("httpflv-addr", ":7001", "HTTP-FLV server listen address") hlsAddr = flag.String("hls-addr", ":7002", "HLS server listen address") operaAddr = flag.String("manage-addr", ":8090", "HTTP manage interface server listen address") - configfilename = flag.String("config-file", "config/livego.json", "configure filename") + configfilename = flag.String("config-file", "livego.json", "configure filename") ) func init() { @@ -116,10 +116,7 @@ func main() { } }() log.Println("start livego, version", version) - err := configure.LoadConfig(*configfilename) - if err != nil { - return - } + configure.LoadConfig(*configfilename) stream := rtmp.NewRtmpStream() hlsServer := startHls()