A lightweight local file server with a beautiful web interface
Project description
🚀 LitheServer
中文
LitheServer 是一个基于 Python 开发的轻量级本地文件服务器,提供了比标准 http.server 更友好、功能更丰富的 Web 界面。
🖼️ 界面预览
主页面 - 文件浏览
现代化的文件浏览界面,支持:
- 🎨 美观的渐变背景设计
- 📁 直观的文件和文件夹图标
- 🔍 实时搜索功能
- 📱 响应式设计,支持移动设备
文件预览功能
强大的文件预览能力:
- 👁️ 图片文件实时预览
- 📄 文本文件语法高亮显示
- 📋 一键复制代码内容
- ⬅️ 便捷的返回导航
多语言语法高亮
支持 20+ 种编程语言的语法高亮:
- 🐍 Python, JavaScript, TypeScript
- 🌐 HTML, CSS, XML, JSON
- ⚙️ C/C++, Java, Go, Rust
- 📝 Markdown, YAML, Shell 脚本等
拖拽上传功能
便捷的文件上传体验:
- 📤 拖拽文件直接上传
- 📁 支持多文件同时上传
- 📊 实时显示文件列表和大小
- ✅ 上传进度和结果反馈
✨ 主要特性
- 🌐 美观的 Web 界面 - 现代化的响应式设计,支持桌面和移动设备
- 📁 文件浏览与导航 - 直观的目录结构浏览,支持面包屑导航和实时搜索
- 👁️ 强大的文件预览 - 支持图片预览和 20+ 种编程语言的语法高亮
- ⬇️ 文件下载 - 一键下载任意文件,支持中文文件名和文件夹 ZIP 下载
- 📤 拖拽上传 - 支持拖拽上传和多文件选择,带有进度显示
- 🗑️ 文件管理 - 文件删除、重命名、移动等完整的文件操作功能
- 📁 文件夹操作 - 创建新文件夹、文件夹 ZIP 下载
- 🔒 安全防护 - 防止目录遍历攻击,限制访问范围
- 📱 响应式设计 - 在各种屏幕尺寸下都有良好的用户体验
- 🚀 零依赖 - 仅使用 Python 标准库,无需安装额外依赖
🛠️ 安装与使用
快速开始
# 通过pip安装
pip install litheserver
# 启动服务器
litheserver
# 或指定端口和目录
litheserver -p 8080 -d /path/to/directory
从源码安装
# 克隆项目
git clone https://github.com/xyanmi/litheserver.git
cd litheserver
# 安装
python setup.py install
# 启动服务器
python -m litheserver
命令行选项
litheserver [选项]
选项:
-p, --port PORT 指定服务器端口 (默认: 8000)
-d, --directory DIR 指定服务目录 (默认: 当前目录)
--host HOST 指定绑定地址 (默认: 0.0.0.0)
-h, --help 显示帮助信息
🌟 功能演示
访问 http://localhost:8000 即可使用所有功能:
- 文件浏览: 点击文件夹进入子目录,支持面包屑导航
- 实时搜索: 在搜索框中输入关键词快速定位文件
- 文件预览: 点击 👁️ 图标预览支持的文件类型
- 文件下载: 点击 ⬇️ 图标下载文件,支持文件夹 ZIP 下载
- 文件上传: 点击"📤 Upload Files"展开上传区域,支持拖拽上传
- 文件管理: 重命名 🏷️、删除 🗑️、移动文件到其他目录
- 新建文件夹: 点击"📁 New Folder"创建新目录
- 打包下载: 点击📦即可将对应文件夹打包成zip并且下载
🎨 支持的文件类型
语法高亮预览
- 编程语言: Python, JavaScript, TypeScript, Java, C/C++, Go, Rust, PHP
- Web 技术: HTML, CSS, XML, JSON, SVG
- 配置文件: YAML, TOML, INI, ENV
- 脚本语言: Shell, PowerShell, Batch
- 文档格式: Markdown, LaTeX, RTF
- 数据格式: CSV, SQL, Log 文件
图片预览
- 常见格式: JPG, PNG, GIF, SVG, WebP
- 即时预览: 无需下载,直接在浏览器中查看
📋 系统要求
- Python 3.6 或更高版本
- 仅使用 Python 标准库,无需安装额外依赖
- 支持 Windows, macOS, Linux
⭐ If you find this project useful, please give it a star!
💡 LitheServer - Making local file serving simple and beautiful!
English
LitheServer is a lightweight local file server developed in Python, providing a more user-friendly and feature-rich web interface than the standard http.server.
🖼️ Interface Preview
Homepage - File Browsing
Modern file browsing interface featuring:
- 🎨 Beautiful gradient background design
- 📁 Intuitive file and folder icons
- 🔍 Real-time search functionality
- 📱 Responsive design with mobile support
File Preview Feature
Powerful file preview capabilities:
- 👁️ Real-time image file preview
- 📄 Text file syntax highlighting
- 📋 One-click code copying
- ⬅️ Convenient back navigation
Multi-language Syntax Highlighting
Supports 20+ programming languages with syntax highlighting:
- 🐍 Python, JavaScript, TypeScript
- 🌐 HTML, CSS, XML, JSON
- ⚙️ C/C++, Java, Go, Rust
- 📝 Markdown, YAML, Shell scripts, etc.
Drag & Drop Upload
Convenient file upload experience:
- 📤 Direct drag & drop file upload
- 📁 Multi-file upload support
- 📊 Real-time file list and size display
- ✅ Upload progress and result feedback
✨ Key Features
- 🌐 Beautiful Web Interface - Modern responsive design supporting desktop and mobile devices
- 📁 File Browsing & Navigation - Intuitive directory structure browsing with breadcrumb navigation and real-time search
- 👁️ Powerful File Preview - Image preview and syntax highlighting for 20+ programming languages
- ⬇️ File Download - One-click download for any file, supports Chinese filenames and folder ZIP download
- 📤 Drag & Drop Upload - Drag & drop upload with multi-file selection and progress display
- 🗑️ File Management - Complete file operations including delete, rename, and move
- 📁 Folder Operations - Create new folders, folder ZIP download
- 🔒 Security Protection - Prevents directory traversal attacks, restricts access scope
- 📱 Responsive Design - Excellent user experience across all screen sizes
- 🚀 Zero Dependencies - Uses only Python standard library, no additional dependencies required
🛠️ Installation & Usage
Quick Start
# Install via pip
pip install litheserver
# Start the server
litheserver
# Or specify port and directory
litheserver -p 8080 -d /path/to/directory
Install from Source
# Clone the project
git clone https://github.com/xyanmi/litheserver.git
cd litheserver
# Install
python setup.py install
# Start the server
python -m litheserver
Command Line Options
litheserver [options]
Options:
-p, --port PORT Specify server port (default: 8000)
-d, --directory DIR Specify service directory (default: current directory)
--host HOST Specify bind address (default: 0.0.0.0)
-h, --help Show help information
🌟 Feature Demonstration
Visit http://localhost:8000 to use all features:
- File Browsing: Click folders to enter subdirectories, supports breadcrumb navigation
- Real-time Search: Enter keywords in the search box to quickly locate files
- File Preview: Click 👁️ icon to preview supported file types
- File Download: Click ⬇️ icon to download files, supports folder ZIP download
- File Upload: Click "📤 Upload Files" to expand upload area, supports drag & drop upload
- File Management: Rename 🏷️, delete 🗑️, move files to other directories
- New Folder: Click "📁 New Folder" to create new directory
- Pack Download: Click 📦 to pack corresponding folder into zip and download
🎨 Supported File Types
Syntax Highlighting Preview
- Programming Languages: Python, JavaScript, TypeScript, Java, C/C++, Go, Rust, PHP
- Web Technologies: HTML, CSS, XML, JSON, SVG
- Configuration Files: YAML, TOML, INI, ENV
- Script Languages: Shell, PowerShell, Batch
- Document Formats: Markdown, LaTeX, RTF
- Data Formats: CSV, SQL, Log files
Image Preview
- Common Formats: JPG, PNG, GIF, SVG, WebP
- Instant Preview: No download required, view directly in browser
📋 System Requirements
- Python 3.6 or higher
- Uses only Python standard library, no additional dependencies required
- Supports Windows, macOS, Linux
⭐ If you find this project useful, please give it a star!
💡 LitheServer - Making local file serving simple and beautiful!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file litheserver-0.1.1.tar.gz.
File metadata
- Download URL: litheserver-0.1.1.tar.gz
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cbe8f0e42d7553ce5eb0aca3342b94c125e72bf69897796f1eb099b34794d35
|
|
| MD5 |
8d81c9b91fd347f2fbaf9aef4c89ea36
|
|
| BLAKE2b-256 |
f94e605ada52727824cc514705c4685b588ec8153ee184a0eed93bdb34324370
|
File details
Details for the file litheserver-0.1.1-py3-none-any.whl.
File metadata
- Download URL: litheserver-0.1.1-py3-none-any.whl
- Upload date:
- Size: 1.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0dd820f98d30a5c98b5fe7ec8c873921ffea8549af2baf69c32f1427a7c20a9
|
|
| MD5 |
123b1166e76e01db00537b580e38ba94
|
|
| BLAKE2b-256 |
bafb810a21d6784cb7cab12cc958762db5cd318243a536da16cef81791c1a9b0
|