Skip to content

Commit

Permalink
meilisearch準備
Browse files Browse the repository at this point in the history
  • Loading branch information
na2na-p committed Sep 3, 2024
1 parent 6dcd5dd commit a3a4a5b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
7 changes: 7 additions & 0 deletions infra/k8s/web/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ spec:
secretKeyRef:
name: {{ include "web.fullname" . }}-external-secret
key: DATABASE_PASSWORD
{{ if and .Values.misskeyCm.meilisearch.enabled .Values.externalSecrets.remoteRef.meiliMasterKeyKey }}
- name: MEILISEARCH_MASTER_KEY
valueFrom:
secretKeyRef:
name: {{ include "web.fullname" . }}-external-secret
key: MEILISEARCH_MASTER_KEY
{{ end }}
volumeMounts:
- mountPath: /misskey/.config
name: misskey-default-conf-file
Expand Down
5 changes: 5 additions & 0 deletions infra/k8s/web/templates/externalsecret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@ spec:
- secretKey: DATABASE_PASSWORD
remoteRef:
key: {{ .Values.externalSecrets.remoteRef.databasePasswordKey }}
{{ if and .Values.misskeyCm.meilisearch.enabled .Values.externalSecrets.remoteRef.meiliMasterKeyKey }}
- secretKey: MEILISEARCH_MASTER_KEY
remoteRef:
key: {{ .Values.externalSecrets.remoteRef.meiliMasterKeyKey }}
{{ end }}
{{ end }}
13 changes: 13 additions & 0 deletions infra/k8s/web/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ misskeyCm:
host: "localhost"
port: 6379
misskeyBlockMentionsFromUnfamiliarRemoteUsers: false
meilisearch:
enabled: false
host: "localhost"
port: 7700
# 空なら環境変数を見る
# externalSecrets.remoteRef.meiliMasterKeyKey に指定されたキーの値を使う
apikey: ""
ssl: false
scope: "local"

service:
type: ClusterIP
Expand Down Expand Up @@ -67,5 +76,9 @@ externalSecrets:
targetName: misskey-external-secret
creationPolicy: Owner
remoteRef:
# DATABASE_HOST
databaseHostKey: ""
# DATABASE_PASSWORD
databasePasswordKey: ""
# MEILISEARCH_MASTER_KEY
meiliMasterKeyKey: ""
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "misskey",
"version": "2024.8.0-na2na-v2",
"version": "2024.8.0-na2na-v4",
"codename": "nasubi",
"repository": {
"type": "git",
Expand Down
14 changes: 13 additions & 1 deletion packages/backend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,19 @@ export function loadConfig(): Config {
db: { ...config.db, host: dbHost, db: dbDb, user: dbUser, pass: dbPass },
dbReplications: config.dbReplications,
dbSlaves: config.dbSlaves,
meilisearch: config.meilisearch,
meilisearch: (() => {
const meiliMasterKeyKey = config.meilisearch?.apiKey ?? process.env.MEILISEARCH_MASTER_KEY;
if (config.meilisearch) {
if (!meiliMasterKeyKey) {
throw new Error('meilisearch.apiKey is required.');
}
return {
...config.meilisearch,
apiKey: meiliMasterKeyKey,
}
}
return undefined;
})(),
redis,
redisForPubsub: config.redisForPubsub ? convertRedisOptions(config.redisForPubsub, host) : redis,
redisForJobQueue: config.redisForJobQueue ? convertRedisOptions(config.redisForJobQueue, host) : redis,
Expand Down

0 comments on commit a3a4a5b

Please sign in to comment.