Caddyext install hugo, cors, upload

Hello,
I am trying to create my own caddy with addons. But I am getting the following error

`cors` added to Caddy.
`git` added to Caddy.
`ipfilter` added to Caddy.
`jsonp` added to Caddy.
`jwt` added to Caddy.
`mailout` added to Caddy.
`prometheus` added to Caddy.
`realip` added to Caddy.
`search` added to Caddy.
`upload` added to Caddy.
`hugo` added to Caddy.
prometheus successfully moved.

`caddyext build` error: exit status 2
Usage:
  caddyext build [output path] [flags]

This is how I am building it

 go get -tags=$CADDY_VERSION github.com/mholt/caddy
 go get github.com/caddyserver/caddyext
 caddyext install cors:github.com/captncraig/cors
 caddyext install git:github.com/abiosoft/caddy-git
 caddyext install ipfilter:github.com/pyed/ipfilter
 caddyext install jsonp:github.com/pschlump/caddy-jsonp
 caddyext install jwt:github.com/BTBurke/caddy-jwt
 caddyext install mailout:github.com/SchumacherFM/mailout
 caddyext install prometheus:github.com/miekg/caddy-prometheus
 caddyext install realip:github.com/captncraig/caddy-realip
 caddyext install search:github.com/pedronasser/caddy-search 
 caddyext install upload:github.com/wmark/caddy.upload
 caddyext install hugo:github.com/hacdias/caddy-hugo
 caddyext move prometheus 0
 caddyext build

I am not sure where to start debugging for this.

It looks like errors are recorded but not displayed - if you change the second highlighted line to cmd.Stderr = os.Stderr we might have more information. Also set cmd.Stdout = os.Stdout just in case.

I did the change

With upload the error is

caddy/directives.go:5:2: code in directory /home/mohan/project/go/src/github.com/wmark/caddy.upload expects import "blitznote.com/src/caddy.upload"

`caddyext build` error: exit status 1
Usage:
  caddyext build [output path] [flags]

With cors

caddy/directives.go:58: undefined: cors.Setup

`caddyext build` error: exit status 2
Usage:
  caddyext build [output path] [flags]

with hugo

../../hacdias/caddy-hugo/hugo.go:18:2: no buildable Go source files in /home/mohan/project/go/src/github.com/hacdias/caddy-hugo/routes/assets

`caddyext build` error: exit status 1
Usage:
  caddyext build [output path] [flags]

Got it for cors and upload
with upload the the install should be caddyext install upload:blitznote.com/src/caddy.upload
and with cors caddyext install cors:github.com/captncraig/cors/caddy

Ah, gotcha. For hugo, that is not actually an error, it is more like a notice. It’s too bad it exits with status 1, but that’s a Go tool issue.

Does the custom binary still appear? I don’t see a reason why it should not…

With that error custom binary did appear.
After looking at Can't build caddy hugo with latest caddy src · Issue #67 · filebrowser/filebrowser · GitHub
I managed to fix it with

cd $GOPATH/src/github.com/hacdias/caddy-hugo
go generate

then run

caddyext build
1 Like

/cc @abiosoft - let’s keep these kinds of things in mind as you write the new caddy tool.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.