Skip to content

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.

Configuration Methods

FileCodeBox supports two configuration methods:

  1. Admin Panel Configuration (Recommended): Access /admin to enter the admin panel and modify settings on the settings page
  2. Database Configuration: Configuration is stored in the data/filecodebox.db database

Note

On first startup, the system uses default configuration from core/settings.py. Modified configurations are saved to the database.

Basic Settings

Site Information

SettingTypeDefaultDescription
namestring文件快递柜 - FileCodeBoxSite name, displayed in page title and navigation bar
descriptionstring开箱即用的文件快传系统Site description, used for SEO
keywordsstringFileCodeBox, 文件快递柜...Site keywords, used for SEO
portint12345Service listening port

Notification Settings

SettingTypeDefaultDescription
notify_titlestring系统通知Notification title
notify_contentstringWelcome messageNotification content, supports HTML
page_explainstringLegal disclaimerFooter explanation text
robotsTextstringUser-agent: *\nDisallow: /robots.txt content

Upload Settings

File Upload Limits

SettingTypeDefaultDescription
openUploadint1Enable upload functionality (1=enabled, 0=disabled)
uploadSizeint10485760Maximum single file upload size (bytes), default 10MB
enableChunkint0Enable chunked upload (1=enabled, 0=disabled)

Note

uploadSize is in bytes. 10MB = 10 * 1024 * 1024 = 10485760 bytes

Upload Rate Limiting

SettingTypeDefaultDescription
uploadMinuteint1Upload limit time window (minutes)
uploadCountint10Maximum uploads allowed within the time window

Example: Default configuration allows up to 10 uploads per minute.

File Expiration Settings

SettingTypeDefaultDescription
expireStylelist["day","hour","minute","forever","count"]Available expiration methods
max_save_secondsint0Maximum file retention time (seconds), 0 means no limit

Expiration methods explained:

  • day - Expire by days
  • hour - Expire by hours
  • minute - Expire by minutes
  • forever - Never expire
  • count - Expire by download count

Theme Settings

Theme Selection

SettingTypeDefaultDescription
themesSelectstringthemes/2024Currently active theme
themesChoiceslistSee belowAvailable themes list

Default available themes:

json
[
  {
    "name": "2023",
    "key": "themes/2023",
    "author": "Lan",
    "version": "1.0"
  },
  {
    "name": "2024",
    "key": "themes/2024",
    "author": "Lan",
    "version": "1.0"
  }
]

Interface Style

SettingTypeDefaultDescription
opacityfloat0.9Interface opacity (0-1)
backgroundstring""Custom background image URL, empty uses default background

Admin Settings

SettingTypeDefaultDescription
admin_tokenstringFileCodeBox2023Admin login password
showAdminAddrint0Show admin panel entry on homepage (1=show, 0=hide)

Security Warning

Always change the default admin_token in production environments! Using the default password poses serious security risks.

Security Settings

Error Rate Limiting

SettingTypeDefaultDescription
errorMinuteint1Error limit time window (minutes)
errorCountint1Maximum errors allowed within the time window

This setting prevents brute-force attacks on extraction codes.

Storage Settings

Storage Type

SettingTypeDefaultDescription
file_storagestringlocalStorage backend type
storage_pathstring""Custom storage path

Supported storage types:

  • local - Local storage
  • s3 - S3-compatible storage (AWS S3, Aliyun OSS, MinIO, etc.)
  • onedrive - OneDrive storage
  • webdav - WebDAV storage
  • opendal - OpenDAL storage

For detailed storage configuration, see Storage Configuration.

Configuration Examples

Example 1: Small Personal Use

Suitable for personal or small team use with relaxed limits:

python
{
    "name": "My File Share",
    "uploadSize": 52428800,        # 50MB
    "uploadMinute": 5,             # 5 minutes
    "uploadCount": 20,             # Max 20 uploads
    "expireStyle": ["day", "hour", "forever"],
    "admin_token": "your-secure-password",
    "showAdminAddr": 1
}

Example 2: Public Service

Suitable for public services requiring stricter limits:

python
{
    "name": "Public File Box",
    "uploadSize": 10485760,        # 10MB
    "uploadMinute": 1,             # 1 minute
    "uploadCount": 5,              # Max 5 uploads
    "errorMinute": 5,              # 5 minutes
    "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
}

Example 3: Enterprise Internal Use

Suitable for enterprise internal use with large file and chunked upload support:

python
{
    "name": "Enterprise File Transfer",
    "uploadSize": 1073741824,      # 1GB
    "enableChunk": 1,              # Enable chunked upload
    "uploadMinute": 10,            # 10 minutes
    "uploadCount": 100,            # Max 100 uploads
    "expireStyle": ["day", "forever"],
    "file_storage": "s3",          # Use S3 storage
    "admin_token": "enterprise-secure-token",
    "showAdminAddr": 1
}

Next Steps

Released under the LGPL-3.0 license