cli icon indicating copy to clipboard operation
cli copied to clipboard

Suggested site names may have illegal-length domains

Open ascorbic opened this issue 3 years ago • 5 comments
trafficstars

Describe the bug

The pattern used for generating default site names can lead to it generating domains that cannot be resolved as they are too long. According to RFC 1035, a label may be up to 63 characters long. The longest template is netlify-thinks-${slug}-is-great${suffix}, where suffix is six characters and slug is the slugified username, so can be arbitrarily long. When generating a deploy preview, a 24 character hash is prepended. This means that any username that is over 6 characters will lead to a domain that is too long.

Related: #4630

Steps to reproduce

  • generate a site using ntl sites:create
  • choose the default site name
  • run ntl deploy
  • observe length of domain, and see that it won't resolve

Configuration

No response

Environment


  System:
    OS: macOS 11.6.4
    CPU: (8) arm64 Apple M1
    Memory: 74.05 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.22.15 - ~/.nvm/versions/node/v16.14.2/bin/yarn
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
    Watchman: 2021.06.07.00 - /opt/homebrew/bin/watchman
  npmGlobalPackages:
    netlify-cli: 10.3.1

ascorbic avatar May 30 '22 09:05 ascorbic

Cross-linking these as they are related issues:

https://github.com/netlify/product/issues/743 https://github.com/netlify/bitballoon/issues/5996

overlordofmu avatar Jun 03 '22 00:06 overlordofmu

@ascorbic Is there some public dependency which Netlify uses for its standard site name pattern as mentioned in https://github.com/netlify/cli/issues/4630 ?

If yes, I can pick https://github.com/netlify/cli/issues/4630 & this issue up.

tinfoil-knight avatar Jul 18 '22 19:07 tinfoil-knight

Related issue: https://github.com/netlify/cli/issues/4503

tinfoil-knight avatar Jul 26 '22 14:07 tinfoil-knight

There is also a PR for this (or at least parts) already: https://github.com/netlify/cli/pull/4553

danez avatar Aug 10 '22 17:08 danez

@danez that's related, but different. This issue is about auto-generated names, rather than user-specified ones

ascorbic avatar Aug 10 '22 18:08 ascorbic