Upgraded Snap Candidate to have base core24, MongoDB 7 and Caddy 2.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2025-06-26 05:39:37 +03:00
parent 1b44c848ad
commit 6526d99123
4 changed files with 107 additions and 79 deletions

View file

@ -1,18 +1,29 @@
http://:8080
proxy / localhost:3001 {
websocket
transparent
# Caddy 2 configuration for Wekan
:8080 {
# Reverse proxy to Wekan
reverse_proxy localhost:3001 {
# Enable WebSocket support
header_up Connection {>Connection}
header_up Upgrade {>Upgrade}
}
}
## SSL/TLS example. Firefox Inspect Console does not support http/2, so turning it off
## so that Firefox would not show wss websocket errors. Chrome console supports http/2.
#
#wekan.example.com {
# SSL/TLS example with HTTP/2 disabled for Firefox WebSocket compatibility
# Uncomment and customize for your domain
#{$DOMAIN:wekan.example.com} {
# # Enable TLS but use HTTP/1.1 protocol
# tls {
# alpn http/1.1
# protocols tls1.2 tls1.3
# }
# proxy / localhost:3001 {
# websocket
# transparent
# # Force HTTP/1.1
# protocols h1
#
# # Reverse proxy to Wekan
# reverse_proxy localhost:3001 {
# # Enable WebSocket support
# header_up Connection {>Connection}
# header_up Upgrade {>Upgrade}
# }
#}
#}

View file

@ -1,10 +1,13 @@
#!/bin/bash
# get wekan/mongo settings
# Get wekan/mongo settings
source $SNAP/bin/wekan-read-settings
if [ "$CADDY_ENABLED" = "true" ]; then
env LC_ALL=C caddy -conf=$SNAP_COMMON/Caddyfile -host=localhost:${CADDY_PORT} -agree
# Use Caddy 2 command format
# The 'host' option is no longer needed in Caddy 2
# The 'agree' option is no longer needed as Caddy 2 doesn't prompt for EULA
env LC_ALL=C caddy run --config $SNAP_COMMON/Caddyfile
else
echo "caddy is disabled. Stop service"
snapctl stop --disable ${SNAP_NAME}.caddy

View file

@ -102,18 +102,18 @@ if [ -z "${MONGO_URL}" ]; then
if [ "syslog" == "${MONGO_LOG_DESTINATION}" ]; then
echo "Sending mongodb logs to syslog"
mongod --dbpath ${SNAP_COMMON} --syslog --journal ${BIND_OPTIONS} --quiet
mongod --dbpath ${SNAP_COMMON} --syslog ${BIND_OPTIONS} --quiet
exit 0
fi
if [ "snapcommon" == "${MONGO_LOG_DESTINATION}" ]; then
echo "Sending mongodb logs to $SNAP_COMMON"
mongod --dbpath ${SNAP_COMMON} --logpath ${SNAP_COMMON}/mongodb.log --logappend --journal ${BIND_OPTIONS} --quiet
mongod --dbpath ${SNAP_COMMON} --logpath ${SNAP_COMMON}/mongodb.log --logappend ${BIND_OPTIONS} --quiet
fi
if [ "devnull" == "${MONGO_LOG_DESTINATION}" ]; then
echo "Sending mongodb logs to /dev/null"
mongod --dbpath ${SNAP_COMMON} --logpath /dev/null --journal ${BIND_OPTIONS} --quiet
mongod --dbpath ${SNAP_COMMON} --logpath /dev/null ${BIND_OPTIONS} --quiet
fi
#echo "mongodb log destination: ${MONGO_LOG_DESTINATION}" >> "${SNAP_COMMON}/settings.log"
@ -138,17 +138,17 @@ else
if [ "syslog" == "${MONGO_LOG_DESTINATION}" ]; then
echo "Sending mongodb logs to syslog"
mongod --dbpath ${SNAP_COMMON} --syslog --journal ${MONGO_URL} --quiet
mongod --dbpath ${SNAP_COMMON} --syslog ${MONGO_URL} --quiet
fi
if [ "snapcommon" == "${MONGO_LOG_DESTINATION}" ]; then
echo "Sending mongodb logs to ${SNAP_COMMON}"
mongod --dbpath ${SNAP_COMMON} --logpath ${SNAP_COMMON}/mongodb.log --logappend --journal ${MONGO_URL} --quiet
mongod --dbpath ${SNAP_COMMON} --logpath ${SNAP_COMMON}/mongodb.log --logappend ${MONGO_URL} --quiet
fi
if [ "devnull" == "${MONGO_LOG_DESTINATION}" ]; then
echo "Sending mongodb logs to /dev/null"
mongod --dbpath ${SNAP_COMMON} --logpath /dev/null --journal ${MONGO_URL} --quiet
mongod --dbpath ${SNAP_COMMON} --logpath /dev/null ${MONGO_URL} --quiet
fi
# Disable MongoDB telemetry and free monitoring