mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-10-27 23:30:40 +01:00
e6465645b9
Stalwart v1.0.0 (26 Oct 2026) ships a new data store layout, so v0.16.x deployments cannot be upgraded in place. Data has to be copied into a new, empty v1 store with stalwartlabs/stalwart-migrate, which requires v0.16.27 as its source version and needs an interactive prepare step plus an offline final cutover. The update path pulled "latest" and would have swapped the binary for v1 on existing containers, leaving the mail server unable to start on its old store. Pin install and update to v0.16.27 instead and surface the reason through check_for_gh_release. Containers that already pulled v1.0.0 are put back on v0.16.27 by the next update run.
63 lines
1.6 KiB
Bash
63 lines
1.6 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
|
# Author: MickLesk (CanbiZ)
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://github.com/stalwartlabs/stalwart
|
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
|
color
|
|
verb_ip6
|
|
catch_errors
|
|
setting_up_container
|
|
network_check
|
|
update_os
|
|
|
|
fetch_and_deploy_gh_release "stalwart" "stalwartlabs/stalwart" "prebuild" "v0.16.27" "/opt/stalwart" "stalwart-$(arch_resolve x86_64 aarch64)-unknown-linux-gnu.tar.gz"
|
|
chmod +x /opt/stalwart/stalwart
|
|
|
|
msg_info "Configuring Stalwart"
|
|
mkdir -p /opt/stalwart_data/{etc,data,logs}
|
|
cat <<EOF >/opt/stalwart_data/etc/stalwart.env
|
|
# Uncomment and edit an entry to override its default.
|
|
# Apply changes with: systemctl restart stalwart
|
|
|
|
#STALWART_HOSTNAME=mail.example.com
|
|
#STALWART_PUBLIC_URL=https://mail.example.com
|
|
#STALWART_RECOVERY_MODE=true
|
|
#STALWART_RECOVERY_ADMIN=admin:changeme
|
|
EOF
|
|
chmod 600 /opt/stalwart_data/etc/stalwart.env
|
|
msg_ok "Configured Stalwart"
|
|
|
|
msg_info "Creating Service"
|
|
cat <<EOF >/etc/systemd/system/stalwart.service
|
|
[Unit]
|
|
Description=Stalwart Mail Server
|
|
Conflicts=postfix.service sendmail.service exim4.service
|
|
Wants=network-online.target
|
|
After=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=root
|
|
WorkingDirectory=/opt/stalwart_data
|
|
EnvironmentFile=-/opt/stalwart_data/etc/stalwart.env
|
|
ExecStart=/opt/stalwart/stalwart --config=/opt/stalwart_data/etc/config.json
|
|
LimitNOFILE=65536
|
|
KillMode=process
|
|
KillSignal=SIGINT
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
SyslogIdentifier=stalwart
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
systemctl enable -q --now stalwart
|
|
msg_ok "Created Service"
|
|
|
|
motd_ssh
|
|
customize
|
|
cleanup_lxc
|