oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.29k stars 739 forks source link

Opengrok not showing projects - indexer is working. #4556

Closed kasiapetka closed 3 months ago

kasiapetka commented 3 months ago

Hi I have a configured opengrok on docker container. I have below auth config:

/tomcat/conf/server.xml:

      <Realm className="org.apache.catalina.realm.CombinedRealm" >
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>
        <Realm className="org.apache.catalina.realm.JNDIRealm"
              debug="99"
              digest="MD5"
              digestEncoding="UTF-8"
              connectionURL=""
              connectionName=""
              connectionPassword=""
              userBase=""
              userSearch="(uid={0})"
              userSubtree="true"
              userRoleName=""
              allRolesMode="" />
      </Realm>

/tomcat/conf/web.xml:


  <security-constraint>
        <web-resource-collection>
            <web-resource-name>API endpoints are checked separately by the web app</web-resource-name>
            <url-pattern>/api/*</url-pattern>
        </web-resource-collection>
    </security-constraint>

  <security-constraint>
      <web-resource-collection>
          <web-resource-name>OpenGrok</web-resource-name>
          <url-pattern>/*</url-pattern>
      </web-resource-collection>

      <auth-constraint>
          <role-name>*</role-name>
      </auth-constraint>

  </security-constraint>

  <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name></realm-name>
  </login-config>

  <security-role>
      <description/>
      <role-name>*</role-name>
  </security-role>

/tomcat/conf/tomcat-users.xml:

  <role rolename="manager-gui"/>
  <user username="tomcat" password="og_s3cret" roles="manager-gui"/>
  <role rolename="opengrok"/>
  <user username="opengrok" password="opengrokcheck" roles="opengrok,tomcat,manager-script,manager-gui"/>

and readonly config:


 <?xml version="1.0" encoding="UTF-8"?>
<java version="1.8.0_172" class="java.beans.XMLDecoder">
 <object class="org.opengrok.indexer.configuration.Configuration" id="Configuration0">

  <void property="pluginDirectory">
   <string>/opengrok/dist/share/lib</string>
  </void>

  <void property="pluginStack">
        <void property="stack">
            <!-- get user cred from HTTP headers -->

            <void method="add">
                <object class="org.opengrok.indexer.authorization.AuthorizationPlugin">
                    <void property="name">
                        <string>opengrok.auth.plugin.UserPlugin</string>
                    </void>
                    <void property="flag">
                        <string>REQUISITE</string>
                    </void>
                    <void property="setup">
                        <void method="put">
                             <string>decoder</string>
                             <string>opengrok.auth.plugin.decoders.HttpBasicAuthHeaderDecoder</string>
                        </void>
                    </void>
                </object>
            </void>

            <void method="add">
                <object class="org.opengrok.indexer.authorization.AuthorizationPlugin">
                    <void property="forProjects">
                            <void method="add">
                                <string>opengrok</string>
                            </void>
                    </void>
                    <void property="name">
                        <string>opengrok.auth.plugin.UserWhiteListPlugin</string>
                    </void>
                    <void property="flag">
                        <string>REQUIRED</string>
                    </void>
                    <void property="setup">
                        <void method="put">
                             <string>file</string>
                             <string>/opengrok/etc/whitelist.txt</string>
                        </void>
                    </void>
                </object>
            </void>

        </void>
  </void>
 </object>
</java>

Everything is applied correctly. I can authenticate to tomcat app and opengrok can do reindex. However tafter indexing there is nothing in web ui. No porjects are shown in the web page. Without authentication it works well. Do You have any suggestions or ideas how should I modify my config?