Merge pull request #1205 from bysinka-95/loki

Add Loki
This commit is contained in:
Michel Roegl-Brunner
2026-01-09 09:40:09 +01:00
committed by GitHub
7 changed files with 266 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: hoholms
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/grafana/loki
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Loki"
$STD apk add loki
$STD sed -i '/http_addr/s/127.0.0.1/0.0.0.0/g' /etc/conf.d/loki
$STD rc-service loki start
$STD rc-update add loki default
$STD mkdir /tmp/loki/
$STD chown -R loki:grafana /tmp/loki/
$STD mkdir /var/log/loki/
$STD chown -R loki:grafana /var/log/loki/
$STD chmod 755 /etc/loki/loki-local-config.yaml
$STD sed -i '/^querier:/,/enable_multi_variant_queries: false/ s/^/#/' /etc/loki/loki-local-config.yaml
$STD echo "output_log=\"\${output_log:-/var/log/loki/output.log}\"" >> /etc/init.d/loki
$STD echo "error_log=\"\${error_log:-/var/log/loki/error.log}\"" >> /etc/init.d/loki
$STD echo "start_stop_daemon_args=\"\${SSD_OPTS} -1 \${output_log} -2 \${error_log}\"" >> /etc/init.d/loki
$STD rc-service loki restart
msg_ok "Installed Loki"
msg_info "Installing Promtail"
$STD apk add loki-promtail
$STD sed -i '/http_addr/s/127.0.0.1/0.0.0.0/g' /etc/conf.d/loki
$STD rc-service loki-promtail start
$STD rc-update add loki-promtail default
msg_ok "Installed Promtail"
motd_ssh
customize

37
install/loki-install.sh Normal file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: hoholms
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/grafana/loki
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Setting up Grafana Repository"
setup_deb822_repo \
"grafana" \
"https://apt.grafana.com/gpg.key" \
"https://apt.grafana.com" \
"stable" \
"main"
msg_ok "Grafana Repository setup sucessfully"
msg_info "Installing Loki"
$STD apt install -y loki
systemctl enable -q --now loki
msg_ok "Installed Loki"
msg_info "Installing Promtail"
$STD apt install -y promtail
systemctl enable -q --now promtail
msg_ok "Installed Promtail"
motd_ssh
customize
cleanup_lxc