1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-03 17:14:08 +02:00

experimental multi-s3 support

This commit is contained in:
Robin Appelman 2023-02-03 15:57:46 +01:00
commit 6f78480b48
7 changed files with 60 additions and 13 deletions

View file

@ -88,6 +88,7 @@ impl Service {
pub fn from_type(ty: &str) -> Option<&'static [Self]> {
match ty {
"s3" => Some(&[Service::ObjectStore(ObjectStore::S3)]),
"s3m" => Some(&[Service::ObjectStore(ObjectStore::S3m)]),
"s3mb" => Some(&[Service::ObjectStore(ObjectStore::S3mb)]),
"azure" => Some(&[Service::ObjectStore(ObjectStore::Azure)]),
"ldap" => Some(&[Service::LDAP(LDAP), Service::LDAPAdmin(LDAPAdmin)]),

View file

@ -12,6 +12,7 @@ use miette::IntoDiagnostic;
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum ObjectStore {
S3,
S3m,
S3mb,
Azure,
}
@ -20,6 +21,7 @@ impl ObjectStore {
fn image(&self) -> &str {
match self {
ObjectStore::S3 => "localstack/localstack:0.14.3",
ObjectStore::S3m => "localstack/localstack:0.14.3",
ObjectStore::S3mb => "localstack/localstack:0.14.3",
ObjectStore::Azure => "arafato/azurite:2.6.5",
}
@ -28,6 +30,7 @@ impl ObjectStore {
fn self_env(&self) -> Vec<&str> {
match self {
ObjectStore::S3 => vec!["DEBUG=1", "SERVICES=s3"],
ObjectStore::S3m => vec!["DEBUG=1", "SERVICES=s3"],
ObjectStore::S3mb => vec!["DEBUG=1", "SERVICES=s3"],
ObjectStore::Azure => vec![],
}
@ -35,6 +38,7 @@ impl ObjectStore {
fn host_name(&self) -> &str {
match self {
ObjectStore::S3 => "s3",
ObjectStore::S3m => "s3",
ObjectStore::S3mb => "s3",
ObjectStore::Azure => "azure",
}
@ -46,6 +50,7 @@ impl ServiceTrait for ObjectStore {
fn name(&self) -> &str {
match self {
ObjectStore::S3 => "s3",
ObjectStore::S3m => "s3m",
ObjectStore::S3mb => "s3mb",
ObjectStore::Azure => "azure",
}
@ -54,6 +59,7 @@ impl ServiceTrait for ObjectStore {
fn env(&self) -> &[&str] {
match self {
ObjectStore::S3 => &["S3=1"],
ObjectStore::S3m => &["S3M=1"],
ObjectStore::S3mb => &["S3MB=1"],
ObjectStore::Azure => &["AZURE=1"],
}