daemon: Fix --disable-sshd when HTTP is enabled
If the HTTP server is enabled, but SSH is disabled with the command line flag, the HTTP server module setup must not try to use the sshdInjector and needs to have the NoSshModule bound in Guice. Change-Id: Ie07c85e3fe344a1d4275c0ce845c98340d25ab40
This commit is contained in:
@@ -31,6 +31,8 @@ public class GitOverHttpModule extends ServletModule {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configureServlets() {
|
protected void configureServlets() {
|
||||||
|
install(new ProjectServlet.Module());
|
||||||
|
|
||||||
filter("/p/*").through(ProjectAccessPathFilter.class);
|
filter("/p/*").through(ProjectAccessPathFilter.class);
|
||||||
if (authConfig.isTrustContainerAuth()) {
|
if (authConfig.isTrustContainerAuth()) {
|
||||||
filter("/p/*").through(ContainerAuthFilter.class);
|
filter("/p/*").through(ContainerAuthFilter.class);
|
||||||
|
@@ -119,7 +119,6 @@ public class WebModule extends FactoryModule {
|
|||||||
install(new UrlModule());
|
install(new UrlModule());
|
||||||
install(new UiRpcModule());
|
install(new UiRpcModule());
|
||||||
install(new GerritRequestModule());
|
install(new GerritRequestModule());
|
||||||
install(new ProjectServlet.Module());
|
|
||||||
|
|
||||||
bind(GitWebConfig.class).toInstance(gitWebConfig);
|
bind(GitWebConfig.class).toInstance(gitWebConfig);
|
||||||
if (gitWebConfig.getGitwebCGI() != null) {
|
if (gitWebConfig.getGitwebCGI() != null) {
|
||||||
|
@@ -250,13 +250,15 @@ public class Daemon extends SiteProgram {
|
|||||||
|
|
||||||
private Injector createWebInjector() {
|
private Injector createWebInjector() {
|
||||||
final List<Module> modules = new ArrayList<Module>();
|
final List<Module> modules = new ArrayList<Module>();
|
||||||
modules.add(sshInjector.getInstance(WebModule.class));
|
|
||||||
modules.add(sysInjector.getInstance(GitOverHttpModule.class));
|
|
||||||
modules.add(sshInjector.getInstance(WebSshGlueModule.class));
|
|
||||||
modules.add(CacheBasedWebSession.module());
|
modules.add(CacheBasedWebSession.module());
|
||||||
modules.add(HttpContactStoreConnection.module());
|
modules.add(HttpContactStoreConnection.module());
|
||||||
|
modules.add(sysInjector.getInstance(WebModule.class));
|
||||||
|
modules.add(sysInjector.getInstance(GitOverHttpModule.class));
|
||||||
if (sshd) {
|
if (sshd) {
|
||||||
modules.add(sshInjector.getInstance(ProjectQoSFilter.Module.class));
|
modules.add(sshInjector.getInstance(WebSshGlueModule.class));
|
||||||
|
modules.add(new ProjectQoSFilter.Module());
|
||||||
|
} else {
|
||||||
|
modules.add(new NoSshModule());
|
||||||
}
|
}
|
||||||
return sysInjector.createChildInjector(modules);
|
return sysInjector.createChildInjector(modules);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user