diff --git a/app/controllers/Application.scala b/app/controllers/Application.scala index 34cd2a0fa..d46500a42 100644 --- a/app/controllers/Application.scala +++ b/app/controllers/Application.scala @@ -31,7 +31,12 @@ class Application @Inject()(files: FileService, collections: CollectionService, def swaggerUI = Action { implicit request => val swagger = routes.Application.swagger().absoluteURL(Utils.https(request)) - Redirect("http://clowder.ncsa.illinois.edu/swagger/?url=" + swagger) + val swaggerUIHost = play.Play.application().configuration().getString("swaggerUIHost") + if (swaggerUIHost == null || swaggerUIHost.isEmpty()) { + Redirect("http://clowder.ncsa.illinois.edu/swagger/?url=" + swagger) + } else { + Redirect(swaggerUIHost) + } } /** diff --git a/conf/application.conf b/conf/application.conf index 2aad1f5df..0bde8801f 100644 --- a/conf/application.conf +++ b/conf/application.conf @@ -123,6 +123,11 @@ clowder.license { download=false } +# swagger api doc host +# if no setting of swaggerUIHost, it will use https://clowder.ncsa.illinois.edu/swagger to show the swagger api doc. +# otherwise, you can point `swaggerUIHost` to your swagger-ui url to show the swagger api doc. +swaggerUIHost="" + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Space related information # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docker-compose.yml b/docker-compose.yml index 1e9f05fcb..cc08ea6df 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -74,6 +74,7 @@ services: - S3_BUCKET=${S3_BUCKET:-clowder} - S3_ACCESS_KEY=${S3_ACCESS_KEY:-clowder} - S3_SECRET_KEY=${S3_SECRET_KEY:-catsarecute} + - SWAGGER_UI_HOST=${SWAGGER_UI_HOST:-https://clowder.ncsa.illinois.edu/clowder/swagger} labels: - "traefik.enable=true" - "traefik.backend=clowder" diff --git a/docker/custom.conf b/docker/custom.conf index 52f1fb090..576ca445b 100644 --- a/docker/custom.conf +++ b/docker/custom.conf @@ -35,6 +35,9 @@ smtp.host=${?SMTP_SERVER} smtp.from="devnull@ncsa.illinois.edu" smtp.from=${?SMTP_FROM} +# swagger-ui host +swaggerUIHost=${?SWAGGER_UI_HOST} + # storage service.byteStorage=services.filesystem.DiskByteStorageService service.byteStorage=${?CLOWDER_STORAGE}