Caddy json schema plugin: auth json not available

Hey! :slight_smile:

So I came across this thread Getting a better experience with JSON/YAML configuration and wanted to try out the plugin myself.

Then I ran into an issue when using it. As far as I can tell there seems to be a problem when fetching the json schema.

/caddy-custom json-schema --vscode --indent 4
json-schema cached docs not found for root config.
json-schema fetching https://caddyserver.com/api/docs/config/ ...
json-schema
json-schema cached docs not found for apps/exec.
json-schema fetching https://caddyserver.com/api/docs/config/apps/exec ...
json-schema
json-schema cached docs not found for apps/supervisor.
json-schema fetching https://caddyserver.com/api/docs/config/apps/supervisor ...
json-schema
json-schema cached docs not found for apps/http.
json-schema fetching https://caddyserver.com/api/docs/config/apps/http ...
json-schema
json-schema cached docs not found for apps/pki.
json-schema fetching https://caddyserver.com/api/docs/config/apps/pki ...
json-schema
json-schema cached docs not found for apps/tls.
json-schema fetching https://caddyserver.com/api/docs/config/apps/tls ...
json-schema
json-schema cached docs not found for apps/auth.
json-schema fetching https://caddyserver.com/api/docs/config/apps/auth ...
json-schema
json-schema: unexpected end of JSON input
curl -v https://caddyserver.com/api/docs/config/apps/auth
*   Trying 2604:a880:2:d0::21b0:6001:443...
* TCP_NODELAY set
* Connected to caddyserver.com (2604:a880:2:d0::21b0:6001) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=caddyserver.com
*  start date: Nov  9 12:27:01 2021 GMT
*  expire date: Feb  7 12:27:00 2022 GMT
*  subjectAltName: host "caddyserver.com" matched cert's "caddyserver.com"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x559be48ade30)
> GET /api/docs/config/apps/auth HTTP/2
> Host: caddyserver.com
> user-agent: curl/7.68.0
> accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
< HTTP/2 502
< server: Caddy
< content-length: 0
< date: Sun, 19 Dec 2021 17:17:23 GMT
<
* Connection #0 to host caddyserver.com left intact

There is an open issue over at the repo which hosts the plugin unexpected end of JSON input · Issue #7 · abiosoft/caddy-json-schema · GitHub

Knowing Christmas is right around the corner and this isn’t super critical, maybe this is something which could be easily fixed next year? :slight_smile:

I think this was caused by the auth app being renamed, or something like that.

What plugins are you using?

I tried it with those:

$ xcaddy build v2.4.6 \
    --with github.com/abiosoft/caddy-json-schema \
    --with github.com/caddy-dns/cloudflare \
    --with github.com/mholt/caddy-l4 \
    --with github.com/mholt/caddy-ratelimit \
--output caddy-custom

This topic was automatically closed after 30 days. New replies are no longer allowed.