/** * Returns UI plugin <em>data path</em>, under which UI plugin descriptor (JSON) files are placed. */ public static String resolvePluginDataPath() { return ConfigUtil.resolvePath(EngineLocalConfig.getInstance().getUsrDir().getAbsolutePath(), UI_PLUGIN_DIR); }
@Override public void init(ServletConfig config) throws ServletException { super.init(config); String applicationName = getServletContext().getInitParameter(APP_NAME); if (applicationName == null) { throw new ServletException("Application name not specified"); //$NON-NLS-1$ } Path symbolMapDirectory = EngineLocalConfig.getInstance().getUsrDir().toPath().resolve("gwt-symbols"); //$NON-NLS-1$ Path symbolMapZipFile = symbolMapDirectory.resolve(applicationName + "/symbolMaps.zip"); //$NON-NLS-1$ try { initDeobfuscator(FileSystems.newFileSystem(symbolMapZipFile, null)); } catch (Exception e) { log.warn("Cannot read GWT symbol maps: " + symbolMapZipFile, e); //$NON-NLS-1$ } }
public static String signOpenSSHCertificate( String name, String hostname, String principal ) throws IOException { EngineLocalConfig config = EngineLocalConfig.getInstance(); if ( !new OpenSslCAWrapper().signOpenSSHCertificate( new File(new File(config.getUsrDir(), "bin"), "pki-enroll-openssh-cert.sh"), name, hostname, principal ) ) { throw new RuntimeException("OpenSSH certificate enrollment failed"); } return new String(Files.readAllBytes( Paths.get(config.getPKIDir().getPath(), "certs", String.format("%s-cert.pub", name)))); }
public static String signCertificateRequest( String request, String name, String hostname ) throws IOException { EngineLocalConfig config = EngineLocalConfig.getInstance(); try ( final OutputStream os = new FileOutputStream( new File( new File(config.getPKIDir(), "requests"), String.format("%s.req", name) ) ) ) { os.write(request.getBytes(StandardCharsets.UTF_8)); } if ( !new OpenSslCAWrapper().signCertificateRequest( new File(new File(config.getUsrDir(), "bin"), "pki-enroll-request.sh"), name, hostname ) ) { throw new RuntimeException("Certificate enrollment failed"); } return new String(Files.readAllBytes( Paths.get(config.getPKIDir().getPath(), "certs", String.format("%s.cer", name)))); }