No description
- TypeScript 96.5%
- Dockerfile 3.5%
| src | ||
| .dockerignore | ||
| .env | ||
| .gitignore | ||
| .npmrc | ||
| Dockerfile | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
| tsconfig.json | ||
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.