Jenkins and Jetty

539 views
Skip to first unread message

Alexander Voss

unread,
May 14, 2013, 2:32:46 AM5/14/13
to jenkins...@googlegroups.com

Dear all,

I have been trying to install Jenkins in a Jetty container. I soon came across the problem that Jenkins requires a login service 


My problem is that the solutions described here do not seem to work. Only when I introduced a realm name into the Jenkins configuration that matched the name provided to the LoginService did Jenkins start up ok. However, now when I access it for the first time I am asked to set up security but not for an admin password, so I am logged out of the system as soon as I turn security on. There does not seem to be a way to provide the admin password. I seem to remember that Jenkins was asking for one in earlier versions. So, I suspect that either my providing a realm name in web.xml was wrong (but what name should I give the LoginSevice?) or there is another problem?

I am using Jenkins 1.514 and Jetty 9.0.3.v20130506.

My Jetty application context configuration (webapps/jenkins.xml) looks like this:

--8<--
<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/jenkins.war</Set>
  <Set name="contextPath">/jenkins</Set>
  <Set name="overrideDescriptor"><SystemProperty name="jetty.home" default="."/>/confs/jenkins-web.xml</Set>
<Get name="securityHandler">
    <Set name="loginService">
      <New class="org.eclipse.jetty.security.HashLoginService">
            <Set name="name">jenkins</Set>
            <Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/realm.properties</Set>
      </New>
    </Set>
  </Get>
</Configure>
--8<--

and my overlay web.xml (confs/jenkins-web.xml) like this:

--8<--
<?xml version="1.0" encoding="UTF-8"?>
         version="2.4">
  <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>jenkins</realm-name>
    <form-login-config>
      <form-login-page>/login</form-login-page>
      <form-error-page>/loginError</form-error-page>
    </form-login-config>
  </login-config>
</web-app>
--8<--

Cheers,

Alex

Alexander Voss

unread,
May 14, 2013, 4:42:37 AM5/14/13
to jenkins...@googlegroups.com

Hi again,

sorry, I should have mentioned that I am trying to use the Jenkins built-in user database and per-project matrix authentication.

Cheers,

Alex

Alexander Voss

unread,
May 14, 2013, 12:29:06 PM5/14/13
to jenkins...@googlegroups.com
Hi again,

I figured out that the way to create a user account is to leave the 'allow users to sign up' box ticked initially, set up an account with all rights, the remove the tick. (perhaps that as too obvious for me to see...) However, my question about the configuration of Jenkins in Jetty is still open - is it right to add the real name to the Jenkins web.xml? It did not work before I changed this and now seems to work but before I deploy this on a production server I would like to know I am not holding the wrong end of the stick.

Cheers,

Alex

On Tuesday, 14 May 2013 07:32:46 UTC+1, Alexander Voss wrote:
Reply all
Reply to author
Forward
0 new messages