Skip to content

Environment variables ​

Every flag has an environment variable: ALMOND_ + the flag name upper-cased with - → _. The same names work in the process environment, in a dotenv config file (--config <FILE>, else ./.env) and in Docker -e options:

dotenv
# /etc/almond/almond.env
ALMOND_BIND_ADDR=0.0.0.0:3000
ALMOND_PUBLIC_URL=https://blossom.example.com
ALMOND_ALLOWED_NPUBS=npub1you...
ALMOND_UPLOAD_MAX_AGE=7d
ALMOND_METRICS_TOKEN=change-me

Command-line flags override the environment, which overrides the config file; see Configuration overview. .env.example documents every variable with comments.

Value formats ​

TypeFormat
Duration<n><unit> with s, m, h, d (30s, 5m, 24h, 7d); bare 0 allowed, other numbers need a unit
Size<n><unit> with B, KiB, MiB, GiB, TiB (case-insensitive, IEC only; MB/GB are rejected); bare 0 allowed
Booleantrue/false, yes/no, on/off, 1/0; on the CLI a bare --tls-enabled means true, --list-enabled=false disables
ListComma-separated; on the CLI also by repeating the flag
Access modeoff, public, wot, dvm

Reference ​

Network and TLS

SettingDefaultDescription
ALMOND_BIND_ADDR127.0.0.1:3000Listen address; use 0.0.0.0:3000 in a container or behind a proxy
ALMOND_PUBLIC_URLhttp://127.0.0.1:3000 (https:// with TLS)Public origin used in blob descriptors; no trailing slash
ALMOND_CORS_ORIGINS–Browser origins allowed to read discovery and metrics responses; blob GET/HEAD is always public
ALMOND_TLS_ENABLEDfalseTerminate TLS in Almond; leave off behind a TLS proxy
ALMOND_TLS_CERT / ALMOND_TLS_KEY./cert.pem / ./key.pemCertificate and private key
ALMOND_TLS_SELF_SIGNEDfalseGenerate a self-signed pair when the files are missing; development only

Storage and retention (see Retention and eviction)

SettingDefaultDescription
ALMOND_STORAGE_PATH./filesStorage root
ALMOND_STORAGE_MAX_SIZE0 (unlimited)Total size of all completed blobs
ALMOND_STORAGE_MAX_FILES0 (unlimited)Total number of completed blobs
ALMOND_STORAGE_MIN_FREE256MiBUploads get 507 below this free disk space
ALMOND_BLOB_MAX_SIZE500MiBPer-blob size limit
ALMOND_CLEANUP_INTERVAL30sCleanup cadence; must be greater than zero
ALMOND_UPLOAD_MAX_AGE0 (off)Maximum age of uploads, explicit and HLS mirrors
ALMOND_UPSTREAM_CACHE_TTL1dMaximum age of upstream-cache copies; 0 disables

S3 (see S3 storage)

SettingDefaultDescription
ALMOND_S3_ENDPOINT, ALMOND_S3_BUCKET–Bucket location; all four S3 credentials and location values are required together
ALMOND_S3_ACCESS_KEY_ID, ALMOND_S3_SECRET_ACCESS_KEY–Credentials
ALMOND_S3_REGIONautoSigV4 signing region
ALMOND_S3_FORCE_PATH_STYLEfalsePath-style bucket addressing (MinIO, Garage)

Access and authorization (see Access control)

SettingDefaultDescription
ALMOND_UPLOAD_ACCESSpublicUpload access mode
ALMOND_MIRROR_ACCESSpublicMirror access mode
ALMOND_REPORT_ACCESSoffBUD-09 report access mode
ALMOND_REPORT_ACTIONquarantinequarantine or delete
ALMOND_CUSTOM_ORIGIN_ACCESSoffAccess mode for client upstream hints
ALMOND_LIST_ENABLEDtrueServe /list
ALMOND_HOMEPAGE_ENABLEDtrueServe the homepage
ALMOND_ALLOWED_NPUBS–Allowlist; also the web-of-trust seed; required for delete
ALMOND_AUTH_MAX_TTL24hMaximum authorization lifetime; must be greater than zero
ALMOND_AUTH_CLOCK_SKEW30sTolerated client clock skew
ALMOND_AUTH_REQUIRE_SERVER_TAGfalseRequire a matching server tag in authorization events
ALMOND_DVM_KINDS–DVM kinds admitted in dvm mode (e.g. 5207); required when upload or mirror access is dvm
ALMOND_DVM_RELAYS–Relays queried for DVM announcements
ALMOND_DVM_REFRESH_INTERVAL5mDVM announcement refresh interval

Uploads and mirrors

SettingDefaultDescription
ALMOND_CHUNK_MAX_SIZE100MiBMaximum chunk size for resumable uploads; at most ALMOND_BLOB_MAX_SIZE
ALMOND_CHUNK_SESSION_TIMEOUT30mAbandoned resumable uploads are cleaned up after this
ALMOND_CHUNK_MAX_SESSIONS128Concurrent resumable upload sessions
ALMOND_CHUNK_MAX_SESSIONS_PER_PUBKEY8Concurrent sessions per pubkey
ALMOND_HLS_MIRROR_CONCURRENCY4Parallel segment fetches when mirroring an HLS playlist

Upstream (see Upstream lookups)

SettingDefaultDescription
ALMOND_UPSTREAM_SERVERS–Trusted upstream Blossom origins
ALMOND_UPSTREAM_MODEproxyproxy, redirect or redirect-and-cache
ALMOND_UPSTREAM_MAX_DOWNLOAD_SIZE100MiBLarger blobs are proxied without caching
ALMOND_SERVER_LIST_CACHE_TTL24hCache time for authors' BUD-03 server lists

Payments (see Payments)

SettingDefaultDescription
ALMOND_CASHU_PAID–Paid operations: upload, mirror, download
ALMOND_CASHU_PRICE_PER_MIB1Sats per MiB
ALMOND_CASHU_MINT–The one accepted mint URL; required when payments are on
ALMOND_CASHU_WALLET_PATH./cashu_wallet.dbWallet database

Operations

SettingDefaultDescription
ALMOND_METRICS_TOKEN–Bearer token for /metrics; the endpoint returns 404 while unset
ALMOND_FILTER_ALGORITHMbinary-fuse-16BUD-11 filter: bloom, binary-fuse-8, binary-fuse-16, binary-fuse-32
ALMOND_SERVE_FILES_PATH–Directory of static files served alongside blobs
ALMOND_SERVE_FILES_MANIFEST_DIR/tmpManifest location when the served directory is not writable
ALMOND_SERVE_FILES_MANIFEST_NAMEmanifest-sha256.txtSHA-256 manifest file name
ALMOND_SERVE_FILES_REFRESH_INTERVAL1hManifest rebuild interval

FIPS mesh ​

These variables configure the FIPS container of the ghcr.io/flox1an/almond-fips image, not Almond itself: they are read by the image's entrypoint and are not command-line flags. See FIPS mesh for the deployment layouts.

Identity and peers

VariableDefaultDescription
FIPS_NSEC–Node secret key, hex or nsec1; required unless a full config is mounted and FIPS_GENERATE_CONFIG=false
FIPS_PEERS–Peers, one npub,addr[,alias[,transport]] per line; overrides the single-peer variables
FIPS_PEER_NPUB, FIPS_PEER_ADDR–A single direct peer: its npub and host:port
FIPS_PEER_ALIASpeerName of the single peer in logs and fipsctl; also the default for FIPS_PEERS lines without one
FIPS_PEER_TRANSPORTudpTransport of the single peer; also the default for FIPS_PEERS lines without one
FIPS_HOSTS–.fips aliases, one name npub1... per line; media-cache npub1... makes media-cache.fips resolve

Transport and interface

VariableDefaultDescription
FIPS_UDP_BIND0.0.0.0:2121UDP transport listen address; publish this port
FIPS_UDP_PORTport of FIPS_UDP_BINDTransport port that FIPS_ISOLATE keeps open
FIPS_TCP_BIND–Optional TCP transport listen address
FIPS_TUN_NAMEfips0Name of the mesh interface
FIPS_TUN_MTU1280MTU of the mesh interface

Container behavior

VariableDefaultDescription
FIPS_RUN_ALMONDtruetrue: run Almond in the same container. false: run only FIPS, for the pod layout
FIPS_REWRITE_DNStruePoint the container's (in a pod: the shared) /etc/resolv.conf at a local dnsmasq that sends .fips names to FIPS and everything else to the original resolver. false leaves DNS alone; Almond then cannot resolve .fips upstreams
FIPS_ISOLATEfalsetrue drops all traffic on FIPS_POD_IFACE except the FIPS transport: mesh-only egress. In a pod this applies to Almond too
FIPS_POD_IFACEeth0Physical container interface that FIPS_ISOLATE restricts
FIPS_GENERATE_CONFIGtrueWrite the FIPS config from these variables at every start; false uses a mounted config if it exists
FIPS_CONFIG_PATH/etc/fips/fips.yamlLocation of the FIPS config

Migrating from pre-0.5 names ​

Almond 0.5 renamed every setting to the ALMOND_* scheme. The old names below still work as deprecated aliases: their values are translated (units appended) and a deprecation warning is logged at startup. If both the old and the new name are set, the new one wins and a warning names the ignored old one. The old names will be removed in a later release.

Docker images apply their container defaults only when neither the new nor the old name is set, so old names passed with -e keep working there too.

ALMOND_S3_* names are unchanged. Values that were previously accepted leniently (unknown enum values, invalid npubs, AUTH_MAX_TTL_SECS=0) now stop startup with an error.

Old nameNew nameValue conversion
BIND_ADDRALMOND_BIND_ADDR–
PUBLIC_URLALMOND_PUBLIC_URL–
CORS_ALLOWED_ORIGINSALMOND_CORS_ORIGINS–
ENABLE_HTTPSALMOND_TLS_ENABLED–
TLS_CERT_PATHALMOND_TLS_CERT–
TLS_KEY_PATHALMOND_TLS_KEY–
TLS_AUTO_GENERATEALMOND_TLS_SELF_SIGNED– ; the default is now false, set true to keep auto-generation
STORAGE_PATHALMOND_STORAGE_PATH–
MAX_TOTAL_SIZEALMOND_STORAGE_MAX_SIZEMiB: 99999 → 99999MiB
MAX_TOTAL_FILESALMOND_STORAGE_MAX_FILES– ; 0 now means unlimited
MIN_FREE_DISK_MBALMOND_STORAGE_MIN_FREE256 → 256MiB
MAX_BLOB_SIZE_MBALMOND_BLOB_MAX_SIZE100 → 100MiB
CLEANUP_INTERVAL_SECSALMOND_CLEANUP_INTERVAL30 → 30s
MAX_FILE_AGE_DAYSALMOND_UPLOAD_MAX_AGE7 → 7d
MAX_UPSTREAM_CACHE_TTL_DAYSALMOND_UPSTREAM_CACHE_TTL1 → 1d
FEATURE_UPLOAD_ENABLEDALMOND_UPLOAD_ACCESS–
FEATURE_MIRROR_ENABLEDALMOND_MIRROR_ACCESS–
FEATURE_CUSTOM_UPSTREAM_ORIGIN_ENABLEDALMOND_CUSTOM_ORIGIN_ACCESS–
FEATURE_REPORT_ENABLEDALMOND_REPORT_ACCESS–
REPORT_ACTIONALMOND_REPORT_ACTION–
FEATURE_LIST_ENABLEDALMOND_LIST_ENABLED–
FEATURE_HOMEPAGE_ENABLEDALMOND_HOMEPAGE_ENABLED–
ALLOWED_NPUBSALMOND_ALLOWED_NPUBS–
AUTH_MAX_TTL_SECSALMOND_AUTH_MAX_TTL86400 → 24h; 0 is now rejected
AUTH_CLOCK_SKEW_SECSALMOND_AUTH_CLOCK_SKEW30 → 30s
AUTH_REQUIRE_SERVER_TAGALMOND_AUTH_REQUIRE_SERVER_TAG–
MAX_CHUNK_SIZE_MBALMOND_CHUNK_MAX_SIZE100 → 100MiB
CHUNK_CLEANUP_TIMEOUT_MINUTESALMOND_CHUNK_SESSION_TIMEOUT30 → 30m
MAX_CHUNK_UPLOAD_SESSIONSALMOND_CHUNK_MAX_SESSIONS–
MAX_CHUNK_UPLOAD_SESSIONS_PER_PUBKEYALMOND_CHUNK_MAX_SESSIONS_PER_PUBKEY–
HLS_MIRROR_CONCURRENCYALMOND_HLS_MIRROR_CONCURRENCY–
UPSTREAM_SERVERSALMOND_UPSTREAM_SERVERS–
UPSTREAM_MODEALMOND_UPSTREAM_MODEredirect_and_cache is now spelled redirect-and-cache (old spelling still accepted)
MAX_UPSTREAM_DOWNLOAD_SIZE_MBALMOND_UPSTREAM_MAX_DOWNLOAD_SIZE100 → 100MiB
METRICS_BEARER_TOKENALMOND_METRICS_TOKEN–
SERVE_FILES_PATHALMOND_SERVE_FILES_PATH–
SERVE_FILES_MANIFEST_DIRALMOND_SERVE_FILES_MANIFEST_DIR–
SERVE_FILES_MANIFEST_NAMEALMOND_SERVE_FILES_MANIFEST_NAME–
SERVE_FILES_REFRESH_INTERVAL_SECSALMOND_SERVE_FILES_REFRESH_INTERVAL3600 → 3600s
FEATURE_PAID_UPLOAD, FEATURE_PAID_MIRROR, FEATURE_PAID_DOWNLOADALMOND_CASHU_PAIDmerged into one list: FEATURE_PAID_UPLOAD=on + FEATURE_PAID_MIRROR=on → upload,mirror
CASHU_PRICE_PER_MBALMOND_CASHU_PRICE_PER_MIB–
CASHU_ACCEPTED_MINTSALMOND_CASHU_MINT– (one mint URL)
CASHU_WALLET_PATHALMOND_CASHU_WALLET_PATH–
BLOSSOM_SERVER_LIST_CACHE_TTL_HOURSALMOND_SERVER_LIST_CACHE_TTL24 → 24h
FILTER_ALGORITHMALMOND_FILTER_ALGORITHM–
DVM_ALLOWED_KINDSALMOND_DVM_KINDS–
DVM_RELAYSALMOND_DVM_RELAYS–
DVM_REFRESH_INTERVAL_MINSALMOND_DVM_REFRESH_INTERVAL5 → 5m

Released under the MIT License.