No description
  • TypeScript 96.5%
  • Dockerfile 3.5%
Find a file
2026-03-01 13:13:32 +01:00
src init 2026-03-01 13:13:32 +01:00
.dockerignore init 2026-03-01 13:13:32 +01:00
.env init 2026-03-01 13:13:32 +01:00
.gitignore init 2026-03-01 13:13:32 +01:00
.npmrc init 2026-03-01 13:13:32 +01:00
Dockerfile init 2026-03-01 13:13:32 +01:00
package.json init 2026-03-01 13:13:32 +01:00
pnpm-lock.yaml init 2026-03-01 13:13:32 +01:00
README.md first commit 2026-03-01 13:11:50 +01:00
tsconfig.json init 2026-03-01 13:13:32 +01:00

ViShare Server

Persistence server for ViShare P2P file sharing. Downloads and seeds torrents to ensure file availability.

Environment Variables

Variable Description Default
MAGNET_SERVER_PORT Port for magnet link API 3001
HTTP_PORT HTTP server port 3002
HTTPS_PORT HTTPS server port 3443
RETENTION_HOURS Hours to keep torrents seeded 24
STORAGE_PATH Path to store torrent data /tmp/torrents
DB_PATH SQLite database path /tmp/data.db
TRACKER_URL WebSocket tracker URL ws://127.0.0.1:8000
AUTH_KEY API authentication key (optional) -

Development

# Install dependencies
pnpm install

# Start dev server
pnpm run dev

# Build for production
pnpm run build

# Start production server
pnpm run start

Docker

# Build image
docker build -t vishare-server .

# Run container
docker run -p 3001:3001 -p 3002:3002 -p 3443:3443 vishare-server

API

POST /magnet

Add a magnet link to be downloaded and seeded.

Headers:

  • Content-Type: application/json

Body:

{
  "magnetLink": "magnet:?xt=urn:btih:...",
  "shareName": "swift_bear_42"
}

Auth: If AUTH_KEY is set, include ?key=YOUR_KEY in URL.

GET /magnet

List all stored magnet links.

DELETE /magnet/:infoHash

Remove a magnet link and stop seeding.

GET /health

Health check endpoint.