The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.
TypeScript budget-trackercollaborativedockeritinerarymcp-serveroffline-firstopen-sourceopenstreetmappacking-listpwareal-timeself-hostedselfhostedtraveltravel-apptravel-journaltravel-plannertripitwanderlog
returning test connectioon button to original intend
Marek Maslowskif7c965bc6bfb
diff --git a/server/src/db/migrations.ts b/server/src/db/migrations.tsindex d14d4a851..20f160d2f 100644--- a/server/src/db/migrations.ts+++ b/server/src/db/migrations.ts@@ -662,7 +662,7 @@ function runMigrations(db: Database.Database): void {settings_get: '/integrations/synologyphotos/settings',settings_put: '/integrations/synologyphotos/settings',status_get: '/integrations/synologyphotos/status',- test_get: '/integrations/synologyphotos/status',+ test_post: '/integrations/synologyphotos/test',}),1,);diff --git a/server/src/db/seeds.ts b/server/src/db/seeds.tsindex 8035d214b..ef849d9aa 100644--- a/server/src/db/seeds.ts+++ b/server/src/db/seeds.ts@@ -119,7 +119,7 @@ function seedAddons(db: Database.Database): void {settings_get: '/integrations/synologyphotos/settings',settings_put: '/integrations/synologyphotos/settings',status_get: '/integrations/synologyphotos/status',- test_get: '/integrations/synologyphotos/status',+ test_post: '/integrations/synologyphotos/test',}),},];diff --git a/server/src/routes/immich.ts b/server/src/routes/immich.tsindex 7ed3dd459..dd0246804 100644--- a/server/src/routes/immich.ts+++ b/server/src/routes/immich.ts@@ -79,16 +79,17 @@ router.get('/status', authenticate, async (req: Request, res: Response) => {}});-// Test connection with saved credentials+// Test connection with provided credentials onlyrouter.post('/test', authenticate, async (req: Request, res: Response) => {- const authReq = req as AuthRequest;- const creds = getImmichCredentials(authReq.user.id);- if (!creds) return res.json({ connected: false, error: 'No credentials configured' });- const ssrf = await checkSsrf(creds.immich_url);+ const { immich_url, immich_api_key } = req.body as { immich_url?: string; immich_api_key?: string };+ const url = String(immich_url || '').trim();+ const apiKey = String(immich_api_key || '').trim();+ if (!url || !apiKey) return res.json({ connected: false, error: 'URL and API key required' });+ const ssrf = await checkSsrf(url);if (!ssrf.allowed) return res.json({ connected: false, error: ssrf.error ?? 'Invalid Immich URL' });try {- const resp = await fetch(`${creds.immich_url}/api/users/me`, {- headers: { 'x-api-key': creds.immich_api_key, 'Accept': 'application/json' },+ const resp = await fetch(`${url}/api/users/me`, {+ headers: { 'x-api-key': apiKey, 'Accept': 'application/json' },signal: AbortSignal.timeout(10000),});if (!resp.ok) return res.json({ connected: false, error: `HTTP ${resp.status}` });diff --git a/server/src/routes/synology.ts b/server/src/routes/synology.tsindex 9e98fcf0b..c1e868e25 100644--- a/server/src/routes/synology.ts+++ b/server/src/routes/synology.ts@@ -7,6 +7,7 @@ import { broadcast } from '../websocket';import { AuthRequest } from '../types';import { maybe_encrypt_api_key, decrypt_api_key } from '../services/apiKeyCrypto';import { consumeEphemeralToken } from '../services/ephemeralTokens';+import { checkSsrf } from '../utils/ssrfGuard';const router = express.Router();@@ -263,6 +264,49 @@ router.get('/status', authenticate, async (req: Request, res: Response) => {}});+// Test connection with provided credentials only+router.post('/test', authenticate, async (req: Request, res: Response) => {+ const { synology_url, synology_username, synology_password } = req.body as { synology_url?: string; synology_username?: string; synology_password?: string };++ const url = String(synology_url || '').trim();+ const username = String(synology_username || '').trim();+ const password = String(synology_password || '').trim();++ if (!url || !username || !password) {+ return res.json({ connected: false, error: 'URL, username, and password are required' });+ }++ const ssrf = await checkSsrf(url);+ if (!ssrf.allowed) return res.json({ connected: false, error: ssrf.error ?? 'Invalid Synology URL' });++ try {+ const endpoint = prepareSynologyEndpoint(url);+ const body = new URLSearchParams({+ api: 'SYNO.API.Auth',+ method: 'login',+ version: '3',+ account: username,+ passwd: password,+ });++ const resp = await fetch(endpoint, {+ method: 'POST',+ headers: {+ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',+ },+ body,+ signal: AbortSignal.timeout(30000),+ });++ if (!resp.ok) return res.json({ connected: false, error: `HTTP ${resp.status}` });+ const data = await resp.json() as { success: boolean; data?: { sid?: string } };+ if (!data.success || !data.data?.sid) return res.json({ connected: false, error: 'Authentication failed' });+ return res.json({ connected: true, user: { username } });+ } catch (err: unknown) {+ return res.json({ connected: false, error: err instanceof Error ? err.message : 'Connection failed' });+ }+});+// Album linking parity with Immichrouter.get('/albums', authenticate, async (req: Request, res: Response) => {const authReq = req as AuthRequest;