Skip to content

📚 The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Fix bucker policy

Smaug6739cf2cd5d70d05
diff --git a/backend/app/minio.go b/backend/app/minio.go
index ab8b64ed..aacbb58b 100644
--- a/backend/app/minio.go
+++ b/backend/app/minio.go
@@ -43,16 +43,16 @@ func MinioConnection() (*minio.Client, error) {
}
// Définir la politique de lecture publique
policy := fmt.Sprintf(`{
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Principal": "*",
- "Action": "s3:GetObject",
- "Resource": "arn:aws:s3:::%s/*"
- }
- ]
- }`, bucketName)
+ "Version": "2012-10-17",
+ "Statement": [
+ {
+ "Effect": "Allow",
+ "Principal": { "AWS": ["*"] },
+ "Action": ["s3:GetObject"],
+ "Resource": ["arn:aws:s3:::%s/*"]
+ }
+ ]
+}`, bucketName)
err = minioClient.SetBucketPolicy(ctx, bucketName, policy)
if err != nil {
diff --git a/docker-compose.yml b/docker-compose.yml
index a0f542c9..b3259433 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -22,29 +22,33 @@ services:
start_period: 30s
# Object Storage
- garage:
- image: dxflrs/garage:v2.1.0
- container_name: alexandrie-garage
+ rustfs:
+ image: rustfs/rustfs:latest
+ container_name: alexandrie-rustfs
restart: unless-stopped
+ environment:
+ # définition des clés directement
+ RUSTFS_ACCESS_KEY: alexandrie-key
+ RUSTFS_SECRET_KEY: alexandrie-secret
+ RUSTFS_CONSOLE_ENABLE: 'false' # ou true si tu veux console graphique
+ # autres variables selon besoin (volume, domain, etc.)
ports:
- - '3900:3900' # API S3
- - '3902:3902' # Admin interface
+ - '9000:9000' # API S3
volumes:
- - ./garage.toml:/etc/garage.toml
- - garage_data:/data
- - garage_metadata:/metadata
+ - rustfs_data:/data
networks:
- alexandrie-network
healthcheck:
- test: ['CMD', '/garage', 'status']
+ test: ['CMD-SHELL', 'nc -z localhost 9000 || exit 1']
interval: 30s
timeout: 10s
retries: 3
- start_period: 30s
+ start_period: 20s
# Alexandrie Backend
backend:
- image: ghcr.io/smaug6739/alexandrie-backend:latest
+ build:
+ context: ./backend
container_name: alexandrie-backend
environment:
# Database Configuration
@@ -60,7 +64,7 @@ services:
COOKIE_DOMAIN: localhost # Very optional, can be left empty. For auth cookies: If you can't login (or you are disconnected immediatly), check this; DON'T set an URL just the DOMAIN (e.g., "example.com" or "localhost")
# MinIO Configuration (optional, you can replace config with "" to disable MinIO usage)
- MINIO_ENDPOINT: garage:3900
+ MINIO_ENDPOINT: rustfs:9000
MINIO_ACCESSKEY: alexandrie-key
MINIO_SECRETKEY: alexandrie-secret
MINIO_BUCKET: alexandrie
@@ -80,7 +84,7 @@ services:
depends_on:
mysql:
condition: service_healthy
- garage:
+ rustfs:
condition: service_healthy
networks:
- alexandrie-network
@@ -110,7 +114,5 @@ networks:
volumes:
mysql_data:
driver: local
- garage_data:
- driver: local
- garage_metadata:
+ rustfs_data:
driver: local