📚 Encyclopedia

Tools & Workflow · updated 2026-10-13

Open-sourcing old proprietary code (scrub, rewrite history, modernize, publish)

gitgit-filter-repoopen-sourcesecretsangularfluttermigrationgithub

Publishing years-old company code means three separate jobs: remove every secret and internal identifier from the working tree and from all of git history, bring the toolchain up to something that builds today, and only then publish. In 2026-08 this was done for two recovered DCTI products: Call Accounting (ex-EdgeLink, Angular 9 + PHP call-reporting for Asterisk/FreePBX, published at github.com/justinemailone/call-accounting under MIT) and Trunkline (ex-Phone Manager, Flutter + PHP FreePBX manager, publish-ready but parked).

1. Confirm the target first

"The X one" can be ambiguous when sibling products share logos, DB files and servers. A plausible lineage inference ("EdgeLink was renamed to Phone Manager") cost three days of work on the wrong product. List the candidates and confirm, or look for direct evidence before starting a long pipeline.

2. Inventory what must go

Typical findings in a 2019 to 2021 codebase: - DB and SMTP passwords hard-coded in PHP config and utility files, and in READMEs. - Android release keystore plus key.properties, Firebase google-services.json / GoogleService-Info.plist. - Real customer data (voicemail WAVs). - Internal and public IP addresses, company hostnames and email addresses. - Old remotes (Bitbucket, GitLab).

In the working tree, replace them with configuration: build-time --dart-define values in Flutter, an INI file outside the web root for PHP secrets (with an example file committed), placeholders such as YOUR_SERVER_IP, relative API URLs, conditional application of the Google Services Gradle plugin so users bring their own Firebase.

3. Rewrite history on a separate clone

Work on a fresh clone so the original stays intact.

pip install --user --break-system-packages git-filter-repo
git clone orig publish && cd publish
git filter-repo --invert-paths --path android/key.jks --path android/key.properties --path android/app/google-services.json --path-glob 'vm/*.wav'
git filter-repo --replace-text ../replacements.txt     # lines like  literal-secret==>REDACTED
git filter-repo --mailmap ../mailmap                   # map old authors to the public identity
git branch -m master main; git remote -v               # filter-repo strips remotes; add the new one later
git log --all -p | grep -E 'secret1|secret2|internal-host' # must print nothing

Then add a LICENSE (MIT here) and a root README, and publish with gh repo create <name> --public --source=. --push.

4. Modernize so it builds

Angular 9.1 to 22 (Call Accounting): upgraded in place to the @angular/build application builder, TypeScript 6 (paths without baseUrl), Node 24 via nvm; standalone: false stamped on all 67 declarables because v19 flipped the default; library swaps (jsPDF 3 + autotable 5, ngx-avatars, ngx-charts 25); specs migrated to waitForAsync / TestBed.inject with real-module harnesses (94/94 green). npm install needed --legacy-peer-deps for an ngx-charts/cdk peer quirk.

Flutter 1.x to 3.41 (Trunkline): null-safety migration with a scratch Flutter 3.7.12 SDK running dart migrate --ignore-exceptions (the 2.19 migrator crashed on a mixin override), then manual fixes. Upgrades: bloc 9 (all mapEventToState converted to on<Event>), mocktail instead of mockito, current plugin majors. Old bloc tests were vacuous async* generators that always passed; rewritten as real tests (246/246). Android: Gradle 9 / AGP 9 / Kotlin 2.2 / Java 17, namespace set, desugaring, minSdk 24 / target 36, temporary compat shims for 2021-era plugins.

PHP: lint with PHP 8.3 (php -l over the tree); typical fixes are curly-brace string offsets ($s{0}), ${var} interpolation, and magic-quotes guards.

Gotchas

See also

Linked from

Sources: home memory project_call_accounting, project_trunkline, feedback_confirm_target_identity