overseerr: seed Sonarr and Radarr config in restore.js
Sonarr and Radarr service settings live in settings.json (not the SQLite database). Extend the restore.js initContainer to seed both services on first boot or after a PVC wipe, matching current live config.
This commit is contained in:
@@ -73,6 +73,56 @@ data:
|
||||
}
|
||||
console.log('Jellyfin config present, libraries:', settings.jellyfin.libraries.length);
|
||||
}
|
||||
// Seed Sonarr if not configured
|
||||
if (!settings.sonarr || settings.sonarr.length === 0) {
|
||||
console.log('Sonarr not configured — seeding from defaults');
|
||||
settings.sonarr = [{
|
||||
"name": "Sonarr",
|
||||
"hostname": "sonarr.media.svc",
|
||||
"port": 8989,
|
||||
"apiKey": "4fb7acb509d7469c88e0b46a6fd494e8",
|
||||
"useSsl": false,
|
||||
"baseUrl": "",
|
||||
"activeProfileId": 4,
|
||||
"activeProfileName": "HD-1080p",
|
||||
"activeDirectory": "/media/tv/shows",
|
||||
"is4k": false,
|
||||
"is4kServer": false,
|
||||
"isDefault": true,
|
||||
"enableSeasonFolders": true,
|
||||
"externalUrl": "",
|
||||
"syncEnabled": false,
|
||||
"preventSearch": false,
|
||||
"id": 0
|
||||
}];
|
||||
} else {
|
||||
console.log('Sonarr already configured, skipping seed');
|
||||
}
|
||||
// Seed Radarr if not configured
|
||||
if (!settings.radarr || settings.radarr.length === 0) {
|
||||
console.log('Radarr not configured — seeding from defaults');
|
||||
settings.radarr = [{
|
||||
"name": "Radarr",
|
||||
"hostname": "radarr.media.svc",
|
||||
"port": 7878,
|
||||
"apiKey": "c2b1b65e5c9e46d9b98bf105520f26b5",
|
||||
"useSsl": false,
|
||||
"baseUrl": "",
|
||||
"activeProfileId": 4,
|
||||
"activeProfileName": "HD-1080p",
|
||||
"activeDirectory": "/media/movies",
|
||||
"is4k": false,
|
||||
"is4kServer": false,
|
||||
"isDefault": true,
|
||||
"externalUrl": "",
|
||||
"syncEnabled": false,
|
||||
"preventSearch": false,
|
||||
"minimumAvailability": "released",
|
||||
"id": 0
|
||||
}];
|
||||
} else {
|
||||
console.log('Radarr already configured, skipping seed');
|
||||
}
|
||||
fs.writeFileSync(SETTINGS, JSON.stringify(settings, null, 2));
|
||||
console.log('Settings written successfully');
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user