mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-12-25 16:36:24 +01:00
Compare commits
13 Commits
add-script
...
github-act
| Author | SHA1 | Date | |
|---|---|---|---|
| 10b34b7e70 | |||
| e6ee6e66bf | |||
| 97211b41b7 | |||
| 20a55d4543 | |||
| 0ece3263bd | |||
| 9f1e214bc0 | |||
| 37007f1efe | |||
| e926182748 | |||
| fa8c8ef85c | |||
| c769a43f62 | |||
| d91753824c | |||
| 77a3eacd21 | |||
| 404e87a2e3 |
14
CHANGELOG.md
14
CHANGELOG.md
@ -12,6 +12,20 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
## 2025-12-25
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- InfluxDB: Fixes [@tremor021](https://github.com/tremor021) ([#10308](https://github.com/community-scripts/ProxmoxVE/pull/10308))
|
||||
- Increase Zot Default Memory, Recategorize [@chrismuzyn](https://github.com/chrismuzyn) ([#10311](https://github.com/community-scripts/ProxmoxVE/pull/10311))
|
||||
|
||||
- #### 🔧 Refactor
|
||||
|
||||
- Refactor: OpenObserve [@tremor021](https://github.com/tremor021) ([#10279](https://github.com/community-scripts/ProxmoxVE/pull/10279))
|
||||
- Refactor: NZBGet [@tremor021](https://github.com/tremor021) ([#10302](https://github.com/community-scripts/ProxmoxVE/pull/10302))
|
||||
- Refactor: ntfy [@tremor021](https://github.com/tremor021) ([#10303](https://github.com/community-scripts/ProxmoxVE/pull/10303))
|
||||
- Refactor: Notifiarr [@tremor021](https://github.com/tremor021) ([#10304](https://github.com/community-scripts/ProxmoxVE/pull/10304))
|
||||
|
||||
## 2025-12-24
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
@ -27,9 +27,11 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_info "Updating ${APP}"
|
||||
|
||||
msg_info "Updating InfluxDB"
|
||||
$STD apt update
|
||||
$STD apt -y upgrade
|
||||
$STD apt upgrade -y
|
||||
msg_ok "Updated InfluxDB"
|
||||
msg_ok "Updated successfully!"
|
||||
exit
|
||||
}
|
||||
|
||||
@ -27,10 +27,10 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_info "Updating $APP"
|
||||
msg_info "Updating Notifiarr"
|
||||
$STD apt update
|
||||
$STD apt -y upgrade
|
||||
msg_ok "Updated $APP"
|
||||
$STD apt upgrade -y
|
||||
msg_ok "Updated Notifiarr"
|
||||
msg_ok "Updated successfully!"
|
||||
exit
|
||||
}
|
||||
|
||||
19
ct/ntfy.sh
19
ct/ntfy.sh
@ -34,21 +34,18 @@ function update_script() {
|
||||
rm -f /etc/apt/sources.list.d/archive.heckel.io.list
|
||||
rm -f /etc/apt/sources.list.d/archive.heckel.io.list.bak
|
||||
rm -f /etc/apt/sources.list.d/archive.heckel.io.sources
|
||||
curl -fsSL -o /etc/apt/keyrings/ntfy.gpg https://archive.ntfy.sh/apt/keyring.gpg
|
||||
cat <<'EOF' >/etc/apt/sources.list.d/ntfy.sources
|
||||
Types: deb
|
||||
URIs: https://archive.ntfy.sh/apt/
|
||||
Suites: stable
|
||||
Components: main
|
||||
Signed-By: /etc/apt/keyrings/ntfy.gpg
|
||||
EOF
|
||||
setup_deb822_repo \
|
||||
"ntfy" \
|
||||
"https://archive.ntfy.sh/apt/keyring.gpg" \
|
||||
"https://archive.ntfy.sh/apt/" \
|
||||
"stable"
|
||||
msg_ok "Corrected old Ntfy Repository"
|
||||
fi
|
||||
|
||||
msg_info "Updating $APP LXC"
|
||||
msg_info "Updating ntfy"
|
||||
$STD apt update
|
||||
$STD apt -y upgrade
|
||||
msg_ok "Updated $APP LXC"
|
||||
$STD apt upgrade -y
|
||||
msg_ok "Updated ntfy"
|
||||
msg_ok "Updated successfully!"
|
||||
exit
|
||||
}
|
||||
|
||||
@ -27,10 +27,10 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_info "Updating $APP LXC"
|
||||
msg_info "Updating NZBGet"
|
||||
$STD apt update
|
||||
$STD apt -y upgrade
|
||||
msg_ok "Updated $APP LXC"
|
||||
$STD apt upgrade -y
|
||||
msg_ok "Updated NZBGet"
|
||||
msg_ok "Updated successfully!"
|
||||
exit
|
||||
}
|
||||
|
||||
@ -27,13 +27,16 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_info "Updating $APP"
|
||||
systemctl stop openobserve
|
||||
LATEST=$(curl -fsSL https://api.github.com/repos/openobserve/openobserve/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
||||
$STD tar zxvf <(curl -fsSL https://downloads.openobserve.ai/releases/openobserve/$LATEST/openobserve-$LATEST-linux-amd64.tar.gz) -C /opt/openobserve
|
||||
systemctl start openobserve
|
||||
msg_ok "Updated $APP"
|
||||
msg_ok "Updated successfully!"
|
||||
|
||||
if check_for_gh_release "openobserve" "openobserve/openobserve"; then
|
||||
msg_info "Updating OpenObserve"
|
||||
systemctl stop openobserve
|
||||
RELEASE=$(get_latest_github_release "openobserve/openobserve")
|
||||
tar zxf <(curl -fsSL https://downloads.openobserve.ai/releases/openobserve/v$RELEASE/openobserve-v$RELEASE-linux-amd64.tar.gz) -C /opt/openobserve
|
||||
systemctl start openobserve
|
||||
msg_ok "Updated OpenObserve"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
|
||||
APP="Zot-Registry"
|
||||
var_tags="${var_tags:-registry;oci}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_ram="${var_ram:-4096}"
|
||||
var_disk="${var_disk:-5}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
{
|
||||
"name": "Nextcloud Exporter",
|
||||
"slug": "nextcloud-exporter",
|
||||
"categories": [
|
||||
9
|
||||
],
|
||||
"date_created": "2025-12-17",
|
||||
"type": "addon",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 9205,
|
||||
"documentation": "https://github.com/xperimental/nextcloud-exporter",
|
||||
"website": "https://github.com/xperimental/nextcloud-exporter",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/nextcloud.webp",
|
||||
"config_path": "/etc/nextcloud-exporter.env",
|
||||
"description": "Prometheus exporter for Nextcloud servers. ",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "tools/addon/nextcloud-exporter.sh",
|
||||
"resources": {
|
||||
"cpu": null,
|
||||
"ram": null,
|
||||
"hdd": null,
|
||||
"os": null,
|
||||
"version": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": []
|
||||
}
|
||||
@ -1,4 +1,39 @@
|
||||
[
|
||||
{
|
||||
"name": "PatchMon/PatchMon",
|
||||
"version": "v1.3.7",
|
||||
"date": "2025-12-25T11:08:14Z"
|
||||
},
|
||||
{
|
||||
"name": "openobserve/openobserve",
|
||||
"version": "v0.40.0-rc2",
|
||||
"date": "2025-12-25T09:23:24Z"
|
||||
},
|
||||
{
|
||||
"name": "seriousm4x/UpSnap",
|
||||
"version": "5.2.5",
|
||||
"date": "2025-12-25T09:23:10Z"
|
||||
},
|
||||
{
|
||||
"name": "morpheus65535/bazarr",
|
||||
"version": "v1.5.3",
|
||||
"date": "2025-09-20T12:12:33Z"
|
||||
},
|
||||
{
|
||||
"name": "Jackett/Jackett",
|
||||
"version": "v0.24.532",
|
||||
"date": "2025-12-25T05:48:43Z"
|
||||
},
|
||||
{
|
||||
"name": "jeedom/core",
|
||||
"version": "4.5.1",
|
||||
"date": "2025-12-25T00:27:04Z"
|
||||
},
|
||||
{
|
||||
"name": "steveiliop56/tinyauth",
|
||||
"version": "v4.1.0",
|
||||
"date": "2025-11-23T12:13:34Z"
|
||||
},
|
||||
{
|
||||
"name": "fosrl/pangolin",
|
||||
"version": "1.14.1",
|
||||
@ -54,16 +89,6 @@
|
||||
"version": "6.1.0-rc.1",
|
||||
"date": "2025-12-24T09:46:02Z"
|
||||
},
|
||||
{
|
||||
"name": "Jackett/Jackett",
|
||||
"version": "v0.24.521",
|
||||
"date": "2025-12-24T05:52:23Z"
|
||||
},
|
||||
{
|
||||
"name": "openobserve/openobserve",
|
||||
"version": "v0.40.0-rc1",
|
||||
"date": "2025-12-24T03:37:37Z"
|
||||
},
|
||||
{
|
||||
"name": "comfyanonymous/ComfyUI",
|
||||
"version": "v0.6.0",
|
||||
@ -74,16 +99,6 @@
|
||||
"version": "2.1.1",
|
||||
"date": "2025-06-14T17:45:06Z"
|
||||
},
|
||||
{
|
||||
"name": "jeedom/core",
|
||||
"version": "4.5.1",
|
||||
"date": "2025-12-24T00:27:08Z"
|
||||
},
|
||||
{
|
||||
"name": "steveiliop56/tinyauth",
|
||||
"version": "v4.1.0",
|
||||
"date": "2025-11-23T12:13:34Z"
|
||||
},
|
||||
{
|
||||
"name": "advplyr/audiobookshelf",
|
||||
"version": "v2.32.1",
|
||||
@ -254,11 +269,6 @@
|
||||
"version": "v5.8.0",
|
||||
"date": "2025-12-22T10:12:48Z"
|
||||
},
|
||||
{
|
||||
"name": "morpheus65535/bazarr",
|
||||
"version": "v1.5.3",
|
||||
"date": "2025-09-20T12:12:33Z"
|
||||
},
|
||||
{
|
||||
"name": "open-webui/open-webui",
|
||||
"version": "v0.6.43",
|
||||
@ -417,7 +427,7 @@
|
||||
{
|
||||
"name": "mealie-recipes/mealie",
|
||||
"version": "v3.8.0",
|
||||
"date": "2025-12-19T01:37:16Z"
|
||||
"date": "2025-12-19T01:37:04Z"
|
||||
},
|
||||
{
|
||||
"name": "moghtech/komodo",
|
||||
@ -1069,11 +1079,6 @@
|
||||
"version": "v5.6.1",
|
||||
"date": "2025-11-21T16:51:21Z"
|
||||
},
|
||||
{
|
||||
"name": "seriousm4x/UpSnap",
|
||||
"version": "5.2.4",
|
||||
"date": "2025-11-21T10:25:05Z"
|
||||
},
|
||||
{
|
||||
"name": "MariaDB/server",
|
||||
"version": "mariadb-12.1.2",
|
||||
@ -1109,11 +1114,6 @@
|
||||
"version": "2025.5",
|
||||
"date": "2025-11-19T14:48:47Z"
|
||||
},
|
||||
{
|
||||
"name": "PatchMon/PatchMon",
|
||||
"version": "v1.3.6",
|
||||
"date": "2025-11-18T22:01:02Z"
|
||||
},
|
||||
{
|
||||
"name": "redis/redis",
|
||||
"version": "8.4.0",
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "Zot Registry",
|
||||
"slug": "zot",
|
||||
"categories": [
|
||||
13
|
||||
3
|
||||
],
|
||||
"date_created": "2025-06-06",
|
||||
"type": "ct",
|
||||
@ -20,7 +20,7 @@
|
||||
"script": "ct/zot-registry.sh",
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 2048,
|
||||
"ram": 4096,
|
||||
"hdd": 5,
|
||||
"os": "Debian",
|
||||
"version": "13"
|
||||
|
||||
@ -17,7 +17,7 @@ msg_info "Setting up InfluxDB Repository"
|
||||
setup_deb822_repo \
|
||||
"influxdata" \
|
||||
"https://repos.influxdata.com/influxdata-archive.key" \
|
||||
"https://repos.influxdata.com/$(get_os_info id)" \
|
||||
"https://repos.influxdata.com/debian" \
|
||||
"stable"
|
||||
msg_ok "Set up InfluxDB Repository"
|
||||
|
||||
@ -29,17 +29,15 @@ else
|
||||
fi
|
||||
|
||||
msg_info "Installing InfluxDB"
|
||||
$STD apt update
|
||||
if [[ $INFLUX == "2" ]]; then
|
||||
$STD apt install -y influxdb2
|
||||
else
|
||||
$STD apt install -y influxdb
|
||||
curl -fsSL "https://dl.influxdata.com/chronograf/releases/chronograf_1.10.8_amd64.deb" -o "/chronograf_1.10.8_amd64.deb"
|
||||
$STD dpkg -i chronograf_1.10.8_amd64.deb
|
||||
rm -rf /chronograf_1.10.8_amd64.deb
|
||||
download_file "https://dl.influxdata.com/chronograf/releases/chronograf_1.10.8_amd64.deb" "${HOME}/chronograf_1.10.8_amd64.deb"
|
||||
$STD dpkg -i "${HOME}/chronograf_1.10.8_amd64.deb"
|
||||
rm -rf "${HOME}/chronograf_1.10.8_amd64.deb"
|
||||
fi
|
||||
rm /etc/apt/sources.list.d/influxdata.list
|
||||
$STD systemctl enable --now influxdb
|
||||
systemctl enable -q --now influxdb
|
||||
msg_ok "Installed InfluxDB"
|
||||
|
||||
read -r -p "${TAB3}Would you like to add Telegraf? <y/N> " prompt
|
||||
|
||||
@ -13,20 +13,16 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Notifiarr"
|
||||
msg_info "Setting up Notifiarr"
|
||||
$STD groupadd notifiarr
|
||||
$STD useradd -g notifiarr notifiarr
|
||||
curl -fsSL "https://packagecloud.io/golift/pkgs/gpgkey" | gpg --dearmor >/usr/share/keyrings/golift-archive-keyring.gpg
|
||||
cat <<EOF >/etc/apt/sources.list.d/golift.sources
|
||||
Types: deb
|
||||
URIs: https://packagecloud.io/golift/pkgs/ubuntu
|
||||
Suites: focal
|
||||
Components: main
|
||||
Signed-By: /usr/share/keyrings/golift-archive-keyring.gpg
|
||||
EOF
|
||||
$STD apt update
|
||||
setup_deb822_repo \
|
||||
"notifiarr" \
|
||||
"https://packagecloud.io/golift/pkgs/gpgkey" \
|
||||
"https://packagecloud.io/golift/pkgs/ubuntu" \
|
||||
"focal"
|
||||
$STD apt install -y notifiarr
|
||||
msg_ok "Installed Notifiarr"
|
||||
msg_ok "Setup Notifiarr"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
@ -13,21 +13,15 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing ntfy"
|
||||
mkdir -p /etc/apt/keyrings
|
||||
curl -fsSL -o /etc/apt/keyrings/ntfy.gpg https://archive.ntfy.sh/apt/keyring.gpg
|
||||
cat <<EOF >/etc/apt/sources.list.d/ntfy.sources
|
||||
Types: deb
|
||||
URIs: https://archive.ntfy.sh/apt/
|
||||
Suites: stable
|
||||
Components: main
|
||||
Signed-By: /etc/apt/keyrings/ntfy.gpg
|
||||
EOF
|
||||
|
||||
$STD apt update
|
||||
msg_info "Setting up ntfy"
|
||||
setup_deb822_repo \
|
||||
"ntfy" \
|
||||
"https://archive.ntfy.sh/apt/keyring.gpg" \
|
||||
"https://archive.ntfy.sh/apt/" \
|
||||
"stable"
|
||||
$STD apt install -y ntfy
|
||||
systemctl enable -q --now ntfy
|
||||
msg_ok "Installed ntfy"
|
||||
msg_ok "Setup ntfy"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
@ -16,29 +16,20 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
par2
|
||||
|
||||
cat <<EOF >/etc/apt/sources.list.d/non-free.list
|
||||
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
|
||||
EOF
|
||||
$STD apt update
|
||||
$STD apt install -y unrar
|
||||
rm /etc/apt/sources.list.d/non-free.list
|
||||
par2 \
|
||||
unrar-free
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Installing NZBGet"
|
||||
mkdir -p /usr/share/keyrings
|
||||
curl -fsSL https://nzbgetcom.github.io/nzbgetcom.asc | gpg --dearmor -o /usr/share/keyrings/nzbgetcom.gpg
|
||||
cat <<EOF >/etc/apt/sources.list.d/nzbgetcom.sources
|
||||
Types: deb
|
||||
URIs: https://nzbgetcom.github.io/deb
|
||||
Suites: stable
|
||||
Components: main
|
||||
Architectures: all
|
||||
Signed-By: /usr/share/keyrings/nzbgetcom.gpg
|
||||
EOF
|
||||
$STD apt update
|
||||
setup_deb822_repo \
|
||||
"nzbgetcom" \
|
||||
"https://nzbgetcom.github.io/nzbgetcom.asc" \
|
||||
"https://nzbgetcom.github.io/deb" \
|
||||
"stable"
|
||||
$STD apt install -y nzbget
|
||||
sed -i "s|UnrarCmd=unrar|UnrarCmd=unrar-free|g" /var/lib/nzbget/nzbget.conf
|
||||
sed -i "s|SevenZipCmd=7zz|SevenZipCmd=7z|g" /var/lib/nzbget/nzbget.conf
|
||||
systemctl restart nzbget
|
||||
msg_ok "Installed NZBGet"
|
||||
|
||||
motd_ssh
|
||||
|
||||
@ -15,15 +15,17 @@ update_os
|
||||
|
||||
msg_info "Installing OpenObserve"
|
||||
mkdir -p /opt/openobserve/data
|
||||
LATEST=$(curl -fsSL https://api.github.com/repos/openobserve/openobserve/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
||||
$STD tar zxvf <(curl -fsSL https://downloads.openobserve.ai/releases/openobserve/$LATEST/openobserve-$LATEST-linux-amd64.tar.gz) -C /opt/openobserve
|
||||
RELEASE=$(get_latest_github_release "openobserve/openobserve")
|
||||
tar zxf <(curl -fsSL https://downloads.openobserve.ai/releases/openobserve/v$RELEASE/openobserve-v$RELEASE-linux-amd64.tar.gz) -C /opt/openobserve
|
||||
ROOT_PASS=$(openssl rand -base64 18 | cut -c1-13)
|
||||
|
||||
cat <<EOF >/opt/openobserve/data/.env
|
||||
ZO_ROOT_USER_EMAIL = "admin@example.com"
|
||||
ZO_ROOT_USER_PASSWORD = "$(openssl rand -base64 18 | cut -c1-13)"
|
||||
ZO_ROOT_USER_PASSWORD = "${ROOT_PASS}"
|
||||
ZO_DATA_DIR = "/opt/openobserve/data"
|
||||
ZO_HTTP_PORT = "5080"
|
||||
EOF
|
||||
echo "${RELEASE}" >>~/.openobserve
|
||||
msg_ok "Installed OpenObserve"
|
||||
|
||||
msg_info "Creating Service"
|
||||
|
||||
@ -1,209 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: CrazyWolf13
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/xperimental/nextcloud-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="nextcloud-exporter"
|
||||
APP_TYPE="tools"
|
||||
BINARY_PATH="/usr/bin/nextcloud-exporter"
|
||||
CONFIG_PATH="/etc/nextcloud-exporter.env"
|
||||
SERVICE_PATH="/etc/systemd/system/nextcloud-exporter.service"
|
||||
|
||||
# ==============================================================================
|
||||
# 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 Nextcloud-Exporter"
|
||||
systemctl disable -q --now nextcloud-exporter
|
||||
rm -f "$SERVICE_PATH"
|
||||
|
||||
if dpkg -l | grep -q nextcloud-exporter; then
|
||||
$STD apt-get remove -y nextcloud-exporter || $STD dpkg -r nextcloud-exporter
|
||||
fi
|
||||
|
||||
rm -f "$CONFIG_PATH"
|
||||
rm -f "/usr/local/bin/update_nextcloud-exporter"
|
||||
rm -f "$HOME/.nextcloud-exporter"
|
||||
msg_ok "Nextcloud-Exporter has been uninstalled"
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# UPDATE
|
||||
# ==============================================================================
|
||||
function update() {
|
||||
if check_for_gh_release "nextcloud-exporter" "xperimental/nextcloud-exporter"; then
|
||||
msg_info "Stopping service"
|
||||
systemctl stop nextcloud-exporter
|
||||
msg_ok "Stopped service"
|
||||
|
||||
fetch_and_deploy_gh_release "nextcloud-exporter" "xperimental/nextcloud-exporter" "binary" "latest"
|
||||
|
||||
msg_info "Starting service"
|
||||
systemctl start nextcloud-exporter
|
||||
msg_ok "Started service"
|
||||
msg_ok "Updated successfully"
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# INSTALL
|
||||
# ==============================================================================
|
||||
function install() {
|
||||
read -erp "Enter URL of Nextcloud, example: (http://127.0.0.1:8080): " NEXTCLOUD_SERVER
|
||||
read -rsp "Enter Nextcloud auth token (press Enter to use username/password instead): " NEXTCLOUD_AUTH_TOKEN
|
||||
printf "\n"
|
||||
|
||||
if [[ -z "$NEXTCLOUD_AUTH_TOKEN" ]]; then
|
||||
read -erp "Enter Nextcloud username: " NEXTCLOUD_USERNAME
|
||||
read -rsp "Enter Nextcloud password: " NEXTCLOUD_PASSWORD
|
||||
printf "\n"
|
||||
fi
|
||||
|
||||
read -erp "Query additional info for apps? [Y/n]: " QUERY_APPS
|
||||
if [[ "${QUERY_APPS,,}" =~ ^(n|no)$ ]]; then
|
||||
NEXTCLOUD_INFO_APPS="false"
|
||||
fi
|
||||
|
||||
read -erp "Query update information? [Y/n]: " QUERY_UPDATES
|
||||
if [[ "${QUERY_UPDATES,,}" =~ ^(n|no)$ ]]; then
|
||||
NEXTCLOUD_INFO_UPDATE="false"
|
||||
fi
|
||||
|
||||
read -erp "Do you want to skip TLS-Verification (if using a self-signed Certificate on Nextcloud) [y/N]: " SKIP_TLS
|
||||
if [[ "${SKIP_TLS,,}" =~ ^(y|yes)$ ]]; then
|
||||
NEXTCLOUD_TLS_SKIP_VERIFY="true"
|
||||
fi
|
||||
|
||||
fetch_and_deploy_gh_release "nextcloud-exporter" "xperimental/nextcloud-exporter" "binary" "latest"
|
||||
|
||||
msg_info "Creating configuration"
|
||||
cat <<EOF >"$CONFIG_PATH"
|
||||
# https://github.com/xperimental/nextcloud-exporter
|
||||
NEXTCLOUD_SERVER="${NEXTCLOUD_SERVER}"
|
||||
NEXTCLOUD_AUTH_TOKEN="${NEXTCLOUD_AUTH_TOKEN:-}"
|
||||
NEXTCLOUD_USERNAME="${NEXTCLOUD_USERNAME:-}"
|
||||
NEXTCLOUD_PASSWORD="${NEXTCLOUD_PASSWORD:-}"
|
||||
NEXTCLOUD_INFO_UPDATE=${NEXTCLOUD_INFO_UPDATE:-"true"}
|
||||
NEXTCLOUD_INFO_APPS=${NEXTCLOUD_INFO_APPS:-"true"}
|
||||
NEXTCLOUD_TLS_SKIP_VERIFY=${NEXTCLOUD_TLS_SKIP_VERIFY:-"false"}
|
||||
NEXTCLOUD_LISTEN_ADDRESS=":9205"
|
||||
EOF
|
||||
msg_ok "Created configuration"
|
||||
|
||||
msg_info "Creating service"
|
||||
cat <<EOF >"$SERVICE_PATH"
|
||||
[Unit]
|
||||
Description=nextcloud-exporter
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
EnvironmentFile=$CONFIG_PATH
|
||||
ExecStart=$BINARY_PATH
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl enable -q --now nextcloud-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_nextcloud-exporter
|
||||
#!/usr/bin/env bash
|
||||
# nextcloud-exporter Update Script
|
||||
type=update bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/nextcloud-exporter.sh)"
|
||||
UPDATEEOF
|
||||
chmod +x /usr/local/bin/update_nextcloud-exporter
|
||||
msg_ok "Created update script (/usr/local/bin/update_nextcloud-exporter)"
|
||||
|
||||
echo ""
|
||||
msg_ok "Nextcloud-Exporter installed successfully"
|
||||
msg_ok "Metrics: ${BL}http://${LOCAL_IP}:9205/metrics${CL}"
|
||||
msg_ok "Config: ${BL}${CONFIG_PATH}${CL}"
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# MAIN
|
||||
# ==============================================================================
|
||||
header_info
|
||||
ensure_usr_local_bin_persist
|
||||
import_local_ip
|
||||
|
||||
# Handle type=update (called from update script)
|
||||
if [[ "${type:-}" == "update" ]]; then
|
||||
if [[ -f "$BINARY_PATH" ]]; then
|
||||
update
|
||||
else
|
||||
msg_error "Nextcloud-Exporter is not installed. Nothing to update."
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check if already installed
|
||||
if [[ -f "$BINARY_PATH" ]]; then
|
||||
msg_warn "Nextcloud-Exporter is already installed."
|
||||
echo ""
|
||||
|
||||
echo -n "${TAB}Uninstall Nextcloud-Exporter? (y/N): "
|
||||
read -r uninstall_prompt
|
||||
if [[ "${uninstall_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
uninstall
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo -n "${TAB}Update Nextcloud-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 "Nextcloud-Exporter is not installed."
|
||||
echo ""
|
||||
echo -e "${TAB}${INFO} This will install:"
|
||||
echo -e "${TAB} - Nextcloud Exporter (binary)"
|
||||
echo -e "${TAB} - Systemd service"
|
||||
echo ""
|
||||
|
||||
echo -n "${TAB}Install Nextcloud-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