basecamp / kamal

Deploy web apps anywhere.
https://kamal-deploy.org
MIT License
10.66k stars 410 forks source link

Add a simple validation to the service name to prevent setup issues #692

Closed nickhammond closed 7 months ago

nickhammond commented 7 months ago

Including dots in your service name is going to cause issues with traefik and initial Kamal setup.

This PR adds a simple regex to validate that the service name is alphanumeric and can include hyphens /^[a-z0-9-]+$/.

Feels a bit like overkill but just trying to ease everyone's first impression of Kamal to make it easier to get up and running.

Closes #671.

djmb commented 7 months ago

@nickhammond - I'm seeing this warning now, I guess we want to reverse the order of the - and _?

.../kamal/lib/kamal/configuration.rb:291: warning: character class has '-' without escape: /^[a-z0-9-_]+$/
nickhammond commented 7 months ago

@djmb Fixed in #708, sorry about that.