1// Copyright (c) 2022 Gitpod GmbH. All rights reserved. 2// Licensed under the GNU Affero General Public License (AGPL). 3// See License.AGPL.txt in the project root for license information. 4 5package util 6 7import ( 8 "fmt" 9 "os" 10) 11 12const ( 13 // SupervisorPort defines the supervisor listen port 14 SupervisorPort = 22999 15) 16 17// SupervisorAddress return the <host>:<port> pair for supervisor. 18// Custom values can be defined using the environment variable SUPERVISOR_ADDR. 19func GetSupervisorAddress() string { 20 addr := os.Getenv("SUPERVISOR_ADDR") 21 if addr == "" { 22 addr = fmt.Sprintf("127.0.0.1:%v", SupervisorPort) 23 } 24 25 return addr 26} 27 28