From 27377e116c0a562b0e49b331e6f538baf5810927 Mon Sep 17 00:00:00 2001 From: Simon Klein Date: Tue, 26 May 2020 07:55:45 +0200 Subject: [PATCH 1/8] #1 Update dogu.json --- dogu.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dogu.json b/dogu.json index b0a99b8..b0ee9da 100644 --- a/dogu.json +++ b/dogu.json @@ -16,6 +16,13 @@ "Dependencies": [ "nginx" ], + "Configuration": [ + { + "Name": "validator.url", + "Description": "Set the url of the swaggerui validator.", + "Optional": true + } + ], "HealthChecks": [ { "Type": "tcp", From 58149b6a15d936458e2decfec4c217a3291a655a Mon Sep 17 00:00:00 2001 From: Simon Klein Date: Tue, 26 May 2020 07:56:56 +0200 Subject: [PATCH 2/8] add gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e14257e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea/* +*.iml From 1130e2db1179bdcd26b0a924fbc3fe6bfeadf13f Mon Sep 17 00:00:00 2001 From: Simon Klein Date: Tue, 26 May 2020 11:12:35 +0200 Subject: [PATCH 3/8] #1 Read templateUrl out of etcd --- resources/startup.sh | 4 ++ resources/var/www/html/index.html.tpl | 65 +++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 resources/var/www/html/index.html.tpl diff --git a/resources/startup.sh b/resources/startup.sh index 08c8554..893f420 100755 --- a/resources/startup.sh +++ b/resources/startup.sh @@ -5,11 +5,15 @@ set -o pipefail NGINX_ROOT=/var/www/html INDEX_FILE=$NGINX_ROOT/index.html +INDEX_TEMPLATE_PATH=/var/www/html/index.html.tpl +INDEX_FILE_PATH=/var/www/html/index.html doguctl state "starting" # remove swagger.json from index.html sed -i "s|https://petstore.swagger.io/v2/swagger.json||g" $INDEX_FILE +doguctl template "${INDEX_TEMPLATE_PATH}" "${INDEX_FILE_PATH}" + doguctl state "ready" # Start nginx diff --git a/resources/var/www/html/index.html.tpl b/resources/var/www/html/index.html.tpl new file mode 100644 index 0000000..6367bb7 --- /dev/null +++ b/resources/var/www/html/index.html.tpl @@ -0,0 +1,65 @@ + + + + + + Swagger UI + + + + + + + +
+ + + + + + From a93c8bfd6dfc0bf31857bcec1b66748c5a122278 Mon Sep 17 00:00:00 2001 From: Simon Klein Date: Tue, 26 May 2020 14:15:20 +0200 Subject: [PATCH 4/8] #1 Update changelog --- swagger-ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swagger-ui b/swagger-ui index af1acda..2b67443 160000 --- a/swagger-ui +++ b/swagger-ui @@ -1 +1 @@ -Subproject commit af1acdab4917dc5b294bba27012d02c883966a79 +Subproject commit 2b674435f9e8aa16976daf04d86b140a8813caa8 From 185a2c023dd05173db5cde4dbd955539f00f5c5e Mon Sep 17 00:00:00 2001 From: Simon Klein Date: Tue, 26 May 2020 14:18:20 +0200 Subject: [PATCH 5/8] Update changelog --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c9c2ce..bbcaec4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- added template for the index page +- added etcd key to set the SwaggerValidator ## [v3.25.0-1] - 2020-04-08 ### Added -* add Swagger UI in version 3.25.0 \ No newline at end of file +* add Swagger UI in version 3.25.0 From 50b0aee403a104e0b1e1d62f3e6f198f2c0b640d Mon Sep 17 00:00:00 2001 From: Simon Klein Date: Tue, 26 May 2020 14:31:03 +0200 Subject: [PATCH 6/8] Revert "#1 Update changelog" This reverts commit a93c8bfd --- swagger-ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swagger-ui b/swagger-ui index 2b67443..af1acda 160000 --- a/swagger-ui +++ b/swagger-ui @@ -1 +1 @@ -Subproject commit 2b674435f9e8aa16976daf04d86b140a8813caa8 +Subproject commit af1acdab4917dc5b294bba27012d02c883966a79 From 78a74d8d96d1670b17602009ac4e81414200113e Mon Sep 17 00:00:00 2001 From: Simon Klein Date: Tue, 26 May 2020 15:10:22 +0200 Subject: [PATCH 7/8] #1 Change naming to snake case --- dogu.json | 2 +- resources/var/www/html/index.html.tpl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dogu.json b/dogu.json index b0ee9da..f5d5403 100644 --- a/dogu.json +++ b/dogu.json @@ -18,7 +18,7 @@ ], "Configuration": [ { - "Name": "validator.url", + "Name": "validator_url", "Description": "Set the url of the swaggerui validator.", "Optional": true } diff --git a/resources/var/www/html/index.html.tpl b/resources/var/www/html/index.html.tpl index 6367bb7..af911a9 100644 --- a/resources/var/www/html/index.html.tpl +++ b/resources/var/www/html/index.html.tpl @@ -42,8 +42,8 @@ url: "", dom_id: '#swagger-ui', deepLinking: true, - {{ if .Config.Exists "validator.url" }} - validatorUrl: "{{ .Config.Get "validator.url"}}", + {{ if .Config.Exists "validator_url" }} + validatorUrl: "{{ .Config.Get "validator_url"}}", {{ else }} validatorUrl: null, {{ end }} From 18296030fa1178af0f31c8ab1c3ba6155b7e09dc Mon Sep 17 00:00:00 2001 From: Josha von Gizycki Date: Tue, 26 May 2020 15:44:10 +0200 Subject: [PATCH 8/8] Bump version --- CHANGELOG.md | 2 ++ Dockerfile | 2 +- dogu.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbcaec4..1807e95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [v3.25.0-1] - 2020-05-26 ### Added - added template for the index page - added etcd key to set the SwaggerValidator diff --git a/Dockerfile b/Dockerfile index 56537b7..77695f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN npm run build FROM registry.cloudogu.com/official/base:3.10.3-2 LABEL NAME="official/swaggerui" \ - VERSION="3.25.0-1" \ + VERSION="3.25.0-2" \ maintainer="christian.beyer@cloudogu.com" ENV SERVICE_TAGS=webapp diff --git a/dogu.json b/dogu.json index f5d5403..f3ddd8b 100644 --- a/dogu.json +++ b/dogu.json @@ -1,6 +1,6 @@ { "Name": "official/swaggerui", - "Version": "3.25.0-1", + "Version": "3.25.0-2", "DisplayName": "Swagger UI", "Description": "Swagger UI displays your openAPI specification.", "Logo": "https://github.com/cloudogu/swagger-ui/blob/master/src/img/logo_small.png?raw=true",