Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
68 lines (57 loc) · 2.62 KB
/
Copy path.env.example
File metadata and controls
68 lines (57 loc) · 2.62 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
# ============ CƠ BẢN ============
PORT=3000
BASE_URL=http://localhost:3000 # domain thật khi lên production, vd https://tim.example.com
SESSION_SECRET=doi-thanh-chuoi-ngau-nhien-dai # tạo: openssl rand -hex 32
TRUST_PROXY=1 # số lớp proxy trước app (Nginx=1, Cloudflare+Nginx=2, chạy thẳng=0)
# KHÔNG còn ADMIN_USER/ADMIN_PASSWORD. Admin đầu tiên tạo qua link trong log khi khởi động
# hoặc bằng lệnh: npm run admin:create
# ============ POSTGRESQL (Aiven hoặc local) ============
# Aiven: copy "Service URI" trong Console, ví dụ:
# postgres://avnadmin:MATKHAU@pg-xxx.aivencloud.com:12345/defaultdb?sslmode=require
DATABASE_URL=postgres://search:search@localhost:5432/search
PG_CA_PATH= # đường dẫn ca.pem tải từ Aiven (khuyên dùng khi production)
PG_POOL_MAX=1
# ============ SEARCH ENGINE ============
# meilisearch | opensearch | elasticsearch | typesense | postgres
SEARCH_PROVIDER=meilisearch
# --- Meilisearch ---
MEILI_HOST=http://localhost:7700
MEILI_KEY=masterKey123
# --- OpenSearch (vd Aiven OpenSearch) ---
# Nên tách user/mật khẩu (không cần mã hóa ký tự đặc biệt) và dùng tài khoản quyền tối thiểu
# (tạo bằng: npm run engine:setup -- --create-user)
OPENSEARCH_URL=https://os-xxx.aivencloud.com:12345
OPENSEARCH_USER=
OPENSEARCH_PASSWORD=
OPENSEARCH_INDEX=pages
OPENSEARCH_CA_PATH=
# --- Elasticsearch (tự host hoặc Elastic Cloud) ---
ELASTICSEARCH_URL=https://xxx.es.io:443
ELASTICSEARCH_USER=
ELASTICSEARCH_PASSWORD=
ELASTICSEARCH_API_KEY= # dùng API key HOẶC user/mật khẩu
ELASTICSEARCH_INDEX=pages
ELASTICSEARCH_CA_PATH=
# --- Typesense ---
TYPESENSE_URL=http://localhost:8108
TYPESENSE_API_KEY=
TYPESENSE_COLLECTION=pages
TYPESENSE_CA_PATH=
# --- postgres: không cần biến nào thêm (dùng chung DATABASE_URL) ---
# ============ CLOUDFLARE TURNSTILE (CAPTCHA) ============
# Có ĐỦ cả 2 key thì captcha tự bật ở: /submit, /account/login, /account/register, /admin/login, /admin/setup.
# Key test (luôn pass) để thử local:
# TURNSTILE_SITE_KEY=1x00000000000000000000AA
# TURNSTILE_SECRET_KEY=1x0000000000000000000000000000000AA
TURNSTILE_SITE_KEY=
TURNSTILE_SECRET_KEY=
# ============ CRAWLER ============
BOT_UA=MySearchBot/1.0 (+https://ten-mien-cua-ban/bot)
CRAWL_DELAY_MS=500
VERIFIED_MAX_PAGES=200
# ============ TỪ KHÓA & GỬI SITE ============
AUTO_KEYWORDS=true
KEYWORD_MIN_COUNT=3
SUBMIT_LIMIT=5
# CHỈ dùng khi dev local để crawl localhost. KHÔNG bật trên production (tắt chống SSRF).
# ALLOW_PRIVATE_FETCH=true