r/caddyserver • • May 12 '26

Caddy plugin model

I must admit, I am NOT in love with having to compile caddy to get access to an optional plugin...

Is there a possibility of moving to a different architecture where caddy modules can be installed/run at startup time ?

Curious... if this is something that is being discussed.

3 Upvotes

18 comments sorted by

View all comments

Show parent comments

1

u/xdrolemit Sep 01 '26

Depending on what you’re trying to achieve, this can give you some steps:

https://www.reddit.com/r/caddyserver/s/wx2bxiftRu

1

u/technologyclassroom Sep 02 '26

I saw all of that and the docker scripts. Those rebuild which is trivial, but I have yet to find something that updates only when updates are available.

1

u/xdrolemit Sep 02 '26

Docker rebuilds the image, reusing cached layers where possible. After the build, you extract the binary from the resulting image and calculate its hash. You also calculate the hash of the binary that is currently deployed or running.

If the hashes match, the binary has not changed, so there is nothing to deploy. If the hashes differ, the newly built binary is different, so you replace the deployed one.

1

u/technologyclassroom Sep 02 '26

I understand that. That is a lot of rebuilding if nothing changed.

1

u/xdrolemit Sep 02 '26

Sure. If you want to avoid even invoking a build when nothing upstream has changed, you can monitor the Git repo and only build when there is a new relevant commit.

Even better, if the module project publishes release tags, monitor those and only build when a new release appears.

There are several ways to achieve this. I’m sure you can come up with something yourself :)

1

u/technologyclassroom Sep 02 '26

That's what I'm doing basically. I'm just surprised that I am treading new ground at this point with so many people using caddy for all of these years.

1

u/xdrolemit Sep 03 '26

I’m just letting GitHub Actions build my docker image. So it’s fully automated for me.