vid support
This commit is contained in:
@@ -6,6 +6,7 @@ export const REMOTE_DIR = "/";
|
||||
export const LOCAL_DIR = path.resolve("./downloads");
|
||||
export const LOCAL_DIR_VID = path.resolve("./downloads_vids");
|
||||
export const LOCAL_DIR_VID_EXTRACTED = path.join(path.resolve("./downloads_vids"), "extracted");
|
||||
export const OUT_DIR = path.resolve("./out");
|
||||
|
||||
export async function downloadMissing(remoteDir: string = REMOTE_DIR) {
|
||||
await Promise.all([
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
// src/routes/auth.ts
|
||||
import { Router } from "express";
|
||||
import { downloadMissing, LOCAL_DIR } from "../lib/nextcloud";
|
||||
import { downloadMissing, LOCAL_DIR, OUT_DIR } from "../lib/nextcloud";
|
||||
import path from "node:path";
|
||||
import { createVid, encodeFrames } from "../lib/crateClip";
|
||||
import fs from "node:fs"
|
||||
|
||||
const router = Router();
|
||||
|
||||
export const out_vid_path = `${OUT_DIR}/out.mp4`
|
||||
|
||||
router.get("/video", async (req, res) => {
|
||||
const videoPath = path.resolve("./out.mp4");
|
||||
const videoPath = path.resolve(out_vid_path);
|
||||
const stat = fs.statSync(videoPath);
|
||||
|
||||
// Simple ETag based on file size + modification time
|
||||
|
||||
@@ -12,7 +12,7 @@ dotenv.config();
|
||||
const app = express();
|
||||
|
||||
app.use(cors({
|
||||
origin: "http://localhost:5173",
|
||||
origin: "https://papryk.com",
|
||||
methods: ["GET", "POST"],
|
||||
credentials: true
|
||||
}));
|
||||
|
||||
@@ -1,28 +1,38 @@
|
||||
services:
|
||||
backend:
|
||||
papryk-com-backend:
|
||||
build: ./back
|
||||
container_name: papryk-backend
|
||||
expose:
|
||||
- "3000"
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
volumes:
|
||||
- ./pictures:/app/downloads
|
||||
- ./out:/app/out
|
||||
|
||||
frontend:
|
||||
|
||||
papryk-com-frontend:
|
||||
build:
|
||||
context: ./front
|
||||
args:
|
||||
VITE_API_URL: "http://localhost/api"
|
||||
VITE_API_URL: "https://papryk.com/api"
|
||||
container_name: papryk-frontend
|
||||
expose:
|
||||
- "5173"
|
||||
|
||||
nginx:
|
||||
papryk-com-nginx:
|
||||
image: nginx:alpine
|
||||
container_name: papryk-nginx
|
||||
ports:
|
||||
- "80:80"
|
||||
# ports:
|
||||
# - "80:80"
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
depends_on:
|
||||
- frontend
|
||||
- backend
|
||||
- papryk-com-frontend
|
||||
- papryk-com-backend
|
||||
networks:
|
||||
- proxy-net
|
||||
|
||||
networks:
|
||||
proxy-net:
|
||||
external: true
|
||||
|
||||
@@ -5,7 +5,8 @@ server {
|
||||
# FRONTEND (Vite)
|
||||
# =========================
|
||||
location / {
|
||||
proxy_pass http://frontend:5173;
|
||||
# proxy_pass http://papryk-com-frontend:5173;
|
||||
proxy_pass http://papryk-com-frontend:80;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
@@ -19,7 +20,7 @@ server {
|
||||
location /api/ {
|
||||
rewrite ^/api/(.*)$ /$1 break;
|
||||
|
||||
proxy_pass http://backend:3000;
|
||||
proxy_pass http://papryk-com-backend:3000;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
|
||||
Reference in New Issue
Block a user