Provide configuration option to disable reverse DNS lookup
Adds gerrit.disableReverseDnsLookup configuration option to disable reverse DNS lookup during audit log entry creation for identified user. By default this option is set to 'false'. Setting this option to 'true' would improve push time from host without reverse DNS entry. Currently JVM will wait for 5s until it gives up reverse resolution, this can be bypassed by changing this new configuration option. Based on input from old mail thread[1] [1] https://groups.google.com/d/msg/repo-discuss/pqq4I0-hiUY/ZmaXA0oWvbwJ Change-Id: I13247799e2a2e8793b3c35d9fffb8f2c069e5ce0 Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
This commit is contained in:
committed by
David Pursehouse
parent
bcf97bd354
commit
45ee73ef9d
@@ -1502,6 +1502,12 @@ Defaults to "Report Bug".
|
|||||||
Default change screen UI to direct users to. Valid values are
|
Default change screen UI to direct users to. Valid values are
|
||||||
`OLD_UI` and `CHANGE_SCREEN2`. Default is `CHANGE_SCREEN2`.
|
`OLD_UI` and `CHANGE_SCREEN2`. Default is `CHANGE_SCREEN2`.
|
||||||
|
|
||||||
|
[[gerrit.disableReverseDnsLookup]]gerrit.disableReverseDnsLookup::
|
||||||
|
+
|
||||||
|
Disables reverse DNS lookup during computing ref log entry for identified user.
|
||||||
|
+
|
||||||
|
Defaults to false.
|
||||||
|
|
||||||
[[gitweb]]
|
[[gitweb]]
|
||||||
=== Section gitweb
|
=== Section gitweb
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ import com.google.gerrit.server.cache.h2.DefaultCacheFactory;
|
|||||||
import com.google.gerrit.server.change.ChangeKindCacheImpl;
|
import com.google.gerrit.server.change.ChangeKindCacheImpl;
|
||||||
import com.google.gerrit.server.config.CanonicalWebUrl;
|
import com.google.gerrit.server.config.CanonicalWebUrl;
|
||||||
import com.google.gerrit.server.config.CanonicalWebUrlProvider;
|
import com.google.gerrit.server.config.CanonicalWebUrlProvider;
|
||||||
|
import com.google.gerrit.server.config.DisableReverseDnsLookup;
|
||||||
|
import com.google.gerrit.server.config.DisableReverseDnsLookupProvider;
|
||||||
import com.google.gerrit.server.config.FactoryModule;
|
import com.google.gerrit.server.config.FactoryModule;
|
||||||
import com.google.gerrit.server.git.ChangeCache;
|
import com.google.gerrit.server.git.ChangeCache;
|
||||||
import com.google.gerrit.server.git.TagCache;
|
import com.google.gerrit.server.git.TagCache;
|
||||||
@@ -81,6 +83,8 @@ public class BatchProgramModule extends FactoryModule {
|
|||||||
.toProvider(CommentLinkProvider.class).in(SINGLETON);
|
.toProvider(CommentLinkProvider.class).in(SINGLETON);
|
||||||
bind(String.class).annotatedWith(CanonicalWebUrl.class)
|
bind(String.class).annotatedWith(CanonicalWebUrl.class)
|
||||||
.toProvider(CanonicalWebUrlProvider.class);
|
.toProvider(CanonicalWebUrlProvider.class);
|
||||||
|
bind(Boolean.class).annotatedWith(DisableReverseDnsLookup.class)
|
||||||
|
.toProvider(DisableReverseDnsLookupProvider.class).in(SINGLETON);
|
||||||
bind(IdentifiedUser.class)
|
bind(IdentifiedUser.class)
|
||||||
.toProvider(Providers.<IdentifiedUser> of(null));
|
.toProvider(Providers.<IdentifiedUser> of(null));
|
||||||
bind(CurrentUser.class).to(IdentifiedUser.class);
|
bind(CurrentUser.class).to(IdentifiedUser.class);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import com.google.gerrit.server.account.ListGroupMembership;
|
|||||||
import com.google.gerrit.server.config.AnonymousCowardName;
|
import com.google.gerrit.server.config.AnonymousCowardName;
|
||||||
import com.google.gerrit.server.config.AuthConfig;
|
import com.google.gerrit.server.config.AuthConfig;
|
||||||
import com.google.gerrit.server.config.CanonicalWebUrl;
|
import com.google.gerrit.server.config.CanonicalWebUrl;
|
||||||
|
import com.google.gerrit.server.config.DisableReverseDnsLookup;
|
||||||
import com.google.gerrit.server.group.SystemGroupBackend;
|
import com.google.gerrit.server.group.SystemGroupBackend;
|
||||||
import com.google.gwtorm.server.OrmException;
|
import com.google.gwtorm.server.OrmException;
|
||||||
import com.google.gwtorm.server.ResultSet;
|
import com.google.gwtorm.server.ResultSet;
|
||||||
@@ -70,6 +71,7 @@ public class IdentifiedUser extends CurrentUser {
|
|||||||
private final Provider<String> canonicalUrl;
|
private final Provider<String> canonicalUrl;
|
||||||
private final AccountCache accountCache;
|
private final AccountCache accountCache;
|
||||||
private final GroupBackend groupBackend;
|
private final GroupBackend groupBackend;
|
||||||
|
private final Boolean disableReverseDnsLookup;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public GenericFactory(
|
public GenericFactory(
|
||||||
@@ -77,6 +79,7 @@ public class IdentifiedUser extends CurrentUser {
|
|||||||
AuthConfig authConfig,
|
AuthConfig authConfig,
|
||||||
@AnonymousCowardName String anonymousCowardName,
|
@AnonymousCowardName String anonymousCowardName,
|
||||||
@CanonicalWebUrl Provider<String> canonicalUrl,
|
@CanonicalWebUrl Provider<String> canonicalUrl,
|
||||||
|
@DisableReverseDnsLookup Boolean disableReverseDnsLookup,
|
||||||
AccountCache accountCache,
|
AccountCache accountCache,
|
||||||
GroupBackend groupBackend) {
|
GroupBackend groupBackend) {
|
||||||
this.capabilityControlFactory = capabilityControlFactory;
|
this.capabilityControlFactory = capabilityControlFactory;
|
||||||
@@ -85,6 +88,7 @@ public class IdentifiedUser extends CurrentUser {
|
|||||||
this.canonicalUrl = canonicalUrl;
|
this.canonicalUrl = canonicalUrl;
|
||||||
this.accountCache = accountCache;
|
this.accountCache = accountCache;
|
||||||
this.groupBackend = groupBackend;
|
this.groupBackend = groupBackend;
|
||||||
|
this.disableReverseDnsLookup = disableReverseDnsLookup;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IdentifiedUser create(final Account.Id id) {
|
public IdentifiedUser create(final Account.Id id) {
|
||||||
@@ -92,22 +96,22 @@ public class IdentifiedUser extends CurrentUser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IdentifiedUser create(Provider<ReviewDb> db, Account.Id id) {
|
public IdentifiedUser create(Provider<ReviewDb> db, Account.Id id) {
|
||||||
return new IdentifiedUser(capabilityControlFactory,
|
return new IdentifiedUser(capabilityControlFactory, authConfig,
|
||||||
authConfig, anonymousCowardName, canonicalUrl, accountCache,
|
anonymousCowardName, canonicalUrl, accountCache, groupBackend,
|
||||||
groupBackend, null, db, id, null);
|
disableReverseDnsLookup, null, db, id, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IdentifiedUser create(SocketAddress remotePeer, Account.Id id) {
|
public IdentifiedUser create(SocketAddress remotePeer, Account.Id id) {
|
||||||
return new IdentifiedUser(capabilityControlFactory,
|
return new IdentifiedUser(capabilityControlFactory, authConfig,
|
||||||
authConfig, anonymousCowardName, canonicalUrl, accountCache,
|
anonymousCowardName, canonicalUrl, accountCache, groupBackend,
|
||||||
groupBackend, Providers.of(remotePeer), null, id, null);
|
disableReverseDnsLookup, Providers.of(remotePeer), null, id, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CurrentUser runAs(SocketAddress remotePeer, Account.Id id,
|
public CurrentUser runAs(SocketAddress remotePeer, Account.Id id,
|
||||||
@Nullable CurrentUser caller) {
|
@Nullable CurrentUser caller) {
|
||||||
return new IdentifiedUser(capabilityControlFactory,
|
return new IdentifiedUser(capabilityControlFactory, authConfig,
|
||||||
authConfig, anonymousCowardName, canonicalUrl, accountCache,
|
anonymousCowardName, canonicalUrl, accountCache, groupBackend,
|
||||||
groupBackend, Providers.of(remotePeer), null, id, caller);
|
disableReverseDnsLookup, Providers.of(remotePeer), null, id, caller);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,6 +129,7 @@ public class IdentifiedUser extends CurrentUser {
|
|||||||
private final Provider<String> canonicalUrl;
|
private final Provider<String> canonicalUrl;
|
||||||
private final AccountCache accountCache;
|
private final AccountCache accountCache;
|
||||||
private final GroupBackend groupBackend;
|
private final GroupBackend groupBackend;
|
||||||
|
private final Boolean disableReverseDnsLookup;
|
||||||
|
|
||||||
private final Provider<SocketAddress> remotePeerProvider;
|
private final Provider<SocketAddress> remotePeerProvider;
|
||||||
private final Provider<ReviewDb> dbProvider;
|
private final Provider<ReviewDb> dbProvider;
|
||||||
@@ -137,6 +142,7 @@ public class IdentifiedUser extends CurrentUser {
|
|||||||
final @CanonicalWebUrl Provider<String> canonicalUrl,
|
final @CanonicalWebUrl Provider<String> canonicalUrl,
|
||||||
final AccountCache accountCache,
|
final AccountCache accountCache,
|
||||||
final GroupBackend groupBackend,
|
final GroupBackend groupBackend,
|
||||||
|
final @DisableReverseDnsLookup Boolean disableReverseDnsLookup,
|
||||||
|
|
||||||
final @RemotePeer Provider<SocketAddress> remotePeerProvider,
|
final @RemotePeer Provider<SocketAddress> remotePeerProvider,
|
||||||
final Provider<ReviewDb> dbProvider) {
|
final Provider<ReviewDb> dbProvider) {
|
||||||
@@ -146,21 +152,22 @@ public class IdentifiedUser extends CurrentUser {
|
|||||||
this.canonicalUrl = canonicalUrl;
|
this.canonicalUrl = canonicalUrl;
|
||||||
this.accountCache = accountCache;
|
this.accountCache = accountCache;
|
||||||
this.groupBackend = groupBackend;
|
this.groupBackend = groupBackend;
|
||||||
|
this.disableReverseDnsLookup = disableReverseDnsLookup;
|
||||||
|
|
||||||
this.remotePeerProvider = remotePeerProvider;
|
this.remotePeerProvider = remotePeerProvider;
|
||||||
this.dbProvider = dbProvider;
|
this.dbProvider = dbProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IdentifiedUser create(Account.Id id) {
|
public IdentifiedUser create(Account.Id id) {
|
||||||
return new IdentifiedUser(capabilityControlFactory,
|
return new IdentifiedUser(capabilityControlFactory, authConfig,
|
||||||
authConfig, anonymousCowardName, canonicalUrl, accountCache,
|
anonymousCowardName, canonicalUrl, accountCache, groupBackend,
|
||||||
groupBackend, remotePeerProvider, dbProvider, id, null);
|
disableReverseDnsLookup, remotePeerProvider, dbProvider, id, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IdentifiedUser runAs(Account.Id id, CurrentUser caller) {
|
public IdentifiedUser runAs(Account.Id id, CurrentUser caller) {
|
||||||
return new IdentifiedUser(capabilityControlFactory,
|
return new IdentifiedUser(capabilityControlFactory, authConfig,
|
||||||
authConfig, anonymousCowardName, canonicalUrl, accountCache,
|
anonymousCowardName, canonicalUrl, accountCache, groupBackend,
|
||||||
groupBackend, remotePeerProvider, dbProvider, id, caller);
|
disableReverseDnsLookup, remotePeerProvider, dbProvider, id, caller);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,6 +184,7 @@ public class IdentifiedUser extends CurrentUser {
|
|||||||
private final AuthConfig authConfig;
|
private final AuthConfig authConfig;
|
||||||
private final GroupBackend groupBackend;
|
private final GroupBackend groupBackend;
|
||||||
private final String anonymousCowardName;
|
private final String anonymousCowardName;
|
||||||
|
private final Boolean disableReverseDnsLookup;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private final Provider<SocketAddress> remotePeerProvider;
|
private final Provider<SocketAddress> remotePeerProvider;
|
||||||
@@ -194,6 +202,7 @@ public class IdentifiedUser extends CurrentUser {
|
|||||||
private Collection<AccountProjectWatch> notificationFilters;
|
private Collection<AccountProjectWatch> notificationFilters;
|
||||||
private CurrentUser realUser;
|
private CurrentUser realUser;
|
||||||
|
|
||||||
|
|
||||||
private IdentifiedUser(
|
private IdentifiedUser(
|
||||||
CapabilityControl.Factory capabilityControlFactory,
|
CapabilityControl.Factory capabilityControlFactory,
|
||||||
final AuthConfig authConfig,
|
final AuthConfig authConfig,
|
||||||
@@ -201,6 +210,7 @@ public class IdentifiedUser extends CurrentUser {
|
|||||||
final Provider<String> canonicalUrl,
|
final Provider<String> canonicalUrl,
|
||||||
final AccountCache accountCache,
|
final AccountCache accountCache,
|
||||||
final GroupBackend groupBackend,
|
final GroupBackend groupBackend,
|
||||||
|
final Boolean disableReverseDnsLookup,
|
||||||
@Nullable final Provider<SocketAddress> remotePeerProvider,
|
@Nullable final Provider<SocketAddress> remotePeerProvider,
|
||||||
@Nullable final Provider<ReviewDb> dbProvider,
|
@Nullable final Provider<ReviewDb> dbProvider,
|
||||||
final Account.Id id,
|
final Account.Id id,
|
||||||
@@ -211,6 +221,7 @@ public class IdentifiedUser extends CurrentUser {
|
|||||||
this.groupBackend = groupBackend;
|
this.groupBackend = groupBackend;
|
||||||
this.authConfig = authConfig;
|
this.authConfig = authConfig;
|
||||||
this.anonymousCowardName = anonymousCowardName;
|
this.anonymousCowardName = anonymousCowardName;
|
||||||
|
this.disableReverseDnsLookup = disableReverseDnsLookup;
|
||||||
this.remotePeerProvider = remotePeerProvider;
|
this.remotePeerProvider = remotePeerProvider;
|
||||||
this.dbProvider = dbProvider;
|
this.dbProvider = dbProvider;
|
||||||
this.accountId = id;
|
this.accountId = id;
|
||||||
@@ -383,7 +394,7 @@ public class IdentifiedUser extends CurrentUser {
|
|||||||
final InetSocketAddress sa = (InetSocketAddress) remotePeer;
|
final InetSocketAddress sa = (InetSocketAddress) remotePeer;
|
||||||
final InetAddress in = sa.getAddress();
|
final InetAddress in = sa.getAddress();
|
||||||
|
|
||||||
host = in != null ? in.getCanonicalHostName() : sa.getHostName();
|
host = in != null ? getHost(in) : sa.getHostName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (host == null || host.isEmpty()) {
|
if (host == null || host.isEmpty()) {
|
||||||
@@ -444,4 +455,11 @@ public class IdentifiedUser extends CurrentUser {
|
|||||||
public boolean isIdentifiedUser() {
|
public boolean isIdentifiedUser() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getHost(final InetAddress in) {
|
||||||
|
if (Boolean.FALSE.equals(disableReverseDnsLookup)) {
|
||||||
|
return in.getCanonicalHostName();
|
||||||
|
}
|
||||||
|
return in.getHostAddress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
// Copyright (C) 2014 The Android Open Source Project
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
package com.google.gerrit.server.config;
|
||||||
|
|
||||||
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
|
|
||||||
|
import com.google.inject.BindingAnnotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
|
||||||
|
@Retention(RUNTIME)
|
||||||
|
@BindingAnnotation
|
||||||
|
public @interface DisableReverseDnsLookup {
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
// Copyright (C) 2014 The Android Open Source Project
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
package com.google.gerrit.server.config;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Provider;
|
||||||
|
|
||||||
|
import org.eclipse.jgit.lib.Config;
|
||||||
|
|
||||||
|
public class DisableReverseDnsLookupProvider implements Provider<Boolean> {
|
||||||
|
private final boolean disableReverseDnsLookup;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DisableReverseDnsLookupProvider(@GerritServerConfig Config config) {
|
||||||
|
disableReverseDnsLookup =
|
||||||
|
config.getBoolean("gerrit", null, "disableReverseDnsLookup", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean get() {
|
||||||
|
return disableReverseDnsLookup;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -233,6 +233,8 @@ public class GerritGlobalModule extends FactoryModule {
|
|||||||
bind(FromAddressGenerator.class).toProvider(
|
bind(FromAddressGenerator.class).toProvider(
|
||||||
FromAddressGeneratorProvider.class).in(SINGLETON);
|
FromAddressGeneratorProvider.class).in(SINGLETON);
|
||||||
bind(WebLinks.class).toProvider(WebLinksProvider.class).in(SINGLETON);
|
bind(WebLinks.class).toProvider(WebLinksProvider.class).in(SINGLETON);
|
||||||
|
bind(Boolean.class).annotatedWith(DisableReverseDnsLookup.class)
|
||||||
|
.toProvider(DisableReverseDnsLookupProvider.class).in(SINGLETON);
|
||||||
|
|
||||||
bind(PatchSetInfoFactory.class);
|
bind(PatchSetInfoFactory.class);
|
||||||
bind(IdentifiedUser.GenericFactory.class).in(SINGLETON);
|
bind(IdentifiedUser.GenericFactory.class).in(SINGLETON);
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ import com.google.gerrit.server.config.AllUsersNameProvider;
|
|||||||
import com.google.gerrit.server.config.AnonymousCowardName;
|
import com.google.gerrit.server.config.AnonymousCowardName;
|
||||||
import com.google.gerrit.server.config.AnonymousCowardNameProvider;
|
import com.google.gerrit.server.config.AnonymousCowardNameProvider;
|
||||||
import com.google.gerrit.server.config.CanonicalWebUrl;
|
import com.google.gerrit.server.config.CanonicalWebUrl;
|
||||||
|
import com.google.gerrit.server.config.DisableReverseDnsLookup;
|
||||||
import com.google.gerrit.server.config.GerritServerConfig;
|
import com.google.gerrit.server.config.GerritServerConfig;
|
||||||
import com.google.gerrit.server.extensions.events.GitReferenceUpdated;
|
import com.google.gerrit.server.extensions.events.GitReferenceUpdated;
|
||||||
import com.google.gerrit.server.git.GitModule;
|
import com.google.gerrit.server.git.GitModule;
|
||||||
@@ -181,6 +182,8 @@ public class CommentsTest {
|
|||||||
.toProvider(AnonymousCowardNameProvider.class);
|
.toProvider(AnonymousCowardNameProvider.class);
|
||||||
bind(String.class).annotatedWith(CanonicalWebUrl.class)
|
bind(String.class).annotatedWith(CanonicalWebUrl.class)
|
||||||
.toInstance("http://localhost:8080/");
|
.toInstance("http://localhost:8080/");
|
||||||
|
bind(Boolean.class).annotatedWith(DisableReverseDnsLookup.class)
|
||||||
|
.toInstance(Boolean.FALSE);
|
||||||
bind(GroupBackend.class).to(SystemGroupBackend.class).in(SINGLETON);
|
bind(GroupBackend.class).to(SystemGroupBackend.class).in(SINGLETON);
|
||||||
bind(AccountCache.class).toInstance(accountCache);
|
bind(AccountCache.class).toInstance(accountCache);
|
||||||
bind(GitReferenceUpdated.class)
|
bind(GitReferenceUpdated.class)
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import com.google.gerrit.server.config.AllUsersNameProvider;
|
|||||||
import com.google.gerrit.server.config.AnonymousCowardName;
|
import com.google.gerrit.server.config.AnonymousCowardName;
|
||||||
import com.google.gerrit.server.config.AnonymousCowardNameProvider;
|
import com.google.gerrit.server.config.AnonymousCowardNameProvider;
|
||||||
import com.google.gerrit.server.config.CanonicalWebUrl;
|
import com.google.gerrit.server.config.CanonicalWebUrl;
|
||||||
|
import com.google.gerrit.server.config.DisableReverseDnsLookup;
|
||||||
import com.google.gerrit.server.config.FactoryModule;
|
import com.google.gerrit.server.config.FactoryModule;
|
||||||
import com.google.gerrit.server.config.GerritServerConfig;
|
import com.google.gerrit.server.config.GerritServerConfig;
|
||||||
import com.google.gerrit.server.extensions.events.GitReferenceUpdated;
|
import com.google.gerrit.server.extensions.events.GitReferenceUpdated;
|
||||||
@@ -129,6 +130,8 @@ public class AbstractChangeNotesTest {
|
|||||||
.toProvider(AnonymousCowardNameProvider.class);
|
.toProvider(AnonymousCowardNameProvider.class);
|
||||||
bind(String.class).annotatedWith(CanonicalWebUrl.class)
|
bind(String.class).annotatedWith(CanonicalWebUrl.class)
|
||||||
.toInstance("http://localhost:8080/");
|
.toInstance("http://localhost:8080/");
|
||||||
|
bind(Boolean.class).annotatedWith(DisableReverseDnsLookup.class)
|
||||||
|
.toInstance(Boolean.FALSE);
|
||||||
bind(Realm.class).to(FakeRealm.class);
|
bind(Realm.class).to(FakeRealm.class);
|
||||||
bind(GroupBackend.class).to(SystemGroupBackend.class).in(SINGLETON);
|
bind(GroupBackend.class).to(SystemGroupBackend.class).in(SINGLETON);
|
||||||
bind(AccountCache.class).toInstance(accountCache);
|
bind(AccountCache.class).toInstance(accountCache);
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ import com.google.gerrit.server.config.AnonymousCowardName;
|
|||||||
import com.google.gerrit.server.config.AnonymousCowardNameProvider;
|
import com.google.gerrit.server.config.AnonymousCowardNameProvider;
|
||||||
import com.google.gerrit.server.config.CanonicalWebUrl;
|
import com.google.gerrit.server.config.CanonicalWebUrl;
|
||||||
import com.google.gerrit.server.config.CanonicalWebUrlProvider;
|
import com.google.gerrit.server.config.CanonicalWebUrlProvider;
|
||||||
|
import com.google.gerrit.server.config.DisableReverseDnsLookup;
|
||||||
import com.google.gerrit.server.config.FactoryModule;
|
import com.google.gerrit.server.config.FactoryModule;
|
||||||
import com.google.gerrit.server.config.GerritServerConfig;
|
import com.google.gerrit.server.config.GerritServerConfig;
|
||||||
import com.google.gerrit.server.config.SitePaths;
|
import com.google.gerrit.server.config.SitePaths;
|
||||||
@@ -269,6 +270,8 @@ public class Util {
|
|||||||
bind(GroupBackend.class).to(SystemGroupBackend.class);
|
bind(GroupBackend.class).to(SystemGroupBackend.class);
|
||||||
bind(String.class).annotatedWith(CanonicalWebUrl.class)
|
bind(String.class).annotatedWith(CanonicalWebUrl.class)
|
||||||
.toProvider(CanonicalWebUrlProvider.class);
|
.toProvider(CanonicalWebUrlProvider.class);
|
||||||
|
bind(Boolean.class).annotatedWith(DisableReverseDnsLookup.class)
|
||||||
|
.toInstance(Boolean.FALSE);
|
||||||
bind(String.class).annotatedWith(AnonymousCowardName.class)
|
bind(String.class).annotatedWith(AnonymousCowardName.class)
|
||||||
.toProvider(AnonymousCowardNameProvider.class);
|
.toProvider(AnonymousCowardNameProvider.class);
|
||||||
bind(ChangeKindCache.class).to(ChangeKindCacheImpl.NoCache.class);
|
bind(ChangeKindCache.class).to(ChangeKindCacheImpl.NoCache.class);
|
||||||
|
|||||||
Reference in New Issue
Block a user