mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-10 07:13:24 +01:00
Compare commits
3 Commits
add-script
...
automated/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f58afa82a2 | ||
|
|
e8cc7ce8ff | ||
|
|
1357a6f26e |
52
ct/prometheus-paperless-ngx-exporter.sh
Executable file
52
ct/prometheus-paperless-ngx-exporter.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Andy Grunwald (andygrunwald)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/hansmi/prometheus-paperless-exporter
|
||||
|
||||
APP="Prometheus-Paperless-NGX-Exporter"
|
||||
var_tags="${var_tags:-monitoring;alerting}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-256}"
|
||||
var_disk="${var_disk:-2}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -f /etc/systemd/system/prometheus-paperless-ngx-exporter.service ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
if check_for_gh_release "prom-paperless-exp" "hansmi/prometheus-paperless-exporter"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop prometheus-paperless-ngx-exporter
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
fetch_and_deploy_gh_release "prom-paperless-exp" "hansmi/prometheus-paperless-exporter" "binary"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start prometheus-paperless-ngx-exporter
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
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}:8081/metrics${CL}"
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"generated": "2026-02-09T12:16:55Z",
|
||||
"generated": "2026-02-10T00:25:58Z",
|
||||
"versions": [
|
||||
{
|
||||
"slug": "2fauth",
|
||||
@@ -207,9 +207,9 @@
|
||||
{
|
||||
"slug": "commafeed",
|
||||
"repo": "Athou/commafeed",
|
||||
"version": "6.1.1",
|
||||
"version": "6.2.0",
|
||||
"pinned": false,
|
||||
"date": "2026-01-26T15:14:16Z"
|
||||
"date": "2026-02-09T19:44:58Z"
|
||||
},
|
||||
{
|
||||
"slug": "configarr",
|
||||
@@ -256,9 +256,9 @@
|
||||
{
|
||||
"slug": "discopanel",
|
||||
"repo": "nickheyer/discopanel",
|
||||
"version": "v1.0.35",
|
||||
"version": "v1.0.36",
|
||||
"pinned": false,
|
||||
"date": "2026-02-02T05:20:12Z"
|
||||
"date": "2026-02-09T21:15:44Z"
|
||||
},
|
||||
{
|
||||
"slug": "dispatcharr",
|
||||
@@ -634,9 +634,9 @@
|
||||
{
|
||||
"slug": "kometa",
|
||||
"repo": "Kometa-Team/Kometa",
|
||||
"version": "v2.2.2",
|
||||
"version": "v2.3.0",
|
||||
"pinned": false,
|
||||
"date": "2025-10-06T21:31:07Z"
|
||||
"date": "2026-02-09T21:26:56Z"
|
||||
},
|
||||
{
|
||||
"slug": "komga",
|
||||
@@ -718,9 +718,9 @@
|
||||
{
|
||||
"slug": "lubelogger",
|
||||
"repo": "hargata/lubelog",
|
||||
"version": "v1.5.8",
|
||||
"version": "v1.5.9",
|
||||
"pinned": false,
|
||||
"date": "2026-01-26T18:18:03Z"
|
||||
"date": "2026-02-09T17:36:13Z"
|
||||
},
|
||||
{
|
||||
"slug": "mafl",
|
||||
@@ -753,9 +753,9 @@
|
||||
{
|
||||
"slug": "manyfold",
|
||||
"repo": "manyfold3d/manyfold",
|
||||
"version": "v0.132.0",
|
||||
"version": "v0.132.1",
|
||||
"pinned": false,
|
||||
"date": "2026-01-29T13:53:21Z"
|
||||
"date": "2026-02-09T22:02:28Z"
|
||||
},
|
||||
{
|
||||
"slug": "mealie",
|
||||
@@ -1012,16 +1012,16 @@
|
||||
{
|
||||
"slug": "pelican-panel",
|
||||
"repo": "pelican-dev/panel",
|
||||
"version": "v1.0.0-beta31",
|
||||
"version": "v1.0.0-beta32",
|
||||
"pinned": false,
|
||||
"date": "2026-01-18T22:43:24Z"
|
||||
"date": "2026-02-09T22:15:44Z"
|
||||
},
|
||||
{
|
||||
"slug": "pelican-wings",
|
||||
"repo": "pelican-dev/wings",
|
||||
"version": "v1.0.0-beta22",
|
||||
"version": "v1.0.0-beta23",
|
||||
"pinned": false,
|
||||
"date": "2026-01-18T22:38:36Z"
|
||||
"date": "2026-02-09T22:10:26Z"
|
||||
},
|
||||
{
|
||||
"slug": "pf2etools",
|
||||
@@ -1131,9 +1131,9 @@
|
||||
{
|
||||
"slug": "pulse",
|
||||
"repo": "rcourtman/Pulse",
|
||||
"version": "v5.1.5",
|
||||
"version": "v5.1.6",
|
||||
"pinned": false,
|
||||
"date": "2026-02-08T12:19:53Z"
|
||||
"date": "2026-02-09T14:43:03Z"
|
||||
},
|
||||
{
|
||||
"slug": "pve-scripts-local",
|
||||
@@ -1590,6 +1590,13 @@
|
||||
"pinned": false,
|
||||
"date": "2025-11-11T14:30:28Z"
|
||||
},
|
||||
{
|
||||
"slug": "wger",
|
||||
"repo": "wger-project/wger",
|
||||
"version": "2.4",
|
||||
"pinned": false,
|
||||
"date": "2026-01-18T12:12:02Z"
|
||||
},
|
||||
{
|
||||
"slug": "wikijs",
|
||||
"repo": "requarks/wiki",
|
||||
@@ -1628,9 +1635,9 @@
|
||||
{
|
||||
"slug": "yubal",
|
||||
"repo": "guillevc/yubal",
|
||||
"version": "v0.4.2",
|
||||
"version": "v0.5.0",
|
||||
"pinned": false,
|
||||
"date": "2026-02-08T21:35:13Z"
|
||||
"date": "2026-02-09T22:11:32Z"
|
||||
},
|
||||
{
|
||||
"slug": "zigbee2mqtt",
|
||||
|
||||
@@ -1,35 +1,44 @@
|
||||
{
|
||||
"name": "Prometheus Paperless NGX Exporter",
|
||||
"slug": "prometheus-paperless-ngx-exporter",
|
||||
"categories": [
|
||||
9
|
||||
],
|
||||
"date_created": "2025-02-07",
|
||||
"type": "addon",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 8081,
|
||||
"documentation": "https://github.com/hansmi/prometheus-paperless-exporter",
|
||||
"website": "https://github.com/hansmi/prometheus-paperless-exporter",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/paperless-ngx.webp",
|
||||
"config_path": "/etc/prometheus-paperless-ngx-exporter/config.env",
|
||||
"description": "Prometheus metrics exporter for Paperless-NGX, a document management system transforming physical documents into a searchable online archive. The exporter relies on Paperless' REST API.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "tools/addon/prometheus-paperless-ngx-exporter.sh",
|
||||
"resources": {
|
||||
"cpu": null,
|
||||
"ram": null,
|
||||
"hdd": null,
|
||||
"os": null,
|
||||
"version": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": []
|
||||
"name": "Prometheus Paperless NGX Exporter",
|
||||
"slug": "prometheus-paperless-ngx-exporter",
|
||||
"categories": [
|
||||
9
|
||||
],
|
||||
"date_created": "2025-02-07",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 8081,
|
||||
"documentation": null,
|
||||
"website": "https://github.com/hansmi/prometheus-paperless-exporter",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/paperless-ngx.webp",
|
||||
"config_path": "",
|
||||
"description": "Prometheus metrics exporter for Paperless-NGX, a document management system transforming physical documents into a searchable online archive. The exporter relies on Paperless' REST API.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/prometheus-paperless-ngx-exporter.sh",
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 256,
|
||||
"hdd": 2,
|
||||
"os": "debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Please adjust the Paperless URL in the systemd unit file: /etc/systemd/system/prometheus-paperless-ngx-exporter.service",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Please adjust the Paperless authentication token in the configuration file: /etc/prometheus-paperless-ngx-exporter/paperless_auth_token_file",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
47
install/prometheus-paperless-ngx-exporter-install.sh
Executable file
47
install/prometheus-paperless-ngx-exporter-install.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Andy Grunwald (andygrunwald)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/hansmi/prometheus-paperless-exporter
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
fetch_and_deploy_gh_release "prom-paperless-exp" "hansmi/prometheus-paperless-exporter" "binary"
|
||||
|
||||
msg_info "Configuring Prometheus Paperless NGX Exporter"
|
||||
mkdir -p /etc/prometheus-paperless-ngx-exporter
|
||||
echo "SECRET_AUTH_TOKEN" >/etc/prometheus-paperless-ngx-exporter/paperless_auth_token_file
|
||||
msg_ok "Configured Prometheus Paperless NGX Exporter"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/prometheus-paperless-ngx-exporter.service
|
||||
[Unit]
|
||||
Description=Prometheus Paperless NGX Exporter
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
Restart=always
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/prometheus-paperless-exporter \
|
||||
--paperless_url=http://paperless.example.org \
|
||||
--paperless_auth_token_file=/etc/prometheus-paperless-ngx-exporter/paperless_auth_token_file
|
||||
ExecReload=/bin/kill -HUP \$MAINPID
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now prometheus-paperless-ngx-exporter
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -3351,19 +3351,21 @@ msg_menu() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Display menu
|
||||
echo ""
|
||||
msg_custom "📋" "${BL}" "${title}"
|
||||
echo ""
|
||||
for i in "${!tags[@]}"; do
|
||||
local marker=" "
|
||||
[[ $i -eq 0 ]] && marker="* "
|
||||
printf "${TAB3}${marker}%s) %s\n" "${tags[$i]}" "${descs[$i]}"
|
||||
done
|
||||
echo ""
|
||||
# Display menu to /dev/tty so it doesn't get captured by command substitution
|
||||
{
|
||||
echo ""
|
||||
msg_custom "📋" "${BL}" "${title}"
|
||||
echo ""
|
||||
for i in "${!tags[@]}"; do
|
||||
local marker=" "
|
||||
[[ $i -eq 0 ]] && marker="* "
|
||||
printf "${TAB3}${marker}%s) %s\n" "${tags[$i]}" "${descs[$i]}"
|
||||
done
|
||||
echo ""
|
||||
} >/dev/tty
|
||||
|
||||
local selection=""
|
||||
read -r -t 10 -p "${TAB3}Select [default=${default_tag}, timeout 10s]: " selection || true
|
||||
read -r -t 10 -p "${TAB3}Select [default=${default_tag}, timeout 10s]: " selection </dev/tty >/dev/tty || true
|
||||
|
||||
# Validate selection
|
||||
if [[ -n "$selection" ]]; then
|
||||
|
||||
@@ -1,188 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Andy Grunwald (andygrunwald)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/hansmi/prometheus-paperless-exporter
|
||||
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
|
||||
|
||||
# Enable error handling
|
||||
set -Eeuo pipefail
|
||||
trap 'error_handler' ERR
|
||||
load_functions
|
||||
|
||||
# ==============================================================================
|
||||
# CONFIGURATION
|
||||
# ==============================================================================
|
||||
VERBOSE=${var_verbose:-no}
|
||||
APP="prometheus-paperless-ngx-exporter"
|
||||
APP_TYPE="tools"
|
||||
BINARY_PATH="/usr/bin/prometheus-paperless-exporter"
|
||||
CONFIG_PATH="/etc/prometheus-paperless-ngx-exporter/config.env"
|
||||
SERVICE_PATH="/etc/systemd/system/prometheus-paperless-ngx-exporter.service"
|
||||
AUTH_TOKEN_FILE="/etc/prometheus-paperless-ngx-exporter/paperless_auth_token_file"
|
||||
|
||||
# ==============================================================================
|
||||
# OS DETECTION
|
||||
# ==============================================================================
|
||||
if ! grep -qE 'ID=debian|ID=ubuntu' /etc/os-release 2>/dev/null; then
|
||||
echo -e "${CROSS} Unsupported OS detected. This script only supports Debian and Ubuntu."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ==============================================================================
|
||||
# UNINSTALL
|
||||
# ==============================================================================
|
||||
function uninstall() {
|
||||
msg_info "Uninstalling Prometheus-Paperless-NGX-Exporter"
|
||||
systemctl disable -q --now prometheus-paperless-ngx-exporter
|
||||
|
||||
if dpkg -l | grep -q prometheus-paperless-exporter; then
|
||||
$STD apt-get remove -y prometheus-paperless-exporter || $STD dpkg -r prometheus-paperless-exporter
|
||||
fi
|
||||
|
||||
rm -f "$SERVICE_PATH"
|
||||
rm -rf /etc/prometheus-paperless-ngx-exporter
|
||||
rm -f "/usr/local/bin/update_prometheus-paperless-ngx-exporter"
|
||||
rm -f "$HOME/.prometheus-paperless-ngx-exporter"
|
||||
msg_ok "Prometheus-Paperless-NGX-Exporter has been uninstalled"
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# UPDATE
|
||||
# ==============================================================================
|
||||
function update() {
|
||||
if check_for_gh_release "prom-paperless-exp" "hansmi/prometheus-paperless-exporter"; then
|
||||
msg_info "Stopping service"
|
||||
systemctl stop prometheus-paperless-ngx-exporter
|
||||
msg_ok "Stopped service"
|
||||
|
||||
fetch_and_deploy_gh_release "prom-paperless-exp" "hansmi/prometheus-paperless-exporter" "binary" "latest"
|
||||
|
||||
msg_info "Starting service"
|
||||
systemctl start prometheus-paperless-ngx-exporter
|
||||
msg_ok "Started service"
|
||||
msg_ok "Updated successfully!"
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# INSTALL
|
||||
# ==============================================================================
|
||||
function install() {
|
||||
read -erp "Enter URL of Paperless-NGX, example: (http://127.0.0.1:8000): " PAPERLESS_URL
|
||||
read -rsp "Enter Paperless-NGX authentication token: " PAPERLESS_AUTH_TOKEN
|
||||
printf "\n"
|
||||
|
||||
fetch_and_deploy_gh_release "prom-paperless-exp" "hansmi/prometheus-paperless-exporter" "binary" "latest"
|
||||
|
||||
msg_info "Creating configuration"
|
||||
mkdir -p /etc/prometheus-paperless-ngx-exporter
|
||||
cat <<EOF >"$CONFIG_PATH"
|
||||
# https://github.com/hansmi/prometheus-paperless-exporter
|
||||
PAPERLESS_URL="${PAPERLESS_URL}"
|
||||
EOF
|
||||
echo "${PAPERLESS_AUTH_TOKEN}" >"$AUTH_TOKEN_FILE"
|
||||
chmod 600 "$AUTH_TOKEN_FILE"
|
||||
msg_ok "Created configuration"
|
||||
|
||||
msg_info "Creating service"
|
||||
cat <<EOF >"$SERVICE_PATH"
|
||||
[Unit]
|
||||
Description=Prometheus Paperless NGX Exporter
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
EnvironmentFile=$CONFIG_PATH
|
||||
ExecStart=$BINARY_PATH \\
|
||||
--paperless_url=\${PAPERLESS_URL} \\
|
||||
--paperless_auth_token_file=$AUTH_TOKEN_FILE
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl enable -q --now prometheus-paperless-ngx-exporter
|
||||
msg_ok "Created and started service"
|
||||
|
||||
# Create update script
|
||||
msg_info "Creating update script"
|
||||
ensure_usr_local_bin_persist
|
||||
cat <<'UPDATEEOF' >/usr/local/bin/update_prometheus-paperless-ngx-exporter
|
||||
#!/usr/bin/env bash
|
||||
# prometheus-paperless-ngx-exporter Update Script
|
||||
type=update bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/prometheus-paperless-ngx-exporter.sh)"
|
||||
UPDATEEOF
|
||||
chmod +x /usr/local/bin/update_prometheus-paperless-ngx-exporter
|
||||
msg_ok "Created update script (/usr/local/bin/update_prometheus-paperless-ngx-exporter)"
|
||||
|
||||
echo ""
|
||||
msg_ok "Prometheus-Paperless-NGX-Exporter installed successfully"
|
||||
msg_ok "Metrics: ${BL}http://${LOCAL_IP}:8081/metrics${CL}"
|
||||
msg_ok "Config: ${BL}${CONFIG_PATH}${CL}"
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# MAIN
|
||||
# ==============================================================================
|
||||
header_info
|
||||
ensure_usr_local_bin_persist
|
||||
get_lxc_ip
|
||||
|
||||
# Handle type=update (called from update script)
|
||||
if [[ "${type:-}" == "update" ]]; then
|
||||
if [[ -f "$BINARY_PATH" ]]; then
|
||||
update
|
||||
else
|
||||
msg_error "Prometheus-Paperless-NGX-Exporter is not installed. Nothing to update."
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check if already installed
|
||||
if [[ -f "$BINARY_PATH" ]]; then
|
||||
msg_warn "Prometheus-Paperless-NGX-Exporter is already installed."
|
||||
echo ""
|
||||
|
||||
echo -n "${TAB}Uninstall Prometheus-Paperless-NGX-Exporter? (y/N): "
|
||||
read -r uninstall_prompt
|
||||
if [[ "${uninstall_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
uninstall
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo -n "${TAB}Update Prometheus-Paperless-NGX-Exporter? (y/N): "
|
||||
read -r update_prompt
|
||||
if [[ "${update_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
update
|
||||
exit 0
|
||||
fi
|
||||
|
||||
msg_warn "No action selected. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Fresh installation
|
||||
msg_warn "Prometheus-Paperless-NGX-Exporter is not installed."
|
||||
echo ""
|
||||
echo -e "${TAB}${INFO} This will install:"
|
||||
echo -e "${TAB} - Prometheus Paperless NGX Exporter (binary)"
|
||||
echo -e "${TAB} - Systemd service"
|
||||
echo ""
|
||||
|
||||
echo -n "${TAB}Install Prometheus-Paperless-NGX-Exporter? (y/N): "
|
||||
read -r install_prompt
|
||||
if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
install
|
||||
else
|
||||
msg_warn "Installation cancelled. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
Reference in New Issue
Block a user