Make setting the web server port optional
This commit is contained in:
parent
44806d1a8e
commit
9b104f1d40
@ -1,5 +1,3 @@
|
|||||||
webServerPort: 8080
|
|
||||||
|
|
||||||
instanceDetails:
|
instanceDetails:
|
||||||
name: Owncast
|
name: Owncast
|
||||||
title: Owncast Demo Server
|
title: Owncast Demo Server
|
||||||
|
@ -180,6 +180,15 @@ func (c *config) GetPrivateHLSSavePath() string {
|
|||||||
return "hls"
|
return "hls"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *config) GetPublicWebServerPort() int {
|
||||||
|
if c.WebServerPort != 0 {
|
||||||
|
return c.WebServerPort
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default web server port
|
||||||
|
return 8080
|
||||||
|
}
|
||||||
|
|
||||||
//Load tries to load the configuration file
|
//Load tries to load the configuration file
|
||||||
func Load(filePath string, versionInfo string) error {
|
func Load(filePath string, versionInfo string) error {
|
||||||
Config = new(config)
|
Config = new(config)
|
||||||
|
@ -34,7 +34,7 @@ func Start() error {
|
|||||||
http.HandleFunc("/config", controllers.GetWebConfig)
|
http.HandleFunc("/config", controllers.GetWebConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
port := config.Config.WebServerPort
|
port := config.Config.GetPublicWebServerPort()
|
||||||
|
|
||||||
log.Infof("Web server running on port: %d", port)
|
log.Infof("Web server running on port: %d", port)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user