{"action":"created","issue":{"url":"https://api.github.com/repos/puppetlabs/trapperkeeper-webserver-jetty9/issues/106","labels_url":"https://api.github.com/repos/puppetlabs/trapperkeeper-webserver-jetty9/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/puppetlabs/trapperkeeper-webserver-jetty9/issues/106/comments","events_url":"https://api.github.com/repos/puppetlabs/trapperkeeper-webserver-jetty9/issues/106/events","html_url":"https://github.com/puppetlabs/trapperkeeper-webserver-jetty9/pull/106","id":57536093,"number":106,"title":"(FOR REVIEW) (TK-144) Add support for configuring Jetty via script","user":{"login":"cprice404","id":1341071,"avatar_url":"https://avatars.githubusercontent.com/u/1341071?v=3","gravatar_id":"","url":"https://api.github.com/users/cprice404","html_url":"https://github.com/cprice404","followers_url":"https://api.github.com/users/cprice404/followers","following_url":"https://api.github.com/users/cprice404/following{/other_user}","gists_url":"https://api.github.com/users/cprice404/gists{/gist_id}","starred_url":"https://api.github.com/users/cprice404/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cprice404/subscriptions","organizations_url":"https://api.github.com/users/cprice404/orgs","repos_url":"https://api.github.com/users/cprice404/repos","events_url":"https://api.github.com/users/cprice404/events{/privacy}","received_events_url":"https://api.github.com/users/cprice404/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-12T23:24:23Z","updated_at":"2015-02-17T20:21:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/puppetlabs/trapperkeeper-webserver-jetty9/pulls/106","html_url":"https://github.com/puppetlabs/trapperkeeper-webserver-jetty9/pull/106","diff_url":"https://github.com/puppetlabs/trapperkeeper-webserver-jetty9/pull/106.diff","patch_url":"https://github.com/puppetlabs/trapperkeeper-webserver-jetty9/pull/106.patch"},"body":"NOTE: This isn't ready for merge yet; it needs (at least) docs and is based on a SNAPSHOT build of trapperkeeper that isn't released yet.\r\n\r\n--------------------------------------------------\r\n\r\nA problem that we have had a few times with Jetty is that, in order to try to\r\nmake it easy for our users to manage the application without having to be Jetty\r\nexperts, we run Jetty embedded and only surface a subset of its configuration\r\noptions that we believe the users might care about.\r\n\r\nThis provides a pretty nice UX in cases where we've plumbed the appropriate\r\nsettings through into our config before shipping a build, but, it can be\r\nproblematic when we are trying to debug a customer issue and we discover a\r\npotentially-relevant Jetty setting that we haven't wired through to our\r\nconfiguration files... it means that we can't toggle the Jetty config setting\r\nwithout shipping them a new build.\r\n\r\nAfter discovering how logback supports some basic Java scripting in their\r\nEvaluatorFilters (via a library called Janino), it occurred to me that we might\r\nbe able to support something similar for our Jetty configuration.\r\n\r\nThis commit does that.  It creates a setting called 'post-config-script', which\r\ncan be used for advanced use cases to provide some code to manipulate a Jetty\r\n`Server` object programatically. This should theoretically allow us to cobble\r\ntogether some sample configuration to ship to users who already have a build\r\ninstalled that can modify basically any setting that is available in Jetty.\r\n\r\nUse cases for this setting would hopefully be temporary, and when we find new\r\nJetty settings that we determine would be valuable to users, we can just plumb\r\nthem through to our normal configuration for the next release, but this would\r\ngive users a workaround that doesn't require us to ship them a whole new build\r\nin the interim."},"comment":{"url":"https://api.github.com/repos/puppetlabs/trapperkeeper-webserver-jetty9/issues/comments/74744787","html_url":"https://github.com/puppetlabs/trapperkeeper-webserver-jetty9/pull/106#issuecomment-74744787","issue_url":"https://api.github.com/repos/puppetlabs/trapperkeeper-webserver-jetty9/issues/106","id":74744787,"user":{"login":"KevinCorcoran","id":2945462,"avatar_url":"https://avatars.githubusercontent.com/u/2945462?v=3","gravatar_id":"","url":"https://api.github.com/users/KevinCorcoran","html_url":"https://github.com/KevinCorcoran","followers_url":"https://api.github.com/users/KevinCorcoran/followers","following_url":"https://api.github.com/users/KevinCorcoran/following{/other_user}","gists_url":"https://api.github.com/users/KevinCorcoran/gists{/gist_id}","starred_url":"https://api.github.com/users/KevinCorcoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KevinCorcoran/subscriptions","organizations_url":"https://api.github.com/users/KevinCorcoran/orgs","repos_url":"https://api.github.com/users/KevinCorcoran/repos","events_url":"https://api.github.com/users/KevinCorcoran/events{/privacy}","received_events_url":"https://api.github.com/users/KevinCorcoran/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T20:21:18Z","updated_at":"2015-02-17T20:21:18Z","body":"I'm :+1: on this, in general.  I took a quick look at the code and don't see any major problems.\r\n\r\nHowever, I'm interested if you considered any alternative solutions to this problem.  There are already a lot of ways to configure Jetty ... in particular, it seems like we might be able to solve this problem by adding a hook to support Jetty's normal `web.xml` configuration.  [This example](https://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty#Configuring_a_File_Server_with_XML) seems to show a path forward that we might be able to follow.  Everybody hates XML, but it *is* baked-into Jetty, so perhaps there's advantages to that in this case.\r\n\r\nI don't have a strong opinion on `web.xml` vs. Janino, but curious what you think about that option."}}