-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.env.example
More file actions
126 lines (112 loc) · 4.75 KB
/
Copy path.env.example
File metadata and controls
126 lines (112 loc) · 4.75 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
# MygramDB Environment Variables Template
# Copy this file to .env and customize for your environment
# ============================================================================
# MySQL Configuration
# ============================================================================
MYSQL_HOST=mysql
MYSQL_PORT=3306
MYSQL_USER=repl_user
MYSQL_PASSWORD=your_secure_password_here
MYSQL_DATABASE=mydb
MYSQL_USE_GTID=true
MYSQL_CONNECT_TIMEOUT_MS=3000
# MySQL Root Password (for MySQL container initialization)
MYSQL_ROOT_PASSWORD=root_secure_password_here
# ============================================================================
# Table Configuration
# ============================================================================
TABLE_NAME=articles
TABLE_PRIMARY_KEY=id
TABLE_TEXT_COLUMN=content
TABLE_NGRAM_SIZE=2
TABLE_KANJI_NGRAM_SIZE=0
# ============================================================================
# Replication Configuration
# ============================================================================
REPLICATION_ENABLE=true
# MUST be unique across all instances. Generate: shuf -i 2-4294967295 -n 1
REPLICATION_SERVER_ID=83917
REPLICATION_START_FROM=snapshot
# Build the initial index at startup instead of waiting for a SYNC command.
# Set to false when the source table is large enough that scanning it would
# make startup unacceptably long.
REPLICATION_AUTO_INITIAL_SNAPSHOT=true
# ============================================================================
# Build Configuration
# ============================================================================
BUILD_BATCH_SIZE=5000
BUILD_PARALLELISM=2
# ============================================================================
# Memory Management
# ============================================================================
MEMORY_HARD_LIMIT_MB=8192
MEMORY_SOFT_TARGET_MB=4096
MEMORY_NORMALIZE_NFKC=true
MEMORY_NORMALIZE_WIDTH=narrow
MEMORY_NORMALIZE_LOWER=false
# N-gram post-filter verification: "off" (default), "ascii", "all"
MEMORY_VERIFY_TEXT=off
# ============================================================================
# Dump Configuration
# ============================================================================
DUMP_DIR=/var/lib/mygramdb/dumps
DUMP_INTERVAL_SEC=600
DUMP_RETAIN=3
# Relevance and cache
BM25_ENABLE=false
BM25_K1=1.2
BM25_B=0.75
CACHE_ENABLED=true
CACHE_MAX_MEMORY_MB=32
CACHE_MIN_QUERY_COST_MS=10.0
CACHE_TTL_SECONDS=3600
# MySQL DATETIME timezone and TLS
MYSQL_DATETIME_TIMEZONE=+00:00
MYSQL_SSL_ENABLE=false
MYSQL_SSL_CA=
MYSQL_SSL_CERT=
MYSQL_SSL_KEY=
MYSQL_SSL_VERIFY_SERVER_CERT=true
# ============================================================================
# API Server Configuration
# ============================================================================
# Listener address for a directly launched server. docker-compose.yml ignores
# it and uses API_CONTAINER_BIND / API_HTTP_CONTAINER_BIND (0.0.0.0 by default)
# instead, because a container has to listen on its own network interface;
# there the host-side exposure is limited by the loopback ports mapping.
API_BIND=127.0.0.1
API_PORT=11016
API_HTTP_ENABLE=true
API_HTTP_BIND=127.0.0.1
API_HTTP_PORT=8080
API_RATE_LIMIT_ENABLE=false
API_RATE_LIMIT_CAPACITY=100
API_RATE_LIMIT_REFILL_RATE=10
API_RATE_LIMIT_MAX_CLIENTS=10000
# Required by docker-compose.yml because the container listens on 0.0.0.0.
# Generate a high-entropy value, for example: openssl rand -hex 32
API_ADMIN_TOKEN=CHANGE_ME_GENERATE_RANDOM_SECRET
# ============================================================================
# Network Configuration
# ============================================================================
# Allowed client CIDRs (comma-separated), matched against the address the
# server sees. Under docker compose that is not the host address: Docker
# rewrites the source of a published-port connection to the bridge gateway, so
# a loopback-only list would reject every client on the host. 172.16.0.0/12
# covers Docker's default bridge pool; 127.0.0.1/32 covers in-container clients
# and servers launched outside Docker. Narrow this for a real deployment.
# Do not combine 0.0.0.0/0 or ::/0 with a non-loopback API bind without an
# API_ADMIN_TOKEN. Administrative TCP commands require AUTH <token>.
NETWORK_ALLOW_CIDRS=127.0.0.1/32,172.16.0.0/12
# ============================================================================
# Logging Configuration
# ============================================================================
LOG_LEVEL=info
LOG_FORMAT=json
# ============================================================================
# Docker Compose Configuration
# ============================================================================
# MygramDB version/tag
MYGRAMDB_VERSION=latest
# Compose project name
COMPOSE_PROJECT_NAME=mygramdb