From c410cf58dc09cde3edbe4f2706fc3af19904de8b Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 19 Jan 2026 10:21:12 -0800 Subject: [PATCH 1/3] fix: read URLs from environment variables instead of hardcoded values The URLs.ts file had hardcoded localhost values which prevented the VITE_BACKEND_URL, VITE_FRONTEND_URL, and VITE_CONTAINER_ORIGIN environment variables from being used. This change makes the frontend respect the .env configuration, falling back to localhost defaults for development. Co-Authored-By: Claude Opus 4.5 --- frontend/src/components/utils/URLs.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/utils/URLs.ts b/frontend/src/components/utils/URLs.ts index f657742c..944254bc 100644 --- a/frontend/src/components/utils/URLs.ts +++ b/frontend/src/components/utils/URLs.ts @@ -12,9 +12,10 @@ export const url = isTesting taskchampionSyncServerURL: '', } : { - backendURL: 'http://localhost:8000/', - frontendURL: 'http://localhost:80', - containerOrigin: 'http://localhost:8080/', + backendURL: import.meta.env.VITE_BACKEND_URL || 'http://localhost:8000/', + frontendURL: import.meta.env.VITE_FRONTEND_URL || 'http://localhost:80', + containerOrigin: + import.meta.env.VITE_CONTAINER_ORIGIN || 'http://localhost:8080/', githubRepoURL: 'https://github.com/CCExtractor/ccsync', githubDocsURL: 'https://its-me-abhishek.github.io/ccsync-docs/', zulipURL: 'https://ccextractor.org/public/general/support/', From 47460fed43ed48d47baee012d63c55a7117d7926 Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 19 Jan 2026 10:32:27 -0800 Subject: [PATCH 2/3] test: add import.meta.env mock for Jest tests The ts-jest-mock-import-meta transformer was only mocking import.meta.url but not import.meta.env, causing tests to fail when URLs.ts tries to access import.meta.env.VITE_BACKEND_URL. Co-Authored-By: Claude Opus 4.5 --- frontend/jest.config.cjs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/jest.config.cjs b/frontend/jest.config.cjs index dab1cf45..94f9284c 100644 --- a/frontend/jest.config.cjs +++ b/frontend/jest.config.cjs @@ -24,7 +24,14 @@ module.exports = { { path: 'node_modules/ts-jest-mock-import-meta', options: { - metaObjectReplacement: { url: 'https://www.url.com' }, + metaObjectReplacement: { + url: 'https://www.url.com', + env: { + VITE_BACKEND_URL: 'http://localhost:8000/', + VITE_FRONTEND_URL: 'http://localhost:80', + VITE_CONTAINER_ORIGIN: 'http://localhost:8080/', + }, + }, }, }, ], From 0309d3e9ee11a7f17a860eebe52cde4ad69f547d Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 19 Jan 2026 10:38:47 -0800 Subject: [PATCH 3/3] fix: use sync.server.url instead of deprecated sync.server.origin Taskwarrior deprecated sync.server.origin in favor of sync.server.url. Updated the setup guide to use the new configuration option name. Co-Authored-By: Claude Opus 4.5 --- .../src/components/HomeComponents/SetupGuide/SetupGuide.tsx | 4 ++-- .../HomeComponents/SetupGuide/__tests__/SetupGuide.test.tsx | 2 +- .../HomeComponents/SetupGuide/__tests__/utils.test.ts | 2 +- frontend/src/components/HomeComponents/SetupGuide/utils.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/HomeComponents/SetupGuide/SetupGuide.tsx b/frontend/src/components/HomeComponents/SetupGuide/SetupGuide.tsx index 25fb8a37..5e75cb5d 100644 --- a/frontend/src/components/HomeComponents/SetupGuide/SetupGuide.tsx +++ b/frontend/src/components/HomeComponents/SetupGuide/SetupGuide.tsx @@ -74,8 +74,8 @@ export const SetupGuide = (props: Props) => { commands one block at a time { ).toBeInTheDocument(); expect( - screen.getByText('task config sync.server.origin https://test-container') + screen.getByText('task config sync.server.url https://test-container') ).toBeInTheDocument(); }); diff --git a/frontend/src/components/HomeComponents/SetupGuide/__tests__/utils.test.ts b/frontend/src/components/HomeComponents/SetupGuide/__tests__/utils.test.ts index f59241eb..21bf4a50 100644 --- a/frontend/src/components/HomeComponents/SetupGuide/__tests__/utils.test.ts +++ b/frontend/src/components/HomeComponents/SetupGuide/__tests__/utils.test.ts @@ -19,7 +19,7 @@ describe('exportConfigSetup', () => { ); expect(result).toContain( - `task config sync.server.origin ${url.containerOrigin}` + `task config sync.server.url ${url.containerOrigin}` ); expect(result).toContain(`task config sync.server.client_id ${props.uuid}`); diff --git a/frontend/src/components/HomeComponents/SetupGuide/utils.ts b/frontend/src/components/HomeComponents/SetupGuide/utils.ts index d53cdb60..9824e459 100644 --- a/frontend/src/components/HomeComponents/SetupGuide/utils.ts +++ b/frontend/src/components/HomeComponents/SetupGuide/utils.ts @@ -5,7 +5,7 @@ export function exportConfigSetup(props: Props): string { return [ 'Configure Taskwarrior with these commands, run these commands one block at a time', `task config sync.encryption_secret ${props.encryption_secret}`, - `task config sync.server.origin ${url.containerOrigin}`, + `task config sync.server.url ${url.containerOrigin}`, `task config sync.server.client_id ${props.uuid}`, 'For more information about how this works, refer to the task-sync(5) manpage for details on how to configure the new sync implementation.', ].join('\n');