omniosorg / omnios-extra

Packages for OmniOS extra
https://omnios.org
Other
26 stars 58 forks source link

caddy: add version 2.7.6 to extra.omnios #1411

Closed gkoh closed 7 months ago

gkoh commented 7 months ago

Add v2.7.6 of the Caddy web server.

Add patch to fix Solaris-derivative build. Comes from caddy master:76611fa15079b755ddf3c859ae2ea0ad2123223f and this PR 6021: https://github.com/caddyserver/caddy/pull/6021

gkoh commented 7 months ago

The SmartOS pkgsrc repository dropped caddy for some reason, so I've opted to add it to the OmniOS extra IPS instead.

gkoh commented 7 months ago

Thank you very much for your contribution. This looks good so far. However, since this is a service we should provide an SMF service manifest. Have a look at other stuff in omnios-extra that provides a service manifest.

Let me know if you get stuck or have questions and we can help getting this done and integrated.

Done! Thank you for the initial review. I selected a random available uid/gid from doc/idlist.md, this could well reuse webservd though.

gkoh commented 7 months ago

Done! Thank you for the initial review. I selected a random available uid/gid from doc/idlist.md, this could well reuse webservd though.

Yeah, I think re-using webservd would be a good idea (like we do for apache). Given we are limited to IDs below 100 for service accounts we should not allocate new ones if not necessary.

I have made this change locally, but not sure how to proceed. If I add the webservd uid/gid in the caddy pkg, it results in conflicts with the apache pkg. If I don't add the webservd uid/gid, then it requires apache to be installed just to have the uid/gid present.

Can you recommend a way forward? (I couldn't find a way to optionally create a user).

hadfl commented 7 months ago

Can you recommend a way forward? (I couldn't find a way to optionally create a user).

So the way forward is to create a meta package that will ship the user/group, then make apache and caddy depend on it. We do this already for nginx as we ship multiple versions there. We'd have to do this anyway for webservd once we ship another apache version.

I quickly prepared a commit (untested) that should show you the principle. Feel free to copy whatever you need from it: https://github.com/hadfl/omnios-extra/commit/544e1ba5d44d9365b88cbe049424843d3cea37fd

gkoh commented 7 months ago

Can you recommend a way forward? (I couldn't find a way to optionally create a user).

So the way forward is to create a meta package that will ship the user/group, then make apache and caddy depend on it. We do this already for nginx as we ship multiple versions there. We'd have to do this anyway for webservd once we ship another apache version.

I quickly prepared a commit (untested) that should show you the principle. Feel free to copy whatever you need from it: hadfl@544e1ba

Aha, thank you for that. I have updated, but it is untested.

How does one build this meta package for testing?

hadfl commented 7 months ago

How does one build this meta package for testing?

You can use buildctl in the build directory to build any package (including meta packages). In this case: ./buildctl build webservd-common

gkoh commented 7 months ago

How does one build this meta package for testing?

You can use buildctl in the build directory to build any package (including meta packages). In this case: ./buildctl build webservd-common

Perfect, thanks. Done and tested, confirmed working as expected.