abiosoft/caddy-yaml

module name 'zstd': module value cannot be null

rahilarious opened this issue · 0 comments

Config in YAML:

apps:
  http:
    servers:
      srv0:
        listen:
          - ":443"
        routes:
          - match:
              - host:
                  - sub.example.com
          - handle:
              - handler: encode                                                                                  
                encodings:
                  gzip:
                    level: 9
                  zstd:
                prefer:
                  - zstd
                  - gzip
              - handler: file_server
          - terminal: true
...

Problem:

The YAML adapter translates this line zstd: into JSON "zstd": null resulting in the error.

Fix:

Translating it into "zstd": {} fixes it.
So either config adapter needs to not output it null or caddy needs to load module even if its null.

Workaround:

For now I'm replacing it with this line which is basically JSON in yaml which defeats the purpose of using YAML config
encodings: { gzip: {level: 9}, zstd: {} }