Robert Vogel (talk | contribs) 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..." |
No edit summary |
||
| Line 1: | Line 1: | ||
When working on the S3 filestore features, a developer needs a local S3 service. | 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> | ||
In <code>.env</code>, add<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> | 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 filestore</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> | |||
Similarly in <code>.env</code>, add<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 filestore</code>. | |||
Revision as of 15:34, 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
In .env, add
FILESTORE_ACCESS_KEY=...
FILESTORE_SECRET_KEY=...
FILESTORE_BUCKET_NAME=bluespice
FILESTORE_REGION=eu-north-1
Before starting the full stack:
- create the
$DATADIR/filestoredirectory manually- change its ownership to
0:0
- change its ownership to
- run
./bluespice-deploy up -d filestore- access the MINIO webinterface in your browser at
http://localhost:9001 - Use the values of
FILESTORE_ACCESS_KEYandFILESTORE_SECRET_KEYto log in. - You will need to manually create a bucket with the name of
FILESTORE_BUCKET_NAME.
- access the MINIO webinterface in your browser at
Then you can start the full stack with ./bluespice-deploy up -d filestore.
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"
Similarly in .env, add
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 filestore.