feat: SMTP mail stack and separate server.env deploy
Add mail.php with STARTTLS sending, test scripts, server.env split from local .env, admin@ postbox docs, DKIM DNS support-ticket notes, and todo 11 for boka relay. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+21
-4
@@ -3,8 +3,8 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Load configuration from private/.env (outside document root).
|
||||
* Called from httpdocs/*.php via require on private/config/bootstrap.php.
|
||||
* Load configuration from private/server.env (outside document root).
|
||||
* Local .env is never deployed — see server.env.example.
|
||||
*/
|
||||
|
||||
function bootstrap(): array
|
||||
@@ -15,12 +15,29 @@ function bootstrap(): array
|
||||
return $config;
|
||||
}
|
||||
|
||||
$envFile = dirname(__DIR__) . '/.env';
|
||||
$config = loadEnvFile($envFile);
|
||||
$config = loadEnvFile(envFilePath());
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
function envFilePath(): string
|
||||
{
|
||||
$baseDir = dirname(__DIR__);
|
||||
|
||||
// Webspace: private/config/bootstrap.php → private/server.env
|
||||
if (basename($baseDir) === 'private') {
|
||||
return $baseDir . '/server.env';
|
||||
}
|
||||
|
||||
// Local repo: .env on this machine (never deployed)
|
||||
$local = $baseDir . '/.env';
|
||||
if (is_readable($local)) {
|
||||
return $local;
|
||||
}
|
||||
|
||||
return $baseDir . '/server.env';
|
||||
}
|
||||
|
||||
function env(string $key, ?string $default = null): ?string
|
||||
{
|
||||
$value = bootstrap()[$key] ?? null;
|
||||
|
||||
Reference in New Issue
Block a user