Skip to content

Commit a6624c5

Browse files
authored
Merge pull request #570 from ksangers/master
For reverse proxies, add SWAGGER_HOST environment variable support
2 parents bb246cf + 531c673 commit a6624c5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ There are a bunch of environmental variables that can be set inside the docker c
134134

135135
* `SIGNAL_CLI_GID`: Specifies the gid of the `signal-api` group inside the docker container. Defaults to `1000`
136136

137+
* `SWAGGER_HOST`: The host that's used in the Swagger UI for the interactive examples (and useful when this runs behind a reverse proxy). Defaults to SWAGGER_IP:PORT.
138+
137139
* `SWAGGER_IP`: The IP that's used in the Swagger UI for the interactive examples. Defaults to the container ip.
138140

139141
* `PORT`: Defaults to port `8080` unless this env var is set to tell it otherwise.

src/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ func main() {
8181

8282
defaultSwaggerIp := utils.GetEnv("HOST_IP", "127.0.0.1")
8383
swaggerIp := utils.GetEnv("SWAGGER_IP", defaultSwaggerIp)
84-
docs.SwaggerInfo.Host = swaggerIp + ":" + port
84+
swaggerHost := utils.GetEnv("SWAGGER_HOST", swaggerIp+":"+port)
85+
docs.SwaggerInfo.Host = swaggerHost
8586

8687
log.Info("Started Signal Messenger REST API")
8788

0 commit comments

Comments
 (0)