Commit Graph
9 Commits
Author SHA1 Message Date
Lauri Ojansivu 1173d0a51d Raise Caddy's open-file limit in the snap at every start.
snapcraft has no per-app ulimit key and snapd owns the systemd unit, but
a process may always raise its own soft open-file limit up to the hard
one without privilege. The snap's Caddy service now does that before it
starts Caddy, every time, which is what makes it persist across
restarts and refreshes. CADDY_NOFILE may ask for a lower number; it is
capped at the hard limit, a non-number is ignored, and a failure to
raise is logged without stopping Caddy.

tests/snapCaddyNofile6552.test.cjs runs the helper in bash with a
lowered limit. It has not been run inside an installed snap here.

Thanks to xet7 !

Fixes #6552.
2026-10-02 17:15:23 +03:00
xet7 748fd2d391 Snap: migrate Caddyfile v1 -> v2 format when caddy is enabled
When upgrading from an old WeKan snap, $SNAP_COMMON/Caddyfile may still be in
Caddy v1 format, which Caddy 2 cannot parse (so caddy would fail to start).
caddy-control now runs migrate-caddyfile-v1-to-v2.sh before 'caddy run' when
caddy is enabled. It is safe: a no-op if the file already parses as Caddy 2;
otherwise it backs up the original, converts the common v1 directives (drop the
http:// scheme, 'proxy / TARGET' -> 'reverse_proxy TARGET', drop the v1
'websocket'/'transparent' presets that Caddy 2 does by default, 'gzip' ->
'encode gzip'), validates the result with 'caddy adapt', and only keeps it if
valid — falling back to the shipped Caddy 2 template otherwise, so caddy always
starts with valid config.

Thanks to xet7.
2026-07-10 22:57:39 +03:00
Lauri Ojansivu 1a998f9ece Try to fix Parallel Snap paths.
Thanks to xet7 !
2026-05-10 04:54:05 +03:00
Lauri Ojansivu ae01ea576c Snap: Migrate MongoDB from 3 to 7 only when "snap set wekan migrate-mongodb='true'". Not automatically.
Thanks to xet7 !
2025-10-11 07:42:51 +03:00
Lauri Ojansivu 6526d99123 Upgraded Snap Candidate to have base core24, MongoDB 7 and Caddy 2.
Thanks to xet7 !
2025-06-26 05:39:37 +03:00
Lauri Ojansivu d50e78c787 - Snap Caddy: set -agree flag for Let's Encrypt.
Thanks to halunk3 and xet7 !
2018-07-13 02:07:56 +03:00
Ondrej Kubik fd47e10e52 Tuning services life cycle
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2018-02-22 13:14:03 +00:00
Ondrej Kubik 9966c19f94 Fixing wrong caddy file path
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2018-02-21 22:29:24 +00:00
Ondrej Kubik e077c85d00 Adding caddy support
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2018-02-21 22:29:23 +00:00