docs: improve documentation experience
This commit is contained in:
1 parent
fe1a7727f7
commit
f20a7a5704
34 files changed
+548
-32919
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# Configuration Guide
|
||||
|
||||
FileCodeBox provides rich configuration options that can be customized through the admin panel or by directly modifying the configuration. This document details all available configuration options.
|
||||
FileCodeBox provides rich configuration options. Prefer the admin panel; directly editing the database can introduce invalid types or break security settings.
|
||||
|
||||
## Configuration Methods
|
||||
|
||||
@@ -22,7 +22,9 @@ On first startup, the system uses default configuration from `core/settings.py`.
|
||||
| `name` | string | `文件快递柜 - FileCodeBox` | Site name, displayed in page title and navigation bar |
|
||||
| `description` | string | `开箱即用的文件快传系统` | Site description, used for SEO |
|
||||
| `keywords` | string | `FileCodeBox, 文件快递柜...` | Site keywords, used for SEO |
|
||||
| `port` | int | `12345` | Service listening port |
|
||||
| `serverHost` | string | `0.0.0.0` | Service listening address |
|
||||
| `serverPort` | int | `12345` | Service listening port |
|
||||
| `serverWorkers` | int | `1` | Worker count; keep one worker for SQLite deployments |
|
||||
|
||||
### Notification Settings
|
||||
|
||||
@@ -42,6 +44,7 @@ On first startup, the system uses default configuration from `core/settings.py`.
|
||||
| `openUpload` | int | `1` | Enable upload functionality (1=enabled, 0=disabled) |
|
||||
| `uploadSize` | int | `10485760` | Maximum single file upload size (bytes), default 10MB |
|
||||
| `enableChunk` | int | `0` | Enable chunked upload (1=enabled, 0=disabled) |
|
||||
| `allowed_file_types` | list | `["*"]` | Allowed extensions; `*` allows every file type |
|
||||
|
||||
::: warning Note
|
||||
`uploadSize` is in bytes. 10MB = 10 * 1024 * 1024 = 10485760 bytes
|
||||
@@ -111,6 +114,7 @@ Default available themes:
|
||||
|---------|------|---------|-------------|
|
||||
| `admin_token` | string | Set during setup | Admin login password |
|
||||
| `showAdminAddr` | int | `0` | Show admin panel entry on homepage (1=show, 0=hide) |
|
||||
| `adminSessionExpire` | int | `2592000` | Admin session lifetime in seconds (30 days) |
|
||||
|
||||
::: danger Security Warning
|
||||
The setup page is shown automatically while the system is uninitialized. Complete setup before exposing a production service to the public internet.
|
||||
@@ -123,7 +127,8 @@ The setup page is shown automatically while the system is uninitialized. Complet
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `errorMinute` | int | `1` | Error limit time window (minutes) |
|
||||
| `errorCount` | int | `1` | Maximum errors allowed within the time window |
|
||||
| `errorCount` | int | `10` | Maximum errors allowed within the time window |
|
||||
| `trustedProxies` | list | `[]` | Trusted reverse-proxy IPs used to resolve client addresses |
|
||||
|
||||
This setting prevents brute-force attacks on extraction codes.
|
||||
|
||||
@@ -135,6 +140,7 @@ This setting prevents brute-force attacks on extraction codes.
|
||||
|---------|------|---------|-------------|
|
||||
| `file_storage` | string | `local` | Storage backend type |
|
||||
| `storage_path` | string | `""` | Custom storage path |
|
||||
| `storageLimit` | int | `0` | Total storage quota in bytes; 0 means unlimited |
|
||||
|
||||
Supported storage types:
|
||||
- `local` - Local storage
|
||||
@@ -158,7 +164,6 @@ Suitable for personal or small team use with relaxed limits:
|
||||
"uploadMinute": 5, # 5 minutes
|
||||
"uploadCount": 20, # Max 20 uploads
|
||||
"expireStyle": ["day", "hour", "forever"],
|
||||
"admin_token": "your-secure-password",
|
||||
"showAdminAddr": 1
|
||||
}
|
||||
```
|
||||
@@ -177,7 +182,6 @@ Suitable for public services requiring stricter limits:
|
||||
"errorCount": 3, # Max 3 errors
|
||||
"expireStyle": ["hour", "minute", "count"],
|
||||
"max_save_seconds": 86400, # Max retention 1 day
|
||||
"admin_token": "very-secure-password-123",
|
||||
"showAdminAddr": 0
|
||||
}
|
||||
```
|
||||
@@ -195,11 +199,14 @@ Suitable for enterprise internal use with large file and chunked upload support:
|
||||
"uploadCount": 100, # Max 100 uploads
|
||||
"expireStyle": ["day", "forever"],
|
||||
"file_storage": "s3", # Use S3 storage
|
||||
"admin_token": "enterprise-secure-token",
|
||||
"showAdminAddr": 1
|
||||
}
|
||||
```
|
||||
|
||||
::: warning Configuration examples
|
||||
These dictionaries illustrate combinations of values; they are not editable configuration files. Set the admin password through first-run setup or the admin panel.
|
||||
:::
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [Storage Configuration](/en/guide/storage) - Learn how to configure different storage backends
|
||||
|
||||
@@ -15,12 +15,25 @@ FileCodeBox is a simple and efficient file sharing tool that supports temporary
|
||||
|
||||
## Deployment Methods
|
||||
|
||||
### Docker Deployment
|
||||
### Docker Deployment (Recommended)
|
||||
|
||||
```bash
|
||||
docker run -d --restart=always -p 12345:12345 -v /opt/FileCodeBox/:/app/data --name filecodebox lanol/filecodebox:beta
|
||||
docker run -d --restart unless-stopped \
|
||||
-p 12345:12345 \
|
||||
-v fcb-data:/app/data \
|
||||
--name filecodebox \
|
||||
lanol/filecodebox:latest
|
||||
```
|
||||
|
||||
The named volume persists configuration and uploaded files across container upgrades.
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `HOST` | `0.0.0.0` | Service listening address |
|
||||
| `PORT` | `12345` | Service port |
|
||||
| `WORKERS` | `1` | Worker count; keep one worker for SQLite deployments |
|
||||
| `LOG_LEVEL` | `info` | `debug`, `info`, `warning`, or `error` |
|
||||
|
||||
### Manual Deployment
|
||||
|
||||
1. Clone the repository
|
||||
@@ -59,7 +72,7 @@ python main.py
|
||||
- Visit `http://localhost:12345/#/admin`
|
||||
- Enter the admin password set during setup
|
||||
- Enter admin panel
|
||||
- View system information, file list, user management, etc.
|
||||
- View system information, files, activity records, and configuration
|
||||
|
||||
## Next Steps
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ Command-line download
|
||||
### Docker Deployment
|
||||
|
||||
```bash
|
||||
docker run -d --restart=always -p 12345:12345 -v /opt/FileCodeBox/:/app/data --name filecodebox lanol/filecodebox:beta
|
||||
docker run -d --restart unless-stopped -p 12345:12345 -v fcb-data:/app/data --name filecodebox lanol/filecodebox:latest
|
||||
```
|
||||
|
||||
### Manual Deployment
|
||||
@@ -240,4 +240,4 @@ 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.
|
||||
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.
|
||||
@@ -10,9 +10,7 @@ FileCodeBox provides multiple layers of security mechanisms to protect your file
|
||||
FileCodeBox does not ship with a default admin password. Open the site in your browser on first run and set the admin password on the setup page.
|
||||
:::
|
||||
|
||||
There are two ways to change the admin password:
|
||||
|
||||
**Method 1: Via Admin Panel (Recommended)**
|
||||
Change the admin password through the admin panel:
|
||||
|
||||
1. Access `/admin` to enter the admin panel
|
||||
2. Log in with the current password
|
||||
@@ -20,9 +18,7 @@ There are two ways to change the admin password:
|
||||
4. Find the `admin_token` configuration item
|
||||
5. Enter a new secure password and save
|
||||
|
||||
**Method 2: Via Database**
|
||||
|
||||
Configuration is stored in the `keyvalue` table of the `data/filecodebox.db` database. You can directly modify the `admin_token` value.
|
||||
`admin_token` is stored as a password hash. Do not write a plaintext password to the database, or admin login will stop working.
|
||||
|
||||
### Password Security Recommendations
|
||||
|
||||
@@ -91,7 +87,7 @@ Limit the number of error attempts from a single IP to prevent brute-force attac
|
||||
| Setting | Type | Default | Description |
|
||||
|---------|------|---------|-------------|
|
||||
| `errorMinute` | int | `1` | Error limit time window (minutes) |
|
||||
| `errorCount` | int | `1` | Maximum errors allowed within the time window |
|
||||
| `errorCount` | int | `10` | Maximum errors allowed within the time window |
|
||||
|
||||
**How it works:**
|
||||
- When a user enters an incorrect extraction code, the system records the error count for that IP
|
||||
@@ -110,7 +106,7 @@ Limit the number of error attempts from a single IP to prevent brute-force attac
|
||||
```
|
||||
|
||||
::: warning Note
|
||||
The default configuration `errorMinute=1, errorCount=1` is very strict, meaning you need to wait 1 minute after entering one incorrect extraction code before retrying. Adjust this configuration based on actual needs.
|
||||
The default allows up to 10 errors per IP each minute. Public services can tighten this limit while accounting for users behind shared network addresses.
|
||||
:::
|
||||
|
||||
## Upload Restrictions
|
||||
|
||||
+48
-23
@@ -3,8 +3,8 @@ layout: home
|
||||
|
||||
hero:
|
||||
name: "FileCodeBox"
|
||||
text: "File Express Box"
|
||||
tagline: Share text and files anonymously with access codes, just like picking up a package
|
||||
text: "Share files like picking up a package"
|
||||
tagline: A lightweight, modern, self-hosted service for files and text
|
||||
image:
|
||||
src: /logo_small.png
|
||||
alt: FileCodeBox
|
||||
@@ -16,26 +16,51 @@ hero:
|
||||
text: Live Demo
|
||||
link: https://share.lanol.cn
|
||||
- theme: alt
|
||||
text: View on GitHub
|
||||
link: https://github.com/vastsa/FileCodeBox
|
||||
text: Deployment Guide
|
||||
link: /en/guide/getting-started#docker-deployment-recommended
|
||||
|
||||
features:
|
||||
- icon: 🚀
|
||||
title: Quick Deployment
|
||||
details: Supports one-click Docker deployment, simple and fast, no complex configuration needed
|
||||
- icon: 🔒
|
||||
title: Secure & Reliable
|
||||
details: File access requires an access code, supports expiration time and download limit settings
|
||||
- icon: 💻
|
||||
title: Clean Interface
|
||||
details: Clean user interface with drag-and-drop upload support for excellent user experience
|
||||
- icon: 🛠️
|
||||
title: Feature Rich
|
||||
details: Supports file preview, online playback, image processing, and many other features
|
||||
- icon: 📦
|
||||
title: Storage Extensions
|
||||
details: Supports various storage methods including local storage and object storage
|
||||
- icon: 🔌
|
||||
title: API Support
|
||||
details: Provides complete REST API for easy integration with other systems
|
||||
---
|
||||
- icon: 01
|
||||
title: Share instantly
|
||||
details: Files and text in one flow, with batch, chunked, and resumable uploads
|
||||
- icon: 02
|
||||
title: Flexible expiry
|
||||
details: Expire by time or retrieval count, or keep content permanently
|
||||
- icon: 03
|
||||
title: Own your data
|
||||
details: Local, S3, OneDrive, WebDAV, and OpenDAL storage
|
||||
---
|
||||
|
||||
## Start in 30 seconds
|
||||
|
||||
```bash
|
||||
docker run -d --restart unless-stopped \
|
||||
-p 12345:12345 \
|
||||
-v ./data:/app/data \
|
||||
--name filecodebox \
|
||||
lanol/filecodebox:2.5.0 # x-release-please-version
|
||||
```
|
||||
|
||||
Open `http://localhost:12345` and complete the first-run setup.
|
||||
|
||||
<div class="doc-paths">
|
||||
<a class="doc-path" href="/en/guide/getting-started">
|
||||
<span>Get started</span>
|
||||
<strong>Deploy, initialize, and upgrade</strong>
|
||||
<small>Run FileCodeBox from a clean server →</small>
|
||||
</a>
|
||||
<a class="doc-path" href="/en/guide/storage">
|
||||
<span>Operate</span>
|
||||
<strong>Storage, configuration, and security</strong>
|
||||
<small>Choose production-ready storage and protection →</small>
|
||||
</a>
|
||||
<a class="doc-path" href="/en/api/">
|
||||
<span>Integrate</span>
|
||||
<strong>API and upload workflows</strong>
|
||||
<small>Build on sharing, chunked uploads, and administration →</small>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
::: warning Responsible use
|
||||
Use FileCodeBox only for lawful file and text sharing. Operators are responsible for deployment security, data compliance, and content moderation.
|
||||
:::
|
||||
Reference in new issue
Block a user