SecureFileHub is a lightweight, secure file manager built with Python/Flask, featuring two-factor authentication and a user-friendly interface.
- Secure Authentication: Two-factor authentication with TOTP and backup codes for emergency access
- Brute Force Protection: Limited login attempts from a single IP address
- Multilingual Support: English and Russian language support
- Modern Interface: Responsive design with options to switch between table and tile views
- Built-in Preview: View images and PDF files directly in the interface
- Optimized Performance: HTML minification and page load optimization
- Security: Configured security headers, secure filename handling
- Docker Support: Ready to run in a container
- Cloudflare Upload Limit Bypass: Solution for uploading files larger than 100MB on Cloudflare's free tier
- Python 3.11 or higher
- Docker (optional)
- Pull the latest image:
docker pull isrofilov/secure-file-hub:latest
- Create a docker-compose.yml file:
version: '3'
services:
file-manager:
image: isrofilov/secure-file-hub:latest
ports:
- "8000:8000"
volumes:
- ./uploads:/app/uploads
environment:
- TOTP_SECRET=your_secure_totp_secret_here # Optional, will be generated on startup
- BACKUP_CODES=123456,234567,345678,456789 # Optional
- LOG_LEVEL=INFO # Optional
- TIMEZONE=Europe/London # Optional
- IMAGE_PREVIEW_ENABLED=true # Optional
- DOMAIN=yourdomain.com # Optional
- UPLOAD_DOMAIN=upload.yourdomain.com # Optional
restart: unless-stopped
- Launch with Docker Compose:
docker-compose up -d
- Clone the repository:
git clone https://github.com/Isrofilov/secure-file-hub.git
cd secure-file-hub
- Configure environment variables in docker-compose.yml:
environment:
- TOTP_SECRET=your_secure_totp_secret_here # Optional, will be generated on startup
- BACKUP_CODES=123456,234567,345678,456789 # Optional
- LOG_LEVEL=INFO # Optional
- TIMEZONE=Europe/London # Optional
- IMAGE_PREVIEW_ENABLED=true # Optional
- DOMAIN=yourdomain.com # Optional
- UPLOAD_DOMAIN=upload.yourdomain.com # Optional
- Launch with Docker Compose:
docker-compose up -d
- The application will be available at http://localhost:8000
- Clone the repository:
git clone https://github.com/Isrofilov/secure-file-hub.git
cd secure-file-hub
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # on Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Create an .env file (all parameters are optional):
TOTP_SECRET=your_secure_totp_secret_here
BACKUP_CODES=123456,234567,345678,456789
TIMEZONE=Europe/London
IMAGE_PREVIEW_ENABLED=true
LOG_LEVEL=INFO
- Run the application:
python app.py
- For running with Gunicorn (recommended for production):
gunicorn --bind 0.0.0.0:8000 app:app
To set up two-factor authentication, you need a TOTP secret key:
-
Option 1: Use an online generator:
-
Option 2: Use automatic generation: If TOTP_SECRET is not specified in .env or docker-compose.yml, the application will automatically generate a random key at startup. The startup logs will show the generated key as both a text string and a QR code for convenient scanning:
Temporary TOTP_SECRET generated: XXXXXXXXXXXXXXXXXXXX [QR code for scanning]
Important: An automatically generated key will change with each restart unless you save it in your configuration!
After obtaining your TOTP_SECRET:
- Install a TOTP code generation app (Google Authenticator, Authy, or similar)
- Scan the QR code from the logs or add the key manually
- Use the temporary codes from the app to log into SecureFileHub
Backup codes are designed for emergency access to the system when you don't have access to your primary device with the TOTP app. They provide an alternative authentication method in emergency situations.
Recommendations for using backup codes:
- Use backup codes only on trusted devices
- Store backup codes in a secure location separate from your TOTP app device
- For untrusted devices or when providing temporary access to third parties, use only TOTP
- It's strongly recommended to configure backup codes in .env or docker-compose.yml to ensure access to the application if you lose your TOTP device
The system includes built-in protection against password brute force attempts:
- Limits the number of failed attempts (default 5) from a single IP address
- Temporary login block for 5 minutes after exceeding the limit
- Automatic counter reset after successful login
The application supports two languages:
- English (default)
- Russian
Users can switch the language in the interface, and the choice is saved in the session.
To bypass Cloudflare's limitation on uploading files larger than 100MB on the free tier:
- Create a subdomain for file uploads (e.g., upload.yourdomain.com)
- Set up a DNS record for this subdomain but do not enable proxying through Cloudflare
- Specify both domains in the configuration:
DOMAIN=yourdomain.com
UPLOAD_DOMAIN=upload.yourdomain.com
The system will automatically use different domains for regular operations and for uploading large files.
- Open the application in your browser: http://localhost:8000 (or your configured domain)
- Log in using a TOTP code or one of the backup codes (on trusted devices)
- Manage files through the user-friendly web interface
- Switch the interface language in the settings menu
[Interface screenshots will be added later]
- Flask 3: Web framework
- Bootstrap 5: Frontend framework for responsive design
- Blueprint: Modular code organization
- Flask-Babel: Internationalization and localization
- Docker: Containerization for easy deployment
This project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE.
Thank you for your interest in SecureFileHub!