Set up & run locally
Prepare a virtual environment, install dependencies, and launch both servers for a complete console + API experience.
- Install Python 3.11+ plus system build tools.
- Create a virtual environment and install
requirements.txt. - Start the services with
python run.py.
python -m venv .venv
. .venv/Scripts/activate # PowerShell: .\\.venv\\Scripts\\Activate.ps1
pip install -r requirements.txt
# Run both API and UI (Development)
python run.py
# Run in Production (Granian server)
python run.py --prod
# Or run individually
python run.py --mode api
python run.py --mode ui
Configuration
Configuration defaults live in app/config.py. You can override them using environment variables. This is critical for production deployments behind proxies.
| Variable | Default | Description |
|---|---|---|
API_BASE_URL |
http://127.0.0.1:5000 |
Internal S3 API URL used by the web UI proxy. Also used for presigned URL generation. Set to your public URL if running behind a reverse proxy. |
STORAGE_ROOT |
./data |
Directory for buckets and objects. |
MAX_UPLOAD_SIZE |
1 GB |
Max request body size in bytes. |
SECRET_KEY |
(Auto-generated) | Flask session key. Auto-generates if not set. Set explicitly in production. |
APP_HOST |
0.0.0.0 |
Bind interface. |
APP_PORT |
5000 |
Listen port (UI uses 5100). |
DISPLAY_TIMEZONE |
UTC |
Timezone for UI timestamps (e.g., US/Eastern, Asia/Tokyo). |
| CORS Settings | ||
CORS_ORIGINS |
* |
Allowed origins. Restrict in production. |
CORS_METHODS |
GET,PUT,POST,DELETE,OPTIONS,HEAD |
Allowed HTTP methods. |
CORS_ALLOW_HEADERS |
* |
Allowed request headers. |
CORS_EXPOSE_HEADERS |
* |
Response headers visible to browsers (e.g., ETag). |
| Security Settings | ||
AUTH_MAX_ATTEMPTS |
5 |
Failed login attempts before lockout. |
AUTH_LOCKOUT_MINUTES |
15 |
Lockout duration after max failed attempts. |
RATE_LIMIT_DEFAULT |
200 per minute |
Default API rate limit. |
RATE_LIMIT_LIST_BUCKETS |
60 per minute |
Rate limit for listing buckets. |
RATE_LIMIT_BUCKET_OPS |
120 per minute |
Rate limit for bucket operations. |
RATE_LIMIT_OBJECT_OPS |
240 per minute |
Rate limit for object operations. |
RATE_LIMIT_HEAD_OPS |
100 per minute |
Rate limit for HEAD requests. |
RATE_LIMIT_ADMIN |
60 per minute |
Rate limit for admin API endpoints (/admin/*). |
ADMIN_ACCESS_KEY |
(none) | Custom access key for the admin user on first run or credential reset. Random if unset. |
ADMIN_SECRET_KEY |
(none) | Custom secret key for the admin user on first run or credential reset. Random if unset. |
| Server Settings | ||
SERVER_THREADS |
0 (auto) |
Granian blocking threads (1-64). 0 = auto (CPU cores × 2). |
SERVER_CONNECTION_LIMIT |
0 (auto) |
Max concurrent connections (10-1000). 0 = auto (RAM-based). |
SERVER_BACKLOG |
0 (auto) |
TCP listen backlog (64-4096). 0 = auto (conn_limit × 2). |
SERVER_CHANNEL_TIMEOUT |
120 |
Idle connection timeout in seconds (10-300). |
| Encryption Settings | ||
ENCRYPTION_ENABLED |
false |
Enable server-side encryption support. |
KMS_ENABLED |
false |
Enable KMS key management for encryption. |
| Logging Settings | ||
LOG_LEVEL |
INFO |
Log verbosity: DEBUG, INFO, WARNING, ERROR. |
LOG_TO_FILE |
true |
Enable file logging. |
| Metrics History Settings | ||
METRICS_HISTORY_ENABLED |
false |
Enable metrics history recording and charts (opt-in). |
METRICS_HISTORY_RETENTION_HOURS |
24 |
How long to retain metrics history data. |
METRICS_HISTORY_INTERVAL_MINUTES |
5 |
Interval between history snapshots. |
| Site Sync Settings (Bidirectional Replication) | ||
SITE_SYNC_ENABLED |
false |
Enable bi-directional site sync background worker. |
SITE_SYNC_INTERVAL_SECONDS |
60 |
Interval between sync cycles (seconds). |
SITE_SYNC_BATCH_SIZE |
100 |
Max objects to pull per sync cycle. |
SITE_SYNC_CONNECT_TIMEOUT_SECONDS |
10 |
Connection timeout for site sync (seconds). |
SITE_SYNC_READ_TIMEOUT_SECONDS |
120 |
Read timeout for site sync (seconds). |
SITE_SYNC_MAX_RETRIES |
2 |
Max retry attempts for site sync operations. |
SITE_SYNC_CLOCK_SKEW_TOLERANCE_SECONDS |
1.0 |
Clock skew tolerance for conflict resolution. |
| Replication Settings | ||
REPLICATION_CONNECT_TIMEOUT_SECONDS |
5 |
Connection timeout for replication (seconds). |
REPLICATION_READ_TIMEOUT_SECONDS |
30 |
Read timeout for replication (seconds). |
REPLICATION_MAX_RETRIES |
2 |
Max retry attempts for replication operations. |
REPLICATION_STREAMING_THRESHOLD_BYTES |
10485760 |
Objects larger than this use streaming upload (10 MB). |
REPLICATION_MAX_FAILURES_PER_BUCKET |
50 |
Max failure records to keep per bucket. |
| Security & Auth Settings | ||
SIGV4_TIMESTAMP_TOLERANCE_SECONDS |
900 |
Max time skew for SigV4 requests (15 minutes). |
PRESIGNED_URL_MIN_EXPIRY_SECONDS |
1 |
Minimum presigned URL expiry time. |
PRESIGNED_URL_MAX_EXPIRY_SECONDS |
604800 |
Maximum presigned URL expiry time (7 days). |
| Proxy & Network Settings | ||
NUM_TRUSTED_PROXIES |
1 |
Number of trusted reverse proxies for X-Forwarded-* headers. |
ALLOWED_REDIRECT_HOSTS |
(empty) | Comma-separated whitelist of safe redirect targets. |
ALLOW_INTERNAL_ENDPOINTS |
false |
Allow connections to internal/private IPs (webhooks, replication). |
| Storage Limits | ||
OBJECT_KEY_MAX_LENGTH_BYTES |
1024 |
Maximum object key length in bytes. |
OBJECT_CACHE_MAX_SIZE |
100 |
Maximum number of objects in cache. |
BUCKET_CONFIG_CACHE_TTL_SECONDS |
30 |
Bucket config cache TTL in seconds. |
OBJECT_TAG_LIMIT |
50 |
Maximum number of tags per object. |
LIFECYCLE_MAX_HISTORY_PER_BUCKET |
50 |
Max lifecycle history records per bucket. |
OBJECT_CACHE_TTL |
60 |
Seconds to cache object metadata. |
BULK_DOWNLOAD_MAX_BYTES |
1 GB |
Max total size for bulk ZIP downloads. |
ENCRYPTION_CHUNK_SIZE_BYTES |
65536 |
Chunk size for streaming encryption (64 KB). |
KMS_GENERATE_DATA_KEY_MIN_BYTES |
1 |
Minimum data key size for KMS generation. |
KMS_GENERATE_DATA_KEY_MAX_BYTES |
1024 |
Maximum data key size for KMS generation. |
SECRET_KEY (also enables IAM config encryption at rest), restrict CORS_ORIGINS, configure API_BASE_URL, enable HTTPS via reverse proxy, use --prod flag, and set credential expiry on non-admin users.