Search in sources :

Example 1 with ManagedDirectory

use of org.platformlayer.ops.filesystem.ManagedDirectory in project platformlayer by platformlayer.

the class PlatformLayerInstance method addChildren.

@Override
protected void addChildren() throws OpsException {
    super.addChildren();
    ManagedDirectory configDir = findDirectory(template.getConfigDir());
    File keystoreFile = template.getKeystoreFile();
    if (template.isMultitenant()) {
        ManagedKeystore masterProjectKey = configDir.addChild(ManagedKeystore.class);
        masterProjectKey.path = keystoreFile;
        masterProjectKey.alias = template.getMultitenantKeyAlias();
    }
}
Also used : ManagedKeystore(org.platformlayer.ops.crypto.ManagedKeystore) ManagedDirectory(org.platformlayer.ops.filesystem.ManagedDirectory) File(java.io.File)

Example 2 with ManagedDirectory

use of org.platformlayer.ops.filesystem.ManagedDirectory in project platformlayer by platformlayer.

the class GitRepositoryDirectory method addChildren.

@Override
protected void addChildren() throws OpsException {
    GitRepository model = OpsContext.get().getInstance(GitRepository.class);
    File gitBase = new File("/var/git");
    File repoDir = new File(gitBase, model.name);
    {
        ManagedDirectory dir = ManagedDirectory.build(repoDir, "755");
        addChild(dir);
    }
    {
        GitRepoInit initRepo = injected(GitRepoInit.class);
        initRepo.repoDir = repoDir;
        addChild(initRepo);
    }
    {
        BackupDirectory backup = injected(BackupDirectory.class);
        backup.itemKey = model.getKey();
        backup.backupRoot = repoDir;
        addChild(backup);
    }
}
Also used : GitRepository(org.platformlayer.service.git.model.GitRepository) BackupDirectory(org.platformlayer.ops.backups.BackupDirectory) ManagedDirectory(org.platformlayer.ops.filesystem.ManagedDirectory) File(java.io.File)

Example 3 with ManagedDirectory

use of org.platformlayer.ops.filesystem.ManagedDirectory in project platformlayer by platformlayer.

the class StandardServiceInstance method createKeystore.

private void createKeystore(StandardTemplateData template) throws OpsException {
    ManagedDirectory configDir = findDirectory(template.getConfigDir());
    File keystoreFile = template.getKeystoreFile();
    if (template.shouldCreateSslKey()) {
        // TODO: Unify with additional keys?
        // But be careful.. this is normally a shared key across all instances
        ManagedKeystore httpsKey = configDir.addChild(ManagedKeystore.class);
        httpsKey.path = keystoreFile;
        httpsKey.tagWithPublicKeys = template.getModel();
        httpsKey.alias = ManagedKeystore.DEFAULT_WEBSERVER_ALIAS;
        httpsKey.key = template.findPublicSslKey();
    }
    Map<String, ManagedSecretKey> keys = Maps.newHashMap();
    template.getAdditionalKeys(keys);
    for (Entry<String, ManagedSecretKey> entry : keys.entrySet()) {
        ManagedKeystore httpsKey = configDir.addChild(ManagedKeystore.class);
        httpsKey.path = keystoreFile;
        // httpsKey.tagWithPublicKeys = template.getModel();
        httpsKey.alias = entry.getKey();
        httpsKey.key = entry.getValue();
    }
    addExtraKeys(configDir, keystoreFile);
}
Also used : ManagedKeystore(org.platformlayer.ops.crypto.ManagedKeystore) ManagedDirectory(org.platformlayer.ops.filesystem.ManagedDirectory) ManagedSecretKey(org.platformlayer.ops.crypto.ManagedSecretKey) File(java.io.File)

Aggregations

File (java.io.File)3 ManagedDirectory (org.platformlayer.ops.filesystem.ManagedDirectory)3 ManagedKeystore (org.platformlayer.ops.crypto.ManagedKeystore)2 BackupDirectory (org.platformlayer.ops.backups.BackupDirectory)1 ManagedSecretKey (org.platformlayer.ops.crypto.ManagedSecretKey)1 GitRepository (org.platformlayer.service.git.model.GitRepository)1