Merge branch 'stable-2.10'
* stable-2.10: Inject InitStep members again before calling postRun. SSHD: Update to 0.13.0 Bump SSHD Mina version to 2.0.8 Bump Bouncycastle version to 1.51 Update EncryptedContactStore to not use deprecated/removed methods Change-Id: I7853def28109357e8629f1384f90d4630da00483
This commit is contained in:
		@@ -67,6 +67,8 @@ public class BaseInit extends SiteProgram {
 | 
				
			|||||||
  protected final PluginsDistribution pluginsDistribution;
 | 
					  protected final PluginsDistribution pluginsDistribution;
 | 
				
			||||||
  private final List<String> pluginsToInstall;
 | 
					  private final List<String> pluginsToInstall;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  private Injector sysInjector;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  protected BaseInit(PluginsDistribution pluginsDistribution,
 | 
					  protected BaseInit(PluginsDistribution pluginsDistribution,
 | 
				
			||||||
      List<String> pluginsToInstall) {
 | 
					      List<String> pluginsToInstall) {
 | 
				
			||||||
    this.standalone = true;
 | 
					    this.standalone = true;
 | 
				
			||||||
@@ -108,7 +110,7 @@ public class BaseInit extends SiteProgram {
 | 
				
			|||||||
      run = createSiteRun(init);
 | 
					      run = createSiteRun(init);
 | 
				
			||||||
      run.upgradeSchema();
 | 
					      run.upgradeSchema();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      init.initializer.postRun();
 | 
					      init.initializer.postRun(createSysInjector(init));
 | 
				
			||||||
    } catch (Exception failure) {
 | 
					    } catch (Exception failure) {
 | 
				
			||||||
      if (init.flags.deleteOnFailure) {
 | 
					      if (init.flags.deleteOnFailure) {
 | 
				
			||||||
        recursiveDelete(getSitePath());
 | 
					        recursiveDelete(getSitePath());
 | 
				
			||||||
@@ -326,15 +328,18 @@ public class BaseInit extends SiteProgram {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  private Injector createSysInjector(final SiteInit init) {
 | 
					  private Injector createSysInjector(final SiteInit init) {
 | 
				
			||||||
    final List<Module> modules = new ArrayList<>();
 | 
					    if (sysInjector == null) {
 | 
				
			||||||
    modules.add(new AbstractModule() {
 | 
					      final List<Module> modules = new ArrayList<Module>();
 | 
				
			||||||
      @Override
 | 
					      modules.add(new AbstractModule() {
 | 
				
			||||||
      protected void configure() {
 | 
					        @Override
 | 
				
			||||||
        bind(ConsoleUI.class).toInstance(init.ui);
 | 
					        protected void configure() {
 | 
				
			||||||
        bind(InitFlags.class).toInstance(init.flags);
 | 
					          bind(ConsoleUI.class).toInstance(init.ui);
 | 
				
			||||||
      }
 | 
					          bind(InitFlags.class).toInstance(init.flags);
 | 
				
			||||||
    });
 | 
					        }
 | 
				
			||||||
    return createDbInjector(SINGLE_USER).createChildInjector(modules);
 | 
					      });
 | 
				
			||||||
 | 
					      sysInjector = createDbInjector(SINGLE_USER).createChildInjector(modules);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return sysInjector;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  private static void recursiveDelete(File path) {
 | 
					  private static void recursiveDelete(File path) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,6 +22,7 @@ import com.google.gerrit.pgm.init.api.InitStep;
 | 
				
			|||||||
import com.google.gerrit.server.config.SitePaths;
 | 
					import com.google.gerrit.server.config.SitePaths;
 | 
				
			||||||
import com.google.gerrit.server.plugins.JarPluginProvider;
 | 
					import com.google.gerrit.server.plugins.JarPluginProvider;
 | 
				
			||||||
import com.google.inject.Inject;
 | 
					import com.google.inject.Inject;
 | 
				
			||||||
 | 
					import com.google.inject.Injector;
 | 
				
			||||||
import com.google.inject.Singleton;
 | 
					import com.google.inject.Singleton;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.io.File;
 | 
					import java.io.File;
 | 
				
			||||||
@@ -71,6 +72,8 @@ public class InitPlugins implements InitStep {
 | 
				
			|||||||
  private final InitPluginStepsLoader pluginLoader;
 | 
					  private final InitPluginStepsLoader pluginLoader;
 | 
				
			||||||
  private final PluginsDistribution pluginsDistribution;
 | 
					  private final PluginsDistribution pluginsDistribution;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  private Injector postRunInjector;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @Inject
 | 
					  @Inject
 | 
				
			||||||
  InitPlugins(final ConsoleUI ui, final SitePaths site,
 | 
					  InitPlugins(final ConsoleUI ui, final SitePaths site,
 | 
				
			||||||
      InitFlags initFlags, InitPluginStepsLoader pluginLoader,
 | 
					      InitFlags initFlags, InitPluginStepsLoader pluginLoader,
 | 
				
			||||||
@@ -95,6 +98,11 @@ public class InitPlugins implements InitStep {
 | 
				
			|||||||
    postInitPlugins();
 | 
					    postInitPlugins();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @Inject(optional = true)
 | 
				
			||||||
 | 
					  void setPostRunInjector(Injector injector) {
 | 
				
			||||||
 | 
					    postRunInjector = injector;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  private void installPlugins() throws IOException {
 | 
					  private void installPlugins() throws IOException {
 | 
				
			||||||
    List<PluginData> plugins = listPlugins(site, pluginsDistribution);
 | 
					    List<PluginData> plugins = listPlugins(site, pluginsDistribution);
 | 
				
			||||||
    for (PluginData plugin : plugins) {
 | 
					    for (PluginData plugin : plugins) {
 | 
				
			||||||
@@ -146,6 +154,7 @@ public class InitPlugins implements InitStep {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  private void postInitPlugins() throws Exception {
 | 
					  private void postInitPlugins() throws Exception {
 | 
				
			||||||
    for (InitStep initStep : pluginLoader.getInitSteps()) {
 | 
					    for (InitStep initStep : pluginLoader.getInitSteps()) {
 | 
				
			||||||
 | 
					      postRunInjector.injectMembers(initStep);
 | 
				
			||||||
      initStep.postRun();
 | 
					      initStep.postRun();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -109,12 +109,13 @@ public class SitePathInitializer {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  public void postRun() throws Exception {
 | 
					  public void postRun(Injector injector) throws Exception {
 | 
				
			||||||
    for (InitStep step : steps) {
 | 
					    for (InitStep step : steps) {
 | 
				
			||||||
      if (step instanceof InitPlugins
 | 
					      if (step instanceof InitPlugins
 | 
				
			||||||
          && flags.skipPlugins) {
 | 
					          && flags.skipPlugins) {
 | 
				
			||||||
        continue;
 | 
					        continue;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					      injector.injectMembers(step);
 | 
				
			||||||
      step.postRun();
 | 
					      step.postRun();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,16 +15,16 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Version should match lib/bouncycastle/BUCK
 | 
					# Version should match lib/bouncycastle/BUCK
 | 
				
			||||||
[library "bouncyCastleProvider"]
 | 
					[library "bouncyCastleProvider"]
 | 
				
			||||||
  name = Bouncy Castle Crypto Provider v149
 | 
					  name = Bouncy Castle Crypto Provider v151
 | 
				
			||||||
  url = http://www.bouncycastle.org/download/bcprov-jdk15on-149.jar
 | 
					  url = http://www.bouncycastle.org/download/bcprov-jdk15on-151.jar
 | 
				
			||||||
  sha1 = f5155f04330459104b79923274db5060c1057b99
 | 
					  sha1 = 9ab8afcc2842d5ef06eb775a0a2b12783b99aa80
 | 
				
			||||||
  remove = bcprov-.*[.]jar
 | 
					  remove = bcprov-.*[.]jar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Version should match lib/bouncycastle/BUCK
 | 
					# Version should match lib/bouncycastle/BUCK
 | 
				
			||||||
[library "bouncyCastleSSL"]
 | 
					[library "bouncyCastleSSL"]
 | 
				
			||||||
  name = Bouncy Castle Crypto SSL v149
 | 
					  name = Bouncy Castle Crypto SSL v151
 | 
				
			||||||
  url = http://www.bouncycastle.org/download/bcpkix-jdk15on-149.jar
 | 
					  url = http://www.bouncycastle.org/download/bcpkix-jdk15on-151.jar
 | 
				
			||||||
  sha1 = 924cc7ad2f589630c97b918f044296ebf1bb6855
 | 
					  sha1 = 6c8c1f61bf27a09f9b1a8abc201523669bba9597
 | 
				
			||||||
  needs = bouncyCastleProvider
 | 
					  needs = bouncyCastleProvider
 | 
				
			||||||
  remove = bcpkix-.*[.]jar
 | 
					  remove = bcpkix-.*[.]jar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,20 +1,20 @@
 | 
				
			|||||||
include_defs('//lib/maven.defs')
 | 
					include_defs('//lib/maven.defs')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# This version must match the version that also appears in
 | 
					# This version must match the version that also appears in
 | 
				
			||||||
# gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/libraries.config
 | 
					# gerrit-pgm/src/main/resources/com/google/gerrit/pgm/libraries.config
 | 
				
			||||||
VERSION = '1.49'
 | 
					VERSION = '1.51'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
maven_jar(
 | 
					maven_jar(
 | 
				
			||||||
  name = 'bcprov',
 | 
					  name = 'bcprov',
 | 
				
			||||||
  id = 'org.bouncycastle:bcprov-jdk15on:' + VERSION,
 | 
					  id = 'org.bouncycastle:bcprov-jdk15on:' + VERSION,
 | 
				
			||||||
  sha1 = 'f5155f04330459104b79923274db5060c1057b99',
 | 
					  sha1 = '9ab8afcc2842d5ef06eb775a0a2b12783b99aa80',
 | 
				
			||||||
  license = 'DO_NOT_DISTRIBUTE', #'bouncycastle'
 | 
					  license = 'DO_NOT_DISTRIBUTE', #'bouncycastle'
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
maven_jar(
 | 
					maven_jar(
 | 
				
			||||||
  name = 'bcpg',
 | 
					  name = 'bcpg',
 | 
				
			||||||
  id = 'org.bouncycastle:bcpg-jdk15on:' + VERSION,
 | 
					  id = 'org.bouncycastle:bcpg-jdk15on:' + VERSION,
 | 
				
			||||||
  sha1 = '081d84be5b125e1997ab0e2244d1a2276b5de76c',
 | 
					  sha1 = 'b5fa4c280dfbf8bf7c260bc1e78044c7a1de5133',
 | 
				
			||||||
  license = 'DO_NOT_DISTRIBUTE', #'bouncycastle'
 | 
					  license = 'DO_NOT_DISTRIBUTE', #'bouncycastle'
 | 
				
			||||||
  deps = [':bcprov'],
 | 
					  deps = [':bcprov'],
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
@@ -22,7 +22,7 @@ maven_jar(
 | 
				
			|||||||
maven_jar(
 | 
					maven_jar(
 | 
				
			||||||
  name = 'bcpkix',
 | 
					  name = 'bcpkix',
 | 
				
			||||||
  id = 'org.bouncycastle:bcpkix-jdk15on:' + VERSION,
 | 
					  id = 'org.bouncycastle:bcpkix-jdk15on:' + VERSION,
 | 
				
			||||||
  sha1 = '924cc7ad2f589630c97b918f044296ebf1bb6855',
 | 
					  sha1 = '6c8c1f61bf27a09f9b1a8abc201523669bba9597',
 | 
				
			||||||
  license = 'DO_NOT_DISTRIBUTE', #'bouncycastle'
 | 
					  license = 'DO_NOT_DISTRIBUTE', #'bouncycastle'
 | 
				
			||||||
  deps = [':bcprov'],
 | 
					  deps = [':bcprov'],
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,9 +8,8 @@ EXCLUDE = [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
maven_jar(
 | 
					maven_jar(
 | 
				
			||||||
  name = 'sshd',
 | 
					  name = 'sshd',
 | 
				
			||||||
  id = 'org.apache.sshd:sshd-core:0.12.0-9-g635de65',
 | 
					  id = 'org.apache.sshd:sshd-core:0.13.0',
 | 
				
			||||||
  sha1 = '1ff3c9ebd0acfcd095eef30a0ee0b99846967711',
 | 
					  sha1 = 'c616c5865cc55473c6d63c6fcf46e60d382be172',
 | 
				
			||||||
  repository = GERRIT,
 | 
					 | 
				
			||||||
  license = 'Apache2.0',
 | 
					  license = 'Apache2.0',
 | 
				
			||||||
  deps = [':core'],
 | 
					  deps = [':core'],
 | 
				
			||||||
  exclude = EXCLUDE,
 | 
					  exclude = EXCLUDE,
 | 
				
			||||||
@@ -18,8 +17,8 @@ maven_jar(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
maven_jar(
 | 
					maven_jar(
 | 
				
			||||||
  name = 'core',
 | 
					  name = 'core',
 | 
				
			||||||
  id = 'org.apache.mina:mina-core:2.0.7',
 | 
					  id = 'org.apache.mina:mina-core:2.0.8',
 | 
				
			||||||
  sha1 = 'c878e2aa82de748474a624ec3933e4604e446dec',
 | 
					  sha1 = 'd6ff69fa049aeaecdf0c04cafbb1ab53b7487883',
 | 
				
			||||||
  license = 'Apache2.0',
 | 
					  license = 'Apache2.0',
 | 
				
			||||||
  exclude = EXCLUDE,
 | 
					  exclude = EXCLUDE,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user