-
Notifications
You must be signed in to change notification settings - Fork 8
/
.mercs.yaml
333 lines (285 loc) · 10.6 KB
/
.mercs.yaml
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
server:
network:
public_url: http://127.0.0.1:1688
rateLimit:
global: false
max: 1000
timeWindow: 60000 # 1 minute
session:
cookie:
maxAge: 604800000 # 1 week, 7*24*60*60*1000
secure: true
httpOnly: false
logger:
level: 2
kvStorage: # Location of the server KV Storage
dbPath: './data.local/db'
settings:
kvStorage:
dbPath: './data.local/db'
dbName: 'settings.db'
paths:
apisLocalPath: './data.local/apis-local'
apisTestingPath : './data.local/apis-testing'
fileExportPath : './data.local/file-export'
fileImportPath : './data.local/file-import'
tmpPath : './data.local/tmp'
keystorePath : './data.local/keystore'
dbQueuePath : './data.local/db/queue.db'
services:
jobs:
kvStorage:
dbPath: './data.local/db'
dbName: 'jobs.db'
messaging:
keepaliveInterval: 60000 # 60*1000 ms between sending keepalive packets to the client to prevent proxies from reaping the SSE connection
credentials:
disabled: false
type: default # default, local, vaultwarden (default to KV)
omniKeys: '../../keystore.local.yaml' # The default keystore to use if user doesn't have organization or user level credentials in the root folder
encryption:
keyPath: './data.local/keystore/encryption.key' # The key used to encrypt the credentials in the keystore
algorithm: aes-256-cbc
signature:
keyPath: './data.local/keystore/signature.key' # The key used to sign the credentials in the keystore
algorithm: sha256
storeConfig:
dbPath: './data.local/db'
oauth:
google-tts:
opts:
access_type: 'offline'
prompt: 'consent'
google-translate:
opts:
access_type: 'offline'
prompt: 'consent'
google-play:
opts:
access_type: 'offline'
prompt: 'consent'
google-llm:
opts:
access_type: 'offline'
prompt: 'consent'
google-vision:
opts:
access_type: 'offline'
prompt: 'consent'
google-gmail:
opts:
access_type: 'offline'
prompt: 'consent'
db:
pocketbase:
local:
dbUrl: 'http://127.0.0.1:8090'
login: '[email protected]'
development:
dbUrl: 'https://pocket.intern.mercenaries.ai'
kvStorage:
dbPath: './data.local/db'
rest_consumer:
exchange: { name: 'omni_tasks', type: 'topic', options: { durable: true, autoDelete: false, internal: false, arguments: {} } }
retry:
disabled: false
maxRetries: 3
delay: 3000
disabled: false
amqp:
exchanges:
- name: 'omni_tasks'
type: 'topic'
options:
durable: true
autoDelete: false
internal: false
arguments: {}
- name: 'omni_announce'
type: 'topic'
options:
durable: true
autoDelete: false
internal: false
arguments: {}
blockmanager:
preload: true
kvStorage:
dbPath: './data.local/db'
dbName: 'blocks.db'
# Integrations Configuration (Integrations are defined and added to the server in run.ts before it loads)
integrations:
cdn:
type: local
useLocalRoute: true #whether to use the local route or seaweed returned public url for serving images
localRoute: 'http://127.0.0.1:1688/fid'
kvStorage:
dbPath: './data.local/db'
local:
default_ttl: 7d #default ttl for temp artifacts
# ${{ if navigator.platform.startsWith("Win") }}:
# root: 'c://temp//cdn'
# url: '127.0.0.1:1688'
# insecure: true #whether to use https (e.g. behind reverse proxy) when talking to volume nodes on the backend
# ${{ else }}:
root: './data.local/files'
url: '127.0.0.1:1688'
insecure: true #whether to use https (e.g. behind reverse proxy) when talking to volume nodes on the backend
routes:
'/fid/:fid':
insecure: true
handler: 'fid'
clientExport: 'fid'
'POST /fid':
insecure: false
handler: 'fidupload'
clientExport: 'fidupload'
# Our own backend server APIs. These are declared as routes
mercenaries:
routes:
'/api/v1/mercenaries/ping': # Test route - defaults to GET
handler: 'ping'
clientExport: 'ping'
insecure: true
'POST /api/v1/mercenaries/ping': # Test route - adds the same handler responding to POST
handler: 'ping'
'/api/v1/mercenaries/fetch': # Server side fetch route (formerly /p) - GET
handler: 'fetch'
config:
rateLimit:
max: 300
timeWindow: 60000 # 1 minute
'POST /api/v1/mercenaries/fetch': # Server side fetch route (formerly /p) - POST
handler: 'fetch'
clientExport: 'fetch' # Auto register a client function in the client.api namespace
'/api/v1/mercenaries/integrations': # Server export of client routes
handler: 'integrations'
'/api/v1/mercenaries/components': # Server export of client routes
handler: 'components'
clientExport: 'components'
'/api/v1/mercenaries/extensions': # Get all extensions
handler: 'getExtensions'
'/api/v1/mercenaries/listen': # Server side listen route (sse)
handler: 'listen'
ignoreOnDevServer: true # unfortunately the vite dev server does not support SSE
# so we can't proxy this route
'POST /api/v1/mercenaries/runscript/:script' :
handler: runscript
'GET /api/v1/mercenaries/runscript/:script' :
handler: runscript
'GET /api/v1/mercenaries/user/requiredKeys':
handler: 'getRequiredKeys'
clientExport: 'getRequiredKeys'
'POST /api/v1/mercenaries/user/key':
handler: 'setUserKey'
clientExport: 'setUserKey'
'DELETE /api/v1/mercenaries/user/key':
handler: 'revokeUserKey'
clientExport: 'revokeUserKey'
'GET /api/v1/mercenaries/user/keys':
handler: 'listUserKeys'
clientExport: 'listUserKeys'
'POST /api/v1/mercenaries/user/keys/bulkAdd':
handler: 'bulkAddUserKeys'
auth: # Authentication and user related routes
kvStorage:
dbPath: './data.local/db'
dbName: 'auth.db'
routes:
'POST /api/v1/auth/login': # default username / pwd login
handler: login
authStrategy: local
'/api/v1/auth/autologin': # auto login : cloudflare , pocketbase single user
handler: login
authStrategy: ['cloudflare', 'pb_admin']
'POST /api/v1/auth/logout': # destroy session
handler: logout
'/api/v1/auth/user': # Get authenticated user info
handler: getAuthenticatedUser
'POST /api/v1/auth/token': # Generate token
handler: generateToken
'POST /api/v1/auth/accepttos':
handler: acceptTos
'GET /api/v1/auth/oauth2': # OAuth2.0
handler: oauth2
'GET /api/v1/auth/oauth2/:ns/callback': # OAuth2.0 callback
handler: oauth2Callback
chat:
routes:
'/api/v1/chat/:contextId': # Get associated chat history
handler: 'chatHistory'
clientExport: 'chatHistory'
'PUT /api/v1/chat/:contextId': # Append to persistent layer
handler: 'append'
clientExport: 'append'
'DELETE /api/v1/chat/:contextId': # Delete chat history
handler: 'clear'
clientExport: 'clear'
workflow: # Worklow related routes
routes:
'POST /api/v1/workflow/exec': # Execute a client workflow on the server
handler: 'exec'
clientExport: 'exec'
authStrategy: 'jwt'
'POST /api/v1/workflow/stop': # Stop all running workflows the user has access to
handler: 'stop'
clientExport: 'stop'
authStrategy: 'jwt'
'/api/v1/workflow/workflows': # Get a users workflows
handler: 'getWorkflows'
clientExport: 'getWorkflows'
authStrategy: 'jwt'
'/api/v1/workflow/results': # Get results for a workflow
handler: 'results'
clientExport: 'results'
authStrategy: 'jwt'
'/api/v1/workflow/jobs': # Get a users running workflows (jobs)
handler: 'jobs'
clientExport: 'jobs'
authStrategy: 'jwt'
'PUT /api/v1/workflow': # Update an existing workflow
handler: 'update'
clientExport: 'update'
'POST /api/v1/workflow': # Save/Create a new workflow
handler: 'create'
clientExport: 'create'
'POST /api/v1/workflow/clone': # Clone an existing workflow
handler: 'clone'
clientExport: 'clone'
'GET /api/v1/workflow/:workflowId/:version': # Load workflow from backend
handler: 'load'
clientExport: 'load'
'GET /api/v1/workflow/:workflowId': # Load the non-published version of a workflow
handler: 'load'
clientExport: 'load'
'GET /api/v1/workflow/download/:workflowId': # Download a workflow
handler: 'download'
'DELETE /api/v1/workflow/:workflowId': # Delete a workflow
handler: 'deleteWorkflow'
clientExport: 'deleteWorkflow'
# Vite Configuration
vite:
# Configuration for the build visualizer plugin. Set to true or pass in the visualizer options
# https://github.com/btd/rollup-plugin-visualizer
visualizer:
open: false #whether or not to open statistics in a browser after build
gzipSize: true #whether to show the gzip size
template: 'treemap' # treemap, sunburst, network, list, raw-data
title: 'Mercenaries.ai Vite Build Statistics' # title for generated HTML
filename: 'stats.html'
# Additional API proxy routes
# Any route or proxy defined under server.integrations is automatically declared
# when vite.config.js builds the vite configuration
apiProxy:
'/t':
# not defining target: means use the address provided in the server.network section
# (this logic is implemented in vite.config.js)
changeOrigin: true
'/sets':
changeOrigin: true
'/fid':
changeOrigin: true
'/auth':
changeOrigin: true
'/img':
changeOrigin: true