|
|
@@ -12,7 +12,6 @@ import lombok.Getter; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.RandomUtils; |
|
|
|
import org.cobbzilla.util.daemon.ZillaRuntime; |
|
|
|
import org.cobbzilla.util.io.FileUtil; |
|
|
|
import org.glassfish.grizzly.http.server.Request; |
|
|
|
import org.glassfish.jersey.server.ContainerRequest; |
|
|
|
|
|
|
@@ -36,6 +35,7 @@ import static org.cobbzilla.util.json.JsonUtil.COMPACT_MAPPER; |
|
|
|
import static org.cobbzilla.util.json.JsonUtil.json; |
|
|
|
import static org.cobbzilla.util.network.NetworkUtil.*; |
|
|
|
import static org.cobbzilla.util.string.StringUtil.splitAndTrim; |
|
|
|
import static org.cobbzilla.util.system.CommandShell.execScript; |
|
|
|
import static org.cobbzilla.wizard.resources.ResourceUtil.invalidEx; |
|
|
|
|
|
|
|
@Slf4j |
|
|
@@ -58,7 +58,7 @@ public class ApiConstants { |
|
|
|
|
|
|
|
private static String initDefaultDomain() { |
|
|
|
final File f = new File(HOME_DIR, ".BUBBLE_DEFAULT_DOMAIN"); |
|
|
|
final String domain = FileUtil.toStringOrDie(f); |
|
|
|
final String domain = toStringOrDie(f); |
|
|
|
return domain != null ? domain.trim() : die("initDefaultDomain: "+abs(f)+" not found"); |
|
|
|
} |
|
|
|
|
|
|
@@ -75,6 +75,9 @@ public class ApiConstants { |
|
|
|
|
|
|
|
public static final GoogleAuthenticator G_AUTH = new GoogleAuthenticator(); |
|
|
|
|
|
|
|
public static final String HOST_KEY = toStringOrDie("/etc/ssh/ssh_host_rsa_key.pub").trim(); |
|
|
|
public static final String KNOWN_HOST_KEY = execScript("ssh-keyscan -t rsa $(hostname -d) 2>&1 | grep -v \"^#\""); |
|
|
|
|
|
|
|
public static final Predicate ALWAYS_TRUE = m -> true; |
|
|
|
public static final String HOME_DIR; |
|
|
|
static { |
|
|
|