Files
ProxmoxVE/install/listmonk-install.sh
T

52 lines
1.4 KiB
Bash
Raw Normal View History

2024-11-24 17:59:23 +01:00
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
2024-11-24 17:59:23 +01:00
# Author: bvdberg01
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://listmonk.app/ | Github: https://github.com/knadh/listmonk
2024-11-24 17:59:23 +01:00
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
2024-11-24 17:59:23 +01:00
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
2025-07-31 18:58:19 +02:00
PG_VERSION="17" setup_postgresql
2024-11-24 17:59:23 +01:00
PG_DB_NAME="listmonk" PG_DB_USER="listmonk" setup_postgresql_db
2024-11-24 17:59:23 +01:00
fetch_and_deploy_gh_release "listmonk" "knadh/listmonk" "prebuild" "latest" "/opt/listmonk" "listmonk*linux_$(arch_resolve).tar.gz"
2024-11-24 17:59:23 +01:00
2025-07-31 18:58:19 +02:00
msg_info "Configuring listmonk"
mkdir -p /opt/listmonk/uploads
2024-11-24 17:59:23 +01:00
$STD /opt/listmonk/listmonk --new-config --config /opt/listmonk/config.toml
sed -i -e 's/address = "localhost:9000"/address = "0.0.0.0:9000"/' -e 's/^password = ".*"/password = "'"$PG_DB_PASS"'"/' /opt/listmonk/config.toml
2024-11-24 17:59:23 +01:00
$STD /opt/listmonk/listmonk --install --yes --config /opt/listmonk/config.toml
2025-07-31 18:58:19 +02:00
msg_ok "Configured listmonk"
2024-11-24 17:59:23 +01:00
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/listmonk.service
[Unit]
Description=Listmonk Service
Wants=network.target
After=postgresql.service
[Service]
Type=simple
ExecStart=/opt/listmonk/listmonk --config /opt/listmonk/config.toml
Restart=always
RestartSec=3
WorkingDirectory=/opt/listmonk
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now listmonk
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc