Share text and files anonymously with a passcode, like picking up a package
[](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)
[](https://qm.qq.com/q/PemPzhdEIM)
[](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)
## ๐ 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.
## ๐ผ๏ธ Preview
๐ Lightweight
Based on FastAPI + SQLite3 + Vue3 + ElementUI
|
๐ค Easy Upload
Support copy-paste and drag-drop
|
๐ฆ Multiple Types
Support text and various file types
|
๐ Security
- IP upload limits
- Error attempt limits
- File expiration
|
๐ซ Passcode Sharing
Random codes with customizable limits
|
๐ Multi-language
Support for Simplified Chinese, Traditional Chinese, and English
|
๐ญ Anonymous
No registration required
|
๐ Admin Panel
File and system management
|
๐ณ Docker
One-click deployment
|
๐พ Storage Options
Local, S3, OneDrive support
|
๐ฑ Responsive
Mobile-friendly design
|
๐ป CLI Support
Command-line download
|
## ๐ Quick Start
### 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
```ymlfix
version: "3"
services:s
file-code-box:
image: lanol/filecodebox:latest
volumes:
- fcb-data:/app/data:rw
restart: unless-stopped
ports:
- "12345:12345"
volumes:
fcb-data:
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
```
## ๐ 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 `FileCodeBox2023`
3. Manage files and settings
### Command Line Upload (curl)
Upload files and get extraction codes via curl:
```bash
# Upload file (default 1 day expiration)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/your/file.txt"
# Upload file with expiration (1 hour)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/your/file.txt" \
-F "expire_value=1" \
-F "expire_style=hour"
# Upload file with download limit (10 downloads)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/your/file.txt" \
-F "expire_value=10" \
-F "expire_style=count"
# Share text
curl -X POST "http://localhost:12345/share/text/" \
-F "text=This is the text content to share"
# Download file by extraction code
curl -L "http://localhost:12345/share/select/?code=YOUR_CODE" -o downloaded_file
```
**Parameters:**
- `expire_value`: Expiration value (default 1)
- `expire_style`: Expiration type
- `day` - Days
- `hour` - Hours
- `minute` - Minutes
- `count` - Download count
- `forever` - Never expire
**Response Example:**
```json
{
"code": 200,
"msg": "success",
"detail": {
"code": "abcd1234",
"name": "file.txt"
}
}
```
> Note: If guest upload is disabled in admin panel (`openUpload=false`), you need to login first to get a token, then add `Authorization: Bearer