Skip to content

Commit 0704d8c

Browse files
tine2ktchiotludo
authored andcommitted
fix login path to contain base path, closes #46 (#47)
1 parent 1c59d34 commit 0704d8c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

application.example.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
kafkahq:
22
server:
3-
base-path: "" # if behind a reverse proxy, path to kafkahq with trailing slash (optionnal). Example: kafkahq is
3+
base-path: "" # if behind a reverse proxy, path to kafkahq with trailing slash (optional). Example: kafkahq is
44
# behind a reverse proxy with url http://my-server/kafkahq, set base-path: "/kafkahq/".
55
# Not needed if you're behind a reverse proxy with subdomain http://kafkahq.my-server/
6-
access-log: # Access log configuration (optionnal)
6+
access-log: # Access log configuration (optional)
77
enabled: true # true by default
88
name: org.kafkahq.log.access # Logger name
99
format: "[Date: {}] [Duration: {} ms] [Url: {} {} {}] [Status: {}] [Ip: {}] [Length: {}] [Port: {}]" # Logger format
1010

11-
# default kafka properties for each clients, available for admin / producer / consumer (optionnal)
11+
# default kafka properties for each clients, available for admin / producer / consumer (optional)
1212
clients-defaults:
1313
consumer:
1414
properties:
@@ -17,9 +17,9 @@ kafkahq:
1717
# list of kafka cluster available for kafkahq
1818
connections:
1919
my-cluster-1: # url friendly name for the cluster
20-
properties: # standard kafka properties (optionnal)
20+
properties: # standard kafka properties (optional)
2121
bootstrap.servers: "kafka:9092"
22-
schema-registry: "http://schema-registry:8085" # schema registry url (optionnal)
22+
schema-registry: "http://schema-registry:8085" # schema registry url (optional)
2323

2424
my-cluster-2:
2525
properties:
@@ -43,13 +43,13 @@ kafkahq:
4343
ssl.keystore.password: password
4444
ssl.key.password: password
4545

46-
# Topic display data options (optionnal)
46+
# Topic display data options (optional)
4747
topic-data:
4848
sort: OLDEST # default sort order (OLDEST, NEWEST) (default: OLDEST)
4949
size: 50 # max record per page (default: 50)
5050
poll-timeout: 1000 # The time, in milliseconds, spent waiting in poll if data is not available in the buffer.
5151

52-
# Auth & Roles (optionnal)
52+
# Auth & Roles (optional)
5353
security:
5454
default-roles: # Roles available for all the user even unlogged user
5555
- topic/read

src/main/java/org/kafkahq/controllers/LoginController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@Requires(property = SecurityConfigurationProperties.PREFIX + ".enabled", value = StringUtils.TRUE)
1717
@Controller
1818
public class LoginController extends AbstractController {
19-
@Get("/login{/failed:[a-zA-Z]+}")
19+
@Get("${kafkahq.server.base-path:}/login{/failed:[a-zA-Z]+}")
2020
@View("login")
2121
public HttpResponse login(Optional<String> failed) {
2222
return HttpResponse

src/main/resources/views/login.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<@template.header "Login" />
66

7-
<form class="khq-login" method="POST" action="/login">
7+
<form class="khq-login" method="POST" action="${basePath}/login">
88
<div>
99
<h3 class="logo"><img src="${basePath}/static/img/logo.svg" alt=""/><sup><strong>HQ</strong></sup></h3>
1010
</div>

0 commit comments

Comments
 (0)