Files
ProxmoxVE/install/mattermost-install.sh
T

45 lines
1.8 KiB
Bash
Raw Normal View History

2025-01-30 05:34:27 -05:00
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
2025-01-30 05:34:27 -05:00
# Author: Kaedon Cleland-Host (dracentis)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://mattermost.com/
2025-01-30 05:34:27 -05:00
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
2025-01-30 05:34:27 -05:00
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_warn "WARNING: This script will run an external installer from a third-party source (https://mattermost.com/)."
msg_warn "The following code is NOT maintained or audited by our repository."
msg_warn "If you have any doubts or concerns, please review the installer code before proceeding:"
msg_custom "${TAB3}${GATEWAY}${BGN}${CL}" "\e[1;34m" "→ https://deb.packages.mattermost.com/repo-setup.sh"
echo
read -r -p "${TAB3}Do you want to continue? [y/N]: " CONFIRM
if [[ ! "$CONFIRM" =~ ^([yY][eE][sS]|[yY])$ ]]; then
msg_error "Aborted by user. No changes have been made."
exit 10
fi
PG_VERSION="16" setup_postgresql
2025-01-30 05:34:27 -05:00
PG_DB_NAME="mattermost" PG_DB_USER="mmuser" setup_postgresql_db
2025-01-30 05:34:27 -05:00
msg_info "Installing Mattermost"
2025-04-01 14:33:26 +02:00
curl -fsSL -o /usr/share/keyrings/mattermost-archive-keyring.gpg https://deb.packages.mattermost.com/pubkey.gpg
sh -c 'curl -fsSL https://deb.packages.mattermost.com/repo-setup.sh | sudo bash -s mattermost' >/dev/null
apt_update_safe
$STD apt install -y mattermost
2025-01-30 05:34:27 -05:00
$STD install -C -m 600 -o mattermost -g mattermost /opt/mattermost/config/config.defaults.json /opt/mattermost/config/config.json
sed -i -e "/DataSource/c\ \"DataSource\": \"postgres://mmuser:$PG_DB_PASS@localhost:5432/mattermost?sslmode=disable&connect_timeout=10\"," \
2026-01-19 16:33:08 +01:00
-e "/SiteURL/c\ \"SiteURL\": \"http://$LOCAL_IP:8065\"," /opt/mattermost/config/config.json
2025-04-01 20:22:40 +02:00
systemctl enable -q --now mattermost
2025-01-30 05:34:27 -05:00
msg_ok "Installed Mattermost"
motd_ssh
customize
cleanup_lxc