feat(federation): update key path handling and ensure directory creation for federation keys
Some checks failed
Build & Push Docker Image / build (push) Has been cancelled

This commit is contained in:
2026-03-02 23:01:15 +01:00
parent 4a4ec0a3a3
commit e4001cb33f
2 changed files with 6 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ services:
env_file: ".env"
volumes:
- uploads:/app/uploads
- ./keys:/app/keys
depends_on:
postgres:
condition: service_healthy

View File

@@ -13,7 +13,11 @@ let publicKeyPem = '';
// Load or generate Ed25519 keys
if (FEDERATION_DOMAIN) {
const keyPath = path.join(__dirname, 'federation_key.pem');
const keyPath = process.env.FEDERATION_KEY_PATH || '/app/keys/federation_key.pem';
const keyDir = path.dirname(keyPath);
if (!fs.existsSync(keyDir)) {
fs.mkdirSync(keyDir, { recursive: true });
}
if (!privateKeyPem && fs.existsSync(keyPath)) {
privateKeyPem = fs.readFileSync(keyPath, 'utf8');