No description
Find a file
2026-05-14 14:35:13 +07:00
backend fix: security hardening - remove secrets, fix CORS, add non-root user, add Secure flag 2026-05-14 14:24:14 +07:00
doc feat: modernize watch page, add mix playlist, and fix navigation 2026-03-24 21:59:10 +07:00
frontend fix: security hardening - remove secrets, fix CORS, add non-root user, add Secure flag 2026-05-14 14:24:14 +07:00
.dockerignore fix: Add .dockerignore to properly exclude files during build 2026-03-25 07:55:54 +07:00
.env.example feat: modernize watch page, add mix playlist, and fix navigation 2026-03-24 21:59:10 +07:00
.gitignore fix: security hardening - remove secrets, fix CORS, add non-root user, add Secure flag 2026-05-14 14:24:14 +07:00
docker-compose.yml refactor: make docker-compose generic for any domain deployment 2026-05-14 14:27:36 +07:00
Dockerfile fix: security hardening - remove secrets, fix CORS, add non-root user, add Secure flag 2026-05-14 14:24:14 +07:00
Dockerfile.diag Add Synology-compatible Dockerfile and docker-compose (v4.0.8) 2026-03-24 22:57:30 +07:00
LICENSE docs: add MIT license 2026-05-14 14:31:01 +07:00
package-lock.json feat: add watch page controls and custom KV-Tube branding 2026-05-14 10:59:21 +07:00
README.md docs: restyle README with badges, icons, and visual layout 2026-05-14 14:35:13 +07:00
restart.sh feat: modernize watch page, add mix playlist, and fix navigation 2026-03-24 21:59:10 +07:00
SECURITY.md Create SECURITY.md for security policy 2026-05-14 14:12:57 +07:00
stop.sh feat: modernize watch page, add mix playlist, and fix navigation 2026-03-24 21:59:10 +07:00
supervisord.conf fix: security hardening - remove secrets, fix CORS, add non-root user, add Secure flag 2026-05-14 14:24:14 +07:00

Go Next.js Docker SQLite License

🎬 KV-Tube

Self-hosted video streaming platform
Go backend + Next.js frontend — single Docker container

Quick StartFeaturesArchitectureDeploymentDevelopment


🚀 Quick Start

git clone https://github.com/vndangkhoa/kv-tube.git
cd kv-tube
mkdir -p data
docker build -t kv-tube:latest .
docker compose up -d

Frontend: http://localhost:5011  •  API: http://localhost:8981


Features

🎞️ Video Playback
HLS streaming with quality selection
📜 Watch History
Track what you've watched
🔔 Subscriptions
Follow YouTube channels
🔍 Search
Find videos instantly
🎵 Background Audio
Play with screen locked
📱 PWA
Install as native app
🌍 Region Selection
Tailor content by region
🌓 Themes
Light & dark mode

🏗️ Architecture

Single unified Docker container running:

Component Tech Port Role
Backend Go + Gin 8080 REST API, video processing, yt-dlp
Frontend Next.js 16 3000 SSR, PWA, UI
Process Manager supervisord Manages both processes
Storage SQLite Watch history & metadata

📦 Deployment

🐳 Docker Compose

services:
  kv-tube:
    build: .
    container_name: kv-tube
    ports:
      - "5011:3000"
      - "8981:8080"
    volumes:
      - ./data:/app/data
    environment:
      - KVTUBE_DATA_DIR=/app/data
      - GIN_MODE=release
      - NODE_ENV=production
      - CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5011
    restart: unless-stopped

🖥️ Synology NAS (DSM 7.2+)

  1. Create /volume1/docker/kv-tube/data
  2. Upload docker-compose.yml, Dockerfile, supervisord.conf
  3. Open Container Manager > Project > Create
  4. Select path /volume1/docker/kv-tube, click Done

🛠️ Multi-arch Build

docker buildx build --platform linux/amd64 -t kv-tube:latest --push .

⚙️ Environment Variables

Variable Default Description
KVTUBE_DATA_DIR /app/data Data storage path
GIN_MODE release Gin framework mode
NODE_ENV production Node environment
CORS_ALLOWED_ORIGINS Comma-separated allowed CORS origins
PORT 8080 Backend API port

💻 Development

# Frontend
cd frontend
npm install
npm run dev

# Backend
cd backend
go run main.go

🔄 Updating

docker compose pull
docker compose up -d

Or enable auto-updates with Watchtower.


📄 License

License

MIT License — see LICENSE for details.