-
-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy path.env.example
More file actions
171 lines (145 loc) · 8.83 KB
/
Copy path.env.example
File metadata and controls
171 lines (145 loc) · 8.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# --- Application Settings ---
# Set to 'production' for production environments
NODE_ENV=development
PORT_BACKEND=4000
PORT_FRONTEND=3000
# The public-facing URL of your application. This is used by the backend to configure CORS,
# and it forms the OAuth redirect URI for OAuth Mailbox ingestion sources
# ({APP_URL}/api/v1/oauth/callback — register that exact URI with your OAuth provider).
APP_URL=http://localhost:3000
# This is used by the SvelteKit Node adapter to determine the server's public-facing URL.
# It should always be set to the value of APP_URL.
ORIGIN=$APP_URL
# The frequency of continuous email syncing. Default is every minutes, but you can change it to another value based on your needs.
SYNC_FREQUENCY='* * * * *'
# Set to 'true' to include Junk and Trash folders in the email archive. Defaults to false.
ALL_INCLUSIVE_ARCHIVE=false
# Set to 'true' to archive unsent drafts from live mailboxes (IMAP, Google, Microsoft). Off by
# default: a draft is not a record, and archiving one goes wrong both ways. Providers that give
# every auto-save its own identity fill the archive with revisions of an email that was never sent,
# while servers that keep one Message-ID from draft to sent have the draft archived first and the
# real message then discarded as a duplicate of it. File imports (PST, EML, mbox) ignore this and
# always archive everything the file contains.
ARCHIVE_DRAFTS=false
# Number of mailbox jobs that run concurrently in the ingestion worker. Increase on servers with more RAM. Max 32.
INGESTION_WORKER_CONCURRENCY=5
# How many emails within ONE mailbox are archived at the same time. Overlaps downloading from the
# provider with writing to storage and the database, which used to alternate. Multiplies with
# INGESTION_WORKER_CONCURRENCY for memory, so raise it in small steps. Max 32.
INGESTION_EMAIL_CONCURRENCY=3
# --- Docker Compose Service Configuration ---
# These variables are used by docker-compose.yml to configure the services. Leave them unchanged if you use Docker services for Postgresql, Valkey (Redis) and Meilisearch. If you decide to use your own instances of these services, you can substitute them with your own connection credentials.
# PostgreSQL
POSTGRES_DB=open_archive
POSTGRES_USER=admin
POSTGRES_PASSWORD=password
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}"
# Meilisearch
MEILI_MASTER_KEY=aSampleMasterKey
MEILI_HOST=http://meilisearch:7700
# How many email ids one indexing job carries. Queue granularity, and the multiplier on how many
# emails the self-healing reconcile pass can drain per tick — not a memory setting.
MEILI_INDEXING_BATCH=500
# How many documents are built and sent to Meilisearch at a time inside one job. THIS is the memory
# dial: building a document holds the whole .eml, its parse tree and its extracted attachment text in
# memory, so a job's peak usage follows this number, not MEILI_INDEXING_BATCH.
MEILI_INDEXING_CHUNK=25
# Upper bound on extracted text kept per attachment and per email body, in bytes. Guards against a
# single scanned PDF turning into tens of megabytes of indexed string. Minimum 10000.
INDEXING_MAX_TEXT_BYTES=1000000
# How many indexing jobs run at once. A job spends most of its life waiting — a storage read per
# email, then a Meilisearch task it must see finish before marking those emails indexed — so at 1
# the worker idles while jobs queue behind it. Raising it multiplies the documents held in memory:
# raise INDEXING_WORKER_MAX_OLD_SPACE_MB or lower MEILI_INDEXING_CHUNK alongside it. Max 32.
INDEXING_WORKER_CONCURRENCY=4
# Heap ceiling for the indexing worker, in MB.
INDEXING_WORKER_MAX_OLD_SPACE_MB=2048
# Redis (We use Valkey, which is Redis-compatible and open source)
REDIS_HOST=valkey
REDIS_PORT=6379
REDIS_PASSWORD=defaultredispassword
# If you run Valkey service from Docker Compose, set the REDIS_TLS_ENABLED variable to false.
REDIS_TLS_ENABLED=false
# Redis username. Only needed when your Redis/Valkey has ACL users configured.
# The Valkey service in docker-compose.yml runs with --requirepass only, and on such a
# server the single user is 'default', so naming any other user fails every connection
# with "WRONGPASS invalid username-password pair". Leave this unset for the default setup.
# REDIS_USER=default
# --- Storage Settings ---
# Choose your storage backend. Valid options are 'local' or 's3'.
STORAGE_TYPE=local
# The maximum request body size the SvelteKit frontend server will accept (including file uploads via streaming).
# Accepts a numeric value in bytes, or a unit suffix: K (kilobytes), M (megabytes), G (gigabytes).
# Set to 'Infinity' to remove the limit entirely (recommended for archiving large PST/Mbox files).
# Examples: 512K, 100M, 5G, Infinity. Defaults to 512K if not set.
# For very large files (multi-GB), consider using the "Local Path" ingestion option which bypasses this limit entirely.
BODY_SIZE_LIMIT=100M
# --- Local Storage Settings ---
# The path inside the container where files will be stored.
# This is mapped to a Docker volume for persistence.
# This is not an optional variable, it is where the Open Archiver service stores application data. Set this even if you are using S3 storage.
# Make sure the user that runs the Open Archiver service has read and write access to this path.
# Important: It is recommended to create this path manually before installation, otherwise you may face permission and ownership problems.
STORAGE_LOCAL_ROOT_PATH=/var/data/open-archiver
# --- S3-Compatible Storage Settings ---
# These are only used if STORAGE_TYPE is 's3'.
STORAGE_S3_ENDPOINT=
STORAGE_S3_BUCKET=
STORAGE_S3_ACCESS_KEY_ID=
STORAGE_S3_SECRET_ACCESS_KEY=
STORAGE_S3_REGION=
# Set to 'true' for MinIO and other non-AWS S3 services
STORAGE_S3_FORCE_PATH_STYLE=false
# --- Storage Encryption ---
# IMPORTANT: Generate a secure, random 32-byte hex string for this key.
# You can use `openssl rand -hex 32` to generate a key.
# This key is used for AES-256 encryption of files at rest.
# This is an optional variable, if not set, files will not be encrypted.
STORAGE_ENCRYPTION_KEY=
# --- Security & Authentication ---
# Enable or disable deletion of emails and ingestion sources. Defaults to false.
ENABLE_DELETION=false
# Rate Limiting
# The window in milliseconds for which API requests are checked. Defaults to 60000 (1 minute).
RATE_LIMIT_WINDOW_MS=60000
# The maximum number of API requests allowed from an IP within the window. Defaults to 100.
RATE_LIMIT_MAX_REQUESTS=100
# JWT
# IMPORTANT: Change this to a long, random, and secret string in your .env file
JWT_SECRET=a-very-secret-key-that-you-should-change
JWT_EXPIRES_IN="7d"
# Master Encryption Key for sensitive data (Such as Ingestion source credentials and passwords)
# IMPORTANT: Generate a secure, random 32-byte hex string for this
# You can use `openssl rand -hex 32` to generate a key.
ENCRYPTION_KEY=
# Apache Tika Integration
# ONLY active if TIKA_URL is set
TIKA_URL=http://tika:9998
# Timeout (ms) for the built-in PDF text extractor used during indexing when TIKA_URL is
# not set. A malformed PDF that never finishes parsing is given up on after this, so it
# can't stall the indexing worker. Only affects the legacy (non-Tika) parser. Default 20000.
PDF_PARSE_TIMEOUT_MS=20000
# Share of the process heap (0-1, exclusive) that a single PDF parse may GROW the heap by
# before it is abandoned. Some pathological PDFs allocate memory far faster than they make
# progress, and the timeout alone cannot stop that before it kills the indexing worker.
# Measured against each parse's own starting point, not the absolute heap level, so a parse
# is never blamed for memory its predecessor left behind. Only affects the legacy (non-Tika)
# parser. Default 0.25.
PDF_PARSE_HEAP_BUDGET_RATIO=0.25
# Enterprise features (Skip this part if you are using the open-source version)
# Batch size for managing retention policy lifecycle. (This number of emails will be checked each time when retention policy scans the database. Adjust based on your system capability.)
RETENTION_BATCH_SIZE=1000
# --- SMTP Journaling (Enterprise only) ---
# The port the embedded SMTP journaling listener binds to inside the container.
# This is the port your MTA (Exchange, MS365, Postfix, etc.) will send journal reports to.
# The docker-compose.yml maps this same port on the host side by default.
SMTP_JOURNALING_PORT=2525
# The domain used to generate routing addresses for journaling sources.
# Each source gets a unique address like journal-<id>@<domain>.
# Set this to the domain/subdomain whose MX record points to this server.
SMTP_JOURNALING_DOMAIN=journal.yourdomain.com
# Maximum number of waiting jobs in the journal queue before the SMTP listener
# returns 4xx temporary failures (backpressure). The MTA will retry automatically.
JOURNAL_QUEUE_BACKPRESSURE_THRESHOLD=10000
#BullMQ worker concurrency for processing journaled emails. Increase on servers with more CPU cores.
JOURNAL_WORKER_CONCURRENCY=3