david_bai 8ef43029d5 fix(deploy+docker+frontend): enforce same-origin via Nginx, disable Next Image optimization in Docker, allow Socket.IO polling fallback, and improve health checks and access info
- generate-config.sh: add --with-nginx flag handling; when enabled, set NEXT_PUBLIC_API_URL empty to use same-origin /api and /socket.io; add BACKEND_INTERNAL_URL for SSR/internal fetch; adjust lan-tls HTTPS (8443) and TLS generation policy
- deploy.sh: show only valid access URLs when Nginx is enabled (gateway URLs), avoid misleading :3002/:3001 entries
- frontend (env/webrtc): return mutable transports [websocket,polling]; use empty signaling server for same-origin; comments in English
- frontend (next.config): support NEXT_IMAGE_UNOPTIMIZED to turn off image optimization in Docker
- frontend (health): prefer BACKEND_INTERNAL_URL for internal health checks, fallback to public URL/localhost
- docker-compose + Dockerfile(frontend): pass NEXT_IMAGE_UNOPTIMIZED and BACKEND_INTERNAL_URL envs
2025-10-10 20:49:17 +08:00
2025-06-26 22:58:39 +08:00
2025-06-18 23:25:02 +08:00

PrivyDrop Logo

PrivyDrop - A Privacy-Focused, WebRTC-Based File Sharing Tool

简体中文

License: MIT

PrivyDrop(formerly SecureShare) is an open-source, peer-to-peer (P2P) file and text sharing tool built on WebRTC. It requires no server-side data relay; all data is transmitted directly between browsers, ensuring end-to-end encryption for maximum privacy and security.

We believe everyone should have control over their own data. PrivyDrop was created to fulfill this vision: a simple, fast, and private sharing solution.

Try it Live » | GitHub Repository »


PrivyDrop Interface GIF

Key Features

  • 🔒 End-to-End Encryption: Leverages P2P direct connections via WebRTC. All files and text are transferred directly between browsers without passing through any central server.
  • 📂 File & Folder Transfer: Supports transferring multiple files and entire folders.
  • ⏸️ Resume Transfer: Resume file transfer from the point of interruption. Simply set the save directory to enable this feature, ensuring your large files are delivered safely even with unstable networks. If interrupted, you currently need to refresh both the sender and receiver web pages to restart the transfer.
  • Real-time & Efficient: Displays real-time transfer progress and automatically calculates transfer speed.
  • 📝 Rich Text Clipboard: Supports editing and sending formatted text, not just files.
  • 🔗 Convenient Sharing: Easily share a room and establish a connection via a link or QR code.
  • 📱 Multi-Device Support: Responsive design supports both desktop and mobile browsers.
  • 🌐 Internationalization: Supports multiple languages, including English and Chinese.

🛠️ Tech Stack

  • Frontend: Next.js 14, React 18, TypeScript, Tailwind CSS, shadcn/ui
  • Backend: Node.js, Express.js, TypeScript
  • Real-time Communication: WebRTC, Socket.IO
  • Data Storage: Redis
  • Deployment: PM2, Nginx, Docker

Deploy in minutes with zero manual configuration. Supports private/public networks and auto HTTPS (Lets Encrypt).

# Private LAN (no domain/public IP)
bash ./deploy.sh --mode lan-http

# Private LAN + TURN (for complex NAT/LAN)
bash ./deploy.sh --mode lan-http --with-turn

# LAN HTTPS (self-signed; dev/managed env; explicitly enable 8443)
bash ./deploy.sh --mode lan-tls --enable-web-https --with-nginx

# Public IP without domain (with TURN)
bash ./deploy.sh --mode public --with-turn

# Public domain (HTTPS + Nginx + TURN + SNI 443, auto-issue/renew)
bash ./deploy.sh --mode full --domain your-domain.com --with-nginx --with-turn --le-email you@domain.com

See Docker Deployment Guide (Modes Overview, LAN TLS limitations, Lets Encrypt auto-issue/renew)

Heads-up (LAN TLS, self-signed)

  • Import the CA certificate into your browser (or system trust store) on first use: docker/ssl/ca-cert.pem. Otherwise the browser shows “certificate not valid/untrusted”.
  • Access endpoints (by default):
    • Nginx: http://localhost
    • HTTPS: https://localhost:8443, https://<your LAN IP>:8443
    • Frontend dev ports (optional): http://localhost:3002, http://<your LAN IP>:3002
    • With CA trusted, using same-origin HTTPS (8443) avoids CORS; common dev origins (localhost, :3002) are allowed by default.

🚀 Quick Start (Full-Stack Local Development)

Before you begin, ensure your development environment has Node.js (v18+), npm, and a running Redis instance installed.

  1. Clone the Project & install redis

    git clone https://github.com/david-bai00/PrivyDrop.git
    cd PrivyDrop
    sudo apt-get install -y redis-server
    
  2. Configure and Start the Backend Service

    cd backend
    npm install
    
    # Copy the development environment file, then modify .env.development as needed
    cp .env_development_example .env.development
    
    npm run dev # Starts by default at http://localhost:3001
    
  3. Configure and Start the Frontend App (in a new terminal window)

    cd frontend
    pnpm install
    
    # Copy the development environment file, then modify .env.development as needed, Remove optional items
    cp .env_development_example .env.development
    
    pnpm dev # Starts by default at http://localhost:3002
    
  4. Start Sharing Open http://localhost:3002 in your browser to access the application.

🗺️ Roadmap

We have a public roadmap that outlines our vision for the future and our current priorities. It's a great place to see what we're working on or to find areas where you can contribute.

➡️ Check out the Project Roadmap

📚 Documentation

We provide detailed documentation to help you dive deeper into the project's design and deployment details:

🤝 Contributing

We warmly welcome contributions of all forms! Whether it's reporting a bug, suggesting a feature, submitting code or adding a star, your help is invaluable to PrivyDrop's growth. Please read our Contribution Guidelines to start your journey.

We have a Code of Conduct that all contributors are expected to follow. Please be sure to review it before participating.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

S
Description
An open-source web-app alternative to AirDrop
Readme MIT 6.2 MiB
Languages
TypeScript 57.8%
MDX 33.8%
Shell 7.5%
JavaScript 0.4%
Dockerfile 0.3%
Other 0.2%