Configuration

PicFast supports two config modes: config.yaml or PICFAST_ prefixed environment variables. Env vars always take precedence over YAML values.

Full example (config.yaml)

server:
  port: 8080
  base_url: "http://localhost:8080"
  web_dir: ""
  pprof_enabled: false

database:
  url: "postgres://picfast:picfast@localhost:5432/picfast?sslmode=disable"

jwt:
  secret: "change-me-in-production"
  access_ttl: 15m
  refresh_ttl: 168h
  signing_method: "HS256"

storage:
  local_root: "./data/uploads"
  thumbnail_dir: "./data/thumbnails"

mail:
  host: "127.0.0.1"
  port: 1025
  username: ""
  password: ""
  from_email: "noreply@picfast.local"
  from_name: "PicFast"
  encryption: "none"

app:
  name: "PicFast"
  site_description: "PicFast is a modern self-hosted image hosting service."
  favicon_url: ""
  allow_guest_upload: false
  allow_registration: true
  allow_oauth_registration: true
  allow_user_image_processing: true
  skip_image_processing: false
  require_email_verification: true
  audit_upload_logs: false
  user_initial_capacity: 524288000
  guest_capacity_bytes: 10737418240
  default_image_ttl: "0"
  guest_image_ttl: "0"
  admin_email: ""
  admin_password: ""
  moderation_mode: "disabled"
  footer_text_1: ""
  footer_link_1: ""
  footer_text_2: ""
  footer_link_2: ""
  icp_number: ""
  icp_link: "https://beian.miit.gov.cn/"
  psb_number: ""
  psb_link: ""
  analytics_provider: ""
  analytics_config: "{}"

Reference

database

KeyEnv VariableTypeDefaultDescription
urlPICFAST_DATABASE_URLstringPostgreSQL connection string (required)

server

KeyEnv VariableTypeDefaultDescription
portPICFAST_SERVER_PORTint8080HTTP port to listen on
base_urlPICFAST_SERVER_BASE_URLstringhttp://localhost:8080Public URL of the service. Must be set for email verification links and ShareX config to work correctly.
web_dirPICFAST_SERVER_WEB_DIRstring""Path to frontend dist (optional; auto-detects web-dist/ and web/dist/)
pprof_enabledPICFAST_SERVER_PPROF_ENABLEDboolfalseEnable Go pprof endpoints at /api/v1/admin/debug/pprof/* (admin only)

storage

KeyEnv VariableTypeDefaultDescription
local_rootPICFAST_STORAGE_LOCAL_ROOTstring"./data/uploads"Root directory for file storage when using the local backend
thumbnail_dirPICFAST_STORAGE_THUMBNAIL_DIRstring"./data/thumbnails"Directory for generated thumbnail files

jwt

KeyEnv VariableTypeDefaultDescription
secretPICFAST_JWT_SECRETstringchange-me-in-productionRequired. Must be changed. Using the default causes a startup error.
access_ttlPICFAST_JWT_ACCESS_TTLduration15mAccess token lifetime
refresh_ttlPICFAST_JWT_REFRESH_TTLduration168hRefresh token lifetime (7 days)
signing_methodPICFAST_JWT_SIGNING_METHODstringHS256HS256, HS384, or HS512

app

KeyEnv VariableTypeDefaultDescription
namePICFAST_APP_NAMEstringPicFastSite name shown in page titles, emails, and the web UI
web_base_urlPICFAST_APP_WEB_BASE_URLstring""Frontend URL users land on after login. Falls back to server.base_url when empty. Required when OAuth is enabled.
site_descriptionPICFAST_APP_SITE_DESCRIPTIONstring""Meta description for the web UI
favicon_urlPICFAST_APP_FAVICON_URLstring""Custom site favicon URL; empty uses the bundled favicon
allow_guest_uploadPICFAST_APP_ALLOW_GUEST_UPLOADboolfalseAllow uploading without an account
guest_capacity_bytesPICFAST_APP_GUEST_CAPACITY_BYTESint6410737418240Total storage quota shared across all guest uploads (10 GB)
allow_registrationPICFAST_APP_ALLOW_REGISTRATIONboolfalseAllow new user sign-ups. Set to false once you have your accounts.
allow_oauth_registrationPICFAST_APP_ALLOW_OAUTH_REGISTRATIONboolfalseAllow new accounts through OAuth/OIDC login. When email registration is disabled but this is enabled, the login page shows only OAuth sign-in options.
allow_user_image_processingPICFAST_APP_ALLOW_USER_IMAGE_PROCESSINGbooltrueAllow users to opt into per-image compression / watermarking
skip_image_processingPICFAST_APP_SKIP_IMAGE_PROCESSINGboolfalseSkip all image processing and store original files as-is. When enabled, user image processing settings are hidden and ignored.
max_upload_bytesPICFAST_APP_MAX_UPLOAD_BYTESint6452428800Default per-file upload limit in bytes (50 MB). Group-level limits can override this.
require_email_verificationPICFAST_APP_REQUIRE_EMAIL_VERIFICATIONboolfalseRequire email verification before login. Only takes effect when SMTP is configured and reachable.
audit_upload_logsPICFAST_APP_AUDIT_UPLOAD_LOGSboolfalseLog all upload events to the audit log table
user_initial_capacityPICFAST_APP_USER_INITIAL_CAPACITYint64524288000Default storage quota per user in bytes (500 MB)
default_image_ttlPICFAST_APP_DEFAULT_IMAGE_TTLduration0 (never)Default expiry for uploaded images (0 = never, e.g. 24h, 168h)
guest_image_ttlPICFAST_APP_GUEST_IMAGE_TTLduration0 (never)Separate expiry for guest uploads (0 = use default_image_ttl)
admin_emailPICFAST_APP_ADMIN_EMAILstring""If set with admin_password, auto-creates admin and skips the setup wizard
admin_passwordPICFAST_APP_ADMIN_PASSWORDstring""Password for the auto-created admin account
moderation_modePICFAST_APP_MODERATION_MODEstringdisabled"disabled" (default), "manual" (admin approval queue)
footer_text_1PICFAST_APP_FOOTER_TEXT_1string""Optional footer text line 1; hidden if empty
footer_link_1PICFAST_APP_FOOTER_LINK_1string""Optional link for footer text line 1
footer_text_2PICFAST_APP_FOOTER_TEXT_2string""Optional footer text line 2; hidden if empty
footer_link_2PICFAST_APP_FOOTER_LINK_2string""Optional link for footer text line 2
icp_numberPICFAST_APP_ICP_NUMBERstring""Chinese ICP filing number for sites hosted in China
icp_linkPICFAST_APP_ICP_LINKstringhttps://beian.miit.gov.cn/ICP filing link target
psb_numberPICFAST_APP_PSB_NUMBERstring""Chinese PSB filing number
psb_linkPICFAST_APP_PSB_LINKstring""PSB filing link target
theme_configPICFAST_APP_THEME_CONFIGjson""Theme overrides as JSON (logo, colors, etc.)
default_copy_formatPICFAST_APP_DEFAULT_COPY_FORMATstring"markdown"Format pre-selected on the upload page: url, markdown, html, bbcode
copy_templatePICFAST_APP_COPY_TEMPLATEstring""Optional custom template for the copied string (e.g. ![image]({url}))
analytics_providerPICFAST_APP_ANALYTICS_PROVIDERstring"""" (disabled), "plausible", "umami", "ga4", "baidu", "custom"
analytics_configPICFAST_APP_ANALYTICS_CONFIGjson""Provider-specific config (see Analytics section)

Analytics providers

PicFast supports integrating with analytics services for visitor tracking on the web UI. Configure via app.analytics_provider and app.analytics_config.

ProviderConfig fields
plausibledomain (required), server_url (optional)
umamiwebsite_id (required), script_url (required)
ga4measurement_id (required)
baidusite_id (required)
customscript_html (raw HTML/script string injected into every page)

oauth

KeyEnv VariableTypeDescription
providersPICFAST_OAUTH_PROVIDERSarrayList of OAuth / OIDC providers. See the OAuth docs for setup guides.
providers[].idstringUnique provider identifier (e.g. "github", "keycloak")
providers[].display_namestringName shown on the login button
providers[].typestring"oidc" or "github"
providers[].client_idstringOAuth client ID from the provider
providers[].client_secretstringOAuth client secret from the provider
providers[].issuerstringRequired for type: oidc. OIDC issuer URL; used to validate the ID token's iss claim and (by default) to discover endpoints.
providers[].auth_urlstringOAuth authorization endpoint. Required when the provider doesn't support discovery, alongside token_url and jwks_url.
providers[].token_urlstringOAuth token endpoint. Required alongside auth_url when discovery is unavailable.
providers[].userinfo_urlstringOIDC userinfo endpoint. Optional; overrides the discovered or default endpoint in any mode.
providers[].scopes[]stringOAuth scopes. Defaults to [openid, profile, email]
providers[].jwks_urlstringJWKS endpoint for ID token verification. Auto-discovered from issuer if unset.
providers[].enabledboolEnable this provider

mail

KeyEnv VariableTypeDefaultDescription
hostPICFAST_MAIL_HOSTstring""SMTP server hostname
portPICFAST_MAIL_PORTint1025SMTP port (587 for STARTTLS, 465 for TLS, 1025 for local Mailpit)
usernamePICFAST_MAIL_USERNAMEstring""SMTP username
passwordPICFAST_MAIL_PASSWORDstring""SMTP password
encryptionPICFAST_MAIL_ENCRYPTIONstringnone"starttls", "tls", or "none"
from_emailPICFAST_MAIL_FROM_EMAILstringnoreply@picfast.localSender address; must be set when SMTP is configured
from_namePICFAST_MAIL_FROM_NAMEstringPicFastSender display name

Email verification notes

By default, registration succeeds immediately and the user can log in right away. To enable email verification:

  1. Configure mail.* with a working SMTP server
  2. Set app.require_email_verification = true

If require_email_verification is set but SMTP is unreachable, the system falls back to immediate registration and logs a warning at startup.

For local development, the included mailpit (ports 1025 SMTP / 8025 UI) captures all outgoing mail locally without sending to external addresses.