Configuration
Plik is configured via a TOML file (plikd.cfg) and optional environment variable overrides.
Config File Locations
The server looks for configuration in this order:
--configflagPLIKD_CONFIGenvironment variable./plikd.cfg(current directory)/etc/plikd.cfg
Environment Variable Override
Any config parameter can be set via environment variable using PLIKD_ prefix with SCREAMING_SNAKE_CASE:
bash
PLIKD_DEBUG_REQUESTS=true ./plikd
PLIKD_LISTEN_PORT=9090 ./plikdArrays and maps must be provided in JSON format. Arrays are overridden, maps are merged:
bash
PLIKD_DATA_BACKEND_CONFIG='{"Directory":"/var/files"}' ./plikdServer Settings
| Parameter | Default | Description |
|---|---|---|
ListenPort | 8080 | HTTP server port |
ListenAddress | 0.0.0.0 | HTTP server bind address |
MetricsPort | 0 | Prometheus metrics port (0 = disabled) |
Path | "" | HTTP root path prefix |
SslEnabled | false | Enable TLS |
SslCert / SslKey | — | TLS certificate and key paths |
TlsVersion | tlsv10 | Minimum TLS version |
NoWebInterface | false | Disable web UI |
DownloadDomain | "" | Enforce download domain (e.g., https://dl.plik.example.com) |
DownloadDomainAlias | [] | Additional accepted domains |
EnhancedWebSecurity | false | Extra security headers + secure cookies |
SessionTimeout | 365d | Authentication session duration |
AbuseContact | "" | Abuse contact email (displayed in UI) |
WebappDirectory | ../webapp/dist | Web UI static files directory |
ClientsDirectory | ../clients | CLI client binaries directory |
ChangelogDirectory | ../changelog | Release changelog directory |
SourceIpHeader | "" | Header for real IP behind proxy (e.g., X-Forwarded-For) |
UploadWhitelist | [] | Restrict uploads to IP ranges (CIDR) |
Limits
| Parameter | Default | Description |
|---|---|---|
MaxFileSizeStr | 10GB | Maximum file size (or "unlimited") |
MaxUserSizeStr | unlimited | Default per-user storage limit |
MaxFilePerUpload | 1000 | Max files per upload |
DefaultTTLStr | 30d | Default time-to-live |
MaxTTLStr | 30d | Maximum TTL (0 = no limit) |
Feature Flags
Features can be set to one of four states:
| Value | Behavior |
|---|---|
disabled | Feature always off |
enabled | Feature available, opt-in |
default | Feature available, opt-out (on by default) |
forced | Feature always on |
| Flag | Default | Description |
|---|---|---|
FeatureAuthentication | disabled | User authentication (forced = no anonymous uploads) |
FeatureOneShot | enabled | Files deleted after first download |
FeatureRemovable | enabled | Anyone can delete files |
FeatureStream | enabled | Direct uploader-to-downloader streaming |
FeaturePassword | enabled | Password-protected uploads |
FeatureComments | enabled | Markdown comments on uploads |
FeatureSetTTL | enabled | Custom TTL setting |
FeatureExtendTTL | disabled | Extend TTL on each download |
FeatureClients | enabled | Show CLI download button in UI |
FeatureGithub | enabled | Show source code link in UI |
FeatureText | enabled | Text upload dialog |
DisableLocalLogin | false | Hide login/password form |
Full Example
See the default plikd.cfg for a fully commented configuration file.
