TheOpenPresenter
  • Introduction
    • Welcome
    • Motivation & Challenges
    • System Architecture
    • Terminologies
    • Server Communication
    • Project Topology
  • Development
    • Quickstart
    • Static files
    • Media Storage
  • Plugins
    • Introduction
    • Official Plugins
      • Google Slides
      • Lyrics Presenter
        • Lyrics compatibility
      • Video Player
      • Audio Recorder
    • Developing a Plugin
      • Plugin API
        • Yjs
          • Awareness
          • Scene
          • Renderer
        • Backend
          • Yjs Handler
          • Loading Frontend
          • Security
        • Frontend
          • Remote
          • Renderer
        • Media
          • Server Plugin API
          • Frontend
            • Tus
            • Form Data
        • TRPC
        • Database
      • Audio
      • Viewer State
      • Notifying Errors
      • Caveats
        • Sharing dependencies
        • Cross-over between plugins
      • Performance
  • API Reference
    • Plugin Context
  • Guide
    • Playing Audio
    • Listen to scene changes
  • Scratch Pad
    • Ambition
    • Background music
  • Environment Variables
  • External
    • Page 1
Powered by GitBook
On this page
  • Storage Proxy
  • Changing between storage type
  • Serving media yourself
  1. Development

Media Storage

We currently have 2 storage types that you can use.

  1. File storage

  2. S3 storage

This can be set through the STORAGE_TYPE environment variable. There are corresponding env that you can set to configure that storage type. S3 for example:

STORAGE_S3_BUCKET=
STORAGE_S3_REGION=
STORAGE_S3_ENDPOINT=
STORAGE_S3_ACCESS_KEY_ID=
STORAGE_S3_SECRET_ACCESS_KEY=

Storage Proxy

The URL of the media will always be pointing to your-url.com/media/data/[file].

As such, you could serve the media through any methods by resolving that URL. It may be useful to hook it up to a CDN like Cloudflare to reduce unnecessary server load. In practice, you could set a redirect from that URL to another subdomain in Cloudflare to get granular access of what you serve.

We also provide the STORAGE_PROXY env variable. This setting controls whether you want the server to serve the media on the path mentioned above.

When STORAGE_PROXY is local, it will serve the static files in the server. This only works if STORAGE_TYPE is file.

You could also set STORAGE_PROXY to any URL. This will in turn proxy the request to the specified URL.

Alternatively, pass any other value and the proxy will be disabled.

Changing between storage type

We currently do not have any mechanism to handle changing between storage types. Changing how the server handles it is just a simple envvar change. However, you'll need to migrate the data between storage type manually.

Serving media yourself

Cloudflare

Cache

CORS

PreviousStatic filesNextIntroduction

Last updated 4 months ago