clach04 / ha_weblink

Home Assistant weblink extractor and generator, simple dashboard generator
Apache License 2.0
0 stars 0 forks source link

Caddyfile to yaml file converter #6

Open clach04 opened 1 year ago

clach04 commented 1 year ago

Possible with docker-compose.yml / Dockerfile scanning?

Primary focus would be Caddyfile. Would not need a complete parser.

  1. handle multilines?
  2. fine {} and the bit before

partially grep hack:

cat Caddyfile | grep http | grep -- {

one line per "host" / URL:

cat Caddyfile | grep -v '^#' | grep http | grep -- {| sed -e 's/{//g' | sed -e 's/,/\n/g' | sed -e 's/ //g'   
clach04 commented 1 year ago

Discovered https://github.com/samcro1967/docker-compose-ports-dump which was created a day after this issue was opened! This scans docker-compose.yml (ONLY, i.e. no Caddy support).