1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-03-08 13:19:05 +00:00

New Script: Graylog (#2270)

* add graylog script

* Update install/graylog-install.sh

Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>

* fixes

* Update ct/graylog.sh

Co-authored-by: bvdberg01 <74251551+bvdberg01@users.noreply.github.com>

* used wildcard to remove repo deb

* fixes v2

---------

Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>
Co-authored-by: bvdberg01 <74251551+bvdberg01@users.noreply.github.com>
This commit is contained in:
Slaviša Arežina 2025-02-12 20:05:42 +01:00 committed by GitHub
parent e5c6953e98
commit 067c962baf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 167 additions and 0 deletions

59
ct/graylog.sh Normal file
View File

@ -0,0 +1,59 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: Slaviša Arežina (tremor021)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://graylog.org/
APP="Graylog"
TAGS="logging"
var_cpu="2"
var_ram="8192"
var_disk="30"
var_os="debian"
var_version="12"
var_unprivileged="1"
header_info "$APP"
base_settings
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /etc/graylog ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Stopping $APP"
systemctl stop graylog-datanode
systemctl stop graylog-server
msg_ok "Stopped $APP"
msg_info "Updating $APP"
apt-get update &> /dev/null
apt-get upgrade -y &> /dev/null
msg_ok "Updated $APP"
msg_info "Starting $APP"
systemctl start graylog-datanode
systemctl start graylog-server
msg_ok "Started $APP"
msg_ok "Update Successful"
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9000${CL}"

View File

@ -0,0 +1,65 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: Slaviša Arežina (tremor021)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://graylog.org/
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
curl \
sudo \
mc \
gnupg
msg_ok "Installed Dependencies"
msg_info "Setup MongoDB"
curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor
echo "deb [signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg] https://repo.mongodb.org/apt/debian bookworm/mongodb-org/7.0 main" >/etc/apt/sources.list.d/mongodb-org-7.0.list
$STD apt-get update
$STD apt-get install -y mongodb-org
$STD apt-mark hold mongodb-org
systemctl enable -q --now mongod
msg_ok "Setup MongoDB"
msg_info "Setup Graylog Data Node"
PASSWORD_SECRET=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c16)
wget -q https://packages.graylog2.org/repo/packages/graylog-6.1-repository_latest.deb
$STD dpkg -i graylog-6.1-repository_latest.deb
$STD apt-get update
$STD apt-get install graylog-datanode -y
sed -i "s/password_secret =/password_secret = $PASSWORD_SECRET/g" /etc/graylog/datanode/datanode.conf
systemctl enable -q --now graylog-datanode
msg_ok "Setup Graylog Data Node"
msg_info "Setup ${APPLICATION}"
$STD apt-get install graylog-server
ROOT_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c16)
{
echo "${APPLICATION} Credentials"
echo "Admin User: admin"
echo "Admin Password: ${ROOT_PASSWORD}"
} >> ~/graylog.creds
ROOT_PASSWORD=$(echo -n $ROOT_PASSWORD | shasum -a 256 | awk '{print $1}')
sed -i "s/password_secret =/password_secret = $PASSWORD_SECRET/g" /etc/graylog/server/server.conf
sed -i "s/root_password_sha2 =/root_password_sha2 = $ROOT_PASSWORD/g" /etc/graylog/server/server.conf
sed -i 's/#http_bind_address = 127.0.0.1.*/http_bind_address = 0.0.0.0:9000/g' /etc/graylog/server/server.conf
systemctl enable -q --now graylog-server
msg_ok "Setup ${APPLICATION}"
motd_ssh
customize
msg_info "Cleaning up"
rm -f graylog-*-repository_latest.deb
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"

43
json/graylog.json Normal file
View File

@ -0,0 +1,43 @@
{
"name": "Graylog",
"slug": "graylog",
"categories": [
9
],
"date_created": "2025-02-12",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 9000,
"documentation": "https://go2docs.graylog.org/current/home.htm",
"website": "https://graylog.org/",
"logo": "https://graylog.org/wp-content/uploads/2023/11/gl-logo-horiz-all-white-1200w-300x96.png.webp",
"description": "Graylog is a free and open log management platform.",
"install_methods": [
{
"type": "default",
"script": "ct/graylog.sh",
"resources": {
"cpu": 2,
"ram": 8192,
"hdd": 30,
"os": "debian",
"version": "12"
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": [
{
"text": "Initial Setup credentials: `tail /var/log/graylog-server/server.log` after the server starts for the first time.",
"type": "info"
},
{
"text": "Type `cat ~/graylog.creds` to get admin password that you use to log in AFTER the Initial Setup",
"type": "info"
}
]
}