serverpod_cloud_storage_rustfs 1.0.0 copy "serverpod_cloud_storage_rustfs: ^1.0.0" to clipboard
serverpod_cloud_storage_rustfs: ^1.0.0 copied to clipboard

Serverpod integration for RustFS S3-compatible cloud storage

serverpod_cloud_storage_rustfs #

Serverpod integration for RustFS S3-compatible cloud storage.

For documentation, visit: https://docs.serverpod.dev.

Warning: This is not official serverpod library! #

What is Serverpod? #

Serverpod is an open-source, scalable app server, written in Dart for the Flutter community. Check it out!

Serverpod.dev

Quick Start #

import 'package:serverpod_cloud_storage_rustfs/serverpod_cloud_storage_rustfs.dart';

pod.addCloudStorage(RustFsCloudStorage(
  serverpod: pod,
  storageId: 'public',
  public: true,
  bucket: 'serverpod',
));

Configuration #

Set credentials via environment variables:

  • SERVERPOD_RUSTFS_ACCESS_KEY
  • SERVERPOD_RUSTFS_SECRET_KEY

Or in config/passwords.yaml:

shared:
  rustfsAccessKey: your_access_key
  rustfsSecretKey: your_secret_key

If no credentials are provided, the defaults rustfsadmin / rustfsadmin_secret are used, which are suitable for local development.

Custom Endpoint #

By default, the client connects to http://localhost:9001. Override with the baseUri parameter:

pod.addCloudStorage(RustFsCloudStorage(
  serverpod: pod,
  storageId: 'public',
  public: true,
  bucket: 'serverpod',
  baseUri: Uri(scheme: 'https', host: 'rustfs.example.com'),
));

Using RustFS for Local Development #

Serverpod's default local file storage saves files as blobs in the database. RustFS is a better alternative because:

  • Visibility — comes with a web UI (at http://localhost:9001) where you can browse, upload, and delete files without touching the database.
  • Production parity — RustFS speaks the S3 API, so your local setup behaves the same as any S3-compatible production environment. RustFS itself can also be used in production.
  • Performance — dedicated object storage is faster than storing blobs in Postgres.

Setup #

Add the following services to your project's docker-compose.yaml:

+  rustfs:
+    image: rustfs/rustfs:latest
+    container_name: rustfs_server
+    ports: ["9001:9001"]
+    environment:
+      - RUSTFS_ACCESS_KEY=rustfsadmin
+      - RUSTFS_SECRET_KEY=rustfsadmin_secret
+    volumes: ["{projectName}_files:/data"]
+    command: /data
+
+  create_buckets:
+    image: minio/mc
+    depends_on: [rustfs]
+    entrypoint: >
+      /bin/sh -c "
+      until /usr/bin/mc alias set myrustfs http://rustfs_server:9000 rustfsadmin rustfsadmin_secret; do sleep 2; done;
+      /usr/bin/mc mb myrustfs/serverpod --ignore-existing;
+      /usr/bin/mc anonymous set public myrustfs/serverpod;
+      exit 0;
+      "

Also add the named volume at the end of the same file:

 volumes:
   {appName}_data:
+  {appName}_files:
   {appName}_test_data:

Then start the services:

docker compose up -d

The RustFS console will be available at http://localhost:9001 (login: rustfsadmin / rustfsadmin_secret).

0
likes
150
points
175
downloads

Documentation

API reference

Publisher

verified publisherthecodebrothers.pl

Weekly Downloads

Serverpod integration for RustFS S3-compatible cloud storage

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

serverpod, serverpod_cloud_storage_s3_compat

More

Packages that depend on serverpod_cloud_storage_rustfs