diff --git a/java/com/google/gerrit/pgm/init/InitSshd.java b/java/com/google/gerrit/pgm/init/InitSshd.java index 68bdefc6c5..c0adbe785b 100644 --- a/java/com/google/gerrit/pgm/init/InitSshd.java +++ b/java/com/google/gerrit/pgm/init/InitSshd.java @@ -124,7 +124,7 @@ public class InitSshd implements InitStep { "-q" /* quiet */, "-t", "ed25519", - "-P", + "-N", emptyPassphraseArg, "-C", comment, @@ -152,7 +152,7 @@ public class InitSshd implements InitStep { "ecdsa", "-b", "256", - "-P", + "-N", emptyPassphraseArg, "-C", comment, @@ -180,7 +180,7 @@ public class InitSshd implements InitStep { "ecdsa", "-b", "384", - "-P", + "-N", emptyPassphraseArg, "-C", comment, @@ -208,7 +208,7 @@ public class InitSshd implements InitStep { "ecdsa", "-b", "521", - "-P", + "-N", emptyPassphraseArg, "-C", comment, diff --git a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-gerrit.js b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-gerrit.js index 546b9f321c..e48ef91916 100644 --- a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-gerrit.js +++ b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-gerrit.js @@ -156,4 +156,41 @@ // Preloaded plugins should be installed after Gerrit.install() is set, // since plugin preloader substitutes Gerrit.install() temporarily. Gerrit._pluginLoader.installPreloadedPlugins(); + + // TODO(taoalpha): List all internal supported event names. + // Also convert this to inherited class once we move Gerrit to class. + Gerrit._eventEmitter = new EventEmitter(); + ['addListener', + 'dispatch', + 'emit', + 'off', + 'on', + 'once', + 'removeAllListeners', + 'removeListener', + ].forEach(method => { + /** + * Enabling EventEmitter interface on Gerrit. + * + * This will enable to signal across different parts of js code without relying on DOM, + * including core to core, plugin to plugin and also core to plugin. + * + * @example + * + * // Emit this event from pluginA + * Gerrit.install(pluginA => { + * fetch("some-api").then(() => { + * Gerrit.on("your-special-event", {plugin: pluginA}); + * }); + * }); + * + * // Listen on your-special-event from pluignB + * Gerrit.install(pluginB => { + * Gerrit.on("your-special-event", ({plugin}) => { + * // do something, plugin is pluginA + * }); + * }); + */ + Gerrit[method] = Gerrit._eventEmitter[method].bind(Gerrit._eventEmitter); + }); })(window); \ No newline at end of file diff --git a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-public-js-api.js b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-public-js-api.js index 9ff1297d2c..6dc0309119 100644 --- a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-public-js-api.js +++ b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-public-js-api.js @@ -381,40 +381,4 @@ }; window.Plugin = Plugin; - // TODO(taoalpha): List all internal supported event names. - // Also convert this to inherited class once we move Gerrit to class. - Gerrit._eventEmitter = new EventEmitter(); - ['addListener', - 'dispatch', - 'emit', - 'off', - 'on', - 'once', - 'removeAllListeners', - 'removeListener', - ].forEach(method => { - /** - * Enabling EventEmitter interface on Gerrit. - * - * This will enable to signal across different parts of js code without relying on DOM, - * including core to core, plugin to plugin and also core to plugin. - * - * @example - * - * // Emit this event from pluginA - * Gerrit.install(pluginA => { - * fetch("some-api").then(() => { - * Gerrit.on("your-special-event", {plugin: pluginA}); - * }); - * }); - * - * // Listen on your-special-event from pluignB - * Gerrit.install(pluginB => { - * Gerrit.on("your-special-event", ({plugin}) => { - * // do something, plugin is pluginA - * }); - * }); - */ - Gerrit[method] = Gerrit._eventEmitter[method].bind(Gerrit._eventEmitter); - }); })(window);