caddy icon indicating copy to clipboard operation
caddy copied to clipboard

Added special case support for caddyfile suffix, case insensitive

Open omalk98 opened this issue 2 years ago • 2 comments

Description

  • Added case insensitive support for special prefix case Caddyfile
  • Added support for .caddyfile suffix, also case insensitive
  • Handles extension check without case sensitivity

References issue #5909

omalk98 avatar Oct 27 '23 21:10 omalk98

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 27 '23 21:10 CLAassistant

I think this can open up an interesting path for automation. What if the registered modules provide a static list of file extensions in its interface that they are able to handle? Like yaml and yml, mysql and sql, etc. This could allow bypassing the adapter flag when a known file extension is used. What are your thoughts on this? I'm willing to open up some pull requests in the adapter modules to support this.

All the best with your new baby!

omalk98 avatar Dec 14 '23 17:12 omalk98

@omalk98 Whew, finally starting to go through my backlog. Anyway, that is interesting; I guess each adapter would just have to add a line of code to register its known file extension(s). That sounds like a good idea though, should help reduce frustrations if forgetting to use the --adapter flag. I'd be open to this!

mholt avatar Mar 07 '24 02:03 mholt

@omalk98 I fixed a panic when the config file has no extension (slice access of [1:0]) in e1f4b83.

mholt avatar Apr 11 '24 23:04 mholt