Skip to content

For reverse proxies, add SWAGGER_HOST environment variable support #570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ There are a bunch of environmental variables that can be set inside the docker c

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

* `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.

* `SWAGGER_IP`: The IP that's used in the Swagger UI for the interactive examples. Defaults to the container ip.

* `PORT`: Defaults to port `8080` unless this env var is set to tell it otherwise.
3 changes: 2 additions & 1 deletion src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ func main() {

defaultSwaggerIp := utils.GetEnv("HOST_IP", "127.0.0.1")
swaggerIp := utils.GetEnv("SWAGGER_IP", defaultSwaggerIp)
docs.SwaggerInfo.Host = swaggerIp + ":" + port
swaggerHost := utils.GetEnv("SWAGGER_HOST", swaggerIp+":"+port)
docs.SwaggerInfo.Host = swaggerHost

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

Expand Down
Loading