Skip to content

Open-source and local-first Slack and Notion alternative that puts you in control of your data

Add force path style config for s3 - fixes #62 (#65)

Hakan Shehub711af0431a4
diff --git a/apps/server/src/data/storage.ts b/apps/server/src/data/storage.ts
index 9b6dba27..ba431efd 100644
--- a/apps/server/src/data/storage.ts
+++ b/apps/server/src/data/storage.ts
@@ -9,4 +9,5 @@ export const s3Client = new S3Client({
accessKeyId: config.storage.accessKey,
secretAccessKey: config.storage.secretKey,
},
+ forcePathStyle: config.storage.forcePathStyle,
});
diff --git a/apps/server/src/lib/config/storage.ts b/apps/server/src/lib/config/storage.ts
index fcc80588..1fcd2a4b 100644
--- a/apps/server/src/lib/config/storage.ts
+++ b/apps/server/src/lib/config/storage.ts
@@ -7,6 +7,7 @@ export const storageConfigSchema = z.object({
secretKey: z.string({ error: 'STORAGE_S3_SECRET_KEY is required' }),
bucket: z.string({ error: 'STORAGE_S3_BUCKET is required' }),
region: z.string({ error: 'STORAGE_S3_REGION is required' }),
+ forcePathStyle: z.boolean().optional(),
});
export type StorageConfig = z.infer<typeof storageConfigSchema>;
@@ -19,5 +20,6 @@ export const readStorageConfigVariables = () => {
secretKey: process.env.STORAGE_S3_SECRET_KEY,
bucket: process.env.STORAGE_S3_BUCKET,
region: process.env.STORAGE_S3_REGION,
+ forcePathStyle: process.env.STORAGE_S3_FORCE_PATH_STYLE === 'true',
};
};
diff --git a/docker-compose.yaml b/docker-compose.yaml
index 9d7528cb..82ec3f7d 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -150,6 +150,7 @@ services:
STORAGE_S3_SECRET_KEY: 'your_minio_password'
STORAGE_S3_BUCKET: 'colanode-avatars'
STORAGE_S3_REGION: 'us-east-1'
+ STORAGE_S3_FORCE_PATH_STYLE: 'true'
# ───────────────────────────────────────────────────────────────
# SMTP configuration