kitsteam / excalidraw-storage-backend

MIT License
12 stars 11 forks source link

excalidraw-storage-backend

Forked from https://gitlab.com/kiliandeca/excalidraw-storage-backend

This is a reimplementation of excalidraw-json suitable for self hosting you own instance of Excalidraw.

It can be used with kiliandeca/excalidraw-fork

DockerHub kiliandeca/excalidraw-storage-backend

Feature:

It use Keyv as a simple K/V store so you can use the database of your choice.

Environement Variables

Name Description Default value
PORT Server listening port 8080
GLOBAL_PREFIX API global prefix for every routes /api/v2
STORAGE_URI Keyv connection string, example: redis://user:pass@localhost:6379. Availabe Keyv storage adapter: redis, mongo, postgres and mysql "" (in memory non-persistent)
STORAGE_TTL Time to live for data null
LOG_LEVEL Log level (debug, verbose, log, warn, error) warn
BODY_LIMIT Payload size limit for scenes or images 50mb
ENABLE_POSTGRES_TTL_SERVICE Enabling the Postgres TTL Service will clean up expired items once a day. This will break if used with a non-postgres STORAGE_URI. false

Env Variables for Postgres

For setting postgres pool variables, a few code adjustment have to be made in the storage.service.ts:

const store = new (require('@keyv/postgres'))({
  uri,
  max: 1,
});

const keyv = new Keyv({
  store,
  ttl,
});