diff --git a/apps/api/src/lib.ts b/apps/api/src/lib.ts index 2613b6325..0eefbf2a9 100644 --- a/apps/api/src/lib.ts +++ b/apps/api/src/lib.ts @@ -13,6 +13,7 @@ export async function migrateServicesToNewTemplate() { if (service.type === 'vscodeserver' && service.vscodeserver) await vscodeserver(service) if (service.type === 'wordpress' && service.wordpress) await wordpress(service) if (service.type === 'ghost' && service.ghost) await ghost(service) + if (service.type === 'meilisearch' && service.meilisearch) await meilisearch(service) } } catch (error) { @@ -20,6 +21,19 @@ export async function migrateServicesToNewTemplate() { } } + +async function meilisearch(service: any) { + const { masterKey } = service.meilisearch + + const secrets = [ + `MEILI_MASTER_KEY@@@${masterKey}`, + ] + + await migrateSecrets(secrets, service); + + // Remove old service data + // await prisma.service.update({ where: { id: service.id }, data: { wordpress: { delete: true } } }) +} async function ghost(service: any) { const { defaultEmail, defaultPassword, mariadbUser, mariadbPassword, mariadbRootUser, mariadbRootUserPassword, mariadbDatabase } = service.ghost const { fqdn } = service diff --git a/apps/api/src/lib/templates.ts b/apps/api/src/lib/templates.ts index 4d20e1bbe..7de4c54af 100644 --- a/apps/api/src/lib/templates.ts +++ b/apps/api/src/lib/templates.ts @@ -1,4 +1,43 @@ export default [ + { + "templateVersion": "1.0.0", + "serviceDefaultVersion": "latest", + "name": "meilisearch", + "displayName": "MeiliSearch", + "description": "MeiliSearch is a lightning Fast, Ultra Relevant, and Typo-Tolerant Search Engine", + "services": { + "$$id": { + "name": "MeiliSearch", + "documentation": "https://docs.meilisearch.com/", + "depends_on": [ + "$$id_mysql" + ], + "image": "getmeili/meilisearch:$$core_version", + "volumes": [ + "$$id-datams:/meili_data/data.ms", + "$$id-data:/meili_data", + "$$id-snapshot:/snapshot", + "$$id-dump:/dumps" + ], + "environment": [ + "MEILI_MASTER_KEY=$$secret_meili_master_key", + ], + "ports": [ + "7700" + ] + } + + }, + "variables": [ + { + "id": "$$secret_meili_master_key", + "name": "MEILI_MASTER_KEY", + "label": "Master Key", + "defaultValue": "$$generate_passphrase", + "description": "" + } + ] + }, { "templateVersion": "1.0.0", "serviceDefaultVersion": "latest",