mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-05 12:22:57 +00:00
fix(templates): require Docmost mail driver
Require MAIL_DRIVER to be set before Docmost starts and add a unit test to keep the compose template and generated service templates in sync.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
it('requires a mail driver before Docmost can start', function () {
|
||||
$compose = file_get_contents(__DIR__.'/../../templates/compose/docmost.yaml');
|
||||
|
||||
expect($compose)
|
||||
->toContain('MAIL_DRIVER=${MAIL_DRIVER:?}')
|
||||
->not->toContain('MAIL_DRIVER=${MAIL_DRIVER}');
|
||||
|
||||
foreach (['service-templates.json', 'service-templates-latest.json'] as $templateFile) {
|
||||
$templates = json_decode(
|
||||
file_get_contents(__DIR__."/../../templates/{$templateFile}"),
|
||||
associative: true,
|
||||
flags: JSON_THROW_ON_ERROR,
|
||||
);
|
||||
|
||||
$generatedCompose = base64_decode($templates['docmost']['compose'], strict: true);
|
||||
|
||||
expect($generatedCompose)
|
||||
->toContain('MAIL_DRIVER=${MAIL_DRIVER:?}')
|
||||
->not->toContain('MAIL_DRIVER=${MAIL_DRIVER}');
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user