Skip to content

Commit

Permalink
Fix Iglu Server's swagger ui (close #340)
Browse files Browse the repository at this point in the history
  • Loading branch information
istreeter committed Mar 7, 2022
1 parent bdeed5e commit ff03009
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
14 changes: 11 additions & 3 deletions provisioning/resources/configs/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

:80 {
@protectedPaths {
path /home* /elasticsearch* /kibana* /nsqadmin* /control-plane* /metrics* /swagger*
not path /kibana/ui/favicons/* /kibana/built_assets/* /kibana/bundles/* /swagger/*.css /swagger/*.js
path /home* /elasticsearch* /kibana* /nsqadmin* /control-plane* /metrics* /swagger* /iglu-server/static/swagger-ui*
not path /kibana/ui/favicons/* /kibana/built_assets/* /kibana/bundles/* /swagger/*.css /swagger/*.js /iglu-server/static/swagger-ui/*.css /iglu-server/static/swagger-ui/*.js
}

basicauth @protectedPaths {
Expand Down Expand Up @@ -44,7 +44,15 @@

route /iglu-server* {
uri strip_prefix /iglu-server
reverse_proxy localhost:8081
route /static* {
header {
Content-Security-Policy "default-src 'self'; frame-ancestors 'none'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'; img-src data: 'self'"
X-Frame-Options "DENY"
}
}
reverse_proxy localhost:8081 {
header_down -Content-Security-Policy
}
}

route /nsqadmin* {
Expand Down
4 changes: 4 additions & 0 deletions provisioning/resources/configs/iglu-server.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ database {
}
}

swagger {
baseUrl: "/iglu-server"
}

# Enable additional debug endpoint to output all internal state
debug = true

Expand Down
2 changes: 1 addition & 1 deletion provisioning/resources/ui/js/components/IgluServer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class IgluServer extends React.Component<{}, {}> {
</p>
<h3>Quicklinks:</h3>
<ul>
<li>Link to <a href={location.protocol + '//' + window.location.host + '/iglu-server/'}>Iglu Server management</a> page</li>
<li>Link to <a href='/iglu-server/static/swagger-ui/index.html'>Iglu Server management</a> page</li>
</ul>
</div>
);
Expand Down

0 comments on commit ff03009

Please sign in to comment.