diff --git a/README.md b/README.md index c12efae..327dc08 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,173 @@ -# litecloud +# πŸŒ₯️ Litecloud -Selfhosted cloud solution based on Rust and postgresql. uses flutter for the web interface \ No newline at end of file +Your files, your server, your privacy. Litecloud is a lightweight, secure cloud storage solution that you can host yourself. Upload, organize, and share files without compromising your privacy or depending on big tech companies. + +## What makes Litecloud special? + +πŸ”’ **Privacy-first**: Your files are encrypted with military-grade AES-256-GCM encryption before they ever touch the disk +🏠 **Self-hosted**: Run it on your own serverβ€”you control your data +⚑ **Lightning fast**: Built with Rust for maximum performance and safety +πŸ”§ **Developer-friendly**: Clean REST API lets you build custom apps and integrations +πŸš€ **Dead simple**: One Docker command and you're running your own cloud + +## Features at a glance + +- **Secure authentication** with JWT-based sessions +- **File encryption** using AES-256-GCM (the same standard used by banks) +- **Share files easily** with customizable access controls and expiration dates +- **Full REST API** for building your own clients or automations +- **Modern web interface** built with React and TypeScript +- **Single binary deployment** β€” no complex setup required + +## The tech behind the magic + +### Backend Stack +- **Rust + Rocket**: For blazing-fast, memory-safe performance +- **AES-256-GCM encryption**: Your files are scrambled before they hit storage +- **JWT authentication**: Secure, stateless session management +- **Docker-ready**: Runs on port 8082 by default + +### Frontend +- **React + Vite + TypeScript**: Modern, type-safe user interface, with all the added benefits of vite +- **Tailwind CSS**: Clean, responsive design + + +## Why Rust? Why not just use Node.js? + +Great question! Rust gives us superpowers: + +- **Memory safety without garbage collection** β€” no mysterious crashes or memory leaks, hence safer handling of encrypted files. +- **Fearless concurrency** β€” handle thousands of simultaneous uploads without breaking a sweat +- **Zero-cost abstractions** β€” all the safety with none of the performance overhead +- **Type safety for encryption** β€” this really is a no-brainer for an app built with security in mind + +Rocket framework adds the cherry on top with its elegant routing system and built-in request validation. + +## How secure is "secure"? + +We take security seriously: + +- **AES-256-GCM encryption**: The same encryption standard trusted by governments and militaries +- **Server-side encryption**: Files are encrypted before they're written to your server's disk β€” even system administrators can't read your files without the keys +- **No plaintext storage**: Your original files never exist unencrypted on the server +- **JWT-based auth**: Secure, industry-standard authentication tokens + +## API-first design + +Everything you can do in the web interface, you can do programmatically. The entire Litecloud feature set is available under `/api`, so you can: + +- Build a mobile app that syncs with your Litecloud instance +- Create automated backup scripts +- Integrate file storage into your existing applications +- Build a command-line client for power users + +*API documentation is coming soon β€” we're working on comprehensive docs with examples!* + +## Getting started in 30 seconds + +1. Clone the repository: + ```bash + git clone https://git.mercurio.moe/Mercury/litecloud.git + cd litecloud + ``` + +2. Fire it up: + ```bash + docker compose up --build + ``` + +3. Open your browser to `http://localhost:8082` and create your account! + +That's it! You now have your own private cloud storage running locally. + +## Exposing to the internet (Production deployment) + +Running locally is great for testing, but you'll probably want to access your files from anywhere. Here's how to properly expose Litecloud with SSL encryption: + +### Option 1: Using Caddy (Recommended - Super Easy!) + +Caddy automatically handles SSL certificates via Let's Encrypt. Create a `Caddyfile`: + +``` +your-domain.com { + reverse_proxy localhost:8082 +} +``` + +Then run Caddy: +```bash +caddy run +``` + +That's it! Caddy will automatically get SSL certificates and proxy requests to your Litecloud instance. + +### Option 2: Using Nginx Proxy Manager (GUI-friendly) + +If you prefer a web interface for managing your reverse proxy: + +1. Set up [Nginx Proxy Manager](https://nginxproxymanager.com/) +2. Create a new proxy host pointing to `localhost:8082` +3. Enable SSL and let NPM handle the certificate generation +4. Configure any additional security headers you want + +### Option 3: Traditional Nginx + +For those who prefer manual configuration, here's a basic Nginx config: + +```nginx +server { + listen 443 ssl http2; + server_name your-domain.com; + + ssl_certificate /path/to/your/certificate.crt; + ssl_certificate_key /path/to/your/private.key; + + location / { + proxy_pass http://localhost:8082; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + # Important for file uploads, app default is 5 gb + client_max_body_size 100M; + } +} +``` + +### Security considerations + +When exposing to the internet: +- **Always use HTTPS** β€” your files are encrypted at rest, but you want them encrypted in transit too +- Consider **IP whitelisting** if you only access from specific locations +- Set up **fail2ban** to prevent brute force attacks on your login +- Regular **backups** of your encrypted file storage +- Keep your **Docker images updated** for security patches + +## What's next? + +- πŸ“± Mobile app development +- πŸ“š Comprehensive API documentation +- πŸ” File search and tagging +- πŸ”„ Client-side sync capabilities + +## Contributing + +Found a bug? Have a feature idea? We'd love your help! Check out our issues page or submit a pull request. + +## License + +This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). This means: + +- βœ… You can use, modify, and distribute this software freely +- βœ… You can use it for commercial purposes +- βœ… You must provide source code to users (even if they access it over a network) +- βœ… Any modifications must also be open source under AGPL-3.0 + +The AGPL ensures that if you run a modified version of Litecloud as a service, your users have the right to access the source code. This keeps the project truly open and prevents proprietary forks from closing off improvements to the community. + +See the [LICENSE](LICENSE) file for full details. + +--- + +*Built with ❀️ and lots of β˜• by a solo developer who believes your files belong to you, not Big Tech.* \ No newline at end of file diff --git a/api/.env.example b/api/.env.example deleted file mode 100644 index ed44208..0000000 --- a/api/.env.example +++ /dev/null @@ -1,6 +0,0 @@ -DATABASE_URL=postgres://postgres:password@db:5432/litecloud -JWT_SECRET=supersecurejwtsecret -ENCRYPTION_KEY=0123456789abcdef0123456789abcdef -ROCKET_ADDRESS=0.0.0.0 -ROCKET_PORT=8080 -ROCKET_LOG=info