Repository navigation
Require a domain-like host for sites on managed instances - #143
Merged
Merged
Conversation
A single-word host such as afaridar can never match the tracker. When SUPERMETRY_MANAGED is set, new hosts must contain a dot (localhost and IP addresses stay allowed). Hosts a site already stores are not re-checked. The new-site form and site settings show the same hint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A user on production created a site whose only host was
afaridar. The tracker can never match a single-word host, so the site stayed at 0 events.Decision: the rule applies only when
SUPERMETRY_MANAGEDis true. Self-hosters keep intranet names such aswiki.example.com,blog.example.co.uk,*.example.com).localhostand IPv4 addresses stay allowed for testing. IPv6 was already rejected by the existing validator.host "afaridar" is not a domain: use something like example.com./auth/configreports managed. The form checks before submitting. Self-hosted forms are unchanged. Strings are translated in de, es and bn.Sites.SetRequireDomain, set fromcfg.Managedin serve.go.Tests: table tests (managed vs not, wildcard, localhost, IPs, case and whitespace), an update-unchanged DB test, an HTTP 400 test, and web tests. The full
go test ./... -count=1 -p 2run passed, as did web typecheck andbun run test.Cloud: its demo site uses
CLOUD_DEMO_HOST, defaultdemo.supermetry.com, which is fine. Its config only checks for a valid host name, so an operator could set a single-label value; the demo site is only created when absent.