2024-12-20 10:02:06 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2026-01-06 13:28:12 +01:00
|
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
2024-12-20 10:02:06 +01:00
|
|
|
# Author: Michel Roegl-Brunner (michelroegl-brunner)
|
2025-03-04 17:54:20 +01:00
|
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
|
|
|
# Source: https://zammad.com
|
2024-12-20 10:02:06 +01:00
|
|
|
|
|
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
|
|
|
|
color
|
|
|
|
|
verb_ip6
|
|
|
|
|
catch_errors
|
|
|
|
|
setting_up_container
|
|
|
|
|
network_check
|
|
|
|
|
update_os
|
|
|
|
|
|
|
|
|
|
msg_info "Installing Dependencies"
|
2025-10-07 21:23:56 +02:00
|
|
|
$STD apt install -y \
|
2024-12-20 10:02:06 +01:00
|
|
|
git \
|
|
|
|
|
nginx \
|
2025-05-28 10:54:01 +02:00
|
|
|
apt-transport-https
|
2024-12-20 10:02:06 +01:00
|
|
|
msg_ok "Installed Dependencies"
|
|
|
|
|
|
|
|
|
|
msg_info "Setting up Elasticsearch"
|
2025-12-07 21:29:39 +01:00
|
|
|
setup_deb822_repo \
|
|
|
|
|
"elasticsearch" \
|
|
|
|
|
"https://artifacts.elastic.co/GPG-KEY-elasticsearch" \
|
|
|
|
|
"https://artifacts.elastic.co/packages/7.x/apt" \
|
|
|
|
|
"stable" \
|
|
|
|
|
"main"
|
2025-12-09 15:58:13 +01:00
|
|
|
$STD apt install -y elasticsearch
|
2026-02-25 13:55:07 +01:00
|
|
|
sed -i 's/^#\{0,2\} *-Xms[0-9]*g.*/-Xms2g/' /etc/elasticsearch/jvm.options
|
|
|
|
|
sed -i 's/^#\{0,2\} *-Xmx[0-9]*g.*/-Xmx2g/' /etc/elasticsearch/jvm.options
|
|
|
|
|
cat <<EOF >>/etc/elasticsearch/elasticsearch.yml
|
|
|
|
|
discovery.type: single-node
|
|
|
|
|
xpack.security.enabled: false
|
|
|
|
|
bootstrap.memory_lock: false
|
|
|
|
|
EOF
|
2024-12-20 10:02:06 +01:00
|
|
|
$STD /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment -b
|
2026-02-20 22:52:28 +01:00
|
|
|
systemctl daemon-reload
|
2025-05-11 17:12:46 +02:00
|
|
|
systemctl enable -q elasticsearch
|
|
|
|
|
systemctl restart -q elasticsearch
|
2026-02-25 13:55:07 +01:00
|
|
|
for i in $(seq 1 30); do
|
|
|
|
|
if curl -s http://localhost:9200 >/dev/null 2>&1; then
|
|
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
sleep 2
|
|
|
|
|
done
|
2024-12-20 10:02:06 +01:00
|
|
|
msg_ok "Setup Elasticsearch"
|
|
|
|
|
|
|
|
|
|
msg_info "Installing Zammad"
|
2025-12-07 21:29:39 +01:00
|
|
|
setup_deb822_repo \
|
|
|
|
|
"zammad" \
|
|
|
|
|
"https://dl.packager.io/srv/zammad/zammad/key" \
|
|
|
|
|
"https://dl.packager.io/srv/deb/zammad/zammad/stable/debian" \
|
|
|
|
|
"$(get_os_info version_id)" \
|
|
|
|
|
"main"
|
2025-12-09 15:58:13 +01:00
|
|
|
$STD apt install -y zammad
|
2024-12-20 10:02:06 +01:00
|
|
|
$STD zammad run rails r "Setting.set('es_url', 'http://localhost:9200')"
|
|
|
|
|
$STD zammad run rake zammad:searchindex:rebuild
|
|
|
|
|
msg_ok "Installed Zammad"
|
|
|
|
|
|
|
|
|
|
msg_info "Setup Services"
|
|
|
|
|
cp /opt/zammad/contrib/nginx/zammad.conf /etc/nginx/sites-available/zammad.conf
|
2025-12-09 15:58:13 +01:00
|
|
|
sed -i "s/server_name localhost;/server_name $LOCAL_IP;/g" /etc/nginx/sites-available/zammad.conf
|
2026-01-16 08:39:01 +01:00
|
|
|
ln -sf /etc/nginx/sites-available/zammad.conf /etc/nginx/sites-enabled/
|
2026-01-13 07:53:43 +01:00
|
|
|
rm -f /etc/nginx/sites-enabled/default
|
2024-12-20 10:02:06 +01:00
|
|
|
$STD systemctl reload nginx
|
|
|
|
|
msg_ok "Created Service"
|
|
|
|
|
|
|
|
|
|
motd_ssh
|
|
|
|
|
customize
|
2025-11-22 17:27:13 +01:00
|
|
|
cleanup_lxc
|