chore(server): support elasticsearch apiKey (#12405)

This commit is contained in:
fengmk2
2025-05-21 08:35:51 +00:00
parent ff15779208
commit abfc994180
12 changed files with 36 additions and 29 deletions
@@ -16,6 +16,7 @@ declare global {
provider: {
type: SearchProviderType;
endpoint: string;
apiKey: string;
username: string;
password: string;
};
@@ -50,6 +51,12 @@ defineModuleConfig('indexer', {
return z.string().url().safeParse(val);
},
},
'provider.apiKey': {
desc: 'Indexer search service api key. Optional for elasticsearch',
link: 'https://www.elastic.co/guide/server/current/api-key.html',
default: '',
env: ['AFFINE_INDEXER_SEARCH_API_KEY', 'string'],
},
'provider.username': {
desc: 'Indexer search service auth username, if not set, basic auth will be disabled. Optional for elasticsearch',
link: 'https://www.elastic.co/guide/en/elasticsearch/reference/current/http-clients.html',