2024-11-24 17:59:23 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2026-01-06 13:28:12 +01:00
|
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
2024-11-24 17:59:23 +01:00
|
|
|
# Author: bvdberg01
|
2025-03-04 17:54:20 +01:00
|
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
2026-02-24 15:11:53 +01:00
|
|
|
# Source: https://listmonk.app/ | Github: https://github.com/knadh/listmonk
|
2024-11-24 17:59:23 +01:00
|
|
|
|
2025-03-24 14:20:56 +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
|
|
|
|
2026-10-01 08:12:33 +02:00
|
|
|
PG_DB_NAME="listmonk" PG_DB_USER="listmonk" setup_postgresql_db
|
2024-11-24 17:59:23 +01:00
|
|
|
|
2026-06-21 08:21:58 +10: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
|
2026-10-01 08:12:33 +02:00
|
|
|
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
|
2025-11-22 17:27:13 +01:00
|
|
|
cleanup_lxc
|