Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

πŸ§‘β€πŸ’»(devex) fix local recording downloads

lebaudantoinec49cee3ab4d5
diff --git a/compose.yml b/compose.yml
index 41ff84a0..a7ba707d 100644
--- a/compose.yml
+++ b/compose.yml
@@ -153,6 +153,7 @@ services:
target: frontend-production
args:
VITE_API_BASE_URL: "http://localhost:8071"
+ VITE_MEDIA_BASE_URL: "http://localhost:8083"
VITE_APP_TITLE: "LaSuite Meet"
image: meet:frontend-development
ports:
diff --git a/docker/files/etc/nginx/conf.d/default.conf b/docker/files/etc/nginx/conf.d/default.conf
index d508dde2..26eeb2f7 100644
--- a/docker/files/etc/nginx/conf.d/default.conf
+++ b/docker/files/etc/nginx/conf.d/default.conf
@@ -4,6 +4,36 @@ server {
server_name localhost;
charset utf-8;
+ # Proxy auth for recordings (authorized by the recordings viewset)
+ location /media/recordings/ {
+ auth_request /media-auth-recordings;
+ auth_request_set $authHeader $upstream_http_authorization;
+ auth_request_set $authDate $upstream_http_x_amz_date;
+ auth_request_set $authContentSha256 $upstream_http_x_amz_content_sha256;
+
+ proxy_set_header Authorization $authHeader;
+ proxy_set_header X-Amz-Date $authDate;
+ proxy_set_header X-Amz-Content-SHA256 $authContentSha256;
+
+ proxy_pass http://garage:9000/meet-media-storage/recordings/;
+ proxy_set_header Host garage:9000;
+ proxy_hide_header Content-Disposition;
+ add_header Content-Disposition "attachment";
+ }
+
+ location = /media-auth-recordings {
+ internal;
+ proxy_pass http://app-dev:8000/api/v1.0/recordings/media-auth/;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Original-URL $request_uri;
+
+ proxy_pass_request_body off;
+ proxy_set_header Content-Length "";
+ proxy_set_header X-Original-Method $request_method;
+ }
+
# Proxy auth for media
location /media/ {
# Auth request configuration
diff --git a/src/frontend/Dockerfile b/src/frontend/Dockerfile
index 3121d75d..5efe0696 100644
--- a/src/frontend/Dockerfile
+++ b/src/frontend/Dockerfile
@@ -39,6 +39,9 @@ ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
ARG VITE_APP_TITLE
ENV VITE_APP_TITLE=${VITE_APP_TITLE}
+ARG VITE_MEDIA_BASE_URL
+ENV VITE_MEDIA_BASE_URL=${VITE_MEDIA_BASE_URL}
+
RUN npm run build
# ---- Front-end image ----
diff --git a/src/frontend/src/api/mediaUrl.ts b/src/frontend/src/api/mediaUrl.ts
index 01074131..1ceaa4eb 100644
--- a/src/frontend/src/api/mediaUrl.ts
+++ b/src/frontend/src/api/mediaUrl.ts
@@ -1,6 +1,6 @@
export const mediaUrl = (path: string) => {
const origin =
- import.meta.env.VITE_API_BASE_URL ||
+ import.meta.env.VITE_MEDIA_BASE_URL ||
(typeof window !== 'undefined' ? window.location.origin : '')
// Remove leading/trailing slashes from origin/path if it exists
diff --git a/src/frontend/src/vite-env.d.ts b/src/frontend/src/vite-env.d.ts
index 0fe1fb43..a97c6c08 100644
--- a/src/frontend/src/vite-env.d.ts
+++ b/src/frontend/src/vite-env.d.ts
@@ -6,6 +6,7 @@ declare const __MEDIAPIPE_VERSION__: string
interface ImportMetaEnv {
readonly VITE_API_BASE_URL: string
readonly VITE_APP_TITLE: string
+ readonly VITE_MEDIA_BASE_URL?: string
}
interface ImportMeta {