Development/S3 filestore service: Difference between revisions

Created page with "When working on the S3 filestore features, a developer needs a local S3 service. One can add the following to <code>docker-compose.override.yml</code><syntaxhighlight lang="yaml"> x-common-dev: &x-common ... environment: FILESTORE_HOST: filestore FILESTORE_PORT: 9000 FILESTORE_PROTOCOL: http FILESTORE_ACCESS_KEY: ${FILESTORE_ACCESS_KEY} FILESTORE_SECRET_KEY: ${FILESTORE_SECRET_KEY} FILESTORE_BUCKET_NAME: ${FILESTORE_BUCKET_NAME:-bluespice} F..."
 
mNo edit summary
Tag: 2017 source edit
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
When working on the S3 filestore features, a developer needs a local S3 service. One can add the following to <code>docker-compose.override.yml</code><syntaxhighlight lang="yaml">
When working on the S3 filestore features, a developer needs a local S3 service. Here we document two approaches.
__TOC__
== Minio-based local S3 storage ==
<div class="toccolours mw-collapsible mw-collapsed">
Add to <code>docker-compose.override.yaml</code>:
<div class="mw-collapsible-content"><syntaxhighlight lang="yaml">
x-common-dev: &x-common
x-common-dev: &x-common
...
...
Line 25: Line 30:
       - ${DATADIR}/filestore:/data
       - ${DATADIR}/filestore:/data
     restart: no
     restart: no
</syntaxhighlight>In <code>.env</code>, add<syntaxhighlight lang="text">FILESTORE_ACCESS_KEY=...
</syntaxhighlight></div></div>
Also add to <code>.env</code>:<syntaxhighlight lang="text">FILESTORE_ACCESS_KEY=...
FILESTORE_SECRET_KEY=...
FILESTORE_SECRET_KEY=...
FILESTORE_BUCKET_NAME=bluespice
FILESTORE_BUCKET_NAME=bluespice
FILESTORE_REGION=eu-north-1</syntaxhighlight>After a <code>./bluespice-deploy up -d</code> you can access the MINIO webinterface in your browser at <code><nowiki>http://localhost:9001</nowiki></code>. Use the values of <code>FILESTORE_ACCESS_KEY</code> and <code>FILESTORE_SECRET_KEY</code> to log in.
FILESTORE_REGION=eu-north-1</syntaxhighlight>
Before starting the full stack:
* create the <code>$DATADIR/filestore</code> directory manually
** change its ownership to <code>0:0</code>
* run <code>./bluespice-deploy up -d filestore</code>
** access the MINIO webinterface in your browser at <code><nowiki>http://localhost:9001</nowiki></code>
** Use the values of <code>FILESTORE_ACCESS_KEY</code> and <code>FILESTORE_SECRET_KEY</code> to log in.
** You will need to ''manually create'' a bucket with the name of <code>FILESTORE_BUCKET_NAME</code>.
Then you can start the full stack with <code>./bluespice-deploy up -d</code>.


You will need to ''manually create'' a bucket with the name of <code>FILESTORE_BUCKET_NAME</code>.
== Garage-based local S3 storage ==
<div class="toccolours mw-collapsible mw-collapsed">
Add to <code>docker-compose.override.yaml</code>:
<div class="mw-collapsible-content"><syntaxhighlight lang="yaml">
x-common-dev: &x-common
  environment:
    FILESTORE_HOST: filestore
    FILESTORE_PORT: 9000
    FILESTORE_PROTOCOL: http
    FILESTORE_ACCESS_KEY: ${FILESTORE_ACCESS_KEY}
    FILESTORE_SECRET_KEY: ${FILESTORE_SECRET_KEY}
    FILESTORE_BUCKET_NAME: ${FILESTORE_BUCKET_NAME:-bluespice}
    FILESTORE_REGION: ${FILESTORE_REGION:-eu-north-1}
services:
  wiki-installer:
    <<: *x-common
  wiki-web:
    <<: *x-common
    restart: no
  wiki-task:
    <<: *x-common
    restart: no
  filestore:
    image: dxflrs/garage:v2.3.0
    container_name: ${COMPOSE_PROJECT_NAME:-bluespice}-filestore
    command: /garage server --single-node --default-bucket
    environment:
      GARAGE_CONFIG_FILE: /etc/garage.toml
      # 32-byte-hex, e.g. openssl rand -hex 32
      GARAGE_RPC_SECRET: 8af47171e8a9c2d5147e885c84d2c63fe70616a3611518ddc1a6b516beb9dcd5
      GARAGE_DEFAULT_ACCESS_KEY: ${FILESTORE_ACCESS_KEY}
      GARAGE_DEFAULT_SECRET_KEY: ${FILESTORE_SECRET_KEY}
      GARAGE_DEFAULT_BUCKET: ${FILESTORE_BUCKET_NAME:-bluespice}
    ports:
      - "9000:9000"
      - "3903:3903"
    volumes:
      - ${DATADIR}/filestore/meta:/var/lib/garage/meta
      - ${DATADIR}/filestore/data:/var/lib/garage/data
    configs:
      - source: garage_toml
        target: /etc/garage.toml
        mode: 0444
    restart: no
configs:
  garage_toml:
    content: |
      metadata_dir = "/var/lib/garage/meta"
      data_dir = "/var/lib/garage/data"
      db_engine = "sqlite"
 
      replication_factor = 1
 
      rpc_bind_addr = "0.0.0.0:3901"
      rpc_public_addr = "filestore:3901"
 
      [s3_api]
      api_bind_addr = "0.0.0.0:9000"
      s3_region = "eu-north-1"
 
      [admin]
      api_bind_addr = "0.0.0.0:3903"
</syntaxhighlight></div></div>
Also add to <code>.env</code>:<syntaxhighlight lang="text">FILESTORE_ACCESS_KEY=...
FILESTORE_SECRET_KEY=...
FILESTORE_BUCKET_NAME=bluespice
FILESTORE_REGION=eu-north-1</syntaxhighlight>
Then you can start the full stack with <code>./bluespice-deploy up -d</code>.

Latest revision as of 15:37, 15 July 2026

When working on the S3 filestore features, a developer needs a local S3 service. Here we document two approaches.

Minio-based local S3 storage

Add to docker-compose.override.yaml:

x-common-dev: &x-common
...
  environment:
    FILESTORE_HOST: filestore
    FILESTORE_PORT: 9000
    FILESTORE_PROTOCOL: http
    FILESTORE_ACCESS_KEY: ${FILESTORE_ACCESS_KEY}
    FILESTORE_SECRET_KEY: ${FILESTORE_SECRET_KEY}
    FILESTORE_BUCKET_NAME: ${FILESTORE_BUCKET_NAME:-bluespice}
    FILESTORE_REGION: ${FILESTORE_REGION:-eu-north-1}
...

  filestore:
    image: minio/minio:latest
    container_name: ${COMPOSE_PROJECT_NAME:-bluespice}-filestore
    command: server /data --console-address ":9001"
    environment:
      MINIO_ROOT_USER: ${FILESTORE_ACCESS_KEY}
      MINIO_ROOT_PASSWORD: ${FILESTORE_SECRET_KEY}
    ports:
      - "9000:9000"
      - "9001:9001"
    volumes:
      - ${DATADIR}/filestore:/data
    restart: no

Also add to .env:

FILESTORE_ACCESS_KEY=...
FILESTORE_SECRET_KEY=...
FILESTORE_BUCKET_NAME=bluespice
FILESTORE_REGION=eu-north-1

Before starting the full stack:

  • create the $DATADIR/filestore directory manually
    • change its ownership to 0:0
  • run ./bluespice-deploy up -d filestore
    • access the MINIO webinterface in your browser at http://localhost:9001
    • Use the values of FILESTORE_ACCESS_KEY and FILESTORE_SECRET_KEY to log in.
    • You will need to manually create a bucket with the name of FILESTORE_BUCKET_NAME.

Then you can start the full stack with ./bluespice-deploy up -d.

Garage-based local S3 storage

Add to docker-compose.override.yaml:

x-common-dev: &x-common
  environment:
    FILESTORE_HOST: filestore
    FILESTORE_PORT: 9000
    FILESTORE_PROTOCOL: http
    FILESTORE_ACCESS_KEY: ${FILESTORE_ACCESS_KEY}
    FILESTORE_SECRET_KEY: ${FILESTORE_SECRET_KEY}
    FILESTORE_BUCKET_NAME: ${FILESTORE_BUCKET_NAME:-bluespice} 
    FILESTORE_REGION: ${FILESTORE_REGION:-eu-north-1}
services:
  wiki-installer:
    <<: *x-common
  wiki-web:
    <<: *x-common
    restart: no
  wiki-task:
    <<: *x-common
    restart: no
  filestore:
    image: dxflrs/garage:v2.3.0
    container_name: ${COMPOSE_PROJECT_NAME:-bluespice}-filestore
    command: /garage server --single-node --default-bucket
    environment:
      GARAGE_CONFIG_FILE: /etc/garage.toml
      # 32-byte-hex, e.g. openssl rand -hex 32
      GARAGE_RPC_SECRET: 8af47171e8a9c2d5147e885c84d2c63fe70616a3611518ddc1a6b516beb9dcd5
      GARAGE_DEFAULT_ACCESS_KEY: ${FILESTORE_ACCESS_KEY}
      GARAGE_DEFAULT_SECRET_KEY: ${FILESTORE_SECRET_KEY}
      GARAGE_DEFAULT_BUCKET: ${FILESTORE_BUCKET_NAME:-bluespice}
    ports:
      - "9000:9000"
      - "3903:3903"
    volumes:
      - ${DATADIR}/filestore/meta:/var/lib/garage/meta
      - ${DATADIR}/filestore/data:/var/lib/garage/data
    configs:
      - source: garage_toml
        target: /etc/garage.toml
        mode: 0444
    restart: no
configs:
  garage_toml:
    content: |
      metadata_dir = "/var/lib/garage/meta"
      data_dir = "/var/lib/garage/data"
      db_engine = "sqlite"

      replication_factor = 1

      rpc_bind_addr = "0.0.0.0:3901"
      rpc_public_addr = "filestore:3901"

      [s3_api]
      api_bind_addr = "0.0.0.0:9000"
      s3_region = "eu-north-1"

      [admin]
      api_bind_addr = "0.0.0.0:3903"

Also add to .env:

FILESTORE_ACCESS_KEY=...
FILESTORE_SECRET_KEY=...
FILESTORE_BUCKET_NAME=bluespice
FILESTORE_REGION=eu-north-1

Then you can start the full stack with ./bluespice-deploy up -d.


PDF exclude - start

To submit feedback about this documentation, visit our community forum.

PDF exclude - end