Merge pull request #540 from twhiston/interface_setting

add interface variable to settings
This commit is contained in:
Tom Whiston 2018-06-08 13:58:50 +02:00 committed by GitHub
commit bfe1a4f60b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -36,6 +36,7 @@ func main() {
}
fmt.Printf("Semaphore %v\n", util.Version)
fmt.Printf("Interface %v\n", util.Config.Interface)
fmt.Printf("Port %v\n", util.Config.Port)
fmt.Printf("MySQL %v@%v %v\n", util.Config.MySQL.Username, util.Config.MySQL.Hostname, util.Config.MySQL.DbName)
fmt.Printf("Tmp Path (projects home) %v\n", util.Config.TmpPath)
@ -64,7 +65,7 @@ func main() {
var router http.Handler = api.Route()
router = handlers.ProxyHeaders(router)
http.Handle("/", router)
err := http.ListenAndServe(util.Config.Port, nil)
err := http.ListenAndServe(util.Config.Interface+util.Config.Port, nil)
if err != nil {
log.Panic(err)
}

View File

@ -49,8 +49,13 @@ type ldapMappings struct {
type configType struct {
MySQL mySQLConfig `json:"mysql"`
// Format `:port_num` eg, :3000
// if : is missing it will be corrected
Port string `json:"port"`
// Interface ip, put in front of the port.
// defaults to empty
Interface string `json:"interface"`
// semaphore stores ephemeral projects here
TmpPath string `json:"tmp_path"`