Re: Gitblit Plugin v2.8-SNAPSHOT: web.otherUrls functionality

67 views
Skip to first unread message

Luca Milanesio

unread,
May 22, 2013, 2:32:10 AM5/22/13
to Bassem Rabil, repo-d...@googlegroups.com
Yep, your change makes sense.

Will you contribute your patch ?

Luca
---------
Sent from my iPhone
Luca Milanesio
Skype: lucamilanesio


On 21 May 2013, at 21:18, Bassem Rabil <bassem...@gmail.com> wrote:

Hi 

I got the gitblit plugin 2.8 SNAPSHOT working with Gerrit 2.6 rc3. However I have an issue with the change with web.otherUrls which is now inherited from gerrit.config since the commit "e8ea1e076f31fe89b27e4a5eb377f08d515c3bf5" on May 9th. We used to have this value to add clone locations on other gerrit mirrors in the previous version for the plugin properties:

Here below my gerrit config file, when I added other mirrors to SSHD section of Gerrit Config, but it seems to me that it gets the first one and rest of entries are ignored.

[sshd]
        listenAddress = *:29418
        listenAddress = gerritmirror1*:29418
        listenAddress = gerritmirror2*:29418
        listenAddress = gerritmirror3*:29418

[httpd]
        listenUrl = proxy-https://localhost:8085/
        requestLog = true


However still the the shown URLs are just SSHD and HTTPD
Repository URLs:



I spotted in the below code the following snippet where I think it adds only the SSHD and HTTPD URLs and there is no place for adding additional URLs representing the mirror clone URLs. 
I would suggest to modify this part of the code to concatenate SSHD and HTTPD URLs to the existing web.otherUrls defined in the properties of gitblit (if it defined in the properties file).

I appreciate your feedback and suggestions on this issue with web.otherURLs

Thanks and Regards
Bassem Rabil

src/main/java/com/googlesource/gerrit/plugins/gitblit/GerritWicketFilter.java (Line 97-98)
--------------------------------------------------------------------------------------------------
 83   public void init(FilterConfig filterConfig) throws ServletException {
 84     showGitBlitBanner();
 85
 86     try {
 87       InputStream resin =
 88           getClass().getResourceAsStream(GITBLIT_GERRIT_PROPERTIES);
 89       Properties properties = null;
 90       try {
 91         properties = new Properties();
 92         properties.load(resin);
 93         properties.put("git.repositoriesFolder", repoManager.getBasePath()
 94             .getAbsolutePath());
 95         properties.put("realm.userService",
 96             GerritToGitBlitUserService.class.getName());
 97         properties.put("web.otherUrls",
 98             (config.getGitHttpUrl() + " " + config.getGitSshUrl()).trim());
 99       } finally {
100         resin.close();
101       }
102       IStoredSettings settings = new GitBlitSettings(properties);
103       GitBlit.self().configureContext(settings, repoManager.getBasePath(),
104           false);
105       GitBlit.self().contextInitialized(
106           new ServletContextEvent(filterConfig.getServletContext()));
107       super.init(new CustomFilterConfig(filterConfig));
108     } catch (Exception e) {
109       throw new ServletException(e);
110     }
111   }

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Luca Milanesio

unread,
May 23, 2013, 8:13:08 AM5/23/13
to Bassem Rabil, repo-d...@googlegroups.com, Bassem Rabil
Just push to the repo as new change and add me as reviewer.

Luca

---------
Sent from my iPhone
Luca Milanesio
Skype: lucamilanesio


On 22 May 2013, at 20:45, Bassem Rabil <bassem...@gmail.com> wrote:

Hi Luca

Good News. I got it working with the usernames by adding additional parameter to the properties file:
web.otherUrls = ssh://{1}@gerritmirror1:29418/{0} ssh://{1}@gerritmirror2:29418/{0}

instead of:
Thanks for your help. What is the process for contributing the patch to the project at googlesource ?
Reply all
Reply to author
Forward
0 new messages