-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcoco.yml
262 lines (247 loc) · 7.17 KB
/
coco.yml
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
env:
OLLAMA_ENDPOINT: http://localhost:11434
OLLAMA_MODEL: llama3.2
ES_ENDPOINT: https://localhost:9200
ES_USERNAME: admin
ES_PASSWORD: $[[keystore.ES_PASSWORD]]
WEB_BINDING: 0.0.0.0:9000
API_BINDING: 0.0.0.0:2900
coco:
ollama:
endpoint: $[[env.OLLAMA_ENDPOINT]]
model: $[[env.OLLAMA_MODEL]]
keepalive: 30m
## Cleanup exists data:
# curl -u admin:45ff432a5428ade77c7b -k -XDELETE https://localhost:9200/_template/coco-search
# curl -u admin:45ff432a5428ade77c7b -k -XDELETE https://localhost:9200/_template/coco
# curl -u admin:45ff432a5428ade77c7b -k -XDELETE https://localhost:9200/_scripts/coco-query-string
# curl -u admin:45ff432a5428ade77c7b -k -XDELETE https://localhost:9200/coco_*
elastic:
elasticsearch: prod
enabled: true
store:
enabled: false
orm:
enabled: true
index_prefix: "coco_"
override_exists_template: true
index_templates:
"coco-search": |
{
"order": 10,
"index_patterns": [
"coco_*"
],
"settings": {
"index": {
"analysis": {
"char_filter": {
"tsconvert" : {
"type" : "stconvert",
"delimiter" : ",",
"keep_both" : false,
"convert_type" : "t2s"
}
},
"tokenizer": {
"my_pinyin": {
"type": "pinyin",
"keep_first_letter": true,
"keep_separate_first_letter": true,
"keep_full_pinyin": true,
"keep_original": false,
"limit_first_letter_length": 16,
"lowercase": true
}
},
"analyzer": {
"pinyin_analyzer": {
"tokenizer": "my_pinyin"
},
"combined_text_analyzer": {
"char_filter": ["tsconvert"],
"filter": [
"lowercase",
"asciifolding",
"word_delimiter",
"unique"
],
"tokenizer": "classic"
}
}
}
}
},
"mappings": {}
}
search_templates:
"coco-query-string": |
{
"from": "{{from}}",
"size": "{{size}}",
"_source": {
"includes": [ "{{#source}}","{{.}}","{{/source}}"],
"excludes": [ "payload.*","content" ]
},
"query": {
"bool": {
"must": {{#toJson}}must_clauses{{/toJson}},
"must_not": [],
"should": [
{{#query}}
{
"prefix": {
"{{field}}.keyword": {
"value": "{{query}}",
"boost": 10
}
}
},
{
"match_phrase_prefix": {
"{{field}}": {
"query": "{{query}}",
"boost": 2
}
}
},
{
"match": {
"{{field}}": {
"query": "{{query}}",
"fuzziness": "AUTO",
"max_expansions": 10,
"prefix_length": 2,
"fuzzy_transpositions": true
}
}
},
{
"query_string": {
"fields": ["{{field}}","{{field}}.keyword^10","combined_fulltext"],
"query": "{{query}}",
"fuzziness": "AUTO",
"fuzzy_prefix_length": 2,
"fuzzy_max_expansions": 10,
"fuzzy_transpositions": true,
"allow_leading_wildcard": false
}
},{"match": {
"{{field}}.pinyin": "{{query}}"
}}
{{/query}}
]
}
}
}
elasticsearch:
- name: prod
enabled: true
endpoints:
- $[[env.ES_ENDPOINT]]
discovery:
enabled: false
basic_auth:
username: $[[env.ES_USERNAME]]
password: $[[env.ES_PASSWORD]]
api:
enabled: true
websocket:
enabled: false
network:
binding: $[[env.API_BINDING]]
web:
enabled: true
embedding_api: true
network:
binding: $[[env.WEB_BINDING]]
tls:
enabled: false
skip_insecure_verify: true
default_domain: "localhost:2900"
# default_domain: "api.coco.rs"
auto_issue:
enabled: false
email: "hello@infinilabs.com"
include_default_domain: true
domains:
- "www.coco.rs"
provider:
tencent_dns:
secret_id: $[[keystore.TENCENT_DNS_ID]] #./bin/coco keystore add TENCENT_DNS_ID
secret_key: $[[keystore.TENCENT_DNS_KEY]] #./bin/coco keystore add TENCENT_DNS_KEY
connector:
google_drive: # get your token here: https://developers.google.com/drive/api/quickstart/go
enabled: false
queue:
name: indexing_documents
credential_file: credentials.json
interval: 60s
skip_invalid_token: true
yuque:
enabled: false
queue:
name: indexing_documents
interval: 60s
hugo_site:
enabled: false
interval: 60s
queue:
name: indexing_documents
notion:
enabled: false
interval: 60s
queue:
name: indexing_documents
##background jobs
pipeline:
- name: merge_documents
auto_start: true
keep_running: true
processor:
- indexing_merge:
input_queue: "indexing_documents"
idle_timeout_in_seconds: 1
elasticsearch: "prod"
index_name: "coco_document"
key_field: "id"
output_queue:
name: "merged_documents"
label:
tag: "merged"
worker_size: 1
bulk_size_in_kb: 10240
- name: ingest_documents
auto_start: true
keep_running: true
processor:
- bulk_indexing:
bulk:
compress: true
batch_size_in_mb: 10
batch_size_in_docs: 10240
consumer:
fetch_max_messages: 100
queues:
type: indexing_merge
tag: "merged"
http_client:
default:
proxy:
enabled: false
default_config:
http_proxy: http://127.0.0.1:7890
socket5_proxy: socks5://127.0.0.1:7890
override_system_proxy_env: true #override system proxy's environment settings with this proxy settings
permitted:
- "google.com"
denied:
- "localhost"
- "www.yuque.com"
- "yuque.com"
- "infinilabs.com"
- "api.coco.rs"
domains:
"github.com":
http_proxy: http://127.0.0.1:7890
socket5_proxy: socks5://127.0.0.1:7890