Skip to content

fix(enterprise): correct domainSquattingEnabled replacement pattern in Setup script - #178

Closed
bmsimp wants to merge 12 commits into
CyberDrain:devfrom
bmsimp:dev
Closed

bmsimp wants to merge 12 commits into
CyberDrain:devfrom
bmsimp:dev

Conversation

@bmsimp

@bmsimp bmsimp commented Sep 14, 2026

Copy link
Copy Markdown
Member

Problem

Setup-Windows-Chrome-and-Edge.ps1 searches the downloaded templates for

$domainSquattingEnabled = 1 #

but both Deploy-Windows-Chrome-and-Edge.ps1 and Detect-Windows-Chrome-and-Edge.ps1 ship the setting as = 0 #.

Apply-Replacements matches with String.Contains, so the lookup misses, the pattern lands in $missing, and the script throws before writing any output files:

Failed to customize the Deploy template; the following expected pattern(s) were not found:
  - $domainSquattingEnabled = 1 #
The upstream template format may have changed.

This fails for every user regardless of the answers given at the prompts — it is the only one of the 23 patterns that does not match. Since $baseUrl is pinned to refs/heads/main, the templates are always fetched from main, so no local copy of Setup can work around it.

Fix

One line: correct the search pattern to = 0 # so it matches what the templates actually ship.

Verification

Ran the full replacement block from the fixed Setup against the current Deploy and Detect templates:

  • 23/23 patterns match in both templates — zero misses.
  • Both generated scripts parse with 0 errors, tested with awkward values (apostrophes in companyName and cippTenantId, wildcards in urlAllowlist, multi-element webhookEvents). Quote escaping via Format-SingleQuoted / Format-ArrayLiteral is correct.
  • Setting coverage is complete and symmetric: every setting Setup prompts for is written by Deploy and verified by Detect, including the domainSquatting, urlAllowlist, customBranding, genericWebhook and genericWebhook\events subkeys and the browser-specific toolbar property. Nothing is written-but-unchecked or checked-but-unwritten.

No changes to Deploy, Detect or Remove.

🤖 Generated with Claude Code

pull Bot added 12 commits April 24, 2026 16:19
[pull] dev from CyberDrain:dev
[pull] dev from CyberDrain:dev
[pull] dev from CyberDrain:dev
[pull] dev from CyberDrain:dev
[pull] dev from CyberDrain:dev
[pull] dev from CyberDrain:dev
[pull] dev from CyberDrain:dev
[pull] dev from CyberDrain:dev
[pull] dev from CyberDrain:dev
[pull] dev from CyberDrain:dev
[pull] dev from CyberDrain:dev
[pull] dev from CyberDrain:dev
Copilot AI lite review requested due to automatic review settings September 14, 2026 13:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@bmsimp

bmsimp commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

Closing — opened against a stale local upstream/dev ref. The fix (c90973b) is already on CyberDrain/dev via #175, so this PR is empty.

@bmsimp bmsimp closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants