Skip to main content

A modern HTTP file server with web UI

Project description

Web File Server

English

一个基于 FastAPI 和 Vue.js 的简单文件服务器,支持文件和文件夹的上传、预览和管理。

功能特点

  • 📁 文件和文件夹浏览
  • 📤 支持文件和文件夹上传
  • 🖼️ 图片文件预览
  • 🗑️ 文件和文件夹删除
  • 📊 文件大小显示
  • 🔄 实时进度显示
  • 💫 拖放上传支持
  • 🖥️ 命令行界面支持

预览功能

  • .jpg、.jpeg、.png、.gif、.webp 图片预览。
  • .json、.html、.css、.txt、.md、.py 以文本格式预览。
  • .ttf 字体文件预览。

安装

推荐使用 pipx 安装(保证依赖隔离):

pipx install servefs

或者使用 pip 安装:

pip install servefs

使用方法

命令行使用

最简单的使用方式:

# 在当前目录启动服务器
servefs

# 指定端口号
servefs --port 7001

# 指定根目录
servefs --root /path/to/directory

# 查看帮助
servefs --help

完整的命令行选项:

选项:
  -r, --root TEXT     要服务的根目录 [default: .]
  -h, --host TEXT     绑定的主机地址 [default: 127.0.0.1]
  -p, --port INTEGER  绑定的端口号 [default: 8000]
  -v, --version       显示版本号并退出
  --help             显示帮助信息并退出

开发环境使用

  1. 克隆仓库:
git clone [repository-url]
cd fileserver
  1. 安装依赖:
poetry install
  1. 运行服务器:
poetry run servefs
  1. 打开浏览器访问:
http://localhost:8000

技术栈

后端

  • FastAPI:高性能的 Python Web 框架
  • Python 3.8+:编程语言
  • uvicorn:ASGI 服务器
  • Typer:命令行界面框架
  • Rich:终端美化

前端

  • Vue.js 3:前端框架
  • Element Plus:UI 组件库
  • @element-plus/icons-vue:图标库

注意事项

  • 上传文件会自动重命名以避免冲突
  • 删除操作需要确认
  • 支持的图片格式:jpg、jpeg、png、gif、webp
  • 文件大小显示自动转换单位(B、KB、MB、GB)

开发计划

  • 添加文件搜索功能
  • 支持更多文件类型的预览
  • 添加文件排序功能
  • 支持文件重命名
  • 添加用户认证
  • 支持文件分享

感谢

  • Windsurf

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

servefs-0.1.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file servefs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: servefs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for servefs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7046a46ad3855a3e827a229b470d2647feab7619982440bcc58db653f0cba8b8
MD5 0cac39b43f58dde1ebaa97545c83cf77
BLAKE2b-256 a77899f10f3cb796866d385c87ffbcf68f3c5b6affa7ff29f5e467501260a678

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page