|
|
@ -2,12 +2,13 @@ use crate::command_runner::{SetuidCommandRunner, StdCommandRunner}; |
|
|
|
use crate::resources::{
|
|
|
|
AcmeAccountKey, AcmeChallengesDir, AcmeChallengesNginxSnippet, AcmeRootCert, AcmeUser, Cert,
|
|
|
|
CertChain, Cron, Csr, DefaultServer, Dir, File, GitCheckout, Key, KeyAndCertBundle,
|
|
|
|
LoadedDirectory, MariaDbDatabase, MariaDbUser, NpmInstall, Owner, PhpFpmPool, Resource,
|
|
|
|
ServeCustom, ServePhp, ServeRedir, ServeService, ServeStatic, StoredDirectory,
|
|
|
|
LoadedDirectory, MariaDbDatabase, MariaDbUser, NpmInstall, Owner, PhpFpmPool, PostgresqlDatabase,
|
|
|
|
Resource, ServeCustom, ServePhp, ServeRedir, ServeService, ServeStatic, StoredDirectory,
|
|
|
|
SystemdSocketService, User, UserForDomain, WordpressPlugin, WordpressTranslation,
|
|
|
|
};
|
|
|
|
use crate::static_files::LETS_ENCRYPT_X3_CROSS_SIGNED;
|
|
|
|
use crate::storage::SimpleStorage;
|
|
|
|
use crate::storage::Storage;
|
|
|
|
use crate::symbols::acme::Cert as CertSymbol;
|
|
|
|
use crate::symbols::concat::Concat as ConcatSymbol;
|
|
|
|
use crate::symbols::cron::Cron as CronSymbol;
|
|
|
@ -19,6 +20,7 @@ use crate::symbols::mariadb::{ |
|
|
|
};
|
|
|
|
use crate::symbols::npm::Install as NpmInstallSymbol;
|
|
|
|
use crate::symbols::owner::Owner as OwnerSymbol;
|
|
|
|
use crate::symbols::postgresql::PostgreSQLDatabase as PostgreSQLDatabaseSymbol;
|
|
|
|
use crate::symbols::saved_directory::{SavedDirectory as SavedDirectorySymbol, StorageDirection};
|
|
|
|
use crate::symbols::systemd::{
|
|
|
|
ReloadService as ReloadServiceSymbol, UserService as UserServiceSymbol,
|
|
|
@ -715,6 +717,27 @@ impl<D: Clone> ImplementationBuilder<MariaDbDatabase<D>> for DefaultBuilder { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<D: Clone> ImplementationBuilder<PostgresqlDatabase<D>> for DefaultBuilder {
|
|
|
|
type Prerequisites = ();
|
|
|
|
fn prerequisites(resource: &PostgresqlDatabase<D>) -> Self::Prerequisites {
|
|
|
|
()
|
|
|
|
}
|
|
|
|
|
|
|
|
type Implementation = (PostgreSQLDatabaseSymbol<'static, String, String, StdCommandRunner>,);
|
|
|
|
fn create(
|
|
|
|
_resource: &PostgresqlDatabase<D>,
|
|
|
|
(db_name, data_path): &<PostgresqlDatabase<D> as Resource>::Artifact,
|
|
|
|
_: <Self::Prerequisites as ToArtifact>::Artifact,
|
|
|
|
) -> Self::Implementation {
|
|
|
|
let db_dump = SimpleStorage::new(data_path.clone().into());
|
|
|
|
(PostgreSQLDatabaseSymbol::new(
|
|
|
|
db_name.0.clone(),
|
|
|
|
db_dump.read_filename().unwrap().to_str().unwrap().into(),
|
|
|
|
&StdCommandRunner,
|
|
|
|
),)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<P: Clone + AsRef<Path>> ImplementationBuilder<WordpressPlugin<P>> for DefaultBuilder {
|
|
|
|
type Prerequisites = Dir<PathBuf>;
|
|
|
|
fn prerequisites(resource: &WordpressPlugin<P>) -> Self::Prerequisites {
|
|
|
|