Expand submodule subscription support

Current sub module implementation limits the support to sites where
the canonical site name matches the server in the .gitmodules
file. Some sites run the web front end of Gerrit on a different
address than the SSH server, but they still want to utilize the
submodule subscription support.

This patch checks the [sshd] section of the gerrit.config
configuration file to extract the "proper" ssh server name. If the
server name is different from the canoncial web address Gerrit will
use the configured SSH host name when checking the .gitmodules file in
the super repository.

Change-Id: I48dc3964e130c624cc395dbe80f87f36aa8c19f8
This commit is contained in:
Peter Jönsson
2012-05-28 22:57:08 +02:00
committed by Peter Jönsson
parent f6ce5cc010
commit 333676bd1b
8 changed files with 210 additions and 47 deletions

View File

@@ -42,6 +42,8 @@ import com.google.gerrit.server.config.AuthConfig;
import com.google.gerrit.server.config.AuthConfigModule;
import com.google.gerrit.server.config.CanonicalWebUrlModule;
import com.google.gerrit.server.config.CanonicalWebUrlProvider;
import com.google.gerrit.server.config.SshdListenAddressModule;
import com.google.gerrit.server.config.SshdListenAddressProvider;
import com.google.gerrit.server.config.GerritGlobalModule;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.config.MasterNodeStartup;
@@ -295,6 +297,16 @@ public class Daemon extends SiteProgram {
modules.add(new SmtpEmailSender.Module());
modules.add(new SignedTokenEmailTokenVerifier.Module());
modules.add(new PluginModule());
if (sshd) {
modules.add(new SshdListenAddressModule() {
@Override
protected Class<? extends Provider<String>> provider() {
return SshdListenAddressProvider.class;
}
});
}
if (httpd) {
modules.add(new CanonicalWebUrlModule() {
@Override