From ff0f057042c941d04c6b18db536a49cbcbede0b9 Mon Sep 17 00:00:00 2001 From: Lan Date: Wed, 28 May 2025 23:29:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20#350=20=E9=9C=80=E8=A6=81=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E6=B7=BB=E5=8A=A0=E5=8F=8D=E4=BB=A3=E7=A1=AE=E4=BF=9D?= =?UTF-8?q?=E7=9C=9F=E5=AE=9EIP=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.md | 33 ++++++++++++++++++++++++++++++++- readme_en.md | 39 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 68 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 53533a4..a450daa 100644 --- a/readme.md +++ b/readme.md @@ -19,8 +19,8 @@ - ## 🚀 更新计划 + - [ ] 切片上传,同文件秒传,断点续传 - [ ] 文件收集功能 @@ -47,6 +47,7 @@ FileCodeBox 是一个基于 FastAPI + Vue3 开发的轻量级文件分享工具 ### 新版界面 +
@@ -69,6 +70,7 @@ FileCodeBox 是一个基于 FastAPI + Vue3 开发的轻量级文件分享工具 ### 经典界面 +
@@ -143,6 +145,7 @@ FileCodeBox 是一个基于 FastAPI + Vue3 开发的轻量级文件分享工具 - IP 限制上传次数 - 错误次数限制 - 文件过期机制 +

🎫 提取码分享

@@ -188,11 +191,13 @@ FileCodeBox 是一个基于 FastAPI + Vue3 开发的轻量级文件分享工具 ### Docker 部署 #### Docker CLI + ```bash docker run -d --restart=always -p 12345:12345 -v /opt/FileCodeBox/:/app/data --name filecodebox lanol/filecodebox:beta ``` #### Docker Compose + ```yml version: "3" services: @@ -208,20 +213,35 @@ volumes: external: false ``` +### 配置反向代理(Nginx示例) + +请注意,必须添加以下配置来确保正确处理客户端IP和代理请求: + +```nginx +location / { + proxy_set_header X-Real-IP $remote_addr; # 设置真实客户端IP + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://localhost:12345; +} +``` + ### 手动部署 1. 克隆项目 + ```bash git clone https://github.com/vastsa/FileCodeBox.git ``` 2. 安装依赖 + ```bash cd FileCodeBox pip install -r requirements.txt ``` 3. 启动服务 + ```bash python main.py ``` @@ -229,17 +249,20 @@ python main.py ## 📖 使用说明 ### 分享文件 + 1. 打开网页,点击"分享文件" 2. 选择或拖拽文件 3. 设置过期时间和次数 4. 获取提取码 ### 获取文件 + 1. 打开网页,输入提取码 2. 点击获取 3. 下载文件或查看文本 ### 管理面板 + 1. 访问 `/#/admin` 2. 输入管理员密码 `FileCodeBox2023` 3. 管理文件和配置 @@ -247,6 +270,7 @@ python main.py ## 🛠 开发指南 ### 项目结构 + ``` FileCodeBox/ ├── apps/ # 应用代码 @@ -258,18 +282,22 @@ FileCodeBox/ ``` ### 开发环境 + - Python 3.8+ - Node.js 14+ - Vue 3 - FastAPI ### 本地开发 + 1. 后端开发 + ```bash python main.py ``` 2. 前端开发 + ```bash cd fcb-fronted npm install @@ -287,12 +315,15 @@ npm run dev ## ❓ 常见问题 ### Q: 如何修改上传大小限制? + A: 在管理面板中修改配置项 `uploadSize` ### Q: 如何配置存储引擎? + A: 在管理面板中选择存储引擎并配置相应参数 ### Q: 如何备份数据? + A: 备份 `data` 目录即可 更多问题请访问 [Wiki](https://github.com/vastsa/FileCodeBox/wiki/常见问题) diff --git a/readme_en.md b/readme_en.md index 55989f4..cf1b13d 100644 --- a/readme_en.md +++ b/readme_en.md @@ -21,7 +21,9 @@ ## 📝 Introduction -FileCodeBox is a lightweight file sharing tool developed with FastAPI + Vue3. It allows users to share text and files easily, where recipients only need a passcode to retrieve the files, just like picking up a package from a delivery locker. +FileCodeBox is a lightweight file sharing tool developed with FastAPI + Vue3. It allows users to share text and files +easily, where recipients only need a passcode to retrieve the files, just like picking up a package from a delivery +locker. ## 🖼️ Preview @@ -41,6 +43,7 @@ FileCodeBox is a lightweight file sharing tool developed with FastAPI + Vue3. It ### New Interface +
@@ -63,6 +66,7 @@ FileCodeBox is a lightweight file sharing tool developed with FastAPI + Vue3. It ### Classic Interface +
@@ -137,6 +141,7 @@ Support text and various file types - IP upload limits - Error attempt limits - File expiration +

🎫 Passcode Sharing

@@ -181,13 +186,14 @@ Command-line download ### Docker Deployment - #### Docker CLI + ```bash docker run -d --restart=always -p 12345:12345 -v /opt/FileCodeBox/:/app/data --name filecodebox lanol/filecodebox:beta ``` #### Docker Compose + ```yml version: "3" services: @@ -203,20 +209,35 @@ volumes: external: false ``` +### Configure reverse proxy (Nginx example) + +Please note that the following configurations must be added to ensure proper handling of client IP and proxy requests: + +```nginx +location / { +proxy_set_header X-Real-IP $remote_addr; #Set real client IP +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +proxy_pass http://localhost:12345 ; +} +``` + ### Manual Deployment 1. Clone the repository + ```bash git clone https://github.com/vastsa/FileCodeBox.git ``` 2. Install dependencies + ```bash cd FileCodeBox pip install -r requirements.txt ``` 3. Start the service + ```bash python main.py ``` @@ -224,17 +245,20 @@ python main.py ## 📖 Usage Guide ### Share Files + 1. Open the website, click "Share File" 2. Select or drag files 3. Set expiration time and count 4. Get the passcode ### Retrieve Files + 1. Open the website, enter passcode 2. Click retrieve 3. Download file or view text ### Admin Panel + 1. Visit `/admin` 2. Enter admin password 3. Manage files and settings @@ -242,6 +266,7 @@ python main.py ## 🛠 Development Guide ### Project Structure + ``` FileCodeBox/ ├── apps/ # Application code @@ -253,18 +278,22 @@ FileCodeBox/ ``` ### Development Environment + - Python 3.8+ - Node.js 14+ - Vue 3 - FastAPI ### Local Development + 1. Backend development + ```bash python main.py ``` 2. Frontend development + ```bash cd fcb-fronted npm install @@ -282,12 +311,15 @@ npm run dev ## ❓ FAQ ### Q: How to modify upload size limit? + A: Change `uploadSize` in admin panel ### Q: How to configure storage engine? + A: Select storage engine and configure parameters in admin panel ### Q: How to backup data? + A: Backup the `data` directory For more questions, visit [Wiki](https://github.com/vastsa/FileCodeBox/wiki/常见问题) @@ -304,4 +336,5 @@ For more questions, visit [Wiki](https://github.com/vastsa/FileCodeBox/wiki/常 ## 📜 Disclaimer -This project is open-source for learning purposes only. It should not be used for any illegal purposes. The author is not responsible for any consequences. Please retain the project address and copyright information when using it. \ No newline at end of file +This project is open-source for learning purposes only. It should not be used for any illegal purposes. The author is +not responsible for any consequences. Please retain the project address and copyright information when using it. \ No newline at end of file