Skip to content

Commit

Permalink
Merge pull request DeemOpen#24 from aemrob/master
Browse files Browse the repository at this point in the history
added support for zkui behind a proxy
  • Loading branch information
Arjun Surendra authored Feb 20, 2017
2 parents 7fac42e + 0d3335c commit 6572a9d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/target/
.idea/
zkui.iml
/target/
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ build:
rm docker/config.cfg

publish:
docker tag -f $(NAME):$(VERSION) $(NAME):$(VERSION)
docker tag -f $(NAME):$(VERSION) $(NAME):latest
docker push $(NAME)
docker tag $(NAME):$(VERSION) $(NAME):$(VERSION)
docker tag $(NAME):$(VERSION) $(NAME):latest
docker push $(NAME)
4 changes: 3 additions & 1 deletion config.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ keystoreManagerPwd=password
# The default ACL to use for all creation of nodes. If left blank, then all nodes will be universally accessible
# Permissions are based on single character flags: c (Create), r (read), w (write), d (delete), a (admin), * (all)
# For example defaultAcl={"acls": [{"scheme":"ip", "id":"192.168.1.192", "perms":"*"}, {"scheme":"ip", id":"192.168.1.0/24", "perms":"r"}]
defaultAcl=
defaultAcl=
# Set X-Forwarded-For to true if zkui is behind a proxy
X-Forwarded-For=false
3 changes: 3 additions & 0 deletions src/main/java/com/deem/zkui/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public static void main(String[] args) throws Exception {
https.setPort(Integer.parseInt(globalProps.getProperty("serverPort")));
server.setConnectors(new Connector[]{https});
} else {
if(globalProps.getProperty("X-Forwarded-For").equals("true")) {
http_config.addCustomizer(new org.eclipse.jetty.server.ForwardedRequestCustomizer());
}
ServerConnector http = new ServerConnector(server, new HttpConnectionFactory(http_config));
http.setPort(Integer.parseInt(globalProps.getProperty("serverPort")));
server.setConnectors(new Connector[]{http});
Expand Down

0 comments on commit 6572a9d

Please sign in to comment.