From 3afd8513b84f75e47c948f400e57ff9331bc803b Mon Sep 17 00:00:00 2001 From: WardPearce Date: Wed, 4 Jun 2025 17:24:30 +1200 Subject: [PATCH] Updated docs --- docs/DOCKER.md | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/docs/DOCKER.md b/docs/DOCKER.md index ad685d1c..94daa4ac 100644 --- a/docs/DOCKER.md +++ b/docs/DOCKER.md @@ -59,14 +59,14 @@ server { ``` ### Nginx Proxy Manager example 1. Tab: Details - Create a new proxy host with SSL on (Let's Encrypt or your own certificate). -2. Tab: Custom locations, fill in IP and port. Click gear icon to add some security headers. +2. Tab: Custom locations, fill in IP and port. Click gear icon to add some security headers. -Click image for fullsize: +Click image for fullsize: -**Add:** +**Add:** ```nginx if ($request_method = OPTIONS) { return 204; @@ -97,12 +97,37 @@ http: - PATCH - PUT - DELETE - accessControlAllowHeaders: + accessControlAllowHeaders: - User-Agent - - Authorization + - Authorization - Content-Type ``` +### Invidious Companion support +The `VITE_DEFAULT_COMPANION_INSTANCE` environment variable allows you to specify a custom [Invidious Companion](https://github.com/iv-org/invidious-companion) instance. + +To use this with Materialious, your Invidious Companion instance must be accessible with proper CORS headers. Fortunately, you can reuse the same reverse proxy configuration (with CORS modifications) that you applied to your Invidious instance—just apply it to your companion domain as well. + +For example, if you're using Caddy, you can configure your companion domain like this: + +```caddy +companion.example.com { + @cors_preflight { + method OPTIONS + } + respond @cors_preflight 204 + + header Access-Control-Allow-Credentials true + header Access-Control-Allow-Origin "https://materialious.example.com" { + defer + } + header Access-Control-Allow-Methods "GET, POST, OPTIONS, HEAD, PATCH, PUT, DELETE" + header Access-Control-Allow-Headers "User-Agent, Authorization, Content-Type" + + reverse_proxy localhost:3000 +} +``` + ### Other Please open a PR request or issue if you implement this in a different reverse proxy. @@ -132,10 +157,13 @@ services: # URL to your proxied Invidious instance VITE_DEFAULT_INVIDIOUS_INSTANCE: "https://invidious.materialio.us" + # URL to your proxied Companion instance + VITE_DEFAULT_COMPANION_INSTANCE: "https://companion.materialio.us" + # URL TO RYD # Leave blank to disable completely. VITE_DEFAULT_RETURNYTDISLIKES_INSTANCE: "https://returnyoutubedislikeapi.com" - + # URL to Sponsorblock # Leave blank to completely disable sponsorblock. VITE_DEFAULT_SPONSERBLOCK_INSTANCE: "https://sponsor.ajay.app" @@ -148,9 +176,6 @@ services: # Look at "Overwriting Materialious defaults" for all the accepted values. VITE_DEFAULT_SETTINGS: '{"themeColor": "#2596be","region": "US"}' - - # Set the default video/audio bitrate to use, -1 automatic, 999999 always best quality - VITE_DEFAULT_DASH_BITRATE: -1 ``` ### Overwriting Materialious defaults @@ -270,4 +295,4 @@ Add these additional environment variables to Materialious. VITE_DEFAULT_PEERJS_HOST: "peerjs.example.com" VITE_DEFAULT_PEERJS_PATH: "/" VITE_DEFAULT_PEERJS_PORT: 443 -``` \ No newline at end of file +```