# Sharey ๐Ÿ“ A secure, modern file sharing platform with configurable storage backends, encryption, themes, and flexible deployment options. ## โœจ Features - ๐Ÿ“ **File Sharing**: Upload files and get shareable links - ๐Ÿ“ **Pastebin**: Share text snippets with syntax highlighting - ๐Ÿ’พ **Flexible Storage**: Choose between Backblaze B2 cloud storage or local filesystem - ๐Ÿ”’ **Client-side Encryption**: Optional encryption for sensitive files - ๐ŸŽจ **Dark/Light Themes**: Toggle between themes with preference saving - ๐Ÿ”— **Short URLs**: Clean, easy-to-share links - ๐Ÿ›ก๏ธ **Admin Panel**: Secure administration interface - ๐Ÿ”ง **Maintenance Mode**: Graceful service management ## โšก Quick Storage Setup **Choose your storage type in `config.json`:** ```json { "storage": { "backend": "local" // Use "local" for filesystem or "b2" for cloud } } ``` - ๐Ÿ  **`"local"`** = Files stored on your server (free, fast) - โ˜๏ธ **`"b2"`** = Files stored in Backblaze B2 cloud (scalable, reliable) **Test your choice:** `python test_storage.py` ## ๐Ÿ—๏ธ Project Structure ``` sharey/ โ”œโ”€โ”€ src/ # Application source code โ”‚ โ”œโ”€โ”€ app.py # Main Flask application โ”‚ โ”œโ”€โ”€ config.py # Configuration management โ”‚ โ”œโ”€โ”€ config_util.py # Configuration utilities โ”‚ โ”œโ”€โ”€ static/ # CSS, JS, and static assets โ”‚ โ””โ”€โ”€ templates/ # HTML templates โ”œโ”€โ”€ tests/ # Test files โ”œโ”€โ”€ scripts/ # Utility scripts โ”‚ โ”œโ”€โ”€ migrate.py # Database migration โ”‚ โ”œโ”€โ”€ setup.py # Setup script โ”‚ โ”œโ”€โ”€ setup.sh # Shell setup script โ”‚ โ””โ”€โ”€ set_admin_password.py โ”œโ”€โ”€ docs/ # Documentation โ”œโ”€โ”€ logs/ # Application logs โ”œโ”€โ”€ config.json # Application configuration โ”œโ”€โ”€ requirements.txt # Python dependencies โ”œโ”€โ”€ run.py # Application entry point โ””โ”€โ”€ README.md # This file ``` ## ๐Ÿš€ Quick Start ### Method 1: Enhanced Python Runner (Recommended) ```bash python run.py ``` This will automatically: - Check Python version (3.8+ required) - Create and activate virtual environment if needed - Install dependencies - Validate configuration - Create necessary directories - Start the application ## ๐Ÿ’พ Storage Configuration Sharey supports multiple storage backends for maximum flexibility. Choose the one that best fits your needs: ### ๐Ÿ”„ **How to Choose Storage Type** **Method 1: Edit config.json directly (Easiest)** Open your `config.json` file and change the `backend` field: ```json { "storage": { "backend": "local" // Change to "local" or "b2" } } ``` **Method 2: Interactive setup** ```bash python src/config_util.py set # Interactive configuration python src/config_util.py validate # Validate your choice python test_storage.py # Test the storage backend ``` **Method 3: Environment variables** ```bash export STORAGE_BACKEND=local # or "b2" ``` ### Option 1: Backblaze B2 Cloud Storage (Recommended for Production) ```json { "storage": { "backend": "b2" }, "b2": { "application_key_id": "your_key_id", "application_key": "your_application_key", "bucket_name": "your_bucket_name" } } ``` - โœ… Unlimited scalability - โœ… Built-in redundancy and reliability - โœ… No local storage requirements - ๐Ÿ’ฐ Small cost (~$0.005/GB/month) ### Option 2: Local Filesystem Storage (Good for Development/Self-hosting) ```json { "storage": { "backend": "local", "local_path": "storage" } } ``` - โœ… No external dependencies or costs - โœ… Fast local access - โœ… Complete data control - โš ๏ธ Limited by disk space - โš ๏ธ No built-in redundancy ### ๐Ÿงช **Test Your Storage Choice** After changing the storage backend, always test it: ```bash python src/config_util.py validate # Validate configuration python test_storage.py # Test storage operations ``` **Quick Test Results:** - โœ… `Storage backend initialized: local` = Local storage working - โœ… `Storage backend initialized: b2` = B2 cloud storage working - โŒ `Storage test failed` = Check your configuration - โœ… Fast local access - โœ… Complete data control - โš ๏ธ Limited by disk space - โš ๏ธ No built-in redundancy ``` **Interactive Configuration:** ```bash python src/config_util.py set # Interactive setup python src/config_util.py validate # Validate configuration python test_storage.py # Test storage backend ``` See [docs/STORAGE.md](docs/STORAGE.md) for complete storage configuration guide. ### Method 2: Python Utility ```bash # Direct Python usage python sharey.py start # Full application start python sharey.py dev # Quick development mode python sharey.py setup # Set up environment python sharey.py status # Check system status python sharey.py clean # Clean temporary files python sharey.py test # Run tests python sharey.py logs # Show recent logs python sharey.py service # Install as system service (Linux) # Or use the wrapper script (shorter) ./sharey status # Unix/Linux/macOS ``` ### Method 3: Manual Setup ```bash # Create virtual environment python3 -m venv .venv source .venv/bin/activate # Linux/macOS # .venv\Scripts\activate # Windows # Install dependencies pip install -r requirements.txt # Configure storage backend cp config.json.example config.json # Edit config.json with your settings # Run python src/app.py ``` ## ๐Ÿ“‹ Features - ๐Ÿ” **Security**: Optional file encryption with password protection - ๐ŸŽจ **Themes**: Light/dark mode with elegant UI - โ˜๏ธ **Cloud Storage**: Backblaze B2 integration - ๐Ÿ“Š **Progress Tracking**: Real-time upload progress with percentage - ๐Ÿ“ฑ **Mobile Friendly**: Responsive design for all devices - ๐Ÿ”— **Easy Sharing**: Direct links, QR codes, and clipboard integration - ๐Ÿ“ **Pastebin**: Share text content with syntax highlighting ## ๐Ÿ› ๏ธ Development ### Running Tests ```bash cd tests python -m pytest ``` ### Development Mode ```bash # Set debug mode in config.json python run.py ``` ## ๐Ÿ“š Documentation See the `docs/` directory for: - Configuration guide - Deployment instructions - API documentation - Migration notes ## ๐Ÿ”ง Configuration Key configuration options in `config.json`: - `host`: Server host (default: 0.0.0.0) - `port`: Server port (default: 5000) - `debug`: Debug mode (default: false) - `max_file_size`: Maximum upload size - `b2_*`: Backblaze B2 credentials ## ๐Ÿ“„ License See LICENSE file for details.