Move NTFY_SERVER out of source into BuildConfig (hostname in a public repo) #23

Open
opened 2026-09-01 18:23:52 +00:00 by mohlec · 0 comments
Owner

NtfyPushService.kt hardcodes the push server hostname:

private const val NTFY_SERVER = "https://push.ncwcom.com"

This repo is public, so that hostname is readable by anyone. REPO-CONVENTIONS states that
public repos must not carry hostnames, usernames, internal IPs, domain names or credentials.

The fix already has a precedent in this file: c682c22b9 ("security: move ntfy credentials
out of source into BuildConfig") moved NTFY_USER and NTFY_PASS to BuildConfig, and the
server URL was simply left behind. Same treatment: read it from BuildConfig, supplied by the
build, with a placeholder default.

Filing this one separately because it has a clean, precedented fix. The others need decisions
rather than a patch, and are captured in scripts/internal-refs-baseline.txt:

  • assets/base/config.json -- default server URL plus the dev crash webhook (see #14). The
    PRD three-layer config split is the real answer here.
  • fastlane/.env.ncw -- Apple Developer and TestFlight account addresses, and an absolute path
    on the build Mac that names the account holder. Should come from CI secrets.
  • .forgejo/workflows/build-ios.yml, testflight-ios.yml, docs/ncw-ios-ci.md -- internal git
    host by name, and build-Mac home paths.

Happy to take any of those on if you want them prioritised.

`NtfyPushService.kt` hardcodes the push server hostname: ```kotlin private const val NTFY_SERVER = "https://push.ncwcom.com" ``` This repo is public, so that hostname is readable by anyone. REPO-CONVENTIONS states that public repos must not carry hostnames, usernames, internal IPs, domain names or credentials. The fix already has a precedent in this file: `c682c22b9` ("security: move ntfy credentials out of source into BuildConfig") moved `NTFY_USER` and `NTFY_PASS` to `BuildConfig`, and the server URL was simply left behind. Same treatment: read it from `BuildConfig`, supplied by the build, with a placeholder default. ### Related leaks in the same class Filing this one separately because it has a clean, precedented fix. The others need decisions rather than a patch, and are captured in `scripts/internal-refs-baseline.txt`: - `assets/base/config.json` -- default server URL plus the dev crash webhook (see #14). The PRD three-layer config split is the real answer here. - `fastlane/.env.ncw` -- Apple Developer and TestFlight account addresses, and an absolute path on the build Mac that names the account holder. Should come from CI secrets. - `.forgejo/workflows/build-ios.yml`, `testflight-ios.yml`, `docs/ncw-ios-ci.md` -- internal git host by name, and build-Mac home paths. Happy to take any of those on if you want them prioritised.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
slash/slash-mobile#23
No description provided.