A Flask-based web application for managing and sharing files locally.
- Browse and manage files and directories
- Upload files and folders
- Create new folders
- Download files and folders as ZIP archives
- Remove files and folders
- Secure access with IP restrictions
- Python 3.7+
- Flask
- Werkzeug
For a complete list of dependencies, see requirements.txt
.
-
Clone the repository:
git clone https://github.com/yourusername/best-local-web-server.git cd best-local-web-server
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
IMPORTANT: Before running the server, you must configure the variables in the config.py
file correctly. This step is crucial for the proper and secure functioning of the application.
- Open
config.py
and adjust the following settings:FLASK_PORT
: The port on which the server will run (default is 5000)OUTPUT_DIR
: The directory where uploaded files will be storedALLOWED_IP
: Set of IP addresses allowed to access the serverALLOWED_EXTENSIONS
: File extensions that are allowed to be uploadedSECRET_KEY
: A secret key for the application (for security, use a strong, random key)MAX_CONTENT_LENGTH
: Maximum allowed file size for uploads
Example configuration:
FLASK_PORT = '5000'
OUTPUT_DIR = Path(os.path.expanduser("~/uploads"))
ALLOWED_IP = {'127.0.0.1', '192.168.1.100'} # Add your IP addresses here
SECRET_KEY = 'your_secret_key
-
Start the server:
python app.py
-
Open a web browser and navigate to
http://localhost:5000
(or the port specified in your configuration).
- Use the web interface to browse, upload, download, and manage files.
- Create new folders using the "Create New Folder" form.
- Upload files by dragging and dropping them onto the page or using the file input.
- Download folders as ZIP archives by clicking the "Download" button next to a folder.
- Remove files or folders by clicking the "Remove" button next to an item.
- This server is intended for local use only. Do not expose it to the public internet without proper security measures.
- The server restricts access to specified IP addresses. Make sure to configure
ALLOWED_IP
inconfig.py
. - Always keep your system and dependencies up to date.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.