diff --git a/jetty/src/main/jetty-base/webapps/nomulus.xml b/jetty/src/main/jetty-base/webapps/nomulus.xml index b03979805..9e9d1c70b 100644 --- a/jetty/src/main/jetty-base/webapps/nomulus.xml +++ b/jetty/src/main/jetty-base/webapps/nomulus.xml @@ -4,4 +4,8 @@ / ./webapps/nomulus.war + + google.registry.jetty + true + diff --git a/util/src/main/java/google/registry/util/RegistryEnvironment.java b/util/src/main/java/google/registry/util/RegistryEnvironment.java index 8b606d3fe..559228080 100644 --- a/util/src/main/java/google/registry/util/RegistryEnvironment.java +++ b/util/src/main/java/google/registry/util/RegistryEnvironment.java @@ -47,6 +47,18 @@ public enum RegistryEnvironment { */ UNITTEST; + /** System property for configuring which environment we should use. */ + private static final String PROPERTY = "google.registry.environment"; + + /** + * System property for if Nomulus is running on top of a self-hosted Jetty server (i.e., not in + * App Engine). + */ + private static final String JETTY_PROPERTY = "google.registry.jetty"; + + private static final boolean ON_JETTY = + Boolean.parseBoolean(System.getProperty(JETTY_PROPERTY, "false")); + /** Sets this enum as the name of the registry environment. */ public RegistryEnvironment setup() { return setup(SystemPropertySetter.PRODUCTION_IMPL); @@ -66,6 +78,7 @@ public enum RegistryEnvironment { return valueOf(Ascii.toUpperCase(System.getProperty(PROPERTY, UNITTEST.name()))); } - /** System property for configuring which environment we should use. */ - private static final String PROPERTY = "google.registry.environment"; + public static boolean isOnJetty() { + return ON_JETTY; + } }