|
|
@@ -1,48 +1,115 @@
|
|
|
-# HokoriTemp v2
|
|
|
-
|
|
|
-Aplicación Flask para subida temporal de archivos con expiración automática.
|
|
|
-
|
|
|
-## Novedades en la versión 2
|
|
|
-- **Nombre actualizado:** HokoriTemp
|
|
|
-- **Estructura mejorada:**
|
|
|
- - Archivos JavaScript y CSS movidos a `/static/js/main.js` y `/static/css/styles.css`.
|
|
|
- - Favicon SVG moderno en `/static/favicon.svg`.
|
|
|
-- **Soporte visual avanzado:**
|
|
|
- - Mejor contraste y experiencia en modo claro/oscuro.
|
|
|
- - Toast de notificación mejorado, sin errores visuales.
|
|
|
- - Tooltips personalizados para nombres de archivos truncados.
|
|
|
- - Truncado automático de nombres largos de archivos.
|
|
|
-
|
|
|
-## Instalación
|
|
|
-
|
|
|
-1. Clona el repositorio y entra en la carpeta del proyecto.
|
|
|
-2. Instala las dependencias:
|
|
|
- ```bash
|
|
|
- pip install -r requirements.txt
|
|
|
- ```
|
|
|
-3. Ejecuta la aplicación Flask:
|
|
|
- ```bash
|
|
|
- flask run
|
|
|
- ```
|
|
|
-
|
|
|
-## Uso
|
|
|
-- Accede a la interfaz web para subir archivos temporales.
|
|
|
-- Elige la duración de expiración.
|
|
|
-- Descarga o elimina tus archivos desde la lista.
|
|
|
-- Cambia entre modo claro y oscuro con el botón de la esquina.
|
|
|
-
|
|
|
-## Estructura relevante
|
|
|
+# 📁 Flask Temporary File Upload
|
|
|
+
|
|
|
+A lightweight Flask web application for temporary file uploads with automatic expiration and cleanup.
|
|
|
+
|
|
|
+## ⚡ Quick Start
|
|
|
+
|
|
|
+1. **Clone/Download** and navigate to project folder
|
|
|
+2. **Create virtual environment**: `python -m venv venv`
|
|
|
+3. **Activate environment**:
|
|
|
+ - Linux/Mac: `source venv/bin/activate`
|
|
|
+ - Windows: `venv\Scripts\activate`
|
|
|
+4. **Install dependencies**: `pip install -r requirements.txt`
|
|
|
+5. **Create templates folder**: `mkdir templates`
|
|
|
+6. **Place files**:
|
|
|
+ - `app.py` in root folder
|
|
|
+ - `index.html` in `templates/` folder
|
|
|
+7. **Run**: `python app.py`
|
|
|
+8. **Open**: http://localhost:5000
|
|
|
+
|
|
|
+## 🚀 Usage Examples
|
|
|
+
|
|
|
+```bash
|
|
|
+# Basic (localhost only)
|
|
|
+python app.py
|
|
|
+
|
|
|
+# Network access (all devices on LAN)
|
|
|
+python app.py --network
|
|
|
+
|
|
|
+# Custom domain/URL
|
|
|
+python app.py --base-url https://files.mysite.com
|
|
|
+
|
|
|
+# Large files (100MB limit)
|
|
|
+python app.py --max-file-size 100
|
|
|
+
|
|
|
+# Production example
|
|
|
+python app.py --network --port 8080 --max-file-size 50 --base-url https://uploads.mydomain.com
|
|
|
```
|
|
|
-static/
|
|
|
- css/styles.css # Estilos personalizados y mejoras dark/light
|
|
|
- js/main.js # Toda la lógica JS de la app
|
|
|
- favicon.svg # Favicon SVG moderno
|
|
|
-uploads/ # Archivos subidos por los usuarios
|
|
|
-templates/
|
|
|
- index.html # Plantilla principal
|
|
|
-app.py # Backend Flask
|
|
|
+
|
|
|
+## 🔧 Command Options
|
|
|
+
|
|
|
+| Option | Description | Default |
|
|
|
+|--------|-------------|---------|
|
|
|
+| `--host` | Bind to specific host | 127.0.0.1 |
|
|
|
+| `--port` | Port number | 5000 |
|
|
|
+| `--network` | Allow network access (0.0.0.0) | False |
|
|
|
+| `--base-url` | Custom URL for download links | auto |
|
|
|
+| `--max-file-size` | Max file size in MB | 16 |
|
|
|
+| `--debug` | Enable debug mode | False |
|
|
|
+
|
|
|
+## 📋 Features
|
|
|
+
|
|
|
+- ✅ **Drag & drop** file upload
|
|
|
+- ✅ **Automatic cleanup** every 10 minutes
|
|
|
+- ✅ **Custom expiration** (1 hour to 1 week)
|
|
|
+- ✅ **User sessions** via localStorage
|
|
|
+- ✅ **Secure filenames** and validation
|
|
|
+- ✅ **Responsive design** with Tailwind CSS
|
|
|
+- ✅ **Download links** with custom domains
|
|
|
+- ✅ **File management** (upload/download/delete)
|
|
|
+
|
|
|
+## 🗂️ Project Structure
|
|
|
+
|
|
|
+```
|
|
|
+project/
|
|
|
+├── venv/ # Virtual environment
|
|
|
+├── app.py # Main Flask application
|
|
|
+├── requirements.txt # Dependencies
|
|
|
+├── templates/
|
|
|
+│ └── index.html # Web interface
|
|
|
+├── uploads/ # Files storage (auto-created)
|
|
|
+└── files.db # SQLite database (auto-created)
|
|
|
+```
|
|
|
+
|
|
|
+## 🌐 Network Access
|
|
|
+
|
|
|
+- **Localhost only**: `python app.py`
|
|
|
+- **LAN access**: `python app.py --network`
|
|
|
+- **Custom host**: `python app.py --host 192.168.1.100`
|
|
|
+
|
|
|
+## 🔒 Security
|
|
|
+
|
|
|
+- Random 32-character secret key generated on startup
|
|
|
+- Filename sanitization prevents path traversal
|
|
|
+- Session-based file access (users only see their files)
|
|
|
+- Configurable file size limits
|
|
|
+- Automatic expired file cleanup
|
|
|
+
|
|
|
+## 🛠️ Environment Variables
|
|
|
+
|
|
|
+Set `BASE_URL` environment variable as alternative to `--base-url`:
|
|
|
+```bash
|
|
|
+export BASE_URL=https://files.mysite.com
|
|
|
+python app.py --network
|
|
|
+```
|
|
|
+
|
|
|
+## 📝 File Expiration
|
|
|
+
|
|
|
+Users can set file duration when uploading:
|
|
|
+- 1 Hour
|
|
|
+- 6 Hours
|
|
|
+- 24 Hours (default)
|
|
|
+- 3 Days
|
|
|
+- 1 Week
|
|
|
+
|
|
|
+Files are automatically deleted after expiration.
|
|
|
+
|
|
|
+## 🔍 Help
|
|
|
+
|
|
|
+```bash
|
|
|
+python app.py --help
|
|
|
```
|
|
|
|
|
|
---
|
|
|
|
|
|
-¡Disfruta usando HokoriTemp v2! Si tienes sugerencias, abre un issue o contacta al autor.
|
|
|
+**Ready to go!** 🎉 Your temporary file upload server will be running with automatic cleanup and a modern web interface.
|