infogulch / todos

3 stars 0 forks source link

config fails on latest caddy #1

Open gedw99 opened 5 months ago

gedw99 commented 5 months ago

Hey @infogulch

I am using github.com/caddyserver/caddy/v2/cmd/caddy latest with xtemplate compiled in.

CADDY_CMD_NAME=caddy-cmd
go build -o $(BIN_ROOT)/$(CADDY_CMD_NAME) .
package main

import (
    caddycmd "github.com/caddyserver/caddy/v2/cmd"
    //_ "github.com/hairyhenderson/caddy-teapot-module"
    _ "github.com/infogulch/xtemplate"
)

func main() {
    caddycmd.Main()
}

but for todos I get:

cd todos && caddy-cmd run --config Caddyfile
2024/04/29 03:57:40.135 INFO    using provided configuration    {"config_file": "Caddyfile", "config_adapter": ""}
Error: unrecognized config adapter: caddyfile

I think this changed with latest caddy... Need to check..

caddy --config Caddyfile is def old though as in readme...

gedw99 commented 5 months ago

its my fault

cd todos && caddy-cmd list-modules
admin.api.load
caddy.config_loaders.http
caddy.logging.writers.discard
caddy.logging.writers.stderr
caddy.logging.writers.stdout

  Standard modules: 5

  Non-standard modules: 0

  Unknown modules: 0
infogulch commented 5 months ago

You'll want to import xtemplate-caddy like

import _ "github.com/infogulch/xtemplate-caddy"
gedw99 commented 5 months ago

I tried that but got compile errors.

I can submit the code if you want of post the errors ?

infogulch commented 5 months ago

Yes well I haven't updated xtemplate-caddy to reference the new xtemplate config yet, that's probably what needs fixed first. There may be other issues as well.

gedw99 commented 5 months ago

I think that’s it.

I am on mobile at the moment and can’t copy paste the 8 or some compile errors ..

the main.go is very simple. If you want it let me know.