2025-01-26 10:57:46 +08:00
|
|
|
|
# FileCodeBox
|
|
|
|
|
|
|
2023-09-06 11:40:13 +08:00
|
|
|
|
<div align="center">
|
2025-01-26 10:57:46 +08:00
|
|
|
|
|
|
|
|
|
|
<img src="https://fastly.jsdelivr.net/gh/vastsa/FileCodeBox@V1.6/static/banners/img_1.png" alt="FileCodeBox Logo">
|
|
|
|
|
|
|
|
|
|
|
|
<p><em>Share text and files anonymously with a passcode, like picking up a package</em></p>
|
|
|
|
|
|
|
|
|
|
|
|
[](https://github.com/vastsa/FileCodeBox/stargazers)
|
|
|
|
|
|
[](https://github.com/vastsa/FileCodeBox/network)
|
|
|
|
|
|
[](https://github.com/vastsa/FileCodeBox/issues)
|
|
|
|
|
|
[](https://github.com/vastsa/FileCodeBox/blob/master/LICENSE)
|
2025-01-26 11:16:57 +08:00
|
|
|
|
[](https://qm.qq.com/q/PemPzhdEIM)
|
2025-01-26 10:57:46 +08:00
|
|
|
|
[](https://www.python.org)
|
|
|
|
|
|
[](https://fastapi.tiangolo.com)
|
|
|
|
|
|
[](https://v3.vuejs.org)
|
|
|
|
|
|
|
|
|
|
|
|
[简体中文](./readme.md) | [Deployment Guide](https://github.com/vastsa/FileCodeBox/wiki/Deployment-Guide) | [FAQ](https://github.com/vastsa/FileCodeBox/wiki/FAQ)
|
|
|
|
|
|
|
2023-09-06 11:40:13 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
## 📝 Introduction
|
2023-09-06 11:40:13 +08:00
|
|
|
|
|
2025-05-28 23:29:13 +08:00
|
|
|
|
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.
|
2023-09-06 11:40:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
## 🖼️ Preview
|
|
|
|
|
|
|
|
|
|
|
|
<div align="center">
|
|
|
|
|
|
<h3>
|
|
|
|
|
|
<a href="https://github.com/vastsa/FileCodeBoxFronted" target="_blank">
|
2025-02-16 21:38:44 +08:00
|
|
|
|
<img src="https://img.shields.io/badge/Frontend-FileCodeBoxFronted2024-blue?style=for-the-badge&logo=github" alt="前端仓库2024">
|
2025-01-26 10:57:46 +08:00
|
|
|
|
</a>
|
2025-02-16 21:38:44 +08:00
|
|
|
|
<a href="https://github.com/vastsa/FileCodeBoxFronted2023" target="_blank">
|
|
|
|
|
|
<img src="https://img.shields.io/badge/Frontend-FileCodeBoxFronted2023-blue?style=for-the-badge&logo=github" alt="前端仓库2023">
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
<a href="https://share.lanol.cn" target="_blank">
|
2025-02-16 21:38:44 +08:00
|
|
|
|
<img src="https://img.shields.io/badge/Demo-share.lanol.cn-green?style=for-the-badge&logo=internet-explorer" alt="演示站点">
|
2025-01-26 10:57:46 +08:00
|
|
|
|
</a>
|
|
|
|
|
|
</h3>
|
2024-06-15 23:23:28 +08:00
|
|
|
|
</div>
|
2023-09-06 11:40:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
### New Interface
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
<div align="center">
|
|
|
|
|
|
<table>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td><img src="./.github/images/img_7.png" alt="File Upload" title="File Upload Interface"></td>
|
|
|
|
|
|
<td><img src="./.github/images/img_8.png" alt="Text Share" title="Text Share Interface"></td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td><img src="./.github/images/img_10.png" alt="File Management" title="File Management Interface"></td>
|
|
|
|
|
|
<td><img src="./.github/images/img_9.png" alt="System Settings" title="System Settings Interface"></td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td><img src="./.github/images/img_11.png" alt="Mobile View" title="Mobile Interface"></td>
|
|
|
|
|
|
<td><img src="./.github/images/img_12.png" alt="Dark Mode" title="Dark Mode Interface"></td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td><img src="./.github/images/img_13.png" alt="Internationalization" title="Language Support"></td>
|
|
|
|
|
|
<td><img src="./.github/images/img_14.png" alt="Responsive" title="Responsive Design"></td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</div>
|
2023-09-06 11:40:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
### Classic Interface
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
<div align="center">
|
|
|
|
|
|
<table>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td><img src="./.github/images/img.png" alt="Home" title="Home Page"></td>
|
|
|
|
|
|
<td><img src="./.github/images/img_1.png" alt="Upload" title="Upload Interface"></td>
|
2024-06-15 21:40:56 +08:00
|
|
|
|
</tr>
|
2025-01-26 10:57:46 +08:00
|
|
|
|
<tr>
|
|
|
|
|
|
<td><img src="./.github/images/img_2.png" alt="Management" title="Management Interface"></td>
|
|
|
|
|
|
<td><img src="./.github/images/img_3.png" alt="Settings" title="Settings Interface"></td>
|
2024-06-15 21:40:56 +08:00
|
|
|
|
</tr>
|
2025-01-26 10:57:46 +08:00
|
|
|
|
<tr>
|
|
|
|
|
|
<td><img src="./.github/images/img_4.png" alt="Share" title="Share Interface"></td>
|
|
|
|
|
|
<td><img src="./.github/images/img_5.png" alt="Download" title="Download Interface"></td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
## 🎯 Use Cases
|
|
|
|
|
|
|
|
|
|
|
|
<table>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>📁 Temporary File Sharing</h4>
|
|
|
|
|
|
Quick file sharing without registration
|
|
|
|
|
|
</td>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>📝 Quick Text Sharing</h4>
|
|
|
|
|
|
Share code snippets and text content
|
|
|
|
|
|
</td>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>🕶️ Anonymous Transfer</h4>
|
|
|
|
|
|
Privacy-protected file transfer
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>💾 Temporary Storage</h4>
|
|
|
|
|
|
File storage with expiration time
|
|
|
|
|
|
</td>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>🔄 Cross-platform Transfer</h4>
|
|
|
|
|
|
Quick file transfer between devices
|
|
|
|
|
|
</td>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>🌐 Private Share Service</h4>
|
|
|
|
|
|
Build your own file sharing service
|
|
|
|
|
|
</td>
|
2023-09-06 11:40:13 +08:00
|
|
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
## ✨ Core Features
|
2023-09-06 11:40:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
<table>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>🚀 Lightweight</h4>
|
|
|
|
|
|
Based on FastAPI + SQLite3 + Vue3 + ElementUI
|
|
|
|
|
|
</td>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>📤 Easy Upload</h4>
|
|
|
|
|
|
Support copy-paste and drag-drop
|
|
|
|
|
|
</td>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>📦 Multiple Types</h4>
|
|
|
|
|
|
Support text and various file types
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>🔒 Security</h4>
|
2023-09-06 11:40:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
- IP upload limits
|
|
|
|
|
|
- Error attempt limits
|
|
|
|
|
|
- File expiration
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>🎫 Passcode Sharing</h4>
|
|
|
|
|
|
Random codes with customizable limits
|
|
|
|
|
|
</td>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>🌍 Multi-language</h4>
|
|
|
|
|
|
Support for Simplified Chinese, Traditional Chinese, and English
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>🎭 Anonymous</h4>
|
|
|
|
|
|
No registration required
|
|
|
|
|
|
</td>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>🛠 Admin Panel</h4>
|
|
|
|
|
|
File and system management
|
|
|
|
|
|
</td>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>🐳 Docker</h4>
|
|
|
|
|
|
One-click deployment
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>💾 Storage Options</h4>
|
|
|
|
|
|
Local, S3, OneDrive support
|
|
|
|
|
|
</td>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>📱 Responsive</h4>
|
|
|
|
|
|
Mobile-friendly design
|
|
|
|
|
|
</td>
|
|
|
|
|
|
<td align="center">
|
|
|
|
|
|
<h4>💻 CLI Support</h4>
|
|
|
|
|
|
Command-line download
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
</table>
|
2023-09-06 11:40:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
## 🚀 Quick Start
|
2023-09-06 11:40:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
### Docker Deployment
|
2023-09-06 11:40:13 +08:00
|
|
|
|
|
2025-03-12 18:56:27 +08:00
|
|
|
|
#### Docker CLI
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
```bash
|
2025-01-26 10:59:23 +08:00
|
|
|
|
docker run -d --restart=always -p 12345:12345 -v /opt/FileCodeBox/:/app/data --name filecodebox lanol/filecodebox:beta
|
2025-01-26 10:57:46 +08:00
|
|
|
|
```
|
2023-09-06 11:40:13 +08:00
|
|
|
|
|
2025-03-12 18:56:27 +08:00
|
|
|
|
#### Docker Compose
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-08-01 13:25:59 +08:00
|
|
|
|
```ymlfix
|
2025-03-12 18:56:27 +08:00
|
|
|
|
version: "3"
|
2025-08-01 13:25:59 +08:00
|
|
|
|
services:s
|
2025-03-12 18:56:27 +08:00
|
|
|
|
file-code-box:
|
|
|
|
|
|
image: lanol/filecodebox:latest
|
|
|
|
|
|
volumes:
|
|
|
|
|
|
- fcb-data:/app/data:rw
|
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
ports:
|
|
|
|
|
|
- "12345:12345"
|
|
|
|
|
|
volumes:
|
|
|
|
|
|
fcb-data:
|
|
|
|
|
|
external: false
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-05-28 23:29:13 +08:00
|
|
|
|
### 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 ;
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
### Manual Deployment
|
2023-09-06 11:40:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
1. Clone the repository
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
```bash
|
|
|
|
|
|
git clone https://github.com/vastsa/FileCodeBox.git
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
2. Install dependencies
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
```bash
|
|
|
|
|
|
cd FileCodeBox
|
|
|
|
|
|
pip install -r requirements.txt
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
3. Start the service
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
```bash
|
|
|
|
|
|
python main.py
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## 📖 Usage Guide
|
|
|
|
|
|
|
|
|
|
|
|
### Share Files
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
1. Open the website, click "Share File"
|
|
|
|
|
|
2. Select or drag files
|
|
|
|
|
|
3. Set expiration time and count
|
|
|
|
|
|
4. Get the passcode
|
|
|
|
|
|
|
|
|
|
|
|
### Retrieve Files
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
1. Open the website, enter passcode
|
|
|
|
|
|
2. Click retrieve
|
|
|
|
|
|
3. Download file or view text
|
|
|
|
|
|
|
|
|
|
|
|
### Admin Panel
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
1. Visit `/admin`
|
|
|
|
|
|
2. Enter admin password
|
|
|
|
|
|
3. Manage files and settings
|
|
|
|
|
|
|
|
|
|
|
|
## 🛠 Development Guide
|
|
|
|
|
|
|
|
|
|
|
|
### Project Structure
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
```
|
|
|
|
|
|
FileCodeBox/
|
|
|
|
|
|
├── apps/ # Application code
|
|
|
|
|
|
│ ├── admin/ # Admin backend
|
|
|
|
|
|
│ └── base/ # Base functions
|
|
|
|
|
|
├── core/ # Core functions
|
|
|
|
|
|
├── data/ # Data directory
|
|
|
|
|
|
└── fcb-fronted/ # Frontend code
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Development Environment
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
- Python 3.8+
|
|
|
|
|
|
- Node.js 14+
|
|
|
|
|
|
- Vue 3
|
|
|
|
|
|
- FastAPI
|
|
|
|
|
|
|
|
|
|
|
|
### Local Development
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
1. Backend development
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
```bash
|
|
|
|
|
|
python main.py
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
2. Frontend development
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
```bash
|
|
|
|
|
|
cd fcb-fronted
|
|
|
|
|
|
npm install
|
|
|
|
|
|
npm run dev
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## 🤝 Contributing
|
|
|
|
|
|
|
|
|
|
|
|
1. Fork the project
|
|
|
|
|
|
2. Create your feature branch `git checkout -b feature/xxx`
|
|
|
|
|
|
3. Commit your changes `git commit -m 'Add xxx'`
|
|
|
|
|
|
4. Push to the branch `git push origin feature/xxx`
|
|
|
|
|
|
5. Open a Pull Request
|
|
|
|
|
|
|
|
|
|
|
|
## ❓ FAQ
|
|
|
|
|
|
|
|
|
|
|
|
### Q: How to modify upload size limit?
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
A: Change `uploadSize` in admin panel
|
|
|
|
|
|
|
|
|
|
|
|
### Q: How to configure storage engine?
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
A: Select storage engine and configure parameters in admin panel
|
|
|
|
|
|
|
|
|
|
|
|
### Q: How to backup data?
|
2025-05-28 23:29:13 +08:00
|
|
|
|
|
2025-01-26 10:57:46 +08:00
|
|
|
|
A: Backup the `data` directory
|
|
|
|
|
|
|
|
|
|
|
|
For more questions, visit [Wiki](https://github.com/vastsa/FileCodeBox/wiki/常见问题)
|
|
|
|
|
|
|
|
|
|
|
|
## �� Project Statistics and Analytics
|
|
|
|
|
|
|
|
|
|
|
|
<div align="center">
|
|
|
|
|
|
<a href="https://hellogithub.com/repository/75ad7ffedd404a6485b4d621ec5b47e6" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=75ad7ffedd404a6485b4d621ec5b47e6&claim_uid=beSz6INEkCM4mDH" alt="Featured|HelloGitHub" style="width: 200px; height: 45px;" width="200" height="45" /></a>
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
[](https://star-history.com/#vastsa/FileCodeBox&Date)
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
## 📜 Disclaimer
|
|
|
|
|
|
|
2025-05-28 23:29:13 +08:00
|
|
|
|
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.
|