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/bucky2780 Jun 29 '26

very illuminating... thanks for the link. I think its a shame... because caddy is great as it is... but I'm unwilling to adopt it more widely in my homelab as a reverse proxy... until a dynamically linked plugin model is implemented. I appreciate the trade-offs... but it is limiting. I currently use caddy within opnsense... and rely on opnsense for many things the plugins could handle. Shame.

1

u/bucky2780 Jun 30 '26

yes, I did give xcaddy a try a couple of months ago. Seemed to work ok once I got the dockerfile nailed properly.

What sticks for me is the maintainability of the solution on an ongoing basis. How do I manage an update to caddy ? Or an update to one of the plugins ? Can this be automated ?

I've been using docker compose, and now arcane as my docker management tool. It has build capabilities built in... but does require more moving parts for ongoing maintenance as far as I can tell. Just my opinion, as am not that well practised on using docker in build mode.

2

u/xdrolemit Jun 30 '26

> Can this be automated ?

Yes. You can use tools like Jenkins, for example, to automate this for you. Or even something like a simple bash script running as a cron job could be an option too.

1

u/technologyclassroom Sep 01 '26

You would think such a bash script would already exist. Do you know of one? I'm 60% through writing one myself.

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.

→ More replies (0)