From 785462b94acb23ad842adbd9b7775e31618eaa15 Mon Sep 17 00:00:00 2001 From: Vincent Niehues Date: Sun, 21 Sep 2025 07:29:25 +0200 Subject: [PATCH] Add Garage S3 blueprint and update Garage S3 with UI (#367) - Introduced `docker-compose.yml` and `template.toml` for Garage S3. - Added a new entry for Garage S3 in `meta.json` with relevant details and tags. - Updated `docker-compose.yml` and `template.toml` in Garage S3 with UI for refined environment variables, authentication guidance, and token support. - Bumped versions of Garage and Garage Web UI images. --- blueprints/garage-with-ui/docker-compose.yml | 4 +- blueprints/garage-with-ui/template.toml | 18 +++++--- blueprints/garage/docker-compose.yml | 16 +++++++ blueprints/garage/garage.svg | 44 ++++++++++++++++++ blueprints/garage/template.toml | 48 ++++++++++++++++++++ meta.json | 18 +++++++- 6 files changed, 138 insertions(+), 10 deletions(-) create mode 100644 blueprints/garage/docker-compose.yml create mode 100644 blueprints/garage/garage.svg create mode 100644 blueprints/garage/template.toml diff --git a/blueprints/garage-with-ui/docker-compose.yml b/blueprints/garage-with-ui/docker-compose.yml index 4c81937d..7495e168 100644 --- a/blueprints/garage-with-ui/docker-compose.yml +++ b/blueprints/garage-with-ui/docker-compose.yml @@ -1,6 +1,6 @@ services: garage: - image: dxflrs/garage:v1.0.1 + image: dxflrs/garage:v2.0.0 volumes: - ../files/garage.toml:/etc/garage.toml - garage-storage:/var/lib/garage @@ -13,7 +13,7 @@ services: - 3903 garage-webui: - image: khairul169/garage-webui:latest + image: khairul169/garage-webui:1.1.0 restart: unless-stopped volumes: - ../files/garage.toml:/etc/garage.toml:ro diff --git a/blueprints/garage-with-ui/template.toml b/blueprints/garage-with-ui/template.toml index 37ee75a8..5fb6ec63 100644 --- a/blueprints/garage-with-ui/template.toml +++ b/blueprints/garage-with-ui/template.toml @@ -1,14 +1,18 @@ [variables] main_domain = "${domain}" webui_domain = "web-ui.${domain}" -ht_username = "${username}" -ht_password = "${password:16}" +admin_token = "${base64:32}" +metrics_token = "${base64:32}" + [config] env = [ - "AUTH_USER_PASS=", "API_BASE_URL=http://garage:3903", - "S3_ENDPOINT_URL=http://garage:3900" + "S3_ENDPOINT_URL=http://garage:3900", + "", + "# To set up auth for the web-ui please go here: https://github.com/khairul169/garage-webui?tab=readme-ov-file#authentication", + "# or run this command: htpasswd -nbBC 10 'YOUR_USERNAME' 'YOUR_PASSWORD' and paste the output in here.", + "AUTH_USER_PASS=", ] [[config.domains]] @@ -24,7 +28,6 @@ host = "${webui_domain}" [[config.mounts]] filePath = "garage.toml" content = """ - metadata_dir = "/var/lib/garage/meta" data_dir = "/var/lib/garage/data" db_engine = "sqlite" @@ -49,6 +52,7 @@ index = "index.html" [admin] # Required api_bind_addr = "[::]:3903" -admin_token = "${base64:32}" -metrics_token = "${base64:32}" +admin_token = "${admin_token}" +metrics_require_token = true +metrics_token = "${metrics_token}" """ \ No newline at end of file diff --git a/blueprints/garage/docker-compose.yml b/blueprints/garage/docker-compose.yml new file mode 100644 index 00000000..10504934 --- /dev/null +++ b/blueprints/garage/docker-compose.yml @@ -0,0 +1,16 @@ +services: + garage: + image: dxflrs/garage:v2.0.0 + volumes: + - ../files/garage.toml:/etc/garage.toml + - garage-storage:/var/lib/garage + - garage-storage:/var/lib/garage + restart: unless-stopped + ports: + - 3900 + - 3901 + - 3902 + - 3903 + +volumes: + garage-storage: {} \ No newline at end of file diff --git a/blueprints/garage/garage.svg b/blueprints/garage/garage.svg new file mode 100644 index 00000000..fb02c40b --- /dev/null +++ b/blueprints/garage/garage.svg @@ -0,0 +1,44 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blueprints/garage/template.toml b/blueprints/garage/template.toml new file mode 100644 index 00000000..6328d984 --- /dev/null +++ b/blueprints/garage/template.toml @@ -0,0 +1,48 @@ +[variables] +main_domain = "${domain}" +webui_domain = "web-ui.${domain}" +admin_token = "${base64:32}" +metrics_token = "${base64:32}" + +[config] +env = [ + "API_BASE_URL=http://garage:3903", + "S3_ENDPOINT_URL=http://garage:3900", +] + +[[config.domains]] +serviceName = "garage" +port = 3900 +host = "${main_domain}" + +[[config.mounts]] +filePath = "garage.toml" +content = """ +metadata_dir = "/var/lib/garage/meta" +data_dir = "/var/lib/garage/data" +db_engine = "sqlite" +metadata_auto_snapshot_interval = "6h" + +replication_factor = 1 +compression_level = 2 + +rpc_bind_addr = "[::]:3901" +rpc_public_addr = "localhost:3901" # Required +rpc_secret = "${hash:64}" + +[s3_api] +s3_region = "garage" +api_bind_addr = "[::]:3900" +root_domain = ".s3.domain.com" + +[s3_web] # Optional, if you want to expose bucket as web +bind_addr = "[::]:3902" +root_domain = ".web.domain.com" +index = "index.html" + +[admin] # Required +api_bind_addr = "[::]:3903" +admin_token = "${admin_token}" +metrics_require_token = true +metrics_token = "${metrics_token}" +""" \ No newline at end of file diff --git a/meta.json b/meta.json index b99bf643..e3eb57f7 100644 --- a/meta.json +++ b/meta.json @@ -2128,11 +2128,27 @@ "reader" ] }, + { + "id": "garage", + "name": "Garage S3", + "version": "latest", + "description": "Garage is an open-source distributed object storage service tailored for self-hosting.", + "logo": "garage.svg", + "links": { + "github": "https://git.deuxfleurs.fr/Deuxfleurs/garage", + "website": "https://garagehq.deuxfleurs.fr", + "docs": "https://garagehq.deuxfleurs.fr/documentation/quick-start/" + }, + "tags": [ + "storage", + "object-storage" + ] + }, { "id": "garage-with-ui", "name": "Garage S3 with Web UI", "version": "latest", - "description": "Garage is an open-source distributed object storage service tailored for self-hosting", + "description": "Garage is an open-source distributed object storage service tailored for self-hosting. For authentication in the web-ui please go to https://github.com/khairul169/garage-webui?tab=readme-ov-file#authentication", "logo": "garage.svg", "links": { "github": "https://git.deuxfleurs.fr/Deuxfleurs/garage",