Description
The GitHub repository owner and repo name appear hardcoded in two separate locations in src/main/updater.ts:
// src/main/updater.ts — line ~50-51
const owner = "shivanshshrivas";
const repo = "tempdlm";
// src/main/updater.ts — line ~127 (shell:open-external allowlist)
url.startsWith("https://github.com/shivanshshrivas/tempdlm/")
These strings also appear in package.json's build.publish config. If the repository is ever transferred, renamed, or forked, these values silently diverge. Specifically:
- Auto-update checks would continue hitting the original repo's release feed.
- The
shell:open-external URL allowlist would silently reject links from the new repo URL.
Recommended fix:
Add a single REPO constant to src/shared/types.ts:
// ── Repository ────────────────────────────────────────────────────────────────
/**
* GitHub repository coordinates. Single source of truth for owner, repo name,
* and origin URL — used by the updater and the shell:open-external allowlist.
*/
export const REPO = {
owner: "shivanshshrivas",
repo: "tempdlm",
origin: "https://github.com/shivanshshrivas/tempdlm/",
} as const;
Then in src/main/updater.ts, replace the two hardcoded occurrences:
import { REPO } from "../shared/types";
// Line ~50-51:
const owner = REPO.owner;
const repo = REPO.repo;
// Line ~127:
url.startsWith(REPO.origin)
Files to modify:
src/shared/types.ts — add REPO constant export in a new // ── Repository sub-section.
src/main/updater.ts — import REPO and replace the two hardcoded string sites.
Docs to update as part of this fix:
docs/security.md §7 "Auto-Update Security" — update the code snippet showing the shell:open-external allowlist check to reference the REPO.origin constant, and note that the allowlist value is the canonical REPO constant from src/shared/types.ts.
Description
The GitHub repository owner and repo name appear hardcoded in two separate locations in
src/main/updater.ts:These strings also appear in
package.json'sbuild.publishconfig. If the repository is ever transferred, renamed, or forked, these values silently diverge. Specifically:shell:open-externalURL allowlist would silently reject links from the new repo URL.Recommended fix:
Add a single
REPOconstant tosrc/shared/types.ts:Then in
src/main/updater.ts, replace the two hardcoded occurrences:Files to modify:
src/shared/types.ts— addREPOconstant export in a new// ── Repositorysub-section.src/main/updater.ts— importREPOand replace the two hardcoded string sites.Docs to update as part of this fix:
docs/security.md§7 "Auto-Update Security" — update the code snippet showing theshell:open-externalallowlist check to reference theREPO.originconstant, and note that the allowlist value is the canonicalREPOconstant fromsrc/shared/types.ts.