Merge branch 'main' of https://github.com/GoldenSpringness/ProxmoxVED into feature/sonobarr

updating code
This commit is contained in:
GoldenSpring 2025-12-26 01:12:30 +03:00
commit a0e6da9ddc
No known key found for this signature in database
GPG Key ID: 75701174BCB6A808
9 changed files with 4483 additions and 4380 deletions

64
ct/rustypaste.sh Normal file
View File

@ -0,0 +1,64 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: GoldenSpringness
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/orhun/rustypaste
APP="rustypaste"
var_tags="${var_tags:-pastebin;storage}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-512}"
var_disk="${var_disk:-20}"
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 "/opt/rustypaste/target/release/rustypaste" ]]; then
msg_error "No rustypaste Installation Found!"
exit
fi
if check_for_gh_release "rustypaste" "orhun/rustypaste"; then
msg_info "Stopping rustypaste"
systemctl stop rustypaste
msg_ok "Stopped rustypaste"
msg_info "Creating Backup"
tar -czf "/opt/rustypaste_backup_$(date +%F).tar.gz" "/opt/rustypaste/upload"
msg_ok "Backup Created"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "rustypaste" "orhun/rustypaste" "tarball" "latest" "/opt/rustypaste"
msg_info "Updating rustypaste"
cd /opt/rustypaste
sed -i 's|^address = ".*"|address = "0.0.0.0:8000"|' config.toml
$STD cargo build --locked --release
msg_ok "Updated rustypaste"
msg_info "Starting rustypaste"
systemctl start rustypaste
msg_ok "Started rustypaste"
msg_ok "Update Successful"
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}rustypaste setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8000${CL}"

View File

@ -8,11 +8,11 @@
"type": "addon",
"updateable": true,
"privileged": false,
"interface_port": 9025,
"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": "/opt/nextcloud-exporter.env",
"config_path": "/etc/nextcloud-exporter.env",
"description": "Prometheus exporter for Nextcloud servers. ",
"install_methods": [
{
@ -25,17 +25,6 @@
"os": null,
"version": null
}
},
{
"type": "alpine",
"script": "tools/addon/nextcloud-exporter.sh",
"resources": {
"cpu": null,
"ram": null,
"hdd": null,
"os": null,
"version": null
}
}
],
"default_credentials": {

View File

@ -0,0 +1,40 @@
{
"name": "RustyPaste",
"slug": "rustypaste",
"categories": [
12
],
"date_created": "2025-12-22",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 8000,
"documentation": "https://github.com/orhun/rustypaste",
"config_path": "/opt/rustypaste/config.toml",
"website": "https://github.com/orhun/rustypaste",
"logo": "https://github.com/orhun/rustypaste/raw/master/img/rustypaste_logo.png",
"description": "Rustypaste is a minimal file upload/pastebin service.",
"install_methods": [
{
"type": "default",
"script": "ct/rustypaste.sh",
"resources": {
"cpu": 1,
"ram": 512,
"hdd": 20,
"os": "Debian",
"version": "13"
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": [
{
"text": "When updating the script it will backup the whole project including all the uploaded files, make sure to extract it to a safe location or remove",
"type": "info"
}
]
}

View File

@ -13,46 +13,47 @@ setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
pkg-config \
libssl-dev \
libc6-dev \
libpq-dev \
clang \
llvm \
nettle-dev \
build-essential \
make
msg_ok "Installed Dependencies"
#msg_info "Installing Dependencies"
#$STD apt-get install -y \
# pkg-config \
# libssl-dev \
# libc6-dev \
# libpq-dev \
# clang \
# llvm \
# nettle-dev \
# build-essential \
# make
#msg_ok "Installed Dependencies"
setup_rust
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
fetch_and_deploy_gh_release "hoodik" "hudikhq/hoodik" "tarball" "latest" "/opt/hoodik"
#setup_rust
#NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
#fetch_and_deploy_gh_release "hoodik" "hudikhq/hoodik" "tarball" "latest" "/opt/hoodik"
fetch_and_deploy_gh_release "hoodik" "hudikhq/hoodik" "prebuild" "latest" "/opt/hoodik" "*x86_64.tar.gz"
msg_info "Installing wasm-pack"
$STD cargo install wasm-pack
msg_ok "Installed wasm-pack"
#msg_info "Installing wasm-pack"
#$STD cargo install wasm-pack
#msg_ok "Installed wasm-pack"
msg_info "Building Hoodik Frontend"
cd /opt/hoodik
$STD yarn install --frozen-lockfile
$STD yarn wasm-pack
$STD yarn web:build
msg_ok "Built Hoodik Frontend"
#msg_info "Building Hoodik Frontend"
#cd /opt/hoodik
#$STD yarn install --frozen-lockfile
#$STD yarn wasm-pack
#$STD yarn web:build
#msg_ok "Built Hoodik Frontend"
msg_info "Building Hoodik Backend"
cd /opt/hoodik
$STD cargo build --release
cp /opt/hoodik/target/release/hoodik /usr/local/bin/hoodik
chmod +x /usr/local/bin/hoodik
msg_ok "Built Hoodik Backend"
#msg_info "Building Hoodik Backend"
#cd /opt/hoodik
#$STD cargo build --release
#cp /opt/hoodik/target/release/hoodik /usr/local/bin/hoodik
#chmod +x /usr/local/bin/hoodik
#msg_ok "Built Hoodik Backend"
msg_info "Cleaning up build artifacts"
rm -rf /opt/hoodik/target
rm -rf /root/.cargo/registry
rm -rf /opt/hoodik/node_modules
msg_ok "Cleaned up build artifacts"
#msg_info "Cleaning up build artifacts"
#rm -rf /opt/hoodik/target
#rm -rf /root/.cargo/registry
#rm -rf /opt/hoodik/node_modules
#msg_ok "Cleaned up build artifacts"
msg_info "Configuring Hoodik"
mkdir -p /opt/hoodik_data
@ -80,7 +81,8 @@ Type=simple
User=root
WorkingDirectory=/opt/hoodik_data
EnvironmentFile=/opt/hoodik/.env
ExecStart=/usr/local/bin/hoodik
#ExecStart=/usr/local/bin/hoodik
ExecStart=/opt/hoodik
Restart=always
RestartSec=5

View File

@ -0,0 +1,48 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: GoldenSpringness
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# Source: https://github.com/orhun/rustypaste
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y build-essential
msg_ok "Dependencies Installed Successfully"
RUST_VERSION="1.92.0" setup_rust
fetch_and_deploy_gh_release "rustypaste" "orhun/rustypaste" "tarball"
msg_info "Setting up rustypaste"
cd /opt/rustypaste
sed -i 's|^address = ".*"|address = "0.0.0.0:8000"|' config.toml
$STD cargo build --locked --release
msg_ok "Set up rustypaste"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/rustypaste.service
[Unit]
Description=rustypaste Service
After=network.target
[Service]
WorkingDirectory=/opt/rustypaste
ExecStart=/opt/rustypaste/target/release/rustypaste
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now rustypaste
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -20,22 +20,15 @@ load_functions
VERBOSE=${var_verbose:-no}
APP="nextcloud-exporter"
APP_TYPE="tools"
INSTALL_PATH="/opt/nextcloud-exporter"
CONFIG_PATH="/opt/nextcloud-exporter.env"
header_info
ensure_usr_local_bin_persist
BINARY_PATH="/usr/bin/nextcloud-exporter"
CONFIG_PATH="/etc/nextcloud-exporter.env"
SERVICE_PATH="/etc/systemd/system/nextcloud-exporter.service"
# ==============================================================================
# OS DETECTION
# ==============================================================================
if [[ -f "/etc/alpine-release" ]]; then
OS="Alpine"
SERVICE_PATH="/etc/init.d/nextcloud-exporter"
elif grep -qE 'ID=debian|ID=ubuntu' /etc/os-release; then
OS="Debian"
SERVICE_PATH="/etc/systemd/system/nextcloud-exporter.service"
else
echo -e "${CROSS} Unsupported OS detected. Exiting."
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
@ -44,15 +37,14 @@ fi
# ==============================================================================
function uninstall() {
msg_info "Uninstalling Nextcloud-Exporter"
if [[ "$OS" == "Alpine" ]]; then
rc-service nextcloud-exporter stop &>/dev/null
rc-update del nextcloud-exporter &>/dev/null
rm -f "$SERVICE_PATH"
else
systemctl disable -q --now nextcloud-exporter
rm -f "$SERVICE_PATH"
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 -rf "$INSTALL_PATH" "$CONFIG_PATH"
rm -f "$CONFIG_PATH"
rm -f "/usr/local/bin/update_nextcloud-exporter"
rm -f "$HOME/.nextcloud-exporter"
msg_ok "Nextcloud-Exporter has been uninstalled"
@ -64,22 +56,13 @@ function uninstall() {
function update() {
if check_for_gh_release "nextcloud-exporter" "xperimental/nextcloud-exporter"; then
msg_info "Stopping service"
if [[ "$OS" == "Alpine" ]]; then
rc-service nextcloud-exporter stop &>/dev/null
else
systemctl stop nextcloud-exporter
fi
systemctl stop nextcloud-exporter
msg_ok "Stopped service"
fetch_and_deploy_gh_release "nextcloud-exporter" "xperimental/nextcloud-exporter" "prebuild" "latest" "nextcloud-exporter_*_amd64.deb"
setup_go
fetch_and_deploy_gh_release "nextcloud-exporter" "xperimental/nextcloud-exporter" "binary" "latest"
msg_info "Starting service"
if [[ "$OS" == "Alpine" ]]; then
rc-service nextcloud-exporter start &>/dev/null
else
systemctl start nextcloud-exporter
fi
systemctl start nextcloud-exporter
msg_ok "Started service"
msg_ok "Updated successfully"
exit
@ -115,16 +98,15 @@ function install() {
NEXTCLOUD_TLS_SKIP_VERIFY="true"
fi
fetch_and_deploy_gh_release "nextcloud-exporter" "xperimental/nextcloud-exporter" "prebuild" "latest" "nextcloud-exporter_*_amd64.deb"
setup_go
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_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"}
@ -133,52 +115,22 @@ EOF
msg_ok "Created configuration"
msg_info "Creating service"
if [[ "$OS" == "Debian" ]]; then
cat <<EOF >"$SERVICE_PATH"
cat <<EOF >"$SERVICE_PATH"
[Unit]
Description=nextcloud-exporter
After=network.target
[Service]
User=root
WorkingDirectory=/opt/nextcloud-exporter
EnvironmentFile=$CONFIG_PATH
ExecStart=/opt/nextcloud-exporter/nextcloud-exporter
ExecStart=$BINARY_PATH
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable -q --now nextcloud-exporter
else
cat <<EOF >"$SERVICE_PATH"
#!/sbin/openrc-run
name="nextcloud-exporter"
description="Nextcloud Exporter for Prometheus"
command="${INSTALL_PATH}/nextcloud-exporter"
command_background=true
directory="/opt/nextcloud-exporter"
pidfile="/run/\${RC_SVCNAME}.pid"
output_log="/var/log/nextcloud-exporter.log"
error_log="/var/log/nextcloud-exporter.log"
depend() {
need net
after firewall
}
start_pre() {
if [ -f "$CONFIG_PATH" ]; then
export \$(grep -v '^#' $CONFIG_PATH | xargs)
fi
}
EOF
chmod +x "$SERVICE_PATH"
$STD rc-update add nextcloud-exporter default
$STD rc-service nextcloud-exporter start
fi
systemctl daemon-reload
systemctl enable -q --now nextcloud-exporter
msg_ok "Created and started service"
# Create update script
@ -194,7 +146,7 @@ UPDATEEOF
echo ""
msg_ok "Nextcloud-Exporter installed successfully"
msg_ok "Metrics: ${BL}http://${CURRENT_IP}:9205/metrics${CL}"
msg_ok "Metrics: ${BL}http://${LOCAL_IP}:9205/metrics${CL}"
msg_ok "Config: ${BL}${CONFIG_PATH}${CL}"
}
@ -203,10 +155,11 @@ UPDATEEOF
# ==============================================================================
header_info
ensure_usr_local_bin_persist
import_local_ip
# Handle type=update (called from update script)
if [[ "${type:-}" == "update" ]]; then
if [[ -d "$INSTALL_PATH" && -f "$INSTALL_PATH/nextcloud-exporter" ]]; then
if [[ -f "$BINARY_PATH" ]]; then
update
else
msg_error "Nextcloud-Exporter is not installed. Nothing to update."
@ -216,7 +169,7 @@ if [[ "${type:-}" == "update" ]]; then
fi
# Check if already installed
if [[ -d "$INSTALL_PATH" && -f "$INSTALL_PATH/nextcloud-exporter" ]]; then
if [[ -f "$BINARY_PATH" ]]; then
msg_warn "Nextcloud-Exporter is already installed."
echo ""
@ -243,7 +196,7 @@ msg_warn "Nextcloud-Exporter is not installed."
echo ""
echo -e "${TAB}${INFO} This will install:"
echo -e "${TAB} - Nextcloud Exporter (Go binary)"
echo -e "${TAB} - Systemd/OpenRC service"
echo -e "${TAB} - Systemd service"
echo ""
echo -n "${TAB}Install Nextcloud-Exporter? (y/N): "