fix: resolve ctx naming conflict in arr/config.js, add pylon to known config keys
- Remove redundant ctx shim that conflicted with function parameter - Use destructured notification/safeErrorMessage directly - Add pylon, customLogoDark, customLogoLight to known config keys Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -117,7 +117,8 @@ function validateConfig(config) {
|
|||||||
'setupComplete', 'setupCompleted', 'setupMode', 'onboardingCompleted',
|
'setupComplete', 'setupCompleted', 'setupMode', 'onboardingCompleted',
|
||||||
'configurationType', 'defaults', 'customLogo', 'customFavicon',
|
'configurationType', 'defaults', 'customLogo', 'customFavicon',
|
||||||
'dashboardTitle', 'tailscale', 'license', 'skipped',
|
'dashboardTitle', 'tailscale', 'license', 'skipped',
|
||||||
'routingMode', 'domain', 'email', 'defaultIP'
|
'routingMode', 'domain', 'email', 'defaultIP', 'pylon',
|
||||||
|
'customLogoDark', 'customLogoLight'
|
||||||
];
|
];
|
||||||
for (const key of Object.keys(config)) {
|
for (const key of Object.keys(config)) {
|
||||||
if (!knownKeys.includes(key)) {
|
if (!knownKeys.includes(key)) {
|
||||||
|
|||||||
@@ -21,11 +21,6 @@ module.exports = function(ctx) {
|
|||||||
const { credentialManager, servicesStateManager, docker, fetchT, asyncHandler, errorResponse, log, helpers, notification, safeErrorMessage } = ctx;
|
const { credentialManager, servicesStateManager, docker, fetchT, asyncHandler, errorResponse, log, helpers, notification, safeErrorMessage } = ctx;
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
// Ctx shim for backward compatibility
|
|
||||||
const ctx = {
|
|
||||||
notification,
|
|
||||||
safeErrorMessage
|
|
||||||
};
|
|
||||||
|
|
||||||
// Auto-configure Overseerr with detected services
|
// Auto-configure Overseerr with detected services
|
||||||
router.post('/arr/configure-overseerr', asyncHandler(async (req, res) => {
|
router.post('/arr/configure-overseerr', asyncHandler(async (req, res) => {
|
||||||
@@ -282,7 +277,7 @@ module.exports = function(ctx) {
|
|||||||
} else if (error.name === 'AbortError' || error.message?.includes('timeout')) {
|
} else if (error.name === 'AbortError' || error.message?.includes('timeout')) {
|
||||||
return errorResponse(res, 504, 'Connection timeout');
|
return errorResponse(res, 504, 'Connection timeout');
|
||||||
}
|
}
|
||||||
return errorResponse(res, 500, ctx.safeErrorMessage(error));
|
return errorResponse(res, 500, safeErrorMessage(error));
|
||||||
}
|
}
|
||||||
}, 'arr-test-connection'));
|
}, 'arr-test-connection'));
|
||||||
|
|
||||||
@@ -484,7 +479,7 @@ module.exports = function(ctx) {
|
|||||||
|
|
||||||
// Send notification
|
// Send notification
|
||||||
if (anyConfigured) {
|
if (anyConfigured) {
|
||||||
ctx.notification.send(
|
notification.send(
|
||||||
'deploymentSuccess',
|
'deploymentSuccess',
|
||||||
'Arr Stack Auto-Connected',
|
'Arr Stack Auto-Connected',
|
||||||
`Overseerr configured: ${Object.entries(configResults).filter(([k,v]) => v === 'configured').map(([k]) => k).join(', ')}`,
|
`Overseerr configured: ${Object.entries(configResults).filter(([k,v]) => v === 'configured').map(([k]) => k).join(', ')}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user