Merge branch 'main' of https://github.com/GoldenSpringness/ProxmoxVED into feature/sonobarr
This commit is contained in:
commit
6b0b8d07e3
218
.github/workflows/update-github-versions.yml
generated
vendored
Normal file
218
.github/workflows/update-github-versions.yml
generated
vendored
Normal file
@ -0,0 +1,218 @@
|
||||
name: Update GitHub Versions (New)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# Runs 4x daily: 00:00, 06:00, 12:00, 18:00 UTC
|
||||
- cron: "0 0,6,12,18 * * *"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
env:
|
||||
VERSIONS_FILE: frontend/public/json/github-versions.json
|
||||
|
||||
jobs:
|
||||
update-github-versions:
|
||||
if: github.repository == 'community-scripts/ProxmoxVED'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
|
||||
- name: Extract GitHub versions from install scripts
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
echo "========================================="
|
||||
echo " Extracting GitHub versions from scripts"
|
||||
echo "========================================="
|
||||
|
||||
# Initialize versions array
|
||||
versions_json="[]"
|
||||
|
||||
# Function to add a version entry
|
||||
add_version() {
|
||||
local slug="$1"
|
||||
local repo="$2"
|
||||
local version="$3"
|
||||
local pinned="$4"
|
||||
local date="$5"
|
||||
|
||||
versions_json=$(echo "$versions_json" | jq \
|
||||
--arg slug "$slug" \
|
||||
--arg repo "$repo" \
|
||||
--arg version "$version" \
|
||||
--argjson pinned "$pinned" \
|
||||
--arg date "$date" \
|
||||
'. += [{"slug": $slug, "repo": $repo, "version": $version, "pinned": $pinned, "date": $date}]')
|
||||
}
|
||||
|
||||
# Get list of slugs from JSON files
|
||||
echo ""
|
||||
echo "=== Scanning JSON files for slugs ==="
|
||||
|
||||
for json_file in frontend/public/json/*.json; do
|
||||
[[ ! -f "$json_file" ]] && continue
|
||||
|
||||
# Skip non-app JSON files
|
||||
basename_file=$(basename "$json_file")
|
||||
case "$basename_file" in
|
||||
metadata.json|versions.json|github-versions.json|dependency-check.json|update-apps.json)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
# Extract slug from JSON
|
||||
slug=$(jq -r '.slug // empty' "$json_file" 2>/dev/null)
|
||||
[[ -z "$slug" ]] && continue
|
||||
|
||||
# Find corresponding install script
|
||||
install_script="install/${slug}-install.sh"
|
||||
[[ ! -f "$install_script" ]] && continue
|
||||
|
||||
# Look for fetch_and_deploy_gh_release calls
|
||||
# Pattern: fetch_and_deploy_gh_release "app" "owner/repo" ["mode"] ["version"]
|
||||
while IFS= read -r line; do
|
||||
# Skip commented lines
|
||||
[[ "$line" =~ ^[[:space:]]*# ]] && continue
|
||||
|
||||
# Extract repo and version from fetch_and_deploy_gh_release
|
||||
if [[ "$line" =~ fetch_and_deploy_gh_release[[:space:]]+\"[^\"]*\"[[:space:]]+\"([^\"]+)\"([[:space:]]+\"([^\"]+)\")?([[:space:]]+\"([^\"]+)\")? ]]; then
|
||||
repo="${BASH_REMATCH[1]}"
|
||||
mode="${BASH_REMATCH[3]:-tarball}"
|
||||
pinned_version="${BASH_REMATCH[5]:-latest}"
|
||||
|
||||
# Check if version is pinned (not "latest" and not empty)
|
||||
is_pinned=false
|
||||
target_version=""
|
||||
|
||||
if [[ -n "$pinned_version" && "$pinned_version" != "latest" ]]; then
|
||||
is_pinned=true
|
||||
target_version="$pinned_version"
|
||||
fi
|
||||
|
||||
# Fetch version from GitHub
|
||||
if [[ "$is_pinned" == "true" ]]; then
|
||||
# For pinned versions, verify it exists and get date
|
||||
response=$(gh api "repos/${repo}/releases/tags/${target_version}" 2>/dev/null || echo '{}')
|
||||
if echo "$response" | jq -e '.tag_name' > /dev/null 2>&1; then
|
||||
version=$(echo "$response" | jq -r '.tag_name')
|
||||
date=$(echo "$response" | jq -r '.published_at // empty')
|
||||
add_version "$slug" "$repo" "$version" "true" "$date"
|
||||
echo "[$slug] ✓ $version (pinned)"
|
||||
else
|
||||
echo "[$slug] ⚠ pinned version $target_version not found"
|
||||
fi
|
||||
else
|
||||
# Fetch latest release
|
||||
response=$(gh api "repos/${repo}/releases/latest" 2>/dev/null || echo '{}')
|
||||
if echo "$response" | jq -e '.tag_name' > /dev/null 2>&1; then
|
||||
version=$(echo "$response" | jq -r '.tag_name')
|
||||
date=$(echo "$response" | jq -r '.published_at // empty')
|
||||
add_version "$slug" "$repo" "$version" "false" "$date"
|
||||
echo "[$slug] ✓ $version"
|
||||
else
|
||||
# Try tags as fallback
|
||||
version=$(gh api "repos/${repo}/tags" --jq '.[0].name // empty' 2>/dev/null || echo "")
|
||||
if [[ -n "$version" ]]; then
|
||||
add_version "$slug" "$repo" "$version" "false" ""
|
||||
echo "[$slug] ✓ $version (from tags)"
|
||||
else
|
||||
echo "[$slug] ⚠ no version found"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
break # Only first match per script
|
||||
fi
|
||||
done < <(grep 'fetch_and_deploy_gh_release' "$install_script" 2>/dev/null || true)
|
||||
|
||||
done
|
||||
|
||||
# Save versions file
|
||||
echo "$versions_json" | jq --arg date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
||||
'{generated: $date, versions: (. | sort_by(.slug))}' > "$VERSIONS_FILE"
|
||||
|
||||
total=$(echo "$versions_json" | jq 'length')
|
||||
echo ""
|
||||
echo "========================================="
|
||||
echo " Total versions extracted: $total"
|
||||
echo "========================================="
|
||||
|
||||
- name: Check for changes
|
||||
id: check-changes
|
||||
run: |
|
||||
# Check if file is new (untracked) or has changes
|
||||
if [[ ! -f "$VERSIONS_FILE" ]]; then
|
||||
echo "changed=false" >> "$GITHUB_OUTPUT"
|
||||
echo "Versions file was not created"
|
||||
elif ! git ls-files --error-unmatch "$VERSIONS_FILE" &>/dev/null; then
|
||||
# File exists but is not tracked - it's new
|
||||
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||
echo "New file created: $VERSIONS_FILE"
|
||||
elif git diff --quiet "$VERSIONS_FILE" 2>/dev/null; then
|
||||
echo "changed=false" >> "$GITHUB_OUTPUT"
|
||||
echo "No changes detected"
|
||||
else
|
||||
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||
echo "Changes detected:"
|
||||
git diff --stat "$VERSIONS_FILE" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
- name: Create Pull Request
|
||||
if: steps.check-changes.outputs.changed == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
BRANCH_NAME="automated/update-github-versions-$(date +%Y%m%d)"
|
||||
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --global user.name "GitHub Actions[bot]"
|
||||
|
||||
# Check if branch exists and delete it
|
||||
git push origin --delete "$BRANCH_NAME" 2>/dev/null || true
|
||||
|
||||
git checkout -b "$BRANCH_NAME"
|
||||
git add "$VERSIONS_FILE"
|
||||
git commit -m "chore: update github-versions.json
|
||||
|
||||
Total versions: $(jq '.versions | length' "$VERSIONS_FILE")
|
||||
Pinned versions: $(jq '[.versions[] | select(.pinned == true)] | length' "$VERSIONS_FILE")
|
||||
Generated: $(jq -r '.generated' "$VERSIONS_FILE")"
|
||||
|
||||
git push origin "$BRANCH_NAME" --force
|
||||
|
||||
# Check if PR already exists
|
||||
existing_pr=$(gh pr list --head "$BRANCH_NAME" --state open --json number --jq '.[0].number // empty')
|
||||
|
||||
if [[ -n "$existing_pr" ]]; then
|
||||
echo "PR #$existing_pr already exists, updating..."
|
||||
else
|
||||
gh pr create \
|
||||
--title "[Automated] Update GitHub versions" \
|
||||
--body "This PR updates version information from GitHub releases.
|
||||
|
||||
## How it works
|
||||
1. Scans all JSON files in \`frontend/public/json/\` for slugs
|
||||
2. Finds corresponding \`install/{slug}-install.sh\` scripts
|
||||
3. Extracts \`fetch_and_deploy_gh_release\` calls
|
||||
4. Fetches latest (or pinned) version from GitHub
|
||||
|
||||
## Stats
|
||||
- Total versions: $(jq '.versions | length' "$VERSIONS_FILE")
|
||||
- Pinned versions: $(jq '[.versions[] | select(.pinned == true)] | length' "$VERSIONS_FILE")
|
||||
- Latest versions: $(jq '[.versions[] | select(.pinned == false)] | length' "$VERSIONS_FILE")
|
||||
|
||||
---
|
||||
*Automatically generated from install scripts*" \
|
||||
--base main \
|
||||
--head "$BRANCH_NAME" \
|
||||
--label "automated pr"
|
||||
fi
|
||||
11
.github/workflows/update-versions-github.yml
generated
vendored
11
.github/workflows/update-versions-github.yml
generated
vendored
@ -25,13 +25,6 @@ jobs:
|
||||
with:
|
||||
ref: main
|
||||
|
||||
- name: Generate GitHub App Token
|
||||
id: generate-token
|
||||
uses: actions/create-github-app-token@v1
|
||||
with:
|
||||
app-id: ${{ vars.APP_ID }}
|
||||
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||
|
||||
- name: Extract version sources from install scripts
|
||||
run: |
|
||||
set -euo pipefail
|
||||
@ -330,7 +323,7 @@ jobs:
|
||||
|
||||
- name: Fetch versions for all sources
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
@ -453,7 +446,7 @@ jobs:
|
||||
- name: Create Pull Request
|
||||
if: steps.check-changes.outputs.changed == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
BRANCH_NAME="automated/update-versions-$(date +%Y%m%d)"
|
||||
|
||||
|
||||
@ -1,71 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# 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
|
||||
|
||||
APP="Alpine-Loki"
|
||||
var_tags="${var_tags:-alpine;monitoring}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-256}"
|
||||
var_disk="${var_disk:-1}"
|
||||
var_os="${var_os:-alpine}"
|
||||
var_version="${var_version:-3.22}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
if ! apk -e info newt >/dev/null 2>&1; then
|
||||
apk add -q newt
|
||||
fi
|
||||
LXCIP=$(ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
|
||||
while true; do
|
||||
CHOICE=$(
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "SUPPORT" --menu "Select option" 11 58 3 \
|
||||
"1" "Check for Loki Updates" \
|
||||
"2" "Allow 0.0.0.0 for listening" \
|
||||
"3" "Allow only ${LXCIP} for listening" 3>&2 2>&1 1>&3
|
||||
)
|
||||
exit_status=$?
|
||||
if [ $exit_status == 1 ]; then
|
||||
clear
|
||||
exit-script
|
||||
fi
|
||||
header_info
|
||||
case $CHOICE in
|
||||
1)
|
||||
$STD apk -U upgrade
|
||||
msg_ok "Updated successfully!"
|
||||
exit
|
||||
;;
|
||||
2)
|
||||
sed -i -e "s/cfg:server.http_addr=.*/cfg:server.http_addr=0.0.0.0/g" /etc/conf.d/loki
|
||||
service loki restart
|
||||
msg_ok "Allowed listening on all interfaces!"
|
||||
exit
|
||||
;;
|
||||
3)
|
||||
sed -i -e "s/cfg:server.http_addr=.*/cfg:server.http_addr=$LXCIP/g" /etc/conf.d/loki
|
||||
service loki restart
|
||||
msg_ok "Allowed listening only on ${LXCIP}!"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
done
|
||||
exit 0
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${APP} should be reachable by going to the following URL.
|
||||
${BL}http://${IP}:3100${CL} \n"
|
||||
echo -e "Promtail should be reachable by going to the following URL.
|
||||
${BL}http://${IP}:9080${CL} \n"
|
||||
50
ct/alpine-powerdns.sh
Normal file
50
ct/alpine-powerdns.sh
Normal file
@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Slaviša Arežina (tremor021)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://www.powerdns.com/
|
||||
|
||||
APP="Alpine-PowerDNS"
|
||||
var_tags="${var_tags:-os;alpine;dns}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-256}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_os="${var_os:-alpine}"
|
||||
var_version="${var_version:-3.23}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if ! apk info -e pdns >/dev/null 2>&1; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Updating PowerDNS"
|
||||
$STD apk -U upgrade
|
||||
msg_ok "Updated PowerDNS"
|
||||
|
||||
msg_info "Restarting Services"
|
||||
$STD rc-service pdns restart
|
||||
msg_ok "Restarted Services"
|
||||
msg_ok "Updated successfully!"
|
||||
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}:53${CL}"
|
||||
51
ct/alpine-rustypaste.sh
Normal file
51
ct/alpine-rustypaste.sh
Normal file
@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/orhun/rustypaste
|
||||
|
||||
APP="Alpine-RustyPaste"
|
||||
var_tags="${var_tags:-alpine;pastebin;storage}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-256}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_os="${var_os:-alpine}"
|
||||
var_version="${var_version:-3.23}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if ! apk info -e rustypaste >/dev/null 2>&1; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Updating RustyPaste"
|
||||
$STD apk update
|
||||
$STD apk upgrade rustypaste --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
|
||||
msg_ok "Updated RustyPaste"
|
||||
|
||||
msg_info "Restarting Services"
|
||||
$STD rc-service rustypaste restart
|
||||
msg_ok "Restarted Services"
|
||||
msg_ok "Updated successfully!"
|
||||
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}:8000${CL}"
|
||||
@ -1,73 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: pshankinclarke (lazarillo)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://valkey.io/
|
||||
|
||||
APP="Alpine-Valkey"
|
||||
var_tags="${var_tags:-alpine;database}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-256}"
|
||||
var_disk="${var_disk:-1}"
|
||||
var_os="${var_os:-alpine}"
|
||||
var_version="${var_version:-3.22}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
if ! apk -e info newt >/dev/null 2>&1; then
|
||||
apk add -q newt
|
||||
fi
|
||||
LXCIP=$(ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
|
||||
while true; do
|
||||
CHOICE=$(
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Valkey Management" --menu "Select option" 11 58 3 \
|
||||
"1" "Update Valkey" \
|
||||
"2" "Allow 0.0.0.0 for listening" \
|
||||
"3" "Allow only ${LXCIP} for listening" 3>&2 2>&1 1>&3
|
||||
)
|
||||
exit_status=$?
|
||||
if [ $exit_status == 1 ]; then
|
||||
clear
|
||||
exit-script
|
||||
fi
|
||||
header_info
|
||||
case $CHOICE in
|
||||
1)
|
||||
msg_info "Updating Valkey"
|
||||
apk update && apk upgrade valkey
|
||||
rc-service valkey restart
|
||||
msg_ok "Updated Valkey"
|
||||
msg_ok "Updated successfully!"
|
||||
exit
|
||||
;;
|
||||
2)
|
||||
msg_info "Setting Valkey to listen on all interfaces"
|
||||
sed -i 's/^bind .*/bind 0.0.0.0/' /etc/valkey/valkey.conf
|
||||
rc-service valkey restart
|
||||
msg_ok "Valkey now listens on all interfaces!"
|
||||
exit
|
||||
;;
|
||||
3)
|
||||
msg_info "Setting Valkey to listen only on ${LXCIP}"
|
||||
sed -i "s/^bind .*/bind ${LXCIP}/" /etc/valkey/valkey.conf
|
||||
rc-service valkey restart
|
||||
msg_ok "Valkey now listens only on ${LXCIP}!"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed successfully!\n"
|
||||
echo -e "${APP} should be reachable on port 6379.
|
||||
${BL}valkey-cli -h ${IP} -p 6379${CL} \n"
|
||||
@ -29,7 +29,7 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
if check_for_gh_release "Ampache" "ampache/ampache"; then
|
||||
import_local_ip
|
||||
|
||||
msg_info "Stopping Apache"
|
||||
systemctl stop apache2
|
||||
msg_ok "Stopped Apache"
|
||||
|
||||
66
ct/anytype.sh
Normal file
66
ct/anytype.sh
Normal file
@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://anytype.io
|
||||
|
||||
APP="Anytype"
|
||||
var_tags="${var_tags:-notes;productivity;sync}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-4096}"
|
||||
var_disk="${var_disk:-16}"
|
||||
var_os="${var_os:-ubuntu}"
|
||||
var_version="${var_version:-24.04}"
|
||||
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/anytype/any-sync-bundle ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "anytype" "grishy/any-sync-bundle"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop anytype
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Backing up Data"
|
||||
cp -r /opt/anytype/data /opt/anytype_data_backup
|
||||
msg_ok "Backed up Data"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "anytype" "grishy/any-sync-bundle" "prebuild" "latest" "/opt/anytype" "any-sync-bundle_*_linux_amd64.tar.gz"
|
||||
chmod +x /opt/anytype/any-sync-bundle
|
||||
|
||||
msg_info "Restoring Data"
|
||||
cp -r /opt/anytype_data_backup/. /opt/anytype/data
|
||||
rm -rf /opt/anytype_data_backup
|
||||
msg_ok "Restored Data"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start anytype
|
||||
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}:33010${CL}"
|
||||
echo -e "${INFO}${YW} Client config file:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}/opt/anytype/data/client-config.yml${CL}"
|
||||
@ -1,20 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: luismco
|
||||
# Author: thost96 (thost96)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/ThePhaseless/Byparr
|
||||
# Source: https://www.authelia.com/
|
||||
|
||||
APP="Byparr"
|
||||
var_tags="${var_tags:-proxy}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-4}"
|
||||
APP="Authelia"
|
||||
var_tags="${var_tags:-authenticator}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
var_disk="${var_disk:-2}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
base_settings
|
||||
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
@ -23,26 +25,19 @@ function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /opt/Byparr ]]; then
|
||||
if [[ ! -d /etc/authelia/ ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "Byparr" "ThePhaseless/Byparr"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop byparr
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Byparr" "ThePhaseless/Byparr"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start byparr
|
||||
msg_ok "Started Service"
|
||||
if check_for_gh_release "authelia" "authelia/authelia"; then
|
||||
$STD apt update
|
||||
$STD apt -y upgrade
|
||||
fetch_and_deploy_gh_release "authelia" "authelia/authelia" "binary"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
@ -50,4 +45,4 @@ 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}:8191${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9091 or https://auth.YOURDOMAIN ${CL}"
|
||||
58
ct/clawdbot.sh
Normal file
58
ct/clawdbot.sh
Normal file
@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: michelroegl-brunner
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/clawdbot/clawdbot
|
||||
|
||||
APP="Clawdbot"
|
||||
var_tags="${var_tags:-ai;assistant}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-8}"
|
||||
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 ! command -v clawdbot >/dev/null 2>&1; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Backing up Data"
|
||||
cp -r /opt/clawdbot/data /opt/clawdbot_data_backup 2>/dev/null || true
|
||||
cp -r /root/.clawdbot /root/.clawdbot_backup 2>/dev/null || true
|
||||
msg_ok "Backed up Data"
|
||||
|
||||
msg_info "Updating Clawdbot"
|
||||
$STD npm install -g clawdbot@latest
|
||||
msg_ok "Updated Clawdbot"
|
||||
|
||||
msg_info "Restoring Data"
|
||||
cp -r /opt/clawdbot_data_backup/. /opt/clawdbot/data 2>/dev/null || true
|
||||
cp -r /root/.clawdbot_backup/. /root/.clawdbot 2>/dev/null || true
|
||||
rm -rf /opt/clawdbot_data_backup /root/.clawdbot_backup
|
||||
msg_ok "Restored Data"
|
||||
msg_ok "Updated successfully!"
|
||||
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}:18791${CL}"
|
||||
|
||||
@ -1,95 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/Freika/dawarich
|
||||
|
||||
APP="Dawarich"
|
||||
var_tags="${var_tags:-location;tracking;gps}"
|
||||
var_cpu="${var_cpu:-4}"
|
||||
var_ram="${var_ram:-4096}"
|
||||
var_disk="${var_disk:-15}"
|
||||
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 [[ ! -d /opt/dawarich ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "dawarich" "Freika/dawarich"; then
|
||||
msg_info "Stopping Services"
|
||||
systemctl stop dawarich-web dawarich-worker
|
||||
msg_ok "Stopped Services"
|
||||
|
||||
msg_info "Backing up Data"
|
||||
cp -r /opt/dawarich/app/storage /opt/dawarich_storage_backup 2>/dev/null || true
|
||||
cp /opt/dawarich/app/config/master.key /opt/dawarich_master.key 2>/dev/null || true
|
||||
cp /opt/dawarich/app/config/credentials.yml.enc /opt/dawarich_credentials.yml.enc 2>/dev/null || true
|
||||
msg_ok "Backed up Data"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "dawarich" "Freika/dawarich" "tarball" "latest" "/opt/dawarich/app"
|
||||
|
||||
RUBY_VERSION=$(cat /opt/dawarich/app/.ruby-version 2>/dev/null || echo "3.4.6")
|
||||
RUBY_VERSION=${RUBY_VERSION} RUBY_INSTALL_RAILS="false" setup_ruby
|
||||
|
||||
msg_info "Running Migrations"
|
||||
cd /opt/dawarich/app
|
||||
source /root/.profile
|
||||
export PATH="/root/.rbenv/shims:/root/.rbenv/bin:$PATH"
|
||||
eval "$(/root/.rbenv/bin/rbenv init - bash)"
|
||||
|
||||
set -a && source /opt/dawarich/.env && set +a
|
||||
|
||||
$STD bundle config set --local deployment 'true'
|
||||
$STD bundle config set --local without 'development test'
|
||||
$STD bundle install
|
||||
|
||||
if [[ -f /opt/dawarich/package.json ]]; then
|
||||
cd /opt/dawarich
|
||||
$STD npm install
|
||||
cd /opt/dawarich/app
|
||||
elif [[ -f /opt/dawarich/app/package.json ]]; then
|
||||
$STD npm install
|
||||
fi
|
||||
|
||||
$STD bundle exec rake assets:precompile
|
||||
$STD bundle exec rails db:migrate
|
||||
$STD bundle exec rake data:migrate
|
||||
msg_ok "Ran Migrations"
|
||||
|
||||
msg_info "Restoring Data"
|
||||
cp -r /opt/dawarich_storage_backup/. /opt/dawarich/app/storage/ 2>/dev/null || true
|
||||
cp /opt/dawarich_master.key /opt/dawarich/app/config/master.key 2>/dev/null || true
|
||||
cp /opt/dawarich_credentials.yml.enc /opt/dawarich/app/config/credentials.yml.enc 2>/dev/null || true
|
||||
rm -rf /opt/dawarich_storage_backup /opt/dawarich_master.key /opt/dawarich_credentials.yml.enc
|
||||
msg_ok "Restored Data"
|
||||
|
||||
msg_info "Starting Services"
|
||||
systemctl start dawarich-web dawarich-worker
|
||||
msg_ok "Started Services"
|
||||
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}:3000${CL}"
|
||||
44
ct/ebusd.sh
Normal file
44
ct/ebusd.sh
Normal file
@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Joerg Heinemann (heinemannj)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/john30/ebusd
|
||||
|
||||
APP="ebusd"
|
||||
var_tags="${var_tags:-automation}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
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/apt/sources.list.d/ebusd.sources ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Updating ebusd"
|
||||
$STD apt update
|
||||
$STD apt --upgrade -y ebusd
|
||||
msg_ok "Updated ebusd"
|
||||
msg_ok "Updated successfully!"
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
68
ct/fileflows.sh
Normal file
68
ct/fileflows.sh
Normal file
@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: kkroboth
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://fileflows.com/
|
||||
|
||||
APP="FileFlows"
|
||||
var_tags="${var_tags:-media;automation}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-8}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
var_gpu="${var_gpu:-yes}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/fileflows ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
if ! [[ $(dpkg -s jq 2>/dev/null) ]]; then
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y jq
|
||||
fi
|
||||
|
||||
update_available=$(curl -fsSL -X 'GET' "http://localhost:19200/api/status/update-available" -H 'accept: application/json' | jq .UpdateAvailable)
|
||||
if [[ "${update_available}" == "true" ]]; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop fileflows
|
||||
msg_info "Stopped Service"
|
||||
|
||||
msg_info "Creating Backup"
|
||||
backup_filename="/opt/${APP}_backup_$(date +%F).tar.gz"
|
||||
tar -czf "$backup_filename" -C /opt/fileflows Data
|
||||
msg_ok "Backup Created"
|
||||
|
||||
fetch_and_deploy_archive "https://fileflows.com/downloads/zip" "/opt/fileflows"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start fileflows
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at latest version"
|
||||
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}:19200${CL}"
|
||||
@ -6,7 +6,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://forgejo.org/
|
||||
|
||||
APP="Forgejo Runner"
|
||||
APP="Forgejo-Runner"
|
||||
var_tags="${var_tags:-ci}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
|
||||
55
ct/ghost.sh
Normal file
55
ct/ghost.sh
Normal file
@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: fabrice1236
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://ghost.org/
|
||||
|
||||
APP="Ghost"
|
||||
var_tags="${var_tags:-cms;blog}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-1024}"
|
||||
var_disk="${var_disk:-5}"
|
||||
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
|
||||
|
||||
setup_mariadb
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
|
||||
msg_info "Updating Ghost"
|
||||
if command -v ghost &>/dev/null; then
|
||||
current_version=$(ghost version | grep 'Ghost-CLI version' | awk '{print $3}')
|
||||
latest_version=$(npm show ghost-cli version)
|
||||
if [ "$current_version" != "$latest_version" ]; then
|
||||
msg_info "Updating ${APP} from version v${current_version} to v${latest_version}"
|
||||
$STD npm install -g ghost-cli@latest
|
||||
msg_ok "Updated successfully!"
|
||||
else
|
||||
msg_ok "${APP} is already at v${current_version}"
|
||||
fi
|
||||
else
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
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}:2368${CL}"
|
||||
6
ct/headers/alpine-rustypaste
Normal file
6
ct/headers/alpine-rustypaste
Normal file
@ -0,0 +1,6 @@
|
||||
___ __ _ ____ __ ____ __
|
||||
/ | / /___ (_)___ ___ / __ \__ _______/ /___ __/ __ \____ ______/ /____
|
||||
/ /| | / / __ \/ / __ \/ _ \____/ /_/ / / / / ___/ __/ / / / /_/ / __ `/ ___/ __/ _ \
|
||||
/ ___ |/ / /_/ / / / / / __/____/ _, _/ /_/ (__ ) /_/ /_/ / ____/ /_/ (__ ) /_/ __/
|
||||
/_/ |_/_/ .___/_/_/ /_/\___/ /_/ |_|\__,_/____/\__/\__, /_/ \__,_/____/\__/\___/
|
||||
/_/ /____/
|
||||
@ -1,6 +0,0 @@
|
||||
____
|
||||
/ __ )__ ______ ____ ___________
|
||||
/ __ / / / / __ \/ __ `/ ___/ ___/
|
||||
/ /_/ / /_/ / /_/ / /_/ / / / /
|
||||
/_____/\__, / .___/\__,_/_/ /_/
|
||||
/____/_/
|
||||
6
ct/headers/ebusd
Normal file
6
ct/headers/ebusd
Normal file
@ -0,0 +1,6 @@
|
||||
__ __
|
||||
___ / /_ _ ___________/ /
|
||||
/ _ \/ __ \/ / / / ___/ __ /
|
||||
/ __/ /_/ / /_/ (__ ) /_/ /
|
||||
\___/_.___/\__,_/____/\__,_/
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
__ __ _
|
||||
/ / ____ / /__(_)
|
||||
/ / / __ \/ //_/ /
|
||||
/ /___/ /_/ / ,< / /
|
||||
/_____/\____/_/|_/_/
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
__ ___ ____ __ __
|
||||
/ |/ /___ _____ __ __/ __/___ / /___/ /
|
||||
/ /|_/ / __ `/ __ \/ / / / /_/ __ \/ / __ /
|
||||
/ / / / /_/ / / / / /_/ / __/ /_/ / / /_/ /
|
||||
/_/ /_/\__,_/_/ /_/\__, /_/ \____/_/\__,_/
|
||||
/____/
|
||||
@ -1,6 +0,0 @@
|
||||
______
|
||||
/_ __/________ _________ ____ ___________
|
||||
/ / / ___/ __ `/ ___/ _ \/ __ `/ ___/ ___/
|
||||
/ / / / / /_/ / /__/ __/ /_/ / / / /
|
||||
/_/ /_/ \__,_/\___/\___/\__,_/_/ /_/
|
||||
|
||||
407
ct/immich.sh
Normal file
407
ct/immich.sh
Normal file
@ -0,0 +1,407 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: vhsdream
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://immich.app
|
||||
|
||||
APP="immich"
|
||||
var_tags="${var_tags:-photos}"
|
||||
var_disk="${var_disk:-20}"
|
||||
var_cpu="${var_cpu:-4}"
|
||||
var_ram="${var_ram:-6144}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
var_gpu="${var_gpu:-yes}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /opt/immich ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
if [[ -f /etc/apt/sources.list.d/immich.list ]]; then
|
||||
msg_error "Wrong Debian version detected!"
|
||||
msg_error "You must upgrade your LXC to Debian Trixie before updating."
|
||||
msg_error "Please visit https://github.com/community-scripts/ProxmoxVE/discussions/7726 for details."
|
||||
echo "${TAB3} If you have upgraded your LXC to Trixie and you still see this message, please open an Issue in the Community-Scripts repo."
|
||||
exit
|
||||
fi
|
||||
|
||||
setup_uv
|
||||
PNPM_VERSION="$(curl -fsSL "https://raw.githubusercontent.com/immich-app/immich/refs/heads/main/package.json" | jq -r '.packageManager | split("@")[1]')"
|
||||
NODE_VERSION="24" NODE_MODULE="pnpm@${PNPM_VERSION}" setup_nodejs
|
||||
|
||||
if [[ ! -f /etc/apt/preferences.d/preferences ]]; then
|
||||
msg_info "Adding Debian Testing repo"
|
||||
sed -i 's/ trixie-updates/ trixie-updates testing/g' /etc/apt/sources.list.d/debian.sources
|
||||
cat <<EOF >/etc/apt/preferences.d/preferences
|
||||
Package: *
|
||||
Pin: release a=unstable
|
||||
Pin-Priority: 450
|
||||
|
||||
Package: *
|
||||
Pin:release a=testing
|
||||
Pin-Priority: 450
|
||||
EOF
|
||||
if [[ -f /etc/apt/preferences.d/immich ]]; then
|
||||
rm /etc/apt/preferences.d/immich
|
||||
fi
|
||||
$STD apt update
|
||||
msg_ok "Added Debian Testing repo"
|
||||
fi
|
||||
|
||||
if ! dpkg -l "libmimalloc3" | grep -q '3.1' || ! dpkg -l "libde265-dev" | grep -q '1.0.16'; then
|
||||
msg_info "Installing/upgrading Testing repo packages"
|
||||
$STD apt install -t testing libmimalloc3 libde265-dev -y
|
||||
msg_ok "Installed/upgraded Testing repo packages"
|
||||
fi
|
||||
|
||||
if [[ ! -f /etc/apt/sources.list.d/mise.list ]]; then
|
||||
msg_info "Installing Mise"
|
||||
curl -fSs https://mise.jdx.dev/gpg-key.pub | tee /etc/apt/keyrings/mise-archive-keyring.pub 1>/dev/null
|
||||
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.pub arch=amd64] https://mise.jdx.dev/deb stable main" >/etc/apt/sources.list.d/mise.list
|
||||
$STD apt update
|
||||
$STD apt install -y mise
|
||||
msg_ok "Installed Mise"
|
||||
fi
|
||||
|
||||
STAGING_DIR=/opt/staging
|
||||
BASE_DIR=${STAGING_DIR}/base-images
|
||||
SOURCE_DIR=${STAGING_DIR}/image-source
|
||||
cd /tmp
|
||||
if [[ -f ~/.intel_version ]]; then
|
||||
curl -fsSLO https://raw.githubusercontent.com/immich-app/base-images/refs/heads/main/server/Dockerfile
|
||||
readarray -t INTEL_URLS < <(
|
||||
sed -n "/intel-[igc|opencl]/p" ./Dockerfile | awk '{print $2}'
|
||||
sed -n "/libigdgmm12/p" ./Dockerfile | awk '{print $3}'
|
||||
)
|
||||
INTEL_RELEASE="$(grep "intel-opencl-icd_" ./Dockerfile | awk -F '_' '{print $2}')"
|
||||
if [[ "$INTEL_RELEASE" != "$(cat ~/.intel_version)" ]]; then
|
||||
msg_info "Updating Intel iGPU dependencies"
|
||||
for url in "${INTEL_URLS[@]}"; do
|
||||
curl -fsSLO "$url"
|
||||
done
|
||||
$STD apt-mark unhold libigdgmm12
|
||||
$STD apt install -y ./libigdgmm12*.deb
|
||||
rm ./libigdgmm12*.deb
|
||||
$STD apt install -y ./*.deb
|
||||
rm ./*.deb
|
||||
$STD apt-mark hold libigdgmm12
|
||||
dpkg-query -W -f='${Version}\n' intel-opencl-icd >~/.intel_version
|
||||
msg_ok "Intel iGPU dependencies updated"
|
||||
fi
|
||||
rm ./Dockerfile
|
||||
fi
|
||||
if [[ -f ~/.immich_library_revisions ]]; then
|
||||
libraries=("libjxl" "libheif" "libraw" "imagemagick" "libvips")
|
||||
cd "$BASE_DIR"
|
||||
msg_info "Checking for updates to custom image-processing libraries"
|
||||
$STD git pull
|
||||
for library in "${libraries[@]}"; do
|
||||
compile_"$library"
|
||||
done
|
||||
msg_ok "Image-processing libraries up to date"
|
||||
fi
|
||||
|
||||
RELEASE="v2.5.2"
|
||||
if check_for_gh_tag "immich" "immich-app/immich" "${RELEASE}"; then
|
||||
msg_info "Stopping Services"
|
||||
systemctl stop immich-web
|
||||
systemctl stop immich-ml
|
||||
msg_ok "Stopped Services"
|
||||
VCHORD_RELEASE="0.5.3"
|
||||
if [[ ! -f ~/.vchord_version ]] || [[ "$VCHORD_RELEASE" != "$(cat ~/.vchord_version)" ]]; then
|
||||
msg_info "Upgrading VectorChord"
|
||||
curl -fsSL "https://github.com/tensorchord/vectorchord/releases/download/${VCHORD_RELEASE}/postgresql-16-vchord_${VCHORD_RELEASE}-1_amd64.deb" -o vchord.deb
|
||||
$STD apt install -y ./vchord.deb
|
||||
systemctl restart postgresql
|
||||
$STD sudo -u postgres psql -d immich -c "ALTER EXTENSION vector UPDATE;"
|
||||
$STD sudo -u postgres psql -d immich -c "ALTER EXTENSION vchord UPDATE;"
|
||||
$STD sudo -u postgres psql -d immich -c "REINDEX INDEX face_index;"
|
||||
$STD sudo -u postgres psql -d immich -c "REINDEX INDEX clip_index;"
|
||||
echo "$VCHORD_RELEASE" >~/.vchord_version
|
||||
rm ./vchord.deb
|
||||
msg_ok "Upgraded VectorChord to v${VCHORD_RELEASE}"
|
||||
fi
|
||||
if ! dpkg -l | grep -q ccache; then
|
||||
$STD apt install -yqq ccache
|
||||
fi
|
||||
|
||||
INSTALL_DIR="/opt/${APP}"
|
||||
UPLOAD_DIR="$(sed -n '/^IMMICH_MEDIA_LOCATION/s/[^=]*=//p' /opt/immich/.env)"
|
||||
SRC_DIR="${INSTALL_DIR}/source"
|
||||
APP_DIR="${INSTALL_DIR}/app"
|
||||
PLUGIN_DIR="${APP_DIR}/corePlugin"
|
||||
ML_DIR="${APP_DIR}/machine-learning"
|
||||
GEO_DIR="${INSTALL_DIR}/geodata"
|
||||
|
||||
cp "$ML_DIR"/ml_start.sh "$INSTALL_DIR"
|
||||
if grep -qs "set -a" "$APP_DIR"/bin/start.sh; then
|
||||
cp "$APP_DIR"/bin/start.sh "$INSTALL_DIR"
|
||||
else
|
||||
cat <<EOF >"$INSTALL_DIR"/start.sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -a
|
||||
. ${INSTALL_DIR}/.env
|
||||
set +a
|
||||
|
||||
/usr/bin/node ${APP_DIR}/dist/main.js "\$@"
|
||||
EOF
|
||||
chmod +x "$INSTALL_DIR"/start.sh
|
||||
fi
|
||||
|
||||
(
|
||||
shopt -s dotglob
|
||||
rm -rf "${APP_DIR:?}"/*
|
||||
)
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "immich" "immich-app/immich" "tag" "${RELEASE}" "$SRC_DIR"
|
||||
|
||||
msg_info "Updating Immich web and microservices"
|
||||
cd "$SRC_DIR"/server
|
||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||
export CI=1
|
||||
corepack enable
|
||||
|
||||
# server build
|
||||
export SHARP_IGNORE_GLOBAL_LIBVIPS=true
|
||||
$STD pnpm --filter immich --frozen-lockfile build
|
||||
unset SHARP_IGNORE_GLOBAL_LIBVIPS
|
||||
export SHARP_FORCE_GLOBAL_LIBVIPS=true
|
||||
$STD pnpm --filter immich --frozen-lockfile --prod --no-optional deploy "$APP_DIR"
|
||||
cp "$APP_DIR"/package.json "$APP_DIR"/bin
|
||||
sed -i 's|^start|./start|' "$APP_DIR"/bin/immich-admin
|
||||
|
||||
# openapi & web build
|
||||
cd "$SRC_DIR"
|
||||
echo "packageImportMethod: hardlink" >>./pnpm-workspace.yaml
|
||||
$STD pnpm --filter @immich/sdk --filter immich-web --frozen-lockfile --force install
|
||||
unset SHARP_FORCE_GLOBAL_LIBVIPS
|
||||
export SHARP_IGNORE_GLOBAL_LIBVIPS=true
|
||||
$STD pnpm --filter @immich/sdk --filter immich-web build
|
||||
cp -a web/build "$APP_DIR"/www
|
||||
cp LICENSE "$APP_DIR"
|
||||
|
||||
# cli build
|
||||
$STD pnpm --filter @immich/sdk --filter @immich/cli --frozen-lockfile install
|
||||
$STD pnpm --filter @immich/sdk --filter @immich/cli build
|
||||
$STD pnpm --filter @immich/cli --prod --no-optional deploy "$APP_DIR"/cli
|
||||
cd "$APP_DIR"
|
||||
mv "$INSTALL_DIR"/start.sh "$APP_DIR"/bin
|
||||
|
||||
# plugins
|
||||
cd "$SRC_DIR"
|
||||
$STD mise trust --ignore ./mise.toml
|
||||
$STD mise trust ./plugins/mise.toml
|
||||
cd plugins
|
||||
$STD mise install
|
||||
$STD mise run build
|
||||
mkdir -p "$PLUGIN_DIR"
|
||||
cp -r ./dist "$PLUGIN_DIR"/dist
|
||||
cp ./manifest.json "$PLUGIN_DIR"
|
||||
msg_ok "Updated Immich server, web, cli and plugins"
|
||||
|
||||
cd "$SRC_DIR"/machine-learning
|
||||
mkdir -p "$ML_DIR" && chown -R immich:immich "$ML_DIR"
|
||||
chown immich:immich ./uv.lock
|
||||
export VIRTUAL_ENV="${ML_DIR}"/ml-venv
|
||||
if [[ -f ~/.openvino ]]; then
|
||||
msg_info "Updating HW-accelerated machine-learning"
|
||||
# Remove old venv if Python version changed (3.12 -> 3.13)
|
||||
if [[ -d "${VIRTUAL_ENV}" ]] && ! "${VIRTUAL_ENV}/bin/python3" --version 2>/dev/null | grep -q "3.13"; then
|
||||
rm -rf "${VIRTUAL_ENV}"
|
||||
fi
|
||||
$STD sudo --preserve-env=VIRTUAL_ENV -nu immich uv sync --extra openvino --no-dev --active --link-mode copy -n -p python3.13 --managed-python
|
||||
patchelf --clear-execstack "${VIRTUAL_ENV}/lib/python3.13/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-313-x86_64-linux-gnu.so"
|
||||
# Add workaround for onnxruntime-openvino 1.23.x crash if not present
|
||||
if ! grep -q "MACHINE_LEARNING_OPENVINO_NUM_THREADS" "$INSTALL_DIR/.env" 2>/dev/null; then
|
||||
sed -i '/MACHINE_LEARNING_CACHE_FOLDER/a ## - For OpenVINO only - workaround for onnxruntime-openvino 1.23.x crash\n## - See: https://github.com/immich-app/immich/pull/11240\nMACHINE_LEARNING_OPENVINO_NUM_THREADS=$(nproc)' "$INSTALL_DIR/.env"
|
||||
fi
|
||||
msg_ok "Updated HW-accelerated machine-learning"
|
||||
else
|
||||
msg_info "Updating machine-learning"
|
||||
$STD sudo --preserve-env=VIRTUAL_ENV -nu immich uv sync --extra cpu --no-dev --active --link-mode copy -n -p python3.11 --managed-python
|
||||
msg_ok "Updated machine-learning"
|
||||
fi
|
||||
cd "$SRC_DIR"
|
||||
cp -a machine-learning/{ann,immich_ml} "$ML_DIR"
|
||||
mv "$INSTALL_DIR"/ml_start.sh "$ML_DIR"
|
||||
if [[ -f ~/.openvino ]]; then
|
||||
sed -i "/intra_op/s/int = 0/int = os.cpu_count() or 0/" "$ML_DIR"/immich_ml/config.py
|
||||
fi
|
||||
ln -sf "$APP_DIR"/resources "$INSTALL_DIR"
|
||||
cd "$APP_DIR"
|
||||
grep -rl /usr/src | xargs -n1 sed -i "s|\/usr/src|$INSTALL_DIR|g"
|
||||
grep -rlE "'/build'" | xargs -n1 sed -i "s|'/build'|'$APP_DIR'|g"
|
||||
sed -i "s@\"/cache\"@\"$INSTALL_DIR/cache\"@g" "$ML_DIR"/immich_ml/config.py
|
||||
ln -s "${UPLOAD_DIR:-/opt/immich/upload}" "$APP_DIR"/upload
|
||||
ln -s "${UPLOAD_DIR:-/opt/immich/upload}" "$ML_DIR"/upload
|
||||
ln -s "$GEO_DIR" "$APP_DIR"
|
||||
|
||||
chown -R immich:immich "$INSTALL_DIR"
|
||||
systemctl restart immich-ml immich-web
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
function compile_libjxl() {
|
||||
SOURCE=${SOURCE_DIR}/libjxl
|
||||
JPEGLI_LIBJPEG_LIBRARY_SOVERSION="62"
|
||||
JPEGLI_LIBJPEG_LIBRARY_VERSION="62.3.0"
|
||||
: "${LIBJXL_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libjxl.json)}"
|
||||
if [[ "$LIBJXL_REVISION" != "$(grep 'libjxl' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
|
||||
msg_info "Recompiling libjxl"
|
||||
if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
|
||||
$STD git clone https://github.com/libjxl/libjxl.git "$SOURCE"
|
||||
cd "$SOURCE"
|
||||
$STD git reset --hard "$LIBJXL_REVISION"
|
||||
$STD git submodule update --init --recursive --depth 1 --recommend-shallow
|
||||
$STD git apply "$BASE_DIR"/server/sources/libjxl-patches/jpegli-empty-dht-marker.patch
|
||||
$STD git apply "$BASE_DIR"/server/sources/libjxl-patches/jpegli-icc-warning.patch
|
||||
mkdir build
|
||||
cd build
|
||||
$STD cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DJPEGXL_ENABLE_DOXYGEN=OFF \
|
||||
-DJPEGXL_ENABLE_MANPAGES=OFF \
|
||||
-DJPEGXL_ENABLE_PLUGIN_GIMP210=OFF \
|
||||
-DJPEGXL_ENABLE_BENCHMARK=OFF \
|
||||
-DJPEGXL_ENABLE_EXAMPLES=OFF \
|
||||
-DJPEGXL_FORCE_SYSTEM_BROTLI=ON \
|
||||
-DJPEGXL_FORCE_SYSTEM_HWY=ON \
|
||||
-DJPEGXL_ENABLE_JPEGLI=ON \
|
||||
-DJPEGXL_ENABLE_JPEGLI_LIBJPEG=ON \
|
||||
-DJPEGXL_INSTALL_JPEGLI_LIBJPEG=ON \
|
||||
-DJPEGXL_ENABLE_PLUGINS=ON \
|
||||
-DJPEGLI_LIBJPEG_LIBRARY_SOVERSION="$JPEGLI_LIBJPEG_LIBRARY_SOVERSION" \
|
||||
-DJPEGLI_LIBJPEG_LIBRARY_VERSION="$JPEGLI_LIBJPEG_LIBRARY_VERSION" \
|
||||
-DLIBJPEG_TURBO_VERSION_NUMBER=2001005 \
|
||||
..
|
||||
$STD cmake --build . -- -j"$(nproc)"
|
||||
$STD cmake --install .
|
||||
ldconfig /usr/local/lib
|
||||
$STD make clean
|
||||
cd "$STAGING_DIR"
|
||||
rm -rf "$SOURCE"/{build,third_party}
|
||||
sed -i "s/libjxl: .*$/libjxl: $LIBJXL_REVISION/" ~/.immich_library_revisions
|
||||
msg_ok "Recompiled libjxl"
|
||||
fi
|
||||
}
|
||||
|
||||
function compile_libheif() {
|
||||
SOURCE=${SOURCE_DIR}/libheif
|
||||
if ! dpkg -l | grep -q libaom; then
|
||||
$STD apt install -y libaom-dev
|
||||
local update="required"
|
||||
fi
|
||||
: "${LIBHEIF_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libheif.json)}"
|
||||
if [[ "${update:-}" ]] || [[ "$LIBHEIF_REVISION" != "$(grep 'libheif' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
|
||||
msg_info "Recompiling libheif"
|
||||
if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
|
||||
$STD git clone https://github.com/strukturag/libheif.git "$SOURCE"
|
||||
cd "$SOURCE"
|
||||
$STD git reset --hard "$LIBHEIF_REVISION"
|
||||
mkdir build
|
||||
cd build
|
||||
$STD cmake --preset=release-noplugins \
|
||||
-DWITH_DAV1D=ON \
|
||||
-DENABLE_PARALLEL_TILE_DECODING=ON \
|
||||
-DWITH_LIBSHARPYUV=ON \
|
||||
-DWITH_LIBDE265=ON \
|
||||
-DWITH_AOM_DECODER=OFF \
|
||||
-DWITH_AOM_ENCODER=ON \
|
||||
-DWITH_X265=OFF \
|
||||
-DWITH_EXAMPLES=OFF \
|
||||
..
|
||||
$STD make install -j "$(nproc)"
|
||||
ldconfig /usr/local/lib
|
||||
$STD make clean
|
||||
cd "$STAGING_DIR"
|
||||
rm -rf "$SOURCE"/build
|
||||
sed -i "s/libheif: .*$/libheif: $LIBHEIF_REVISION/" ~/.immich_library_revisions
|
||||
msg_ok "Recompiled libheif"
|
||||
fi
|
||||
}
|
||||
|
||||
function compile_libraw() {
|
||||
SOURCE=${SOURCE_DIR}/libraw
|
||||
: "${LIBRAW_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libraw.json)}"
|
||||
if [[ "$LIBRAW_REVISION" != "$(grep 'libraw' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
|
||||
msg_info "Recompiling libraw"
|
||||
if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
|
||||
$STD git clone https://github.com/libraw/libraw.git "$SOURCE"
|
||||
cd "$SOURCE"
|
||||
$STD git reset --hard "$LIBRAW_REVISION"
|
||||
$STD autoreconf --install
|
||||
$STD ./configure --disable-examples
|
||||
$STD make -j"$(nproc)"
|
||||
$STD make install
|
||||
ldconfig /usr/local/lib
|
||||
$STD make clean
|
||||
cd "$STAGING_DIR"
|
||||
sed -i "s/libraw: .*$/libraw: $LIBRAW_REVISION/" ~/.immich_library_revisions
|
||||
msg_ok "Recompiled libraw"
|
||||
fi
|
||||
}
|
||||
|
||||
function compile_imagemagick() {
|
||||
SOURCE=$SOURCE_DIR/imagemagick
|
||||
: "${IMAGEMAGICK_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/imagemagick.json)}"
|
||||
if [[ "$IMAGEMAGICK_REVISION" != "$(grep 'imagemagick' ~/.immich_library_revisions | awk '{print $2}')" ]] ||
|
||||
! grep -q 'DMAGICK_LIBRAW' /usr/local/lib/ImageMagick-7*/config-Q16HDRI/configure.xml; then
|
||||
msg_info "Recompiling ImageMagick"
|
||||
if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
|
||||
$STD git clone https://github.com/ImageMagick/ImageMagick.git "$SOURCE"
|
||||
cd "$SOURCE"
|
||||
$STD git reset --hard "$IMAGEMAGICK_REVISION"
|
||||
$STD ./configure --with-modules CPPFLAGS="-DMAGICK_LIBRAW_VERSION_TAIL=202502"
|
||||
$STD make -j"$(nproc)"
|
||||
$STD make install
|
||||
ldconfig /usr/local/lib
|
||||
$STD make clean
|
||||
cd "$STAGING_DIR"
|
||||
sed -i "s/imagemagick: .*$/imagemagick: $IMAGEMAGICK_REVISION/" ~/.immich_library_revisions
|
||||
msg_ok "Recompiled ImageMagick"
|
||||
fi
|
||||
}
|
||||
|
||||
function compile_libvips() {
|
||||
SOURCE=$SOURCE_DIR/libvips
|
||||
: "${LIBVIPS_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libvips.json)}"
|
||||
if [[ "$LIBVIPS_REVISION" != "$(grep 'libvips' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
|
||||
msg_info "Recompiling libvips"
|
||||
if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
|
||||
$STD git clone https://github.com/libvips/libvips.git "$SOURCE"
|
||||
cd "$SOURCE"
|
||||
$STD git reset --hard "$LIBVIPS_REVISION"
|
||||
$STD meson setup build --buildtype=release --libdir=lib -Dintrospection=disabled -Dtiff=disabled
|
||||
cd build
|
||||
$STD ninja install
|
||||
ldconfig /usr/local/lib
|
||||
cd "$STAGING_DIR"
|
||||
rm -rf "$SOURCE"/build
|
||||
sed -i "s/libvips: .*$/libvips: $LIBVIPS_REVISION/" ~/.immich_library_revisions
|
||||
msg_ok "Recompiled libvips"
|
||||
fi
|
||||
}
|
||||
|
||||
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}:2283${CL}"
|
||||
74
ct/isponsorblocktv.sh
Normal file
74
ct/isponsorblocktv.sh
Normal file
@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Matthew Stern (sternma)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/dmunozv04/iSponsorBlockTV
|
||||
|
||||
APP="iSponsorBlockTV"
|
||||
var_tags="${var_tags:-media;automation}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-1024}"
|
||||
var_disk="${var_disk:-4}"
|
||||
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 [[ ! -d /opt/isponsorblocktv ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "isponsorblocktv" "dmunozv04/iSponsorBlockTV"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop isponsorblocktv
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
if [[ -d /var/lib/isponsorblocktv ]]; then
|
||||
msg_info "Backing up Data"
|
||||
cp -r /var/lib/isponsorblocktv /var/lib/isponsorblocktv_data_backup
|
||||
msg_ok "Backed up Data"
|
||||
fi
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "isponsorblocktv" "dmunozv04/iSponsorBlockTV"
|
||||
|
||||
msg_info "Setting up iSponsorBlockTV"
|
||||
$STD python3 -m venv /opt/isponsorblocktv/venv
|
||||
$STD /opt/isponsorblocktv/venv/bin/pip install --upgrade pip
|
||||
$STD /opt/isponsorblocktv/venv/bin/pip install /opt/isponsorblocktv
|
||||
msg_ok "Set up iSponsorBlockTV"
|
||||
|
||||
if [[ -d /var/lib/isponsorblocktv_data_backup ]]; then
|
||||
msg_info "Restoring Data"
|
||||
rm -rf /var/lib/isponsorblocktv
|
||||
cp -r /var/lib/isponsorblocktv_data_backup /var/lib/isponsorblocktv
|
||||
rm -rf /var/lib/isponsorblocktv_data_backup
|
||||
msg_ok "Restored Data"
|
||||
fi
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start isponsorblocktv
|
||||
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} Run the setup wizard inside the container with:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}iSponsorBlockTV setup${CL}"
|
||||
105
ct/jotty.sh
Normal file
105
ct/jotty.sh
Normal file
@ -0,0 +1,105 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: vhsdream
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/fccview/jotty
|
||||
|
||||
APP="jotty"
|
||||
var_tags="${var_tags:-tasks;notes}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-4096}"
|
||||
var_disk="${var_disk:-6}"
|
||||
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 [[ ! -d /opt/jotty ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "jotty" "fccview/jotty"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop jotty
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Backing up configuration & data"
|
||||
cd /opt/jotty
|
||||
cp ./.env /opt/app.env
|
||||
$STD tar -cf /opt/data_config.tar ./data ./config
|
||||
msg_ok "Backed up configuration & data"
|
||||
|
||||
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "jotty" "fccview/jotty" "tarball" "latest" "/opt/jotty"
|
||||
|
||||
msg_info "Updating jotty"
|
||||
cd /opt/jotty
|
||||
unset NODE_OPTIONS
|
||||
export NODE_OPTIONS="--max-old-space-size=3072"
|
||||
$STD yarn --frozen-lockfile
|
||||
$STD yarn next telemetry disable
|
||||
$STD yarn build
|
||||
|
||||
[ -d "public" ] && cp -r public .next/standalone/
|
||||
[ -d "howto" ] && cp -r howto .next/standalone/
|
||||
mkdir -p .next/standalone/.next
|
||||
cp -r .next/static .next/standalone/.next/
|
||||
|
||||
mv .next/standalone /tmp/jotty_standalone
|
||||
rm -rf ./* .next .git .gitignore .yarn
|
||||
mv /tmp/jotty_standalone/* .
|
||||
mv /tmp/jotty_standalone/.[!.]* . 2>/dev/null || true
|
||||
rm -rf /tmp/jotty_standalone
|
||||
msg_ok "Updated jotty"
|
||||
|
||||
msg_info "Restoring configuration & data"
|
||||
mv /opt/app.env /opt/jotty/.env
|
||||
$STD tar -xf /opt/data_config.tar
|
||||
msg_ok "Restored configuration & data"
|
||||
|
||||
msg_info "Updating Service"
|
||||
cat <<EOF >/etc/systemd/system/jotty.service
|
||||
[Unit]
|
||||
Description=jotty server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/opt/jotty
|
||||
EnvironmentFile=/opt/jotty/.env
|
||||
ExecStart=/usr/bin/node server.js
|
||||
Restart=on-abnormal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
msg_ok "Updated Service"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start jotty
|
||||
msg_ok "Started Service"
|
||||
rm /opt/data_config.tar
|
||||
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}:3000${CL}"
|
||||
60
ct/loki.sh
60
ct/loki.sh
@ -1,60 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# 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
|
||||
|
||||
APP="Loki"
|
||||
var_tags="${var_tags:-monitoring;logs}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
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 ! dpkg -s loki >/dev/null 2>&1; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
msg_info "Stopping Loki"
|
||||
systemctl stop loki
|
||||
systemctl stop promtail
|
||||
msg_ok "Stopped Loki"
|
||||
|
||||
msg_info "Updating Loki"
|
||||
$STD apt update
|
||||
$STD apt --only-upgrade install -y loki
|
||||
$STD apt --only-upgrade install -y promtail
|
||||
msg_ok "Updated Loki"
|
||||
|
||||
msg_info "Starting Loki"
|
||||
systemctl start loki
|
||||
systemctl start promtail
|
||||
msg_ok "Started Loki"
|
||||
msg_ok "Updated successfully!"
|
||||
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}:3100${CL}\n"
|
||||
echo -e "${INFO}${YW} Access promtail using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9080${CL}"
|
||||
105
ct/manyfold.sh
105
ct/manyfold.sh
@ -1,105 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: bvdberg01
|
||||
# Co-Author: SunFlowerOwl
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/manyfold3d/manyfold
|
||||
|
||||
APP="Manyfold"
|
||||
var_tags="${var_tags:-3d}"
|
||||
var_cpu="${var_cpu:-4}"
|
||||
var_ram="${var_ram:-4096}"
|
||||
var_disk="${var_disk:-15}"
|
||||
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 [[ ! -d /opt/manyfold ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "manyfold" "manyfold3d/manyfold"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop manyfold.target manyfold-rails.1 manyfold-default_worker.1 manyfold-performance_worker.1
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Backing up data"
|
||||
source /opt/manyfold/.env
|
||||
mv /opt/manyfold/app/storage /opt/manyfold/app/tmp /opt/manyfold/app/config/credentials.yml.enc /opt/manyfold/app/config/master.key ~/
|
||||
$STD tar -cvzf "/opt/manyfold_${APP_VERSION}_backup.tar.gz" /opt/manyfold/app/
|
||||
rm -rf /opt/manyfold/app/
|
||||
msg_ok "Backed-up data"
|
||||
|
||||
fetch_and_deploy_gh_release "manyfold" "manyfold3d/manyfold" "tarball" "latest" "/opt/manyfold/app"
|
||||
|
||||
msg_info "Configuring manyfold environment"
|
||||
RUBY_INSTALL_VERSION=$(cat /opt/manyfold/app/.ruby-version)
|
||||
YARN_VERSION=$(grep '"packageManager":' /opt/manyfold/app/package.json | sed -E 's/.*"(yarn@[0-9\.]+)".*/\1/')
|
||||
RELEASE=$(get_latest_github_release "manyfold3d/manyfold")
|
||||
sed -i "s/^export APP_VERSION=.*/export APP_VERSION=$RELEASE/" "/opt/manyfold/.env"
|
||||
cat <<EOF >/opt/manyfold/user_setup.sh
|
||||
#!/bin/bash
|
||||
|
||||
source /opt/manyfold/.env
|
||||
export PATH="/home/manyfold/.rbenv/bin:\$PATH"
|
||||
eval "\$(/home/manyfold/.rbenv/bin/rbenv init - bash)"
|
||||
cd /opt/manyfold/app
|
||||
rbenv global $RUBY_INSTALL_VERSION
|
||||
gem install bundler
|
||||
bundle install
|
||||
gem install sidekiq
|
||||
gem install foreman
|
||||
corepack enable yarn
|
||||
corepack prepare $YARN_VERSION --activate
|
||||
corepack use $YARN_VERSION
|
||||
bin/rails db:migrate
|
||||
bin/rails assets:precompile
|
||||
EOF
|
||||
msg_ok "Configured manyfold environment"
|
||||
|
||||
RUBY_VERSION=${RUBY_INSTALL_VERSION} RUBY_INSTALL_RAILS="true" HOME=/home/manyfold setup_ruby
|
||||
|
||||
msg_info "Installing Manyfold"
|
||||
chown -R manyfold:manyfold /home/manyfold/.rbenv
|
||||
rm -rf /opt/manyfold/app/storage /opt/manyfold/app/tmp /opt/manyfold/app/config/credentials.yml.enc
|
||||
mv ~/storage ~/tmp /opt/manyfold/app/
|
||||
mv ~/credentials.yml.enc ~/master.key /opt/manyfold/app/config/
|
||||
chown -R manyfold:manyfold /opt/manyfold
|
||||
chmod +x /opt/manyfold/user_setup.sh
|
||||
$STD sudo -u manyfold bash /opt/manyfold/user_setup.sh
|
||||
rm -f /opt/manyfold/user_setup.sh
|
||||
msg_ok "Installed manyfold"
|
||||
|
||||
msg_info "Restoring Service"
|
||||
source /opt/manyfold/.env
|
||||
export PATH="/home/manyfold/.rbenv/shims:/home/manyfold/.rbenv/bin:$PATH"
|
||||
$STD foreman export systemd /etc/systemd/system -a manyfold -u manyfold -f /opt/manyfold/app/Procfile
|
||||
for f in /etc/systemd/system/manyfold-*.service; do
|
||||
sed -i "s|/bin/bash -lc '|/bin/bash -lc 'source /opt/manyfold/.env \&\& |" "$f"
|
||||
done
|
||||
systemctl enable -q --now manyfold.target manyfold-rails.1 manyfold-default_worker.1 manyfold-performance_worker.1
|
||||
msg_ok "Restored 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}${CL}"
|
||||
@ -1,15 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: luismco
|
||||
# Author: aendel
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/technomancer702/nodecast-tv
|
||||
# Source: https://github.com/nightscout/cgm-remote-monitor
|
||||
|
||||
APP="nodecast-tv"
|
||||
var_tags="${var_tags:-media}"
|
||||
APP="Nightscout"
|
||||
var_tags="${var_tags:-health}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_disk="${var_disk:-10}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
@ -23,25 +23,25 @@ function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /opt/nodecast-tv ]]; then
|
||||
if [[ ! -d /opt/nightscout ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "nodecast-tv" "technomancer702/nodecast-tv"; then
|
||||
if check_for_gh_release "nightscout" "nightscout/cgm-remote-monitor"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop nodecast-tv
|
||||
systemctl stop nightscout
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
fetch_and_deploy_gh_release "nodecast-tv" "technomancer702/nodecast-tv"
|
||||
fetch_and_deploy_gh_release "nightscout" "nightscout/cgm-remote-monitor" "source"
|
||||
|
||||
msg_info "Updating Modules"
|
||||
cd /opt/nodecast-tv
|
||||
msg_info "Updating Nightscout"
|
||||
cd /opt/nightscout
|
||||
$STD npm install
|
||||
msg_ok "Updated Modules"
|
||||
msg_ok "Updated Nightscout"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start nodecast-tv
|
||||
systemctl start nightscout
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
@ -55,5 +55,4 @@ 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}:3000${CL}"
|
||||
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:1337${CL}"
|
||||
@ -29,7 +29,7 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
|
||||
RELEASE="v4.1.0"
|
||||
RELEASE="v5.0.1"
|
||||
if check_for_gh_release "opencloud" "opencloud-eu/opencloud" "${RELEASE}"; then
|
||||
msg_info "Stopping services"
|
||||
systemctl stop opencloud opencloud-wopi
|
||||
|
||||
@ -24,8 +24,8 @@ function update_script() {
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -f "/opt/rustypaste/target/release/rustypaste" ]]; then
|
||||
msg_error "No rustypaste Installation Found!"
|
||||
if [[ ! -f /opt/rustypaste/rustypaste ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
@ -35,22 +35,27 @@ function update_script() {
|
||||
msg_ok "Stopped Services"
|
||||
|
||||
msg_info "Creating Backup"
|
||||
tar -czf "/opt/rustypaste_backup_$(date +%F).tar.gz" "/opt/rustypaste/upload"
|
||||
tar -czf "/opt/rustypaste_backup_$(date +%F).tar.gz" /opt/rustypaste/upload 2>/dev/null || true
|
||||
cp /opt/rustypaste/config.toml /tmp/rustypaste_config.toml.bak
|
||||
msg_ok "Backup Created"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "rustypaste" "orhun/rustypaste" "tarball" "latest" "/opt/rustypaste"
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "rustypaste" "orhun/rustypaste" "prebuild" "latest" "/opt/rustypaste" "*x86_64-unknown-linux-gnu.tar.gz"
|
||||
|
||||
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 "Restoring Data"
|
||||
mv /tmp/rustypaste_config.toml.bak /opt/rustypaste/config.toml
|
||||
tar -xzf "/opt/rustypaste_backup_$(date +%F).tar.gz" -C /opt/rustypaste/upload 2>/dev/null || true
|
||||
rm -rf /opt/rustypaste_backup_$(date +%F).tar.gz
|
||||
msg_ok "Restored Data"
|
||||
|
||||
msg_info "Starting Services"
|
||||
systemctl start rustypaste
|
||||
msg_ok "Started Services"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
|
||||
if check_for_gh_release "rustypaste-cli" "orhun/rustypaste-cli"; then
|
||||
fetch_and_deploy_gh_release "rustypaste-cli" "orhun/rustypaste-cli" "prebuild" "latest" "/usr/local/bin" "*x86_64-unknown-linux-gnu.tar.gz"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
|
||||
77
ct/shelfmark.sh
Normal file
77
ct/shelfmark.sh
Normal file
@ -0,0 +1,77 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: vhsdream
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/calibrain/shelfmark
|
||||
|
||||
APP="shelfmark"
|
||||
var_tags="${var_tags:-ebooks}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-8}"
|
||||
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 [[ ! -d /opt/shelfmark ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
|
||||
if check_for_gh_release "shelfmark" "calibrain/shelfmark"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop shelfmark
|
||||
[[ -f /etc/systemd/system/chromium.service ]] && systemctl stop chromium
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
cp /opt/shelfmark/start.sh /opt/start.sh.bak
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "shelfmark" "calibrain/shelfmark" "tarball" "latest" "/opt/shelfmark"
|
||||
RELEASE_VERSION=$(cat "$HOME/.shelfmark")
|
||||
|
||||
msg_info "Updating Shelfmark"
|
||||
sed -i "s/^RELEASE_VERSION=.*/RELEASE_VERSION=$RELEASE_VERSION/" /etc/shelfmark/.env
|
||||
cd /opt/shelfmark/src/frontend
|
||||
$STD npm ci
|
||||
$STD npm run build
|
||||
mv /opt/shelfmark/src/frontend/dist /opt/shelfmark/frontend-dist
|
||||
cd /opt/shelfmark
|
||||
$STD uv venv -c ./venv
|
||||
$STD source ./venv/bin/activate
|
||||
$STD uv pip install -r ./requirements-base.txt
|
||||
if [[ $(sed -n '/_BYPASS=/s/[^=]*=//p' /etc/shelfmark/.env) == "true" ]] && [[ $(sed -n '/BYPASSER=/s/[^=]*=//p' /etc/shelfmark/.env) == "false" ]]; then
|
||||
$STD uv pip install -r ./requirements-shelfmark.txt
|
||||
fi
|
||||
mv /opt/start.sh.bak /opt/shelfmark/start.sh
|
||||
msg_ok "Updated Shelfmark"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start shelfmark
|
||||
[[ -f /etc/systemd/system/chromium.service ]] && systemctl start chromium
|
||||
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}:8084${CL}"
|
||||
@ -1,86 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: durzo
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/connorgallopo/Tracearr
|
||||
|
||||
APP="Tracearr"
|
||||
var_tags="${var_tags:-media}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-5}"
|
||||
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/tracearr.service ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "tracearr" "connorgallopo/Tracearr"; then
|
||||
msg_info "Stopping Services"
|
||||
systemctl stop tracearr postgresql redis
|
||||
msg_ok "Stopped Services"
|
||||
|
||||
PNPM_VERSION="$(curl -fsSL "https://raw.githubusercontent.com/connorgallopo/Tracearr/refs/heads/main/package.json" | jq -r '.packageManager | split("@")[1]')"
|
||||
NODE_VERSION="22" NODE_MODULE="pnpm@${PNPM_VERSION}" setup_nodejs
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "tracearr" "connorgallopo/Tracearr" "tarball" "latest" "/opt/tracearr.build"
|
||||
|
||||
msg_info "Building Tracearr"
|
||||
export TZ=$(cat /etc/timezone)
|
||||
cd /opt/tracearr.build
|
||||
$STD pnpm install --frozen-lockfile --force
|
||||
$STD pnpm turbo telemetry disable
|
||||
$STD pnpm turbo run build --no-daemon --filter=@tracearr/shared --filter=@tracearr/server --filter=@tracearr/web
|
||||
rm -rf /opt/tracearr
|
||||
mkdir -p /opt/tracearr/{packages/shared,apps/server,apps/web,apps/server/src/db}
|
||||
cp -rf package.json /opt/tracearr/
|
||||
cp -rf pnpm-workspace.yaml /opt/tracearr/
|
||||
cp -rf pnpm-lock.yaml /opt/tracearr/
|
||||
cp -rf apps/server/package.json /opt/tracearr/apps/server/
|
||||
cp -rf apps/server/dist /opt/tracearr/apps/server/dist
|
||||
cp -rf apps/web/dist /opt/tracearr/apps/web/dist
|
||||
cp -rf packages/shared/package.json /opt/tracearr/packages/shared/
|
||||
cp -rf packages/shared/dist /opt/tracearr/packages/shared/dist
|
||||
cp -rf apps/server/src/db/migrations /opt/tracearr/apps/server/src/db/migrations
|
||||
cp -rf data /opt/tracearr/data
|
||||
mkdir -p /opt/tracearr/data/image-cache
|
||||
rm -rf /opt/tracearr.build
|
||||
cd /opt/tracearr
|
||||
$STD pnpm install --prod --frozen-lockfile --ignore-scripts
|
||||
$STD chown -R tracearr:tracearr /opt/tracearr
|
||||
msg_ok "Built Tracearr"
|
||||
|
||||
msg_info "Configuring Tracearr"
|
||||
sed -i "s/^APP_VERSION=.*/APP_VERSION=$(cat /root/.tracearr)/" /data/tracearr/.env
|
||||
chmod 600 /data/tracearr/.env
|
||||
chown -R tracearr:tracearr /data/tracearr
|
||||
msg_ok "Configured Tracearr"
|
||||
|
||||
msg_info "Starting Services"
|
||||
systemctl start postgresql redis tracearr
|
||||
msg_ok "Started Services"
|
||||
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}:3000${CL}"
|
||||
70
ct/vikunja.sh
Normal file
70
ct/vikunja.sh
Normal file
@ -0,0 +1,70 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (Canbiz) | Co-Author: CrazyWolf13
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://vikunja.io/
|
||||
|
||||
APP="Vikunja"
|
||||
var_tags="${var_tags:-todo-app}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-1024}"
|
||||
var_disk="${var_disk:-4}"
|
||||
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 [[ ! -d /opt/vikunja ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
RELEASE="$( [[ -f "$HOME/.vikunja" ]] && cat "$HOME/.vikunja" 2>/dev/null || [[ -f /opt/Vikunja_version ]] && cat /opt/Vikunja_version 2>/dev/null || true)"
|
||||
if [[ -z "$RELEASE" ]] || [[ "$RELEASE" == "unstable" ]] || dpkg --compare-versions "${RELEASE:-0.0.0}" lt "1.0.0"; then
|
||||
msg_warn "You are upgrading from Vikunja '$RELEASE'."
|
||||
msg_warn "This requires MANUAL config changes in /etc/vikunja/config.yml."
|
||||
msg_warn "See: https://vikunja.io/changelog/whats-new-in-vikunja-1.0.0/#config-changes"
|
||||
|
||||
read -rp "Continue with update? (y to proceed): " -t 30 CONFIRM1 || exit 1
|
||||
[[ "$CONFIRM1" =~ ^[yY]$ ]] || exit 0
|
||||
|
||||
echo
|
||||
msg_warn "Vikunja may not start after the update until you manually adjust the config."
|
||||
msg_warn "Details: https://vikunja.io/changelog/whats-new-in-vikunja-1.0.0/#config-changes"
|
||||
|
||||
read -rp "Acknowledge and continue? (y): " -t 30 CONFIRM2 || exit 1
|
||||
[[ "$CONFIRM2" =~ ^[yY]$ ]] || exit 0
|
||||
fi
|
||||
|
||||
if check_for_gh_release "vikunja" "go-vikunja/vikunja"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop vikunja
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
fetch_and_deploy_gh_release "vikunja" "go-vikunja/vikunja" "binary"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start vikunja
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
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}:3456${CL}"
|
||||
74
ct/wger.sh
Normal file
74
ct/wger.sh
Normal file
@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Slaviša Arežina (tremor021)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/wger-project/wger
|
||||
|
||||
APP="wger"
|
||||
var_tags="${var_tags:-management;fitness}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-8}"
|
||||
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 [[ ! -d /opt/wger ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "wger" "wger-project/wger"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop apache2
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Backing up Data"
|
||||
cp -r /opt/wger/media /opt/wger_media_backup
|
||||
cp /opt/wger/.env /opt/wger_env_backup
|
||||
msg_ok "Backed up Data"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "wger" "wger-project/wger" "tarball" "latest" "/opt/wger"
|
||||
|
||||
msg_info "Restoring Data"
|
||||
cp -r /opt/wger_media_backup/. /opt/wger/media
|
||||
cp /opt/wger_env_backup /opt/wger/.env
|
||||
rm -rf /opt/wger_media_backup /opt/wger_env_backup
|
||||
msg_ok "Restored Data"
|
||||
|
||||
msg_info "Updating wger"
|
||||
cd /opt/wger
|
||||
set -a && source /opt/wger/.env && set +a
|
||||
export DJANGO_SETTINGS_MODULE=settings.main
|
||||
$STD uv pip install .
|
||||
$STD uv run python manage.py migrate
|
||||
$STD uv run python manage.py collectstatic --no-input
|
||||
msg_ok "Updated wger"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start apache2
|
||||
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}${CL}"
|
||||
@ -224,9 +224,9 @@ CLEAN_INSTALL=1 fetch_and_deploy_gh_release "appname" "owner/repo"
|
||||
|
||||
### Helper Utilities
|
||||
|
||||
| Function | Description | Example |
|
||||
|----------|-------------|----------|
|
||||
| `import_local_ip` | Sets `$LOCAL_IP` variable | `import_local_ip` |
|
||||
| Function/Variable | Description | Example |
|
||||
|-------------------|-------------|----------|
|
||||
| `$LOCAL_IP` | Always available - contains the container's IP address | `echo "Access: http://${LOCAL_IP}:3000"` |
|
||||
| `ensure_dependencies` | Checks/installs dependencies | `ensure_dependencies curl jq` |
|
||||
| `install_packages_with_retry` | APT install with retry | `install_packages_with_retry nginx redis` |
|
||||
|
||||
|
||||
@ -634,4 +634,224 @@ silent()
|
||||
- `SILENT_LOGFILE`: Silent execution log file path
|
||||
- `SPINNER_PID`: Spinner process ID
|
||||
- `SPINNER_MSG`: Spinner message text
|
||||
- `MSG_INFO_SHOWN`: Tracks shown info messages
|
||||
- `MSG_INFO_SHOWN`: Tracks shown info messages- `PHS_SILENT`: Unattended mode flag (1 = silent)
|
||||
- `var_unattended`: Unattended mode variable (yes/no)
|
||||
- `UNATTENDED`: Alternative unattended mode variable
|
||||
|
||||
## Unattended/Interactive Prompt Functions
|
||||
|
||||
These functions provide a unified way to handle user prompts in both interactive and unattended modes. They automatically detect the execution context and either prompt the user (with timeout) or use default values silently.
|
||||
|
||||
### `is_unattended()`
|
||||
**Purpose**: Detect if script is running in unattended/silent mode
|
||||
**Parameters**: None
|
||||
**Returns**:
|
||||
- `0` (true): Running unattended
|
||||
- `1` (false): Running interactively
|
||||
**Side Effects**: None
|
||||
**Dependencies**: None
|
||||
**Environment Variables Used**: `PHS_SILENT`, `var_unattended`, `UNATTENDED`
|
||||
|
||||
**Usage Example**:
|
||||
```bash
|
||||
if is_unattended; then
|
||||
echo "Running in unattended mode"
|
||||
else
|
||||
echo "Running interactively"
|
||||
fi
|
||||
```
|
||||
|
||||
### `prompt_confirm()`
|
||||
**Purpose**: Prompt user for yes/no confirmation with timeout and unattended support
|
||||
**Parameters**:
|
||||
- `$1` - Prompt message (required)
|
||||
- `$2` - Default value: "y" or "n" (optional, default: "n")
|
||||
- `$3` - Timeout in seconds (optional, default: 60)
|
||||
**Returns**:
|
||||
- `0`: User confirmed (yes)
|
||||
- `1`: User declined (no) or timeout with default "n"
|
||||
**Side Effects**: Displays prompt to terminal
|
||||
**Dependencies**: `is_unattended()`
|
||||
**Environment Variables Used**: Color variables (`YW`, `CL`)
|
||||
|
||||
**Behavior**:
|
||||
- **Unattended mode**: Immediately returns default value
|
||||
- **Non-TTY**: Immediately returns default value
|
||||
- **Interactive**: Displays prompt with timeout countdown
|
||||
- **Timeout**: Auto-applies default value after specified seconds
|
||||
|
||||
**Usage Examples**:
|
||||
```bash
|
||||
# Basic confirmation (default: no)
|
||||
if prompt_confirm "Proceed with installation?"; then
|
||||
install_package
|
||||
fi
|
||||
|
||||
# Default to yes, 30 second timeout
|
||||
if prompt_confirm "Continue?" "y" 30; then
|
||||
continue_operation
|
||||
fi
|
||||
|
||||
# In unattended mode (will use default immediately)
|
||||
var_unattended=yes
|
||||
prompt_confirm "Delete files?" "n" && echo "Deleting" || echo "Skipped"
|
||||
```
|
||||
|
||||
### `prompt_input()`
|
||||
**Purpose**: Prompt user for text input with timeout and unattended support
|
||||
**Parameters**:
|
||||
- `$1` - Prompt message (required)
|
||||
- `$2` - Default value (optional, default: "")
|
||||
- `$3` - Timeout in seconds (optional, default: 60)
|
||||
**Output**: Prints the user input or default value to stdout
|
||||
**Returns**: `0` always
|
||||
**Side Effects**: Displays prompt to stderr (keeps stdout clean for value)
|
||||
**Dependencies**: `is_unattended()`
|
||||
**Environment Variables Used**: Color variables (`YW`, `CL`)
|
||||
|
||||
**Behavior**:
|
||||
- **Unattended mode**: Returns default value immediately
|
||||
- **Non-TTY**: Returns default value immediately
|
||||
- **Interactive**: Waits for user input with timeout
|
||||
- **Empty input**: Returns default value
|
||||
- **Timeout**: Returns default value
|
||||
|
||||
**Usage Examples**:
|
||||
```bash
|
||||
# Get username with default
|
||||
username=$(prompt_input "Enter username:" "admin" 30)
|
||||
echo "Using username: $username"
|
||||
|
||||
# With validation loop
|
||||
while true; do
|
||||
port=$(prompt_input "Enter port:" "8080" 30)
|
||||
[[ "$port" =~ ^[0-9]+$ ]] && break
|
||||
echo "Invalid port number"
|
||||
done
|
||||
|
||||
# Capture value in unattended mode
|
||||
var_unattended=yes
|
||||
db_name=$(prompt_input "Database name:" "myapp_db")
|
||||
```
|
||||
|
||||
### `prompt_select()`
|
||||
**Purpose**: Prompt user to select from a list of options with timeout support
|
||||
**Parameters**:
|
||||
- `$1` - Prompt message (required)
|
||||
- `$2` - Default option number, 1-based (optional, default: 1)
|
||||
- `$3` - Timeout in seconds (optional, default: 60)
|
||||
- `$4+` - Options to display (required, at least 1)
|
||||
**Output**: Prints the selected option value to stdout
|
||||
**Returns**:
|
||||
- `0`: Success
|
||||
- `1`: No options provided
|
||||
**Side Effects**: Displays numbered menu to stderr
|
||||
**Dependencies**: `is_unattended()`
|
||||
**Environment Variables Used**: Color variables (`YW`, `GN`, `CL`)
|
||||
|
||||
**Behavior**:
|
||||
- **Unattended mode**: Returns default selection immediately
|
||||
- **Non-TTY**: Returns default selection immediately
|
||||
- **Interactive**: Displays numbered menu with timeout
|
||||
- **Invalid selection**: Uses default
|
||||
- **Timeout**: Auto-selects default
|
||||
|
||||
**Usage Examples**:
|
||||
```bash
|
||||
# Simple selection
|
||||
choice=$(prompt_select "Select database:" 1 30 "PostgreSQL" "MySQL" "SQLite")
|
||||
echo "Selected: $choice"
|
||||
|
||||
# Using array
|
||||
options=("Production" "Staging" "Development")
|
||||
env=$(prompt_select "Select environment:" 2 60 "${options[@]}")
|
||||
|
||||
# In automation scripts
|
||||
var_unattended=yes
|
||||
db=$(prompt_select "Database:" 1 30 "postgres" "mysql" "sqlite")
|
||||
# Returns "postgres" immediately without menu
|
||||
```
|
||||
|
||||
### `prompt_password()`
|
||||
**Purpose**: Prompt user for password input with hidden characters and auto-generation
|
||||
**Parameters**:
|
||||
- `$1` - Prompt message (required)
|
||||
- `$2` - Default value or "generate" for auto-generation (optional)
|
||||
- `$3` - Timeout in seconds (optional, default: 60)
|
||||
- `$4` - Minimum length for validation (optional, default: 0)
|
||||
**Output**: Prints the password to stdout
|
||||
**Returns**: `0` always
|
||||
**Side Effects**: Displays prompt to stderr with hidden input
|
||||
**Dependencies**: `is_unattended()`, `openssl` (for generation)
|
||||
**Environment Variables Used**: Color variables (`YW`, `CL`)
|
||||
|
||||
**Behavior**:
|
||||
- **"generate" default**: Creates random 16-character password
|
||||
- **Unattended mode**: Returns default/generated password immediately
|
||||
- **Non-TTY**: Returns default/generated password immediately
|
||||
- **Interactive**: Hidden input with timeout
|
||||
- **Min length validation**: Falls back to default if too short
|
||||
- **Timeout**: Returns default/generated password
|
||||
|
||||
**Usage Examples**:
|
||||
```bash
|
||||
# Auto-generate password if user doesn't provide one
|
||||
password=$(prompt_password "Enter password:" "generate" 30)
|
||||
echo "Password has been set"
|
||||
|
||||
# Require minimum length
|
||||
db_pass=$(prompt_password "Database password:" "" 60 12)
|
||||
|
||||
# With default password
|
||||
admin_pass=$(prompt_password "Admin password:" "changeme123" 30)
|
||||
|
||||
# In unattended mode with auto-generation
|
||||
var_unattended=yes
|
||||
password=$(prompt_password "Password:" "generate")
|
||||
# Returns randomly generated password
|
||||
```
|
||||
|
||||
## Prompt Function Decision Flow
|
||||
|
||||
```
|
||||
prompt_confirm() / prompt_input() / prompt_select() / prompt_password()
|
||||
│
|
||||
├── is_unattended()? ─────────────────────┐
|
||||
│ └── PHS_SILENT=1? │
|
||||
│ └── var_unattended=yes? ├── YES → Return default immediately
|
||||
│ └── UNATTENDED=yes? │
|
||||
│ │
|
||||
├── TTY available? ─────────────── NO ────┘
|
||||
│
|
||||
└── Interactive Mode
|
||||
├── Display prompt with timeout hint
|
||||
├── read -t $timeout
|
||||
│ ├── User input received → Validate and return
|
||||
│ ├── Empty input → Return default
|
||||
│ └── Timeout → Return default with message
|
||||
└── Return value
|
||||
```
|
||||
|
||||
## Migration Guide: Converting read Commands
|
||||
|
||||
To make existing scripts unattended-compatible, replace `read` commands with the appropriate prompt function:
|
||||
|
||||
### Before (blocking):
|
||||
```bash
|
||||
read -rp "Continue? [y/N]: " confirm
|
||||
[[ "$confirm" =~ ^[Yy]$ ]] && do_something
|
||||
|
||||
read -p "Enter port: " port
|
||||
port="${port:-8080}"
|
||||
|
||||
read -p "Select (1-3): " choice
|
||||
```
|
||||
|
||||
### After (unattended-safe):
|
||||
```bash
|
||||
prompt_confirm "Continue?" "n" && do_something
|
||||
|
||||
port=$(prompt_input "Enter port:" "8080")
|
||||
|
||||
choice=$(prompt_select "Select option:" 1 60 "Option 1" "Option 2" "Option 3")
|
||||
```
|
||||
|
||||
48
frontend/public/json/anytype.json
Normal file
48
frontend/public/json/anytype.json
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "Anytype",
|
||||
"slug": "anytype",
|
||||
"categories": [
|
||||
12
|
||||
],
|
||||
"date_created": "2026-01-29",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 33010,
|
||||
"documentation": "https://doc.anytype.io/",
|
||||
"website": "https://anytype.io/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/anytype.webp",
|
||||
"config_path": "/opt/anytype/.env",
|
||||
"description": "Anytype is a local-first, privacy-focused alternative to Notion. This script deploys the any-sync-bundle which provides a self-hosted sync server for Anytype clients with external MongoDB and Redis Stack.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/anytype.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 4096,
|
||||
"hdd": 16,
|
||||
"os": "Ubuntu",
|
||||
"version": "24.04"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "After installation, import /opt/anytype/data/client-config.yml into your Anytype apps.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "This uses the community any-sync-bundle by grishy, not the official Anytype deployment.",
|
||||
"type": "warning"
|
||||
},
|
||||
{
|
||||
"text": "Firewall: Open TCP 33010 (DRPC) and UDP 33020 (QUIC) for external access.",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
{
|
||||
"name": "Byparr",
|
||||
"slug": "byparr",
|
||||
"categories": [
|
||||
14
|
||||
],
|
||||
"date_created": "2025-12-02",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 8191,
|
||||
"documentation": "https://github.com/ThePhaseless/Byparr/blob/master/README.md",
|
||||
"website": "https://github.com/ThePhaseless/Byparr",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/byparr.webp",
|
||||
"config_path": "",
|
||||
"description": "Byparr is a proxy server to bypass Cloudflare and DDoS-GUARD protection.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/byparr.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 4,
|
||||
"os": "debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": []
|
||||
}
|
||||
40
frontend/public/json/clawdbot.json
Normal file
40
frontend/public/json/clawdbot.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "Clawdbot",
|
||||
"slug": "clawdbot",
|
||||
"categories": [
|
||||
20
|
||||
],
|
||||
"date_created": "2026-01-26",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 18791,
|
||||
"documentation": "https://docs.clawd.bot/",
|
||||
"website": "https://clawd.bot/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/clawdbot.webp",
|
||||
"config_path": "/opt/clawdbot/.env",
|
||||
"description": "Your own personal AI assistant. Any OS. Any Platform. The lobster way. Clawdbot is a powerful AI agent framework that can be configured to work across multiple platforms and channels.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/clawdbot.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 8,
|
||||
"os": "debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"type": "info",
|
||||
"text": "After install run onboarding: clawdbot onboard --install-daemon"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
{
|
||||
"name": "Dawarich",
|
||||
"slug": "dawarich",
|
||||
"categories": [
|
||||
9
|
||||
],
|
||||
"date_created": "2026-01-16",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 3000,
|
||||
"documentation": "https://dawarich.app/docs",
|
||||
"website": "https://dawarich.app/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/dawarich.webp",
|
||||
"config_path": "/opt/dawarich/.env",
|
||||
"description": "Dawarich is a self-hosted alternative to Google Timeline (Google Maps Location History). It allows you to import your location history from Google Maps Timeline and Owntracks, view it on a map, and analyze your location data with statistics and visualizations.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/dawarich.sh",
|
||||
"resources": {
|
||||
"cpu": 4,
|
||||
"ram": 4096,
|
||||
"hdd": 15,
|
||||
"os": "Debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": "demo@dawarich.app",
|
||||
"password": "password"
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Default credentials: demo@dawarich.app / password - Change after first login!",
|
||||
"type": "warning"
|
||||
}
|
||||
]
|
||||
}
|
||||
40
frontend/public/json/ebusd.json
Normal file
40
frontend/public/json/ebusd.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "ebusd",
|
||||
"slug": "ebusd",
|
||||
"categories": [
|
||||
16
|
||||
],
|
||||
"date_created": "2026-01-26",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": null,
|
||||
"documentation": "https://github.com/john30/ebusd/wiki",
|
||||
"website": "https://github.com/john30/ebusd",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/proxmox-helper-scripts.webp",
|
||||
"config_path": "/etc/default/ebusd",
|
||||
"description": "ebusd is a daemon for handling communication with eBUS devices connected to a 2-wire `energy bus` used by numerous heating systems.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/ebusd.sh",
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 512,
|
||||
"hdd": 2,
|
||||
"os": "debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": "root",
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "For required post installation actions, checkout: `https://github.com/community-scripts/ProxmoxVE/discussions/11352`",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
145
frontend/public/json/github-versions.json
Normal file
145
frontend/public/json/github-versions.json
Normal file
@ -0,0 +1,145 @@
|
||||
{
|
||||
"generated": "2026-01-30T07:00:55Z",
|
||||
"versions": [
|
||||
{
|
||||
"slug": "affine",
|
||||
"repo": "toeverything/AFFiNE",
|
||||
"version": "v0.25.7",
|
||||
"pinned": false,
|
||||
"date": "2025-12-09T04:34:14Z"
|
||||
},
|
||||
{
|
||||
"slug": "ampache",
|
||||
"repo": "ampache/ampache",
|
||||
"version": "7.8.0",
|
||||
"pinned": false,
|
||||
"date": "2025-12-22T04:23:45Z"
|
||||
},
|
||||
{
|
||||
"slug": "anytype",
|
||||
"repo": "grishy/any-sync-bundle",
|
||||
"version": "v1.2.1-2025-12-10",
|
||||
"pinned": false,
|
||||
"date": "2025-12-24T20:40:15Z"
|
||||
},
|
||||
{
|
||||
"slug": "databasus",
|
||||
"repo": "databasus/databasus",
|
||||
"version": "v3.7.0",
|
||||
"pinned": false,
|
||||
"date": "2026-01-28T14:46:28Z"
|
||||
},
|
||||
{
|
||||
"slug": "ente",
|
||||
"repo": "ente-io/ente",
|
||||
"version": "photos-v1.3.7",
|
||||
"pinned": false,
|
||||
"date": "2026-01-29T17:20:41Z"
|
||||
},
|
||||
{
|
||||
"slug": "frigate",
|
||||
"repo": "blakeblackshear/frigate",
|
||||
"version": "v0.16.4",
|
||||
"pinned": false,
|
||||
"date": "2026-01-29T00:42:14Z"
|
||||
},
|
||||
{
|
||||
"slug": "hoodik",
|
||||
"repo": "hudikhq/hoodik",
|
||||
"version": "v1.8.1",
|
||||
"pinned": false,
|
||||
"date": "2025-12-22T20:32:27Z"
|
||||
},
|
||||
{
|
||||
"slug": "isponsorblocktv",
|
||||
"repo": "dmunozv04/iSponsorBlockTV",
|
||||
"version": "v2.6.1",
|
||||
"pinned": false,
|
||||
"date": "2025-10-19T17:43:10Z"
|
||||
},
|
||||
{
|
||||
"slug": "kitchenowl",
|
||||
"repo": "TomBursch/kitchenowl",
|
||||
"version": "v0.7.6",
|
||||
"pinned": false,
|
||||
"date": "2026-01-24T01:21:14Z"
|
||||
},
|
||||
{
|
||||
"slug": "minthcm",
|
||||
"repo": "minthcm/minthcm",
|
||||
"version": "4.2.2",
|
||||
"pinned": false,
|
||||
"date": "2025-10-10T09:37:21Z"
|
||||
},
|
||||
{
|
||||
"slug": "nextexplorer",
|
||||
"repo": "vikramsoni2/nextExplorer",
|
||||
"version": "v2.1.1",
|
||||
"pinned": false,
|
||||
"date": "2026-01-24T21:22:09Z"
|
||||
},
|
||||
{
|
||||
"slug": "nightscout",
|
||||
"repo": "nightscout/cgm-remote-monitor",
|
||||
"version": "15.0.3",
|
||||
"pinned": false,
|
||||
"date": "2025-05-08T22:12:34Z"
|
||||
},
|
||||
{
|
||||
"slug": "opencloud",
|
||||
"repo": "opencloud-eu/opencloud",
|
||||
"version": "v5.0.1",
|
||||
"pinned": true,
|
||||
"date": "2026-01-28T15:08:23Z"
|
||||
},
|
||||
{
|
||||
"slug": "piler",
|
||||
"repo": "jsuto/piler",
|
||||
"version": "piler-1.4.8",
|
||||
"pinned": false,
|
||||
"date": "2025-09-24T06:51:38Z"
|
||||
},
|
||||
{
|
||||
"slug": "pixelfed",
|
||||
"repo": "pixelfed/pixelfed",
|
||||
"version": "v0.12.6",
|
||||
"pinned": false,
|
||||
"date": "2025-09-03T12:12:04Z"
|
||||
},
|
||||
{
|
||||
"slug": "romm",
|
||||
"repo": "RetroAchievements/RALibretro",
|
||||
"version": "1.8.2",
|
||||
"pinned": false,
|
||||
"date": "2026-01-23T17:03:31Z"
|
||||
},
|
||||
{
|
||||
"slug": "rustypaste",
|
||||
"repo": "orhun/rustypaste",
|
||||
"version": "v0.16.1",
|
||||
"pinned": false,
|
||||
"date": "2025-03-21T20:44:47Z"
|
||||
},
|
||||
{
|
||||
"slug": "seer",
|
||||
"repo": "seerr-team/seerr",
|
||||
"version": "v2.7.3",
|
||||
"pinned": false,
|
||||
"date": "2025-08-14T20:43:46Z"
|
||||
},
|
||||
{
|
||||
"slug": "shelfmark",
|
||||
"repo": "FlareSolverr/FlareSolverr",
|
||||
"version": "v3.4.6",
|
||||
"pinned": false,
|
||||
"date": "2025-11-29T02:43:00Z"
|
||||
},
|
||||
{
|
||||
"slug": "wishlist",
|
||||
"repo": "cmintey/wishlist",
|
||||
"version": "v0.59.0",
|
||||
"pinned": false,
|
||||
"date": "2026-01-19T16:42:14Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
44
frontend/public/json/isponsorblocktv.json
Normal file
44
frontend/public/json/isponsorblocktv.json
Normal file
@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "iSponsorBlockTV",
|
||||
"slug": "isponsorblocktv",
|
||||
"categories": [
|
||||
13
|
||||
],
|
||||
"date_created": "2026-01-25",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": null,
|
||||
"documentation": "https://github.com/dmunozv04/iSponsorBlockTV/wiki",
|
||||
"website": "https://github.com/dmunozv04/iSponsorBlockTV",
|
||||
"logo": "https://raw.githubusercontent.com/ajayyy/SponsorBlock/master/public/icons/IconSponsorBlocker512px.png",
|
||||
"config_path": "/var/lib/isponsorblocktv/config.json",
|
||||
"description": "iSponsorBlockTV connects to YouTube TV clients and automatically skips SponsorBlock segments, mutes ads, and presses the Skip Ad button when available.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/isponsorblocktv.sh",
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 1024,
|
||||
"hdd": 4,
|
||||
"os": "debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "No web UI; run `iSponsorBlockTV setup` inside the container to configure.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "SSDP auto-discovery requires multicast on your bridge; manual pairing works without it.",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
{
|
||||
"name": "Loki",
|
||||
"slug": "loki",
|
||||
"categories": [9],
|
||||
"date_created": "2025-12-10",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 3100,
|
||||
"documentation": "https://grafana.com/docs/loki/latest/",
|
||||
"website": "https://github.com/grafana/loki",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@master/webp/loki.webp",
|
||||
"config_path": "Debian: /etc/loki/config.yml | Alpine: /etc/loki/loki-local-config.yaml",
|
||||
"description": "Grafana Loki is a set of open source components that can be composed into a fully featured logging stack. A small index and highly compressed chunks simplifies the operation and significantly lowers the cost of Loki.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/loki.sh",
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 512,
|
||||
"hdd": 2,
|
||||
"os": "debian",
|
||||
"version": "13"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "alpine",
|
||||
"script": "ct/alpine-loki.sh",
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 256,
|
||||
"hdd": 1,
|
||||
"os": "alpine",
|
||||
"version": "3.22"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": []
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
{
|
||||
"name": "Manyfold",
|
||||
"slug": "manyfold",
|
||||
"categories": [
|
||||
24
|
||||
],
|
||||
"date_created": "2025-03-18",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 80,
|
||||
"documentation": "https://manyfold.app/sysadmin/",
|
||||
"website": "https://manyfold.app/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/manyfold.webp",
|
||||
"config_path": "/opt/manyfold/.env",
|
||||
"description": "Manyfold is an open source, self-hosted web application for managing a collection of 3d models, particularly focused on 3d printing.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/manyfold.sh",
|
||||
"resources": {
|
||||
"cpu": 4,
|
||||
"ram": 4096,
|
||||
"hdd": 15,
|
||||
"os": "debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Setup library on first connection in /opt/manyfold/data",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
52
frontend/public/json/nightscout.json
Normal file
52
frontend/public/json/nightscout.json
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "Nightscout",
|
||||
"slug": "nightscout",
|
||||
"categories": [
|
||||
0
|
||||
],
|
||||
"date_created": "2025-01-17",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 1337,
|
||||
"documentation": "https://nightscout.github.io/",
|
||||
"website": "http://www.nightscout.info/",
|
||||
"logo": "https://raw.githubusercontent.com/nightscout/cgm-remote-monitor/master/static/images/large.png",
|
||||
"config_path": "/opt/nightscout/my.env",
|
||||
"description": "Nightscout is an open source, DIY project that allows real time access to a CGM data via personal website, smartwatch watchers, or apps and widgets available for smartphones.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/nightscout.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 10,
|
||||
"os": "debian",
|
||||
"version": "12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Nightscout requires configuring `my.env` with your Mongo connection string. API_SECRET has been generated and saved to `~/nightscout.creds`.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Edit `/opt/nightscout/my.env` to configure your CGM source (Dexcom/CareLink). Then run: `systemctl restart nightscout`",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Official Configuration Guide: https://nightscout.github.io/nightscout/setup_variables/",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Nightscout requires HTTPS for many features (security, tokens, PWA). Usage of a reverse proxy (e.g. Nginx Proxy Manager, Traefik, Caddy) is highly recommended.",
|
||||
"type": "warning"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
{
|
||||
"name": "nodecast-tv",
|
||||
"slug": "nodecast-tv",
|
||||
"categories": [
|
||||
13
|
||||
],
|
||||
"date_created": "2026-01-14",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 3000,
|
||||
"documentation": "https://github.com/technomancer702/nodecast-tv/blob/main/README.md",
|
||||
"website": "https://github.com/technomancer702/nodecast-tv",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/nodecast-tv.webp",
|
||||
"config_path": "",
|
||||
"description": "nodecast-tv is a modern, web-based IPTV player featuring Live TV, EPG, Movies (VOD), and Series support. Built with performance and user experience in mind.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/nodecast-tv.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 4,
|
||||
"os": "debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": []
|
||||
}
|
||||
@ -25,6 +25,17 @@
|
||||
"os": "Debian",
|
||||
"version": "13"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "alpine",
|
||||
"script": "ct/alpine-rustypaste.sh",
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 256,
|
||||
"hdd": 4,
|
||||
"os": "Alpine",
|
||||
"version": "3.22"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
|
||||
40
frontend/public/json/shelfmark.json
Normal file
40
frontend/public/json/shelfmark.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "Shelfmark",
|
||||
"slug": "shelfmark",
|
||||
"categories": [
|
||||
13
|
||||
],
|
||||
"date_created": "2026-01-24",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 8084,
|
||||
"documentation": "https://github.com/calibrain/shelfmark/tree/main/docs",
|
||||
"website": "https://github.com/calibrain/shelfmark",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/shelfmark.webp",
|
||||
"config_path": "/etc/shelfmark",
|
||||
"description": "Shelfmark is a unified web interface for searching and aggregating books and audiobook downloads from multiple sources - all in one place.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/shelfmark.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 6,
|
||||
"os": "Debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "The configuration at `/etc/shelfmark/.env` is for bootstrapping the initial install. Customize the configuration via the Shelfmark UI.",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
{
|
||||
"name": "Tracearr",
|
||||
"slug": "tracearr",
|
||||
"categories": [
|
||||
14
|
||||
],
|
||||
"date_created": "2025-12-28",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 3000,
|
||||
"documentation": "https://github.com/connorgallopo/Tracearr#readme",
|
||||
"config_path": "",
|
||||
"website": "https://github.com/connorgallopo/Tracearr",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/tracearr.webp",
|
||||
"description": "Tracearr is a streaming access manager for Plex, Jellyfin and Emby servers. It answers the question every server owner eventually asks: \"Who's actually using my server, and are they sharing their login?\"",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/tracearr.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 5,
|
||||
"os": "Debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": []
|
||||
}
|
||||
40
frontend/public/json/truenas-vm.json
Normal file
40
frontend/public/json/truenas-vm.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "TrueNAS Community Edition",
|
||||
"slug": "truenas-community-edition",
|
||||
"categories": [
|
||||
2
|
||||
],
|
||||
"date_created": "2026-01-16",
|
||||
"type": "vm",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": null,
|
||||
"documentation": "https://www.truenas.com/docs/",
|
||||
"website": "https://www.truenas.com/truenas-community-edition/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/truenas-core.webp",
|
||||
"config_path": "",
|
||||
"description": "TrueNAS Community Edition is the world's most deployed storage software. Free, flexible and build on OpenZFS with Docker.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "vm/truenas-vm.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 8192,
|
||||
"hdd": 16,
|
||||
"os": null,
|
||||
"version": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Once the script finishes, proceed with the OS installation via the console. For more details, please refer to this discussion: `https://github.com/community-scripts/ProxmoxVE/discussions/11344`",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -51,6 +51,30 @@
|
||||
{
|
||||
"text": "At the end of the update, containers requiring a reboot will be listed, and you may choose to reboot them directly.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Use `var_backup=yes|no` to enable/disable backup (skip prompt).",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Use `var_backup_storage=<name>` to set backup storage location.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Use `var_container=all|all_running|all_stopped|101,102,...` to select containers.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Use `var_unattended=yes|no` to run updates without interaction.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Use `var_skip_confirm=yes` to skip initial confirmation dialog.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Use `var_auto_reboot=yes|no` to auto-reboot containers after update.",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -7,16 +7,17 @@ console.log('Current directory: ' + process.cwd());
|
||||
const jsonDir = "public/json";
|
||||
const metadataFileName = "metadata.json";
|
||||
const versionsFileName = "versions.json";
|
||||
const githubVersionsFileName = "github-versions.json";
|
||||
const encoding = "utf-8";
|
||||
|
||||
const fileNames = (await fs.readdir(jsonDir))
|
||||
.filter((fileName) => fileName !== metadataFileName && fileName !== versionsFileName);
|
||||
.filter((fileName) => fileName !== metadataFileName && fileName !== versionsFileName && fileName !== githubVersionsFileName);
|
||||
|
||||
describe.each(fileNames)("%s", async (fileName) => {
|
||||
let script: Script;
|
||||
|
||||
beforeAll(async () => {
|
||||
const filePath = path.resolve(jsonDir, fileName);
|
||||
const filePath = path.resolve(jsonDir, fileName);
|
||||
const fileContent = await fs.readFile(filePath, encoding)
|
||||
script = JSON.parse(fileContent);
|
||||
})
|
||||
@ -40,7 +41,7 @@ describe(`${metadataFileName}`, async () => {
|
||||
let metadata: Metadata;
|
||||
|
||||
beforeAll(async () => {
|
||||
const filePath = path.resolve(jsonDir, metadataFileName);
|
||||
const filePath = path.resolve(jsonDir, metadataFileName);
|
||||
const fileContent = await fs.readFile(filePath, encoding)
|
||||
metadata = JSON.parse(fileContent);
|
||||
})
|
||||
@ -48,9 +49,9 @@ describe(`${metadataFileName}`, async () => {
|
||||
// TODO: create zod schema for metadata. Move zod schemas to /lib/types.ts
|
||||
assert(metadata.categories.length > 0);
|
||||
metadata.categories.forEach((category) => {
|
||||
assert.isString(category.name)
|
||||
assert.isNumber(category.id)
|
||||
assert.isNumber(category.sort_order)
|
||||
assert.isString(category.name)
|
||||
assert.isNumber(category.id)
|
||||
assert.isNumber(category.sort_order)
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
@ -29,7 +29,7 @@ PG_VERSION="16" PG_MODULES="pgvector" setup_postgresql
|
||||
PG_DB_NAME="affine" PG_DB_USER="affine" setup_postgresql_db
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
setup_rust
|
||||
import_local_ip
|
||||
|
||||
|
||||
fetch_and_deploy_gh_release "affine_app" "toeverything/AFFiNE" "tarball" "latest" "/opt/affine"
|
||||
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
#!/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
|
||||
34
install/alpine-powerdns-install.sh
Normal file
34
install/alpine-powerdns-install.sh
Normal file
@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Slaviša Arežina (tremor021)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://www.powerdns.com/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing PowerDNS"
|
||||
$STD apk add --no-cache pdns pdns-backend-sqlite3 pdns-doc
|
||||
msg_ok "Installed PowerDNS"
|
||||
|
||||
msg_info "Configuring PowerDNS"
|
||||
sed -i '/^# launch=$/c\launch=gsqlite3\ngsqlite3-database=/var/lib/powerdns/pdns.sqlite3' /etc/pdns/pdns.conf
|
||||
mkdir /var/lib/powerdns
|
||||
sqlite3 /var/lib/powerdns/pdns.sqlite3 < /usr/share/doc/pdns/schema.sqlite3.sql
|
||||
chown -R pdns:pdns /var/lib/powerdns
|
||||
msg_ok "Configured PowerDNS"
|
||||
|
||||
msg_info "Creating Service"
|
||||
$STD rc-update add pdns default
|
||||
$STD rc-service pdns start
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@ -13,34 +13,20 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
fetch_and_deploy_gh_release "rustypaste" "orhun/rustypaste" "prebuild" "latest" "/opt/rustypaste" "*x86_64-unknown-linux-musl.tar.gz"
|
||||
msg_info "Installing RustyPaste"
|
||||
$STD apk add --no-cache rustypaste --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
|
||||
msg_ok "Installed RustyPaste"
|
||||
|
||||
msg_info "Setting up rustypaste"
|
||||
cd /opt/rustypaste
|
||||
sed -i 's|^address = ".*"|address = "0.0.0.0:8000"|' config.toml
|
||||
msg_ok "Set up rustypaste"
|
||||
msg_info "Configuring RustyPaste"
|
||||
mkdir -p /var/lib/rustypaste
|
||||
sed -i 's|^address = ".*"|address = "0.0.0.0:8000"|' /etc/rustypaste/config.toml
|
||||
msg_ok "Configured RustyPaste"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<'EOF' >/etc/init.d/rustypaste
|
||||
#!/sbin/openrc-run
|
||||
|
||||
name="rustypaste"
|
||||
description="rustypaste Service"
|
||||
directory="/opt/rustypaste"
|
||||
command="/opt/rustypaste/rustypaste"
|
||||
command_args=""
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
command_background="yes"
|
||||
start_stop_daemon_args="--user root"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/rustypaste
|
||||
rc-update add rustypaste default
|
||||
rc-service rustypaste start
|
||||
$STD rc-update add rustypaste default
|
||||
$STD rc-service rustypaste start
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: pshankinclarke (lazarillo)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://valkey.io/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Valkey"
|
||||
$STD apk add valkey valkey-openrc valkey-cli
|
||||
$STD sed -i 's/^bind .*/bind 0.0.0.0/' /etc/valkey/valkey.conf
|
||||
$STD rc-update add valkey default
|
||||
$STD rc-service valkey start
|
||||
msg_ok "Installed Valkey"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
82
install/anytype-install.sh
Normal file
82
install/anytype-install.sh
Normal file
@ -0,0 +1,82 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://anytype.io
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
setup_mongodb
|
||||
|
||||
msg_info "Configuring MongoDB Replica Set"
|
||||
cat <<EOF >>/etc/mongod.conf
|
||||
|
||||
replication:
|
||||
replSetName: "rs0"
|
||||
EOF
|
||||
systemctl restart mongod
|
||||
sleep 3
|
||||
$STD mongosh --eval 'rs.initiate({_id: "rs0", members: [{_id: 0, host: "127.0.0.1:27017"}]})'
|
||||
msg_ok "Configured MongoDB Replica Set"
|
||||
|
||||
msg_info "Installing Redis Stack"
|
||||
setup_deb822_repo \
|
||||
"redis-stack" \
|
||||
"https://packages.redis.io/gpg" \
|
||||
"https://packages.redis.io/deb" \
|
||||
"jammy" \
|
||||
"main"
|
||||
$STD apt-get install -y \
|
||||
redis-stack-server
|
||||
systemctl enable -q --now redis-stack-server
|
||||
msg_ok "Installed Redis Stack"
|
||||
|
||||
fetch_and_deploy_gh_release "anytype" "grishy/any-sync-bundle" "prebuild" "latest" "/opt/anytype" "any-sync-bundle_*_linux_amd64.tar.gz"
|
||||
chmod +x /opt/anytype/any-sync-bundle
|
||||
|
||||
msg_info "Configuring Anytype"
|
||||
mkdir -p /opt/anytype/data/storage
|
||||
cat <<EOF >/opt/anytype/.env
|
||||
ANY_SYNC_BUNDLE_CONFIG=/opt/anytype/data/bundle-config.yml
|
||||
ANY_SYNC_BUNDLE_CLIENT_CONFIG=/opt/anytype/data/client-config.yml
|
||||
ANY_SYNC_BUNDLE_INIT_STORAGE=/opt/anytype/data/storage/
|
||||
ANY_SYNC_BUNDLE_INIT_EXTERNAL_ADDRS=${LOCAL_IP}
|
||||
ANY_SYNC_BUNDLE_INIT_MONGO_URI=mongodb://127.0.0.1:27017/
|
||||
ANY_SYNC_BUNDLE_INIT_REDIS_URI=redis://127.0.0.1:6379/
|
||||
ANY_SYNC_BUNDLE_LOG_LEVEL=info
|
||||
EOF
|
||||
msg_ok "Configured Anytype"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/anytype.service
|
||||
[Unit]
|
||||
Description=Anytype Sync Server (any-sync-bundle)
|
||||
After=network-online.target mongod.service redis-stack-server.service
|
||||
Wants=network-online.target
|
||||
Requires=mongod.service redis-stack-server.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/anytype
|
||||
EnvironmentFile=/opt/anytype/.env
|
||||
ExecStart=/opt/anytype/any-sync-bundle start-bundle
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now anytype
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
107
install/authelia-install.sh
Normal file
107
install/authelia-install.sh
Normal file
@ -0,0 +1,107 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: thost96 (thost96)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://www.authelia.com/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
fetch_and_deploy_gh_release "authelia" "authelia/authelia" "binary"
|
||||
|
||||
MAX_ATTEMPTS=3
|
||||
attempt=0
|
||||
while true; do
|
||||
attempt=$((attempt + 1))
|
||||
read -rp "${TAB3}Enter your domain or IP (ex. example.com or 192.168.1.100): " DOMAIN
|
||||
if [[ -z "$DOMAIN" ]]; then
|
||||
if ((attempt >= MAX_ATTEMPTS)); then
|
||||
DOMAIN="${LOCAL_IP:-localhost}"
|
||||
msg_warn "Using fallback: $DOMAIN"
|
||||
break
|
||||
fi
|
||||
msg_warn "Domain cannot be empty! (Attempt $attempt/$MAX_ATTEMPTS)"
|
||||
elif [[ "$DOMAIN" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then
|
||||
valid_ip=true
|
||||
IFS='.' read -ra octets <<< "$DOMAIN"
|
||||
for octet in "${octets[@]}"; do
|
||||
if ((octet > 255)); then
|
||||
valid_ip=false
|
||||
break
|
||||
fi
|
||||
done
|
||||
if $valid_ip; then
|
||||
break
|
||||
else
|
||||
msg_warn "Invalid IP address!"
|
||||
fi
|
||||
elif [[ "$DOMAIN" =~ ^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\.[a-zA-Z]{2,}$ ]]; then
|
||||
break
|
||||
else
|
||||
msg_warn "Invalid domain format!"
|
||||
fi
|
||||
done
|
||||
msg_info "Setting Authelia up"
|
||||
touch /etc/authelia/emails.txt
|
||||
JWT_SECRET=$(openssl rand -hex 64)
|
||||
SESSION_SECRET=$(openssl rand -hex 64)
|
||||
STORAGE_KEY=$(openssl rand -hex 64)
|
||||
|
||||
if [[ "$DOMAIN" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then
|
||||
AUTHELIA_URL="https://${DOMAIN}:9091"
|
||||
else
|
||||
AUTHELIA_URL="https://auth.${DOMAIN}"
|
||||
fi
|
||||
echo "$AUTHELIA_URL" > /etc/authelia/.authelia_url
|
||||
|
||||
cat <<EOF >/etc/authelia/users.yml
|
||||
users:
|
||||
authelia:
|
||||
disabled: false
|
||||
displayname: "Authelia Admin"
|
||||
password: "\$argon2id\$v=19\$m=65536,t=3,p=4\$ZBopMzXrzhHXPEZxRDVT2w\$SxWm96DwhOsZyn34DLocwQEIb4kCDsk632PuiMdZnig"
|
||||
groups: []
|
||||
EOF
|
||||
cat <<EOF >/etc/authelia/configuration.yml
|
||||
authentication_backend:
|
||||
file:
|
||||
path: /etc/authelia/users.yml
|
||||
access_control:
|
||||
default_policy: one_factor
|
||||
session:
|
||||
secret: "${SESSION_SECRET}"
|
||||
name: 'authelia_session'
|
||||
same_site: 'lax'
|
||||
inactivity: '5m'
|
||||
expiration: '1h'
|
||||
remember_me: '1M'
|
||||
cookies:
|
||||
- domain: "${DOMAIN}"
|
||||
authelia_url: "${AUTHELIA_URL}"
|
||||
storage:
|
||||
encryption_key: "${STORAGE_KEY}"
|
||||
local:
|
||||
path: /etc/authelia/db.sqlite
|
||||
identity_validation:
|
||||
reset_password:
|
||||
jwt_secret: "${JWT_SECRET}"
|
||||
jwt_lifespan: '5 minutes'
|
||||
jwt_algorithm: 'HS256'
|
||||
notifier:
|
||||
filesystem:
|
||||
filename: /etc/authelia/emails.txt
|
||||
EOF
|
||||
touch /etc/authelia/emails.txt
|
||||
chown -R authelia:authelia /etc/authelia
|
||||
systemctl enable -q --now authelia
|
||||
msg_ok "Authelia Setup completed"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@ -1,50 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: luismco
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/ThePhaseless/Byparr
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt -y install \
|
||||
xauth \
|
||||
xvfb \
|
||||
scrot \
|
||||
chromium \
|
||||
chromium-driver \
|
||||
ca-certificates
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
fetch_and_deploy_gh_release "Byparr" "ThePhaseless/Byparr"
|
||||
setup_uv
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/byparr.service
|
||||
[Unit]
|
||||
Description=Byparr
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/Byparr
|
||||
ExecStart=/usr/local/bin/uv run python3 main.py
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now byparr
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
31
install/clawdbot-install.sh
Normal file
31
install/clawdbot-install.sh
Normal file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: michelroegl-brunner
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/clawdbot/clawdbot
|
||||
|
||||
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 \
|
||||
git
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
|
||||
NODE_VERSION="24" NODE_MODULE="pnpm@latest" setup_nodejs
|
||||
|
||||
curl -fsSL https://clawd.bot/install.sh | bash
|
||||
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
|
||||
@ -14,12 +14,12 @@ network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y nginx
|
||||
$STD apt install -y \
|
||||
nginx \
|
||||
valkey
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
import_local_ip
|
||||
PG_VERSION="17" setup_postgresql
|
||||
PG_DB_NAME="databasus" PG_DB_USER="databasus" setup_postgresql_db
|
||||
setup_go
|
||||
NODE_VERSION="24" setup_nodejs
|
||||
|
||||
@ -36,19 +36,17 @@ $STD go install github.com/swaggo/swag/cmd/swag@latest
|
||||
$STD /root/go/bin/swag init -g cmd/main.go -o swagger
|
||||
$STD env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o databasus ./cmd/main.go
|
||||
mv /opt/databasus/backend/databasus /opt/databasus/databasus
|
||||
mkdir -p /opt/databasus_data/{data,backups,logs}
|
||||
mkdir -p /databasus-data/temp
|
||||
mkdir -p /databasus-data/{pgdata,temp,backups,data,logs}
|
||||
mkdir -p /opt/databasus/ui/build
|
||||
mkdir -p /opt/databasus/migrations
|
||||
cp -r /opt/databasus/frontend/dist/* /opt/databasus/ui/build/
|
||||
cp -r /opt/databasus/backend/migrations /opt/databasus/
|
||||
chown -R postgres:postgres /opt/databasus
|
||||
chown -R postgres:postgres /opt/databasus_data
|
||||
cp -r /opt/databasus/backend/migrations/* /opt/databasus/migrations/
|
||||
chown -R postgres:postgres /databasus-data
|
||||
msg_ok "Built Databasus"
|
||||
|
||||
msg_info "Configuring Databasus"
|
||||
ADMIN_PASS=$(openssl rand -base64 12)
|
||||
JWT_SECRET=$(openssl rand -hex 32)
|
||||
ENCRYPTION_KEY=$(openssl rand -hex 32)
|
||||
|
||||
# Create PostgreSQL version symlinks for compatibility
|
||||
for v in 12 13 14 15 16 18; do
|
||||
@ -67,50 +65,67 @@ ENV_MODE=production
|
||||
SERVER_PORT=4005
|
||||
SERVER_HOST=0.0.0.0
|
||||
|
||||
# Database (Internal PostgreSQL for app data)
|
||||
DATABASE_DSN=host=localhost user=${PG_DB_USER} password=${PG_DB_PASS} dbname=${PG_DB_NAME} port=5432 sslmode=disable
|
||||
DATABASE_URL=postgres://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}?sslmode=disable
|
||||
# Database
|
||||
DATABASE_DSN=host=localhost user=postgres password=postgres dbname=databasus port=5432 sslmode=disable
|
||||
DATABASE_URL=postgres://postgres:postgres@localhost:5432/databasus?sslmode=disable
|
||||
|
||||
# Migrations
|
||||
GOOSE_DRIVER=postgres
|
||||
GOOSE_DBSTRING=postgres://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}?sslmode=disable
|
||||
GOOSE_DBSTRING=postgres://postgres:postgres@localhost:5432/databasus?sslmode=disable
|
||||
GOOSE_MIGRATION_DIR=/opt/databasus/migrations
|
||||
|
||||
# Valkey (Redis-compatible cache)
|
||||
VALKEY_HOST=localhost
|
||||
VALKEY_PORT=6379
|
||||
|
||||
# Security
|
||||
JWT_SECRET=${JWT_SECRET}
|
||||
ENCRYPTION_KEY=$(openssl rand -hex 32)
|
||||
|
||||
# Admin User
|
||||
ADMIN_EMAIL=admin@localhost
|
||||
ADMIN_PASSWORD=${ADMIN_PASS}
|
||||
ENCRYPTION_KEY=${ENCRYPTION_KEY}
|
||||
|
||||
# Paths
|
||||
DATA_DIR=/opt/databasus_data/data
|
||||
BACKUP_DIR=/opt/databasus_data/backups
|
||||
LOG_DIR=/opt/databasus_data/logs
|
||||
|
||||
# PostgreSQL Tools (for creating backups)
|
||||
PG_DUMP_PATH=/usr/lib/postgresql/17/bin/pg_dump
|
||||
PG_RESTORE_PATH=/usr/lib/postgresql/17/bin/pg_restore
|
||||
PSQL_PATH=/usr/lib/postgresql/17/bin/psql
|
||||
DATA_DIR=/databasus-data/data
|
||||
BACKUP_DIR=/databasus-data/backups
|
||||
LOG_DIR=/databasus-data/logs
|
||||
EOF
|
||||
chown postgres:postgres /opt/databasus/.env
|
||||
chmod 600 /opt/databasus/.env
|
||||
msg_ok "Configured Databasus"
|
||||
|
||||
msg_info "Configuring Valkey"
|
||||
cat >/etc/valkey/valkey.conf <<EOF
|
||||
port 6379
|
||||
bind 127.0.0.1
|
||||
protected-mode yes
|
||||
save ""
|
||||
maxmemory 256mb
|
||||
maxmemory-policy allkeys-lru
|
||||
EOF
|
||||
systemctl enable -q --now valkey-server
|
||||
systemctl restart valkey-server
|
||||
msg_ok "Configured Valkey"
|
||||
|
||||
msg_info "Creating Database"
|
||||
# Configure PostgreSQL to allow local password auth for databasus
|
||||
PG_HBA="/etc/postgresql/17/main/pg_hba.conf"
|
||||
if ! grep -q "databasus" "$PG_HBA"; then
|
||||
sed -i '/^local\s*all\s*all/i local databasus postgres trust' "$PG_HBA"
|
||||
sed -i '/^host\s*all\s*all\s*127/i host databasus postgres 127.0.0.1/32 trust' "$PG_HBA"
|
||||
systemctl reload postgresql
|
||||
fi
|
||||
$STD sudo -u postgres psql -c "CREATE DATABASE databasus;" 2>/dev/null || true
|
||||
$STD sudo -u postgres psql -c "ALTER USER postgres WITH SUPERUSER CREATEROLE CREATEDB;" 2>/dev/null || true
|
||||
msg_ok "Created Database"
|
||||
|
||||
msg_info "Creating Databasus Service"
|
||||
cat <<EOF >/etc/systemd/system/databasus.service
|
||||
[Unit]
|
||||
Description=Databasus - PostgreSQL Backup Management
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
Description=Databasus - Database Backup Management
|
||||
After=network.target postgresql.service valkey.service
|
||||
Requires=postgresql.service valkey.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=postgres
|
||||
Group=postgres
|
||||
WorkingDirectory=/opt/databasus
|
||||
Environment="PATH=/usr/local/bin:/usr/bin:/bin"
|
||||
EnvironmentFile=/opt/databasus/.env
|
||||
ExecStart=/opt/databasus/databasus
|
||||
Restart=always
|
||||
|
||||
@ -1,179 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/Freika/dawarich
|
||||
|
||||
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 \
|
||||
build-essential \
|
||||
git \
|
||||
libpq-dev \
|
||||
libgeos-dev \
|
||||
libyaml-dev \
|
||||
libffi-dev \
|
||||
libssl-dev \
|
||||
libjemalloc2 \
|
||||
imagemagick \
|
||||
libmagickwand-dev \
|
||||
libvips-dev \
|
||||
cmake \
|
||||
redis-server \
|
||||
nginx
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PG_VERSION="17" PG_MODULES="postgis-3" setup_postgresql
|
||||
PG_DB_NAME="dawarich_production" PG_DB_USER="dawarich" PG_DB_EXTENSIONS="postgis" setup_postgresql_db
|
||||
|
||||
fetch_and_deploy_gh_release "dawarich" "Freika/dawarich" "tarball" "latest" "/opt/dawarich/app"
|
||||
|
||||
msg_info "Setting up Directories"
|
||||
mkdir -p /opt/dawarich/app/{storage,log,tmp/pids,tmp/cache,tmp/sockets}
|
||||
msg_ok "Set up Directories"
|
||||
|
||||
msg_info "Configuring Environment"
|
||||
SECRET_KEY_BASE=$(openssl rand -hex 64)
|
||||
RELEASE=$(get_latest_github_release "Freika/dawarich")
|
||||
import_local_ip
|
||||
cat <<EOF >/opt/dawarich/.env
|
||||
RAILS_ENV=production
|
||||
SECRET_KEY_BASE=${SECRET_KEY_BASE}
|
||||
DATABASE_HOST=localhost
|
||||
DATABASE_USERNAME=${PG_DB_USER}
|
||||
DATABASE_PASSWORD=${PG_DB_PASS}
|
||||
DATABASE_NAME=${PG_DB_NAME}
|
||||
REDIS_URL=redis://127.0.0.1:6379/0
|
||||
BACKGROUND_PROCESSING_CONCURRENCY=10
|
||||
APPLICATION_HOST=${LOCAL_IP}
|
||||
APPLICATION_HOSTS=${LOCAL_IP},localhost
|
||||
TIME_ZONE=UTC
|
||||
DISABLE_TELEMETRY=true
|
||||
APP_VERSION=${RELEASE}
|
||||
EOF
|
||||
msg_ok "Configured Environment"
|
||||
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
|
||||
RUBY_VERSION=$(cat /opt/dawarich/app/.ruby-version 2>/dev/null || echo "3.4.6")
|
||||
RUBY_VERSION=${RUBY_VERSION} RUBY_INSTALL_RAILS="false" setup_ruby
|
||||
|
||||
msg_info "Installing Dawarich"
|
||||
cd /opt/dawarich/app
|
||||
source /root/.profile
|
||||
export PATH="/root/.rbenv/shims:/root/.rbenv/bin:$PATH"
|
||||
eval "$(/root/.rbenv/bin/rbenv init - bash)"
|
||||
|
||||
set -a && source /opt/dawarich/.env && set +a
|
||||
|
||||
$STD gem install bundler
|
||||
$STD bundle config set --local deployment 'true'
|
||||
$STD bundle config set --local without 'development test'
|
||||
$STD bundle install
|
||||
|
||||
if [[ -f /opt/dawarich/package.json ]]; then
|
||||
cd /opt/dawarich
|
||||
$STD npm install
|
||||
cd /opt/dawarich/app
|
||||
elif [[ -f /opt/dawarich/app/package.json ]]; then
|
||||
$STD npm install
|
||||
fi
|
||||
|
||||
$STD bundle exec rake assets:precompile
|
||||
$STD bundle exec rails db:prepare
|
||||
$STD bundle exec rake data:migrate
|
||||
msg_ok "Installed Dawarich"
|
||||
|
||||
msg_info "Creating Services"
|
||||
cat <<EOF >/etc/systemd/system/dawarich-web.service
|
||||
[Unit]
|
||||
Description=Dawarich Web Server
|
||||
After=network.target postgresql.service redis-server.service
|
||||
Requires=postgresql.service redis-server.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/dawarich/app
|
||||
EnvironmentFile=/opt/dawarich/.env
|
||||
ExecStart=/root/.rbenv/shims/bundle exec puma -C config/puma.rb
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/systemd/system/dawarich-worker.service
|
||||
[Unit]
|
||||
Description=Dawarich Sidekiq Worker
|
||||
After=network.target postgresql.service redis-server.service
|
||||
Requires=postgresql.service redis-server.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/dawarich/app
|
||||
EnvironmentFile=/opt/dawarich/.env
|
||||
ExecStart=/root/.rbenv/shims/bundle exec sidekiq -C config/sidekiq.yml
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl enable -q --now redis-server dawarich-web dawarich-worker
|
||||
msg_ok "Created Services"
|
||||
|
||||
msg_info "Configuring Nginx"
|
||||
cat <<EOF >/etc/nginx/sites-available/dawarich.conf
|
||||
upstream dawarich {
|
||||
server 127.0.0.1:3000;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
root /opt/dawarich/app/public;
|
||||
client_max_body_size 100M;
|
||||
|
||||
location ~ ^/(assets|packs)/ {
|
||||
expires max;
|
||||
add_header Cache-Control "public, immutable";
|
||||
try_files \$uri =404;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files \$uri @rails;
|
||||
}
|
||||
|
||||
location @rails {
|
||||
proxy_pass http://dawarich;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host \$host;
|
||||
proxy_set_header X-Real-IP \$remote_addr;
|
||||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_redirect off;
|
||||
proxy_buffering off;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
ln -sf /etc/nginx/sites-available/dawarich.conf /etc/nginx/sites-enabled/
|
||||
rm -f /etc/nginx/sites-enabled/default
|
||||
systemctl enable -q --now nginx
|
||||
msg_ok "Configured Nginx"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@ -14,7 +14,7 @@ update_os
|
||||
|
||||
msg_info "Setup Functions"
|
||||
setup_local_ip_helper
|
||||
import_local_ip
|
||||
|
||||
msg_ok "Setup Functions"
|
||||
|
||||
msg_info "Installing Dependencies (Patience)"
|
||||
|
||||
@ -1,121 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 tteck
|
||||
# Author: tteck (tteckster)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://www.docker.com/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
# Apply AppArmor workaround BEFORE installing Docker
|
||||
# See: https://github.com/opencontainers/runc/issues/4968
|
||||
apply_docker_apparmor_workaround
|
||||
|
||||
get_latest_release() {
|
||||
curl -fsSL https://api.github.com/repos/"$1"/releases/latest | grep '"tag_name":' | cut -d'"' -f4
|
||||
}
|
||||
|
||||
DOCKER_LATEST_VERSION=$(get_latest_release "moby/moby")
|
||||
PORTAINER_LATEST_VERSION=$(get_latest_release "portainer/portainer")
|
||||
PORTAINER_AGENT_LATEST_VERSION=$(get_latest_release "portainer/agent")
|
||||
DOCKER_COMPOSE_LATEST_VERSION=$(get_latest_release "docker/compose")
|
||||
|
||||
msg_info "Installing Docker $DOCKER_LATEST_VERSION"
|
||||
DOCKER_CONFIG_PATH='/etc/docker/daemon.json'
|
||||
mkdir -p $(dirname $DOCKER_CONFIG_PATH)
|
||||
echo -e '{\n "log-driver": "journald"\n}' >/etc/docker/daemon.json
|
||||
$STD sh <(curl -fsSL https://get.docker.com)
|
||||
msg_ok "Installed Docker $DOCKER_LATEST_VERSION"
|
||||
|
||||
# Restart Docker to apply AppArmor workaround (if running in LXC)
|
||||
$STD systemctl restart docker
|
||||
|
||||
read -r -p "${TAB3}Install Docker Compose v2 plugin? <y/N> " prompt_compose
|
||||
if [[ ${prompt_compose,,} =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
|
||||
mkdir -p /usr/local/lib/docker/cli-plugins
|
||||
curl -fsSL "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_LATEST_VERSION}/docker-compose-$(uname -s)-$(uname -m)" \
|
||||
-o /usr/local/lib/docker/cli-plugins/docker-compose
|
||||
chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
|
||||
msg_ok "Installed Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
|
||||
fi
|
||||
|
||||
read -r -p "${TAB3}Would you like to add Portainer (UI)? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing Portainer $PORTAINER_LATEST_VERSION"
|
||||
docker volume create portainer_data >/dev/null
|
||||
$STD docker run -d \
|
||||
-p 8000:8000 \
|
||||
-p 9443:9443 \
|
||||
--name=portainer \
|
||||
--restart=always \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v portainer_data:/data \
|
||||
portainer/portainer-ce:latest
|
||||
msg_ok "Installed Portainer $PORTAINER_LATEST_VERSION"
|
||||
else
|
||||
read -r -p "${TAB3}Would you like to install the Portainer Agent (for remote management)? <y/N> " prompt_agent
|
||||
if [[ ${prompt_agent,,} =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing Portainer Agent $PORTAINER_AGENT_LATEST_VERSION"
|
||||
$STD docker run -d \
|
||||
-p 9001:9001 \
|
||||
--name portainer_agent \
|
||||
--restart=always \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /var/lib/docker/volumes:/var/lib/docker/volumes \
|
||||
portainer/agent
|
||||
msg_ok "Installed Portainer Agent $PORTAINER_AGENT_LATEST_VERSION"
|
||||
fi
|
||||
fi
|
||||
|
||||
read -r -p "${TAB3}Expose Docker TCP socket (insecure) ? [n = No, l = Local only (127.0.0.1), a = All interfaces (0.0.0.0)] <n/l/a>: " socket_choice
|
||||
case "${socket_choice,,}" in
|
||||
l)
|
||||
socket="tcp://127.0.0.1:2375"
|
||||
;;
|
||||
a)
|
||||
socket="tcp://0.0.0.0:2375"
|
||||
;;
|
||||
*)
|
||||
socket=""
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ -n "$socket" ]]; then
|
||||
msg_info "Enabling Docker TCP socket on $socket"
|
||||
$STD apt-get install -y jq
|
||||
|
||||
tmpfile=$(mktemp)
|
||||
jq --arg sock "$socket" '. + { "hosts": ["unix:///var/run/docker.sock", $sock] }' /etc/docker/daemon.json >"$tmpfile" && mv "$tmpfile" /etc/docker/daemon.json
|
||||
|
||||
mkdir -p /etc/systemd/system/docker.service.d
|
||||
cat <<EOF >/etc/systemd/system/docker.service.d/override.conf
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/bin/dockerd
|
||||
EOF
|
||||
|
||||
$STD systemctl daemon-reexec
|
||||
$STD systemctl daemon-reload
|
||||
|
||||
if systemctl restart docker; then
|
||||
msg_ok "Docker TCP socket available on $socket"
|
||||
else
|
||||
msg_error "Docker failed to restart. Check journalctl -xeu docker.service"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
30
install/ebusd-install.sh
Normal file
30
install/ebusd-install.sh
Normal file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Joerg Heinemann (heinemannj)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/john30/ebusd
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
setup_deb822_repo \
|
||||
"ebusd" \
|
||||
"https://raw.githubusercontent.com/john30/ebusd-debian/master/ebusd.gpg" \
|
||||
"https://repo.ebusd.eu/apt/default/bookworm/" \
|
||||
"bookworm" \
|
||||
"main"
|
||||
|
||||
msg_info "Installing ebusd"
|
||||
$STD apt install -y ebusd
|
||||
systemctl enable -q --now ebusd
|
||||
msg_ok "Installed ebusd"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@ -28,7 +28,7 @@ setup_go
|
||||
NODE_VERSION="24" NODE_MODULE="yarn" setup_nodejs
|
||||
RUST_CRATES="wasm-pack" setup_rust
|
||||
$STD rustup target add wasm32-unknown-unknown
|
||||
import_local_ip
|
||||
|
||||
|
||||
ENTE_CLI_VERSION=$(curl -s https://api.github.com/repos/ente-io/ente/releases | jq -r '[.[] | select(.tag_name | startswith("cli-v"))][0].tag_name')
|
||||
fetch_and_deploy_gh_release "ente-server" "ente-io/ente" "tarball" "latest" "/opt/ente"
|
||||
|
||||
45
install/fileflows-install.sh
Normal file
45
install/fileflows-install.sh
Normal file
@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: kkroboth
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://fileflows.com/
|
||||
|
||||
# Import Functions und Setup
|
||||
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 \
|
||||
ffmpeg \
|
||||
imagemagick
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
setup_hwaccel
|
||||
setup_deb822_repo \
|
||||
"microsoft" \
|
||||
"https://packages.microsoft.com/keys/microsoft-2025.asc" \
|
||||
"https://packages.microsoft.com/debian/13/prod/" \
|
||||
"trixie"
|
||||
fetch_and_deploy_archive "https://fileflows.com/downloads/zip" "/opt/fileflows"
|
||||
|
||||
msg_info "Installing ASP.NET Core Runtime"
|
||||
$STD apt install -y aspnetcore-runtime-8.0
|
||||
msg_ok "Installed ASP.NET Core Runtime"
|
||||
|
||||
msg_info "Setting up FileFlows"
|
||||
$STD ln -svf /usr/bin/ffmpeg /usr/local/bin/ffmpeg
|
||||
$STD ln -svf /usr/bin/ffprobe /usr/local/bin/ffprobe
|
||||
cd /opt/fileflows/Server
|
||||
$STD dotnet FileFlows.Server.dll --systemd install --root true
|
||||
systemctl enable -q --now fileflows
|
||||
msg_ok "Setup FileFlows"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@ -12,19 +12,19 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
if [[ -z "$var_forgejo_instance" ]]; then
|
||||
read -rp "Forgejo Instance URL (e.g. https://code.forgejo.org): " var_forgejo_instance
|
||||
fi
|
||||
# Get required configuration with sensible fallbacks for unattended mode
|
||||
# These will show a warning if defaults are used
|
||||
var_forgejo_instance=$(prompt_input_required \
|
||||
"Forgejo Instance URL:" \
|
||||
"${var_forgejo_instance:-https://codeberg.org}" \
|
||||
120 \
|
||||
"var_forgejo_instance")
|
||||
|
||||
if [[ -z "$var_forgejo_runner_token" ]]; then
|
||||
read -rp "Forgejo Runner Registration Token: " var_forgejo_runner_token
|
||||
echo
|
||||
fi
|
||||
|
||||
if [[ -z "$var_forgejo_instance" || -z "$var_forgejo_runner_token" ]]; then
|
||||
echo "❌ Forgejo instance URL and runner token are required."
|
||||
exit 1
|
||||
fi
|
||||
var_forgejo_runner_token=$(prompt_input_required \
|
||||
"Forgejo Runner Registration Token:" \
|
||||
"${var_forgejo_runner_token:-REPLACE_WITH_YOUR_TOKEN}" \
|
||||
120 \
|
||||
"var_forgejo_runner_token")
|
||||
|
||||
export FORGEJO_INSTANCE="$var_forgejo_instance"
|
||||
export FORGEJO_RUNNER_TOKEN="$var_forgejo_runner_token"
|
||||
@ -78,6 +78,9 @@ EOF
|
||||
systemctl enable -q --now forgejo-runner
|
||||
msg_ok "Created Services"
|
||||
|
||||
# Show warning if any required values used fallbacks
|
||||
show_missing_values_warning
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
|
||||
@ -110,8 +110,7 @@ msg_ok "Installed garmin-grafana"
|
||||
|
||||
msg_info "Setting up garmin-grafana"
|
||||
# Check if using Chinese garmin servers
|
||||
read -rp "Are you using Garmin in mainland China? (y/N): " prompt
|
||||
if [[ "${prompt,,}" =~ ^(y|yes|Y)$ ]]; then
|
||||
if prompt_confirm "Are you using Garmin in mainland China?" "n" 60; then
|
||||
GARMIN_CN="True"
|
||||
else
|
||||
GARMIN_CN="False"
|
||||
@ -131,9 +130,9 @@ EOF
|
||||
# garmin-grafana usually prompts the user for email and password (and MFA) on first run,
|
||||
# then stores a refreshable token. We try to avoid storing user credentials in the env vars
|
||||
if [ -z "$(ls -A /opt/garmin-grafana/.garminconnect)" ]; then
|
||||
read -r -p "Please enter your Garmin Connect Email: " GARMIN_EMAIL
|
||||
read -r -p "Please enter your Garmin Connect Password (this is used to generate a token and NOT stored): " GARMIN_PASSWORD
|
||||
read -r -p "Please enter your MFA Code (if applicable, leave blank if not): " GARMIN_MFA
|
||||
GARMIN_EMAIL=$(prompt_input "Please enter your Garmin Connect Email:" "" 120)
|
||||
GARMIN_PASSWORD=$(prompt_password "Please enter your Garmin Connect Password (used to generate token, NOT stored):" "" 120)
|
||||
GARMIN_MFA=$(prompt_input "Please enter your MFA Code (leave blank if not applicable):" "" 60)
|
||||
# Run the script once to prompt for credential
|
||||
msg_info "Creating Garmin credentials, this will timeout in 60 seconds"
|
||||
timeout 60s uv run --env-file /opt/garmin-grafana/.env --project /opt/garmin-grafana/ /opt/garmin-grafana/src/garmin_grafana/garmin_fetch.py <<EOF
|
||||
|
||||
45
install/ghost-install.sh
Normal file
45
install/ghost-install.sh
Normal file
@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: fabrice1236
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://ghost.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 install -y \
|
||||
nginx \
|
||||
ca-certificates \
|
||||
libjemalloc2 \
|
||||
git
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
setup_mariadb
|
||||
MARIADB_DB_NAME="ghost" MARIADB_DB_USER="ghostuser" setup_mariadb_db
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
|
||||
msg_info "Installing Ghost CLI"
|
||||
$STD npm install ghost-cli@latest -g
|
||||
msg_ok "Installed Ghost CLI"
|
||||
|
||||
msg_info "Creating Service"
|
||||
$STD adduser --disabled-password --gecos "Ghost user" ghost-user
|
||||
$STD usermod -aG sudo ghost-user
|
||||
echo "ghost-user ALL=(ALL) NOPASSWD:ALL" | tee /etc/sudoers.d/ghost-user
|
||||
mkdir -p /var/www/ghost
|
||||
chown -R ghost-user:ghost-user /var/www/ghost
|
||||
chmod 775 /var/www/ghost
|
||||
$STD sudo -u ghost-user -H sh -c "cd /var/www/ghost && ghost install --db=mysql --dbhost=localhost --dbuser=$MARIADB_DB_USER --dbpass=$MARIADB_DB_PASS --dbname=$MARIADB_DB_NAME --url=http://localhost:2368 --no-prompt --no-setup-nginx --no-setup-ssl --no-setup-mysql --enable --start --ip 0.0.0.0"
|
||||
rm /etc/sudoers.d/ghost-user
|
||||
msg_ok "Creating Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
488
install/immich-install.sh
Normal file
488
install/immich-install.sh
Normal file
@ -0,0 +1,488 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: vhsdream
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://immich.app
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo -e "🤖 ${BL}Immich Machine Learning Options${CL}"
|
||||
echo "─────────────────────────────────────────"
|
||||
echo "Please choose your machine-learning type:"
|
||||
echo ""
|
||||
echo " 1) CPU only (default)"
|
||||
echo " 2) Intel OpenVINO (requires GPU passthrough)"
|
||||
echo ""
|
||||
|
||||
read -r -p "${TAB3}Select machine-learning type [1]: " ML_TYPE
|
||||
ML_TYPE="${ML_TYPE:-1}"
|
||||
if [[ "$ML_TYPE" == "2" ]]; then
|
||||
msg_info "Installing OpenVINO dependencies"
|
||||
touch ~/.openvino
|
||||
$STD apt install -y --no-install-recommends patchelf
|
||||
tmp_dir=$(mktemp -d)
|
||||
$STD pushd "$tmp_dir"
|
||||
curl -fsSLO https://raw.githubusercontent.com/immich-app/base-images/refs/heads/main/server/Dockerfile
|
||||
readarray -t INTEL_URLS < <(
|
||||
sed -n "/intel-[igc|opencl]/p" ./Dockerfile | awk '{print $2}'
|
||||
sed -n "/libigdgmm12/p" ./Dockerfile | awk '{print $3}'
|
||||
)
|
||||
for url in "${INTEL_URLS[@]}"; do
|
||||
curl -fsSLO "$url"
|
||||
done
|
||||
$STD apt install -y ./libigdgmm12*.deb
|
||||
rm ./libigdgmm12*.deb
|
||||
$STD apt install -y ./*.deb
|
||||
$STD apt-mark hold libigdgmm12
|
||||
$STD popd
|
||||
rm -rf "$tmp_dir"
|
||||
dpkg-query -W -f='${Version}\n' intel-opencl-icd >~/.intel_version
|
||||
msg_ok "Installed OpenVINO dependencies"
|
||||
fi
|
||||
|
||||
setup_uv
|
||||
|
||||
msg_info "Installing dependencies"
|
||||
$STD apt install --no-install-recommends -y \
|
||||
git \
|
||||
redis \
|
||||
autoconf \
|
||||
build-essential \
|
||||
python3-dev \
|
||||
automake \
|
||||
cmake \
|
||||
jq \
|
||||
libtool \
|
||||
libltdl-dev \
|
||||
libgdk-pixbuf-2.0-dev \
|
||||
libbrotli-dev \
|
||||
libexif-dev \
|
||||
libexpat1-dev \
|
||||
libglib2.0-dev \
|
||||
libgsf-1-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libspng-dev \
|
||||
liblcms2-dev \
|
||||
libopenexr-dev \
|
||||
libgif-dev \
|
||||
librsvg2-dev \
|
||||
libexpat1 \
|
||||
libgcc-s1 \
|
||||
libgomp1 \
|
||||
liblqr-1-0 \
|
||||
libltdl7 \
|
||||
libopenjp2-7 \
|
||||
meson \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
mesa-utils \
|
||||
mesa-va-drivers \
|
||||
mesa-vulkan-drivers \
|
||||
ocl-icd-libopencl1 \
|
||||
tini \
|
||||
zlib1g \
|
||||
libio-compress-brotli-perl \
|
||||
libwebp7 \
|
||||
libwebpdemux2 \
|
||||
libwebpmux3 \
|
||||
libhwy1t64 \
|
||||
libdav1d-dev \
|
||||
libhwy-dev \
|
||||
libwebp-dev \
|
||||
libaom-dev \
|
||||
ccache
|
||||
|
||||
setup_deb822_repo \
|
||||
"jellyfin" \
|
||||
"https://repo.jellyfin.org/jellyfin_team.gpg.key" \
|
||||
"https://repo.jellyfin.org/debian" \
|
||||
"$(get_os_info codename)"
|
||||
$STD apt install -y jellyfin-ffmpeg7
|
||||
ln -sf /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/bin/ffmpeg
|
||||
ln -sf /usr/lib/jellyfin-ffmpeg/ffprobe /usr/bin/ffprobe
|
||||
|
||||
# Set permissions for /dev/dri (only in privileged containers and if /dev/dri exists)
|
||||
if [[ "$CTTYPE" == "0" && -d /dev/dri ]]; then
|
||||
chgrp video /dev/dri 2>/dev/null || true
|
||||
chmod 755 /dev/dri 2>/dev/null || true
|
||||
chmod 660 /dev/dri/* 2>/dev/null || true
|
||||
$STD adduser "$(id -u -n)" video 2>/dev/null || true
|
||||
$STD adduser "$(id -u -n)" render 2>/dev/null || true
|
||||
fi
|
||||
msg_ok "Dependencies Installed"
|
||||
|
||||
msg_info "Installing Mise"
|
||||
curl -fSs https://mise.jdx.dev/gpg-key.pub | tee /etc/apt/keyrings/mise-archive-keyring.pub 1>/dev/null
|
||||
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.pub arch=amd64] https://mise.jdx.dev/deb stable main" >/etc/apt/sources.list.d/mise.list
|
||||
$STD apt update
|
||||
$STD apt install -y mise
|
||||
msg_ok "Installed Mise"
|
||||
|
||||
msg_info "Configuring Debian Testing Repo"
|
||||
sed -i 's/ trixie-updates/ trixie-updates testing/g' /etc/apt/sources.list.d/debian.sources
|
||||
cat <<EOF >/etc/apt/preferences.d/preferences
|
||||
Package: *
|
||||
Pin: release a=unstable
|
||||
Pin-Priority: 450
|
||||
|
||||
Package: *
|
||||
Pin:release a=testing
|
||||
Pin-Priority: 450
|
||||
EOF
|
||||
$STD apt update
|
||||
msg_ok "Configured Debian Testing repo"
|
||||
msg_info "Installing packages from Debian Testing repo"
|
||||
$STD apt install -t testing --no-install-recommends -yqq libmimalloc3 libde265-dev
|
||||
msg_ok "Installed packages from Debian Testing repo"
|
||||
|
||||
PNPM_VERSION="$(curl -fsSL "https://raw.githubusercontent.com/immich-app/immich/refs/heads/main/package.json" | jq -r '.packageManager | split("@")[1]')"
|
||||
NODE_VERSION="24" NODE_MODULE="pnpm@${PNPM_VERSION}" setup_nodejs
|
||||
PG_VERSION="16" PG_MODULES="pgvector" setup_postgresql
|
||||
|
||||
VCHORD_RELEASE="0.5.3"
|
||||
msg_info "Installing Vectorchord v${VCHORD_RELEASE}"
|
||||
curl -fsSL "https://github.com/tensorchord/VectorChord/releases/download/${VCHORD_RELEASE}/postgresql-16-vchord_${VCHORD_RELEASE}-1_amd64.deb" -o vchord.deb
|
||||
$STD apt install -y ./vchord.deb
|
||||
rm vchord.deb
|
||||
echo "$VCHORD_RELEASE" >~/.vchord_version
|
||||
msg_ok "Installed Vectorchord v${VCHORD_RELEASE}"
|
||||
|
||||
sed -i -e "/^#shared_preload/s/^#//;/^shared_preload/s/''/'vchord.so'/" /etc/postgresql/16/main/postgresql.conf
|
||||
systemctl restart postgresql.service
|
||||
PG_DB_NAME="immich" PG_DB_USER="immich" PG_DB_GRANT_SUPERUSER="true" PG_DB_SKIP_ALTER_ROLE="true" setup_postgresql_db
|
||||
|
||||
msg_info "Compiling Custom Photo-processing Library (extreme patience)"
|
||||
LD_LIBRARY_PATH=/usr/local/lib
|
||||
export LD_RUN_PATH=/usr/local/lib
|
||||
STAGING_DIR=/opt/staging
|
||||
BASE_REPO="https://github.com/immich-app/base-images"
|
||||
BASE_DIR=${STAGING_DIR}/base-images
|
||||
SOURCE_DIR=${STAGING_DIR}/image-source
|
||||
$STD git clone -b main "$BASE_REPO" "$BASE_DIR"
|
||||
mkdir -p "$SOURCE_DIR"
|
||||
|
||||
msg_info "(1/5) Compiling libjxl"
|
||||
cd "$STAGING_DIR"
|
||||
SOURCE=${SOURCE_DIR}/libjxl
|
||||
JPEGLI_LIBJPEG_LIBRARY_SOVERSION="62"
|
||||
JPEGLI_LIBJPEG_LIBRARY_VERSION="62.3.0"
|
||||
: "${LIBJXL_REVISION:=$(jq -cr '.revision' $BASE_DIR/server/sources/libjxl.json)}"
|
||||
$STD git clone https://github.com/libjxl/libjxl.git "$SOURCE"
|
||||
cd "$SOURCE"
|
||||
$STD git reset --hard "$LIBJXL_REVISION"
|
||||
$STD git submodule update --init --recursive --depth 1 --recommend-shallow
|
||||
$STD git apply "$BASE_DIR"/server/sources/libjxl-patches/jpegli-empty-dht-marker.patch
|
||||
$STD git apply "$BASE_DIR"/server/sources/libjxl-patches/jpegli-icc-warning.patch
|
||||
mkdir build
|
||||
cd build
|
||||
$STD cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DJPEGXL_ENABLE_DOXYGEN=OFF \
|
||||
-DJPEGXL_ENABLE_MANPAGES=OFF \
|
||||
-DJPEGXL_ENABLE_PLUGIN_GIMP210=OFF \
|
||||
-DJPEGXL_ENABLE_BENCHMARK=OFF \
|
||||
-DJPEGXL_ENABLE_EXAMPLES=OFF \
|
||||
-DJPEGXL_FORCE_SYSTEM_BROTLI=ON \
|
||||
-DJPEGXL_FORCE_SYSTEM_HWY=ON \
|
||||
-DJPEGXL_ENABLE_JPEGLI=ON \
|
||||
-DJPEGXL_ENABLE_JPEGLI_LIBJPEG=ON \
|
||||
-DJPEGXL_INSTALL_JPEGLI_LIBJPEG=ON \
|
||||
-DJPEGXL_ENABLE_PLUGINS=ON \
|
||||
-DJPEGLI_LIBJPEG_LIBRARY_SOVERSION="$JPEGLI_LIBJPEG_LIBRARY_SOVERSION" \
|
||||
-DJPEGLI_LIBJPEG_LIBRARY_VERSION="$JPEGLI_LIBJPEG_LIBRARY_VERSION" \
|
||||
-DLIBJPEG_TURBO_VERSION_NUMBER=2001005 \
|
||||
..
|
||||
$STD cmake --build . -- -j"$(nproc)"
|
||||
$STD cmake --install .
|
||||
ldconfig /usr/local/lib
|
||||
$STD make clean
|
||||
cd "$STAGING_DIR"
|
||||
rm -rf "$SOURCE"/{build,third_party}
|
||||
msg_ok "(1/5) Compiled libjxl"
|
||||
|
||||
msg_info "(2/5) Compiling libheif"
|
||||
SOURCE=${SOURCE_DIR}/libheif
|
||||
: "${LIBHEIF_REVISION:=$(jq -cr '.revision' $BASE_DIR/server/sources/libheif.json)}"
|
||||
$STD git clone https://github.com/strukturag/libheif.git "$SOURCE"
|
||||
cd "$SOURCE"
|
||||
$STD git reset --hard "$LIBHEIF_REVISION"
|
||||
mkdir build
|
||||
cd build
|
||||
$STD cmake --preset=release-noplugins \
|
||||
-DWITH_DAV1D=ON \
|
||||
-DENABLE_PARALLEL_TILE_DECODING=ON \
|
||||
-DWITH_LIBSHARPYUV=ON \
|
||||
-DWITH_LIBDE265=ON \
|
||||
-DWITH_AOM_DECODER=OFF \
|
||||
-DWITH_AOM_ENCODER=ON \
|
||||
-DWITH_X265=OFF \
|
||||
-DWITH_EXAMPLES=OFF \
|
||||
..
|
||||
$STD make install -j "$(nproc)"
|
||||
ldconfig /usr/local/lib
|
||||
$STD make clean
|
||||
cd "$STAGING_DIR"
|
||||
rm -rf "$SOURCE"/build
|
||||
msg_ok "(2/5) Compiled libheif"
|
||||
|
||||
msg_info "(3/5) Compiling libraw"
|
||||
SOURCE=${SOURCE_DIR}/libraw
|
||||
: "${LIBRAW_REVISION:=$(jq -cr '.revision' $BASE_DIR/server/sources/libraw.json)}"
|
||||
$STD git clone https://github.com/libraw/libraw.git "$SOURCE"
|
||||
cd "$SOURCE"
|
||||
$STD git reset --hard "$LIBRAW_REVISION"
|
||||
$STD autoreconf --install
|
||||
$STD ./configure --disable-examples
|
||||
$STD make -j"$(nproc)"
|
||||
$STD make install
|
||||
ldconfig /usr/local/lib
|
||||
$STD make clean
|
||||
cd "$STAGING_DIR"
|
||||
msg_ok "(3/5) Compiled libraw"
|
||||
|
||||
msg_info "(4/5) Compiling imagemagick"
|
||||
SOURCE=$SOURCE_DIR/imagemagick
|
||||
: "${IMAGEMAGICK_REVISION:=$(jq -cr '.revision' $BASE_DIR/server/sources/imagemagick.json)}"
|
||||
$STD git clone https://github.com/ImageMagick/ImageMagick.git "$SOURCE"
|
||||
cd "$SOURCE"
|
||||
$STD git reset --hard "$IMAGEMAGICK_REVISION"
|
||||
$STD ./configure --with-modules CPPFLAGS="-DMAGICK_LIBRAW_VERSION_TAIL=202502"
|
||||
$STD make -j"$(nproc)"
|
||||
$STD make install
|
||||
ldconfig /usr/local/lib
|
||||
$STD make clean
|
||||
cd "$STAGING_DIR"
|
||||
msg_ok "(4/5) Compiled imagemagick"
|
||||
|
||||
msg_info "(5/5) Compiling libvips"
|
||||
SOURCE=$SOURCE_DIR/libvips
|
||||
: "${LIBVIPS_REVISION:=$(jq -cr '.revision' $BASE_DIR/server/sources/libvips.json)}"
|
||||
$STD git clone https://github.com/libvips/libvips.git "$SOURCE"
|
||||
cd "$SOURCE"
|
||||
$STD git reset --hard "$LIBVIPS_REVISION"
|
||||
$STD meson setup build --buildtype=release --libdir=lib -Dintrospection=disabled -Dtiff=disabled
|
||||
cd build
|
||||
$STD ninja install
|
||||
ldconfig /usr/local/lib
|
||||
cd "$STAGING_DIR"
|
||||
rm -rf "$SOURCE"/build
|
||||
msg_ok "(5/5) Compiled libvips"
|
||||
{
|
||||
echo "imagemagick: $IMAGEMAGICK_REVISION"
|
||||
echo "libheif: $LIBHEIF_REVISION"
|
||||
echo "libjxl: $LIBJXL_REVISION"
|
||||
echo "libraw: $LIBRAW_REVISION"
|
||||
echo "libvips: $LIBVIPS_REVISION"
|
||||
} >~/.immich_library_revisions
|
||||
msg_ok "Custom Photo-processing Libraries Compiled Successfully"
|
||||
|
||||
INSTALL_DIR="/opt/${APPLICATION}"
|
||||
UPLOAD_DIR="${INSTALL_DIR}/upload"
|
||||
SRC_DIR="${INSTALL_DIR}/source"
|
||||
APP_DIR="${INSTALL_DIR}/app"
|
||||
PLUGIN_DIR="${APP_DIR}/corePlugin"
|
||||
ML_DIR="${APP_DIR}/machine-learning"
|
||||
GEO_DIR="${INSTALL_DIR}/geodata"
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
mkdir -p {"${APP_DIR}","${UPLOAD_DIR}","${GEO_DIR}","${INSTALL_DIR}"/cache}
|
||||
|
||||
fetch_and_deploy_gh_release "immich" "immich-app/immich" "tag" "v2.5.2" "$SRC_DIR"
|
||||
|
||||
msg_info "Installing Immich (patience)"
|
||||
|
||||
cd "$SRC_DIR"/server
|
||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||
export CI=1
|
||||
corepack enable
|
||||
|
||||
# server build
|
||||
export SHARP_IGNORE_GLOBAL_LIBVIPS=true
|
||||
$STD pnpm --filter immich --frozen-lockfile build
|
||||
unset SHARP_IGNORE_GLOBAL_LIBVIPS
|
||||
export SHARP_FORCE_GLOBAL_LIBVIPS=true
|
||||
$STD pnpm --filter immich --frozen-lockfile --prod --no-optional deploy "$APP_DIR"
|
||||
cp "$APP_DIR"/package.json "$APP_DIR"/bin
|
||||
sed -i 's|^start|./start|' "$APP_DIR"/bin/immich-admin
|
||||
|
||||
# openapi & web build
|
||||
cd "$SRC_DIR"
|
||||
echo "packageImportMethod: hardlink" >>./pnpm-workspace.yaml
|
||||
$STD pnpm --filter @immich/sdk --filter immich-web --frozen-lockfile --force install
|
||||
unset SHARP_FORCE_GLOBAL_LIBVIPS
|
||||
export SHARP_IGNORE_GLOBAL_LIBVIPS=true
|
||||
$STD pnpm --filter @immich/sdk --filter immich-web build
|
||||
cp -a web/build "$APP_DIR"/www
|
||||
cp LICENSE "$APP_DIR"
|
||||
|
||||
# cli build
|
||||
$STD pnpm --filter @immich/sdk --filter @immich/cli --frozen-lockfile install
|
||||
$STD pnpm --filter @immich/sdk --filter @immich/cli build
|
||||
$STD pnpm --filter @immich/cli --prod --no-optional deploy "$APP_DIR"/cli
|
||||
|
||||
# plugins
|
||||
cd "$SRC_DIR"
|
||||
$STD mise trust --ignore ./mise.toml
|
||||
$STD mise trust ./plugins/mise.toml
|
||||
cd plugins
|
||||
$STD mise install
|
||||
$STD mise run build
|
||||
mkdir -p "$PLUGIN_DIR"
|
||||
cp -r ./dist "$PLUGIN_DIR"/dist
|
||||
cp ./manifest.json "$PLUGIN_DIR"
|
||||
msg_ok "Installed Immich Server, Web and Plugin Components"
|
||||
|
||||
cd "$SRC_DIR"/machine-learning
|
||||
$STD useradd -U -s /usr/sbin/nologin -r -M -d "$INSTALL_DIR" immich
|
||||
mkdir -p "$ML_DIR" && chown -R immich:immich "$INSTALL_DIR"
|
||||
export VIRTUAL_ENV="${ML_DIR}/ml-venv"
|
||||
if [[ -f ~/.openvino ]]; then
|
||||
msg_info "Installing HW-accelerated machine-learning"
|
||||
$STD sudo --preserve-env=VIRTUAL_ENV -nu immich uv sync --extra openvino --no-dev --active --link-mode copy -n -p python3.13 --managed-python
|
||||
patchelf --clear-execstack "${VIRTUAL_ENV}/lib/python3.13/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-313-x86_64-linux-gnu.so"
|
||||
msg_ok "Installed HW-accelerated machine-learning"
|
||||
else
|
||||
msg_info "Installing machine-learning"
|
||||
$STD sudo --preserve-env=VIRTUAL_ENV -nu immich uv sync --extra cpu --no-dev --active --link-mode copy -n -p python3.11 --managed-python
|
||||
msg_ok "Installed machine-learning"
|
||||
fi
|
||||
cd "$SRC_DIR"
|
||||
cp -a machine-learning/{ann,immich_ml} "$ML_DIR"
|
||||
if [[ -f ~/.openvino ]]; then
|
||||
sed -i "/intra_op/s/int = 0/int = os.cpu_count() or 0/" "$ML_DIR"/immich_ml/config.py
|
||||
fi
|
||||
ln -sf "$APP_DIR"/resources "$INSTALL_DIR"
|
||||
|
||||
cd "$APP_DIR"
|
||||
grep -rl /usr/src | xargs -n1 sed -i "s|\/usr/src|$INSTALL_DIR|g"
|
||||
grep -rlE "'/build'" | xargs -n1 sed -i "s|'/build'|'$APP_DIR'|g"
|
||||
sed -i "s@\"/cache\"@\"$INSTALL_DIR/cache\"@g" "$ML_DIR"/immich_ml/config.py
|
||||
ln -s "$UPLOAD_DIR" "$APP_DIR"/upload
|
||||
ln -s "$UPLOAD_DIR" "$ML_DIR"/upload
|
||||
|
||||
msg_info "Installing GeoNames data"
|
||||
cd "$GEO_DIR"
|
||||
curl -fsSLZ -O "https://download.geonames.org/export/dump/admin1CodesASCII.txt" \
|
||||
-O "https://download.geonames.org/export/dump/admin2Codes.txt" \
|
||||
-O "https://download.geonames.org/export/dump/cities500.zip" \
|
||||
-O "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/v5.1.2/geojson/ne_10m_admin_0_countries.geojson"
|
||||
unzip -q cities500.zip
|
||||
date --iso-8601=seconds | tr -d "\n" >geodata-date.txt
|
||||
rm cities500.zip
|
||||
cd "$INSTALL_DIR"
|
||||
ln -s "$GEO_DIR" "$APP_DIR"
|
||||
msg_ok "Installed GeoNames data"
|
||||
|
||||
mkdir -p /var/log/immich
|
||||
touch /var/log/immich/{web.log,ml.log}
|
||||
msg_ok "Installed Immich"
|
||||
|
||||
msg_info "Modifying user, creating env file, scripts & services"
|
||||
usermod -aG video,render immich
|
||||
|
||||
cat <<EOF >"${INSTALL_DIR}"/.env
|
||||
TZ=$(cat /etc/timezone)
|
||||
IMMICH_VERSION=release
|
||||
NODE_ENV=production
|
||||
IMMICH_ALLOW_SETUP=true
|
||||
|
||||
DB_HOSTNAME=127.0.0.1
|
||||
DB_USERNAME=${PG_DB_USER}
|
||||
DB_PASSWORD=${PG_DB_PASS}
|
||||
DB_DATABASE_NAME=${PG_DB_NAME}
|
||||
DB_VECTOR_EXTENSION=vectorchord
|
||||
|
||||
REDIS_HOSTNAME=127.0.0.1
|
||||
IMMICH_MACHINE_LEARNING_URL=http://127.0.0.1:3003
|
||||
MACHINE_LEARNING_CACHE_FOLDER=${INSTALL_DIR}/cache
|
||||
## - For OpenVINO only - workaround for onnxruntime-openvino 1.23.x crash
|
||||
## - See: https://github.com/immich-app/immich/pull/11240
|
||||
MACHINE_LEARNING_OPENVINO_NUM_THREADS=$(nproc)
|
||||
## - Uncomment below to increase inference speed while reducing accuracy
|
||||
# MACHINE_LEARNING_OPENVINO_PRECISION=FP16
|
||||
|
||||
IMMICH_MEDIA_LOCATION=${UPLOAD_DIR}
|
||||
EOF
|
||||
cat <<EOF >"${ML_DIR}"/ml_start.sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd ${ML_DIR}
|
||||
. ${VIRTUAL_ENV}/bin/activate
|
||||
|
||||
set -a
|
||||
. ${INSTALL_DIR}/.env
|
||||
set +a
|
||||
|
||||
python3 -m immich_ml
|
||||
EOF
|
||||
cat <<EOF >"$APP_DIR"/bin/start.sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -a
|
||||
. ${INSTALL_DIR}/.env
|
||||
set +a
|
||||
|
||||
/usr/bin/node ${APP_DIR}/dist/main.js "\$@"
|
||||
EOF
|
||||
chmod +x "$ML_DIR"/ml_start.sh "$APP_DIR"/bin/start.sh
|
||||
cat <<EOF >/etc/systemd/system/"${APPLICATION}"-web.service
|
||||
[Unit]
|
||||
Description=${APPLICATION} Web Service
|
||||
After=network.target
|
||||
Requires=redis-server.service
|
||||
Requires=postgresql.service
|
||||
Requires=immich-ml.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=immich
|
||||
Group=immich
|
||||
UMask=0077
|
||||
WorkingDirectory=${APP_DIR}
|
||||
EnvironmentFile=${INSTALL_DIR}/.env
|
||||
ExecStart=/usr/bin/node ${APP_DIR}/dist/main
|
||||
Restart=on-failure
|
||||
SyslogIdentifier=immich-web
|
||||
StandardOutput=append:/var/log/immich/web.log
|
||||
StandardError=append:/var/log/immich/web.log
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
cat <<EOF >/etc/systemd/system/"${APPLICATION}"-ml.service
|
||||
[Unit]
|
||||
Description=${APPLICATION} Machine-Learning
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
UMask=0077
|
||||
User=immich
|
||||
Group=immich
|
||||
WorkingDirectory=${APP_DIR}
|
||||
EnvironmentFile=${INSTALL_DIR}/.env
|
||||
ExecStart=${ML_DIR}/ml_start.sh
|
||||
Restart=on-failure
|
||||
SyslogIdentifier=immich-machine-learning
|
||||
StandardOutput=append:/var/log/immich/ml.log
|
||||
StandardError=append:/var/log/immich/ml.log
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
chown -R immich:immich "$INSTALL_DIR" /var/log/immich
|
||||
systemctl enable -q --now "$APPLICATION"-ml.service "$APPLICATION"-web.service
|
||||
msg_ok "Modified user, created env file, scripts and services"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
97
install/isponsorblocktv-install.sh
Normal file
97
install/isponsorblocktv-install.sh
Normal file
@ -0,0 +1,97 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Matthew Stern (sternma)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/dmunozv04/iSponsorBlockTV
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
INSTALL_DIR="/opt/isponsorblocktv"
|
||||
DATA_DIR="/var/lib/isponsorblocktv"
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
python3 \
|
||||
python3-venv \
|
||||
python3-pip
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
fetch_and_deploy_gh_release "isponsorblocktv" "dmunozv04/iSponsorBlockTV"
|
||||
|
||||
msg_info "Setting up iSponsorBlockTV"
|
||||
$STD python3 -m venv "$INSTALL_DIR/venv"
|
||||
$STD "$INSTALL_DIR/venv/bin/pip" install --upgrade pip
|
||||
$STD "$INSTALL_DIR/venv/bin/pip" install "$INSTALL_DIR"
|
||||
msg_ok "Set up iSponsorBlockTV"
|
||||
|
||||
msg_info "Creating data directory"
|
||||
install -d "$DATA_DIR"
|
||||
msg_ok "Created data directory"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOT >/etc/systemd/system/isponsorblocktv.service
|
||||
[Unit]
|
||||
Description=iSponsorBlockTV
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
Group=root
|
||||
WorkingDirectory=$INSTALL_DIR
|
||||
Environment=iSPBTV_data_dir=$DATA_DIR
|
||||
ExecStart=$INSTALL_DIR/venv/bin/iSponsorBlockTV
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOT
|
||||
systemctl enable -q --now isponsorblocktv
|
||||
msg_ok "Created Service"
|
||||
|
||||
msg_info "Creating CLI wrapper"
|
||||
install -d /usr/local/bin
|
||||
cat <<'EOT' >/usr/local/bin/iSponsorBlockTV
|
||||
#!/usr/bin/env bash
|
||||
export iSPBTV_data_dir="/var/lib/isponsorblocktv"
|
||||
|
||||
set +e
|
||||
/opt/isponsorblocktv/venv/bin/iSponsorBlockTV "$@"
|
||||
status=$?
|
||||
set -e
|
||||
|
||||
case "${1:-}" in
|
||||
setup|setup-cli)
|
||||
systemctl restart isponsorblocktv >/dev/null 2>&1 || true
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $status
|
||||
EOT
|
||||
chmod +x /usr/local/bin/iSponsorBlockTV
|
||||
ln -sf /usr/local/bin/iSponsorBlockTV /usr/bin/iSponsorBlockTV
|
||||
msg_ok "Created CLI wrapper"
|
||||
|
||||
msg_info "Setting default data dir for shells"
|
||||
cat <<'EOT' >/etc/profile.d/isponsorblocktv.sh
|
||||
export iSPBTV_data_dir="/var/lib/isponsorblocktv"
|
||||
EOT
|
||||
if ! grep -q '^iSPBTV_data_dir=' /etc/environment 2>/dev/null; then
|
||||
cat <<'EOT' >>/etc/environment
|
||||
iSPBTV_data_dir=/var/lib/isponsorblocktv
|
||||
EOT
|
||||
fi
|
||||
msg_ok "Set default data dir for shells"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
65
install/jotty-install.sh
Normal file
65
install/jotty-install.sh
Normal file
@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: vhsdream | MickLesk
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/fccview/jotty
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
|
||||
fetch_and_deploy_gh_release "jotty" "fccview/jotty" "prebuild" "latest" "/opt/jotty" "jotty_*_prebuild.tar.gz"
|
||||
|
||||
msg_info "Setup jotty"
|
||||
mkdir -p data/{users,checklists,notes}
|
||||
|
||||
cat <<EOF >/opt/jotty/.env
|
||||
NODE_ENV=production
|
||||
# --- Uncomment to enable
|
||||
# APP_URL=https://your-jotty-domain.com
|
||||
# INTERNAL_API_URL=http://localhost:3000
|
||||
# HTTPS=true
|
||||
# SERVE_PUBLIC_IMAGES=yes
|
||||
# SERVE_PUBLIC_FILES=yes
|
||||
# SERVE_PUBLIC_VIDEOS=yes
|
||||
# STOP_CHECK_UPDATES=yes
|
||||
# --- For troubleshooting
|
||||
# DEBUGGER=true
|
||||
|
||||
# --- SSO with OIDC (optional)
|
||||
# SSO_MODE=oidc
|
||||
# OIDC_ISSUER=<your-oidc-issuer-url>
|
||||
# OIDC_CLIENT_ID=<oidc-client-id>
|
||||
# SSO_FALLBACK_LOCAL=yes
|
||||
# OIDC_CLIENT_SECRET=your_client_secret
|
||||
# OIDC_ADMIN_GROUPS=admins
|
||||
EOF
|
||||
msg_ok "Setup jotty"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/jotty.service
|
||||
[Unit]
|
||||
Description=jotty server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/opt/jotty
|
||||
EnvironmentFile=/opt/jotty/.env
|
||||
ExecStart=/usr/bin/node server.js
|
||||
Restart=on-abnormal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now jotty
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@ -17,13 +17,28 @@ msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
nginx \
|
||||
build-essential \
|
||||
gfortran \
|
||||
pkg-config \
|
||||
ninja-build \
|
||||
autoconf \
|
||||
automake \
|
||||
libpq-dev \
|
||||
libffi-dev \
|
||||
libssl-dev
|
||||
libssl-dev \
|
||||
libpcre2-dev \
|
||||
libre2-dev \
|
||||
libxml2-dev \
|
||||
libxslt-dev \
|
||||
libopenblas-dev \
|
||||
liblapack-dev \
|
||||
zlib1g-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libsqlite3-dev \
|
||||
libexpat1-dev \
|
||||
libicu-dev
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PYTHON_VERSION="3.14" setup_uv
|
||||
import_local_ip
|
||||
fetch_and_deploy_gh_release "kitchenowl" "TomBursch/kitchenowl" "tarball" "latest" "/opt/kitchenowl"
|
||||
rm -rf /opt/kitchenowl/web
|
||||
fetch_and_deploy_gh_release "kitchenowl-web" "TomBursch/kitchenowl" "prebuild" "latest" "/opt/kitchenowl/web" "kitchenowl_Web.tar.gz"
|
||||
@ -31,10 +46,10 @@ fetch_and_deploy_gh_release "kitchenowl-web" "TomBursch/kitchenowl" "prebuild" "
|
||||
msg_info "Setting up KitchenOwl"
|
||||
cd /opt/kitchenowl/backend
|
||||
#rm -f uv.lock
|
||||
$STD uv sync --frozen
|
||||
$STD uv sync --no-dev
|
||||
sed -i 's/default=True/default=False/' /opt/kitchenowl/backend/wsgi.py
|
||||
mkdir -p /nltk_data
|
||||
$STD uv run python -m nltk.downloader -d /nltk_data averaged_perceptron_tagger_eng punkt_tab
|
||||
$STD uv run python -m nltk.downloader -d /nltk_data averaged_perceptron_tagger_eng
|
||||
JWT_SECRET=$(openssl rand -hex 32)
|
||||
mkdir -p /opt/kitchenowl/data
|
||||
cat <<EOF >/opt/kitchenowl/kitchenowl.env
|
||||
|
||||
@ -25,11 +25,65 @@ download_file "https://languagetool.org/download/LanguageTool-stable.zip" /tmp/L
|
||||
unzip -q /tmp/LanguageTool-stable.zip -d /opt
|
||||
mv /opt/LanguageTool-*/ /opt/LanguageTool/
|
||||
download_file "https://dl.fbaipublicfiles.com/fasttext/supervised-models/lid.176.bin" /opt/lid.176.bin
|
||||
msg_ok "Setup LanguageTool"
|
||||
|
||||
ngram_dir=""
|
||||
lang_code=""
|
||||
max_attempts=3
|
||||
attempt=0
|
||||
|
||||
while [[ $attempt -lt $max_attempts ]]; do
|
||||
read -r -p "${TAB3}Enter language code (en, de, es, fr, nl) to download ngrams or press ENTER to skip: " lang_code
|
||||
|
||||
if [[ -z "$lang_code" ]]; then
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ "$lang_code" =~ [[:space:]] ]]; then
|
||||
((attempt++))
|
||||
remaining=$((max_attempts - attempt))
|
||||
if [[ $remaining -gt 0 ]]; then
|
||||
msg_error "Please enter only ONE language code. You have $remaining attempt(s) remaining."
|
||||
else
|
||||
msg_error "Maximum attempts reached. Continuing without ngrams."
|
||||
lang_code=""
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
break
|
||||
done
|
||||
|
||||
if [[ -n "$lang_code" ]]; then
|
||||
if [[ "$lang_code" =~ ^(en|de|es|fr|nl)$ ]]; then
|
||||
msg_info "Searching for $lang_code ngrams..."
|
||||
filename=$(curl -fsSL https://languagetool.org/download/ngram-data/ | grep -oP "ngrams-${lang_code}-[0-9]+\.zip" | sort -uV | tail -n1)
|
||||
|
||||
if [[ -n "$filename" ]]; then
|
||||
msg_info "Downloading $filename"
|
||||
download_file "https://languagetool.org/download/ngram-data/${filename}" "/tmp/${filename}"
|
||||
|
||||
mkdir -p /opt/ngrams
|
||||
msg_info "Extracting $lang_code ngrams to /opt/ngrams"
|
||||
unzip -q "/tmp/${filename}" -d /opt/ngrams
|
||||
rm "/tmp/${filename}"
|
||||
|
||||
ngram_dir="/opt/ngrams"
|
||||
msg_ok "Installed $lang_code ngrams"
|
||||
else
|
||||
msg_info "No ngram file found for ${lang_code}"
|
||||
fi
|
||||
else
|
||||
msg_error "Invalid language code: $lang_code"
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<EOF >/opt/LanguageTool/server.properties
|
||||
fasttextModel=/opt/lid.176.bin
|
||||
fasttextBinary=/usr/bin/fasttext
|
||||
EOF
|
||||
if [[ -n "$ngram_dir" ]]; then
|
||||
echo "languageModel=/opt/ngrams" >> /opt/LanguageTool/server.properties
|
||||
fi
|
||||
echo "${RELEASE}" >~/.languagetool
|
||||
msg_ok "Setup LanguageTool"
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ PG_VERSION="16" setup_postgresql
|
||||
PG_DB_NAME="linkwardendb" PG_DB_USER="linkwarden" setup_postgresql_db
|
||||
RUST_CRATES="monolith" setup_rust
|
||||
fetch_and_deploy_gh_release "linkwarden" "linkwarden/linkwarden"
|
||||
import_local_ip
|
||||
|
||||
|
||||
read -r -p "${TAB3}Would you like to add Adminer? <y/N> " prompt
|
||||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: bysinka-95
|
||||
# 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
|
||||
@ -1,148 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: bvdberg01
|
||||
# Co-Author: SunFlowerOwl
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
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 \
|
||||
libarchive-dev \
|
||||
git \
|
||||
libmariadb-dev \
|
||||
redis-server \
|
||||
nginx \
|
||||
libassimp-dev
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
setup_imagemagick
|
||||
|
||||
PG_VERSION="16" setup_postgresql
|
||||
|
||||
fetch_and_deploy_gh_release "manyfold" "manyfold3d/manyfold" "tarball" "latest" "/opt/manyfold/app"
|
||||
|
||||
msg_info "Configuring manyfold environment"
|
||||
RUBY_INSTALL_VERSION=$(cat /opt/manyfold/app/.ruby-version)
|
||||
YARN_VERSION=$(grep '"packageManager":' /opt/manyfold/app/package.json | sed -E 's/.*"(yarn@[0-9\.]+)".*/\1/')
|
||||
RELEASE=$(get_latest_github_release "manyfold3d/manyfold")
|
||||
DB_NAME=manyfold
|
||||
DB_USER=manyfold
|
||||
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)
|
||||
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
|
||||
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER TEMPLATE template0;"
|
||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
|
||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
|
||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
|
||||
useradd -m -s /usr/bin/bash manyfold
|
||||
cat <<EOF >/opt/manyfold/.env
|
||||
export APP_VERSION=${RELEASE}
|
||||
export GUID=1002
|
||||
export PUID=1001
|
||||
export PUBLIC_PORT=5000
|
||||
export REDIS_URL=redis://127.0.0.1:6379/1
|
||||
export DATABASE_ADAPTER=postgresql
|
||||
export DATABASE_HOST=127.0.0.1
|
||||
export DATABASE_USER=${DB_USER}
|
||||
export DATABASE_PASSWORD=${DB_PASS}
|
||||
export DATABASE_NAME=${DB_NAME}
|
||||
export DATABASE_CONNECTION_POOL=16
|
||||
export MULTIUSER=enabled
|
||||
export HTTPS_ONLY=false
|
||||
export RAILS_ENV=production
|
||||
EOF
|
||||
cat <<EOF >/opt/manyfold/user_setup.sh
|
||||
#!/bin/bash
|
||||
|
||||
source /opt/manyfold/.env
|
||||
export PATH="/home/manyfold/.rbenv/bin:\$PATH"
|
||||
eval "\$(/home/manyfold/.rbenv/bin/rbenv init - bash)"
|
||||
cd /opt/manyfold/app
|
||||
rbenv global $RUBY_INSTALL_VERSION
|
||||
gem install bundler
|
||||
bundle install
|
||||
gem install sidekiq
|
||||
gem install foreman
|
||||
corepack enable yarn
|
||||
rm -f /opt/manyfold/app/config/credentials.yml.enc
|
||||
corepack prepare $YARN_VERSION --activate
|
||||
corepack use $YARN_VERSION
|
||||
export VISUAL="code --wait"
|
||||
bin/rails credentials:edit
|
||||
bin/rails db:migrate
|
||||
bin/rails assets:precompile
|
||||
EOF
|
||||
$STD mkdir -p /opt/manyfold/data
|
||||
msg_ok "Configured manyfold environment"
|
||||
|
||||
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
|
||||
RUBY_VERSION=${RUBY_INSTALL_VERSION} RUBY_INSTALL_RAILS="true" HOME=/home/manyfold setup_ruby
|
||||
|
||||
msg_info "Installing Manyfold"
|
||||
chown -R manyfold:manyfold /home/manyfold/.rbenv
|
||||
chown -R manyfold:manyfold /opt/manyfold
|
||||
chmod +x /opt/manyfold/user_setup.sh
|
||||
npm install --global corepack
|
||||
$STD sudo -u manyfold bash /opt/manyfold/user_setup.sh
|
||||
rm -f /opt/manyfold/user_setup.sh
|
||||
msg_ok "Installed manyfold"
|
||||
|
||||
msg_info "Creating Services"
|
||||
source /opt/manyfold/.env
|
||||
export PATH="/home/manyfold/.rbenv/shims:/home/manyfold/.rbenv/bin:$PATH"
|
||||
$STD foreman export systemd /etc/systemd/system -a manyfold -u manyfold -f /opt/manyfold/app/Procfile
|
||||
for f in /etc/systemd/system/manyfold-*.service; do
|
||||
sed -i "s|/bin/bash -lc '|/bin/bash -lc 'source /opt/manyfold/.env \&\& |" "$f"
|
||||
done
|
||||
systemctl enable -q --now manyfold.target manyfold-rails.1 manyfold-default_worker.1 manyfold-performance_worker.1
|
||||
cat <<EOF >/etc/nginx/sites-available/manyfold.conf
|
||||
server {
|
||||
listen 80;
|
||||
server_name manyfold;
|
||||
root /opt/manyfold/app/public;
|
||||
|
||||
location /cable {
|
||||
proxy_pass http://127.0.0.1:5000;
|
||||
proxy_set_header Host \$host;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
|
||||
proxy_set_header X-Real-IP \$remote_addr;
|
||||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files \$uri/index.html \$uri @rails;
|
||||
}
|
||||
|
||||
location @rails {
|
||||
proxy_pass http://127.0.0.1:5000;
|
||||
proxy_set_header Host \$host;
|
||||
proxy_set_header X-Real-IP \$remote_addr;
|
||||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
ln -s /etc/nginx/sites-available/manyfold.conf /etc/nginx/sites-enabled/
|
||||
rm -f /etc/nginx/sites-enabled/default
|
||||
$STD systemctl reload nginx
|
||||
msg_ok "Created Services"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
@ -12,14 +12,12 @@ catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
PHP_VERSION="8.2"
|
||||
PHP_APACHE="YES" PHP_MODULE="mysql,cli,redis" PHP_FPM="YES" setup_php
|
||||
setup_composer
|
||||
|
||||
msg_info "Enabling Apache modules (rewrite, headers)"
|
||||
$STD a2enmod rewrite
|
||||
$STD a2enmod headers
|
||||
msg_ok "Enabled Apache modules (rewrite, headers)"
|
||||
PHP_VERSION="8.2"
|
||||
PHP_APACHE="YES" PHP_MODULE="mysql,redis" PHP_FPM="YES" setup_php
|
||||
setup_composer
|
||||
setup_mariadb
|
||||
$STD mariadb -u root -e "SET GLOBAL sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'";
|
||||
|
||||
fetch_and_deploy_gh_release "MintHCM" "minthcm/minthcm" "tarball" "latest" "/var/www/MintHCM"
|
||||
|
||||
@ -37,19 +35,17 @@ mkdir -p /var/www/script
|
||||
cp /var/www/MintHCM/docker/script/generate_config.php /var/www/script/generate_config.php
|
||||
cp /var/www/MintHCM/docker/.env /var/www/script/.env
|
||||
chown -R www-data:www-data /var/www/script
|
||||
msg_ok "Configured MintHCM"
|
||||
|
||||
msg_info "Restarting Apache2"
|
||||
$STD a2enmod rewrite
|
||||
$STD a2enmod headers
|
||||
$STD systemctl restart apache2
|
||||
msg_ok "Restarted Apache2"
|
||||
msg_ok "Configured MintHCM"
|
||||
|
||||
msg_info "Setting up Elasticsearch"
|
||||
setup_deb822_repo \
|
||||
"elasticsearch" \
|
||||
"https://artifacts.elastic.co/GPG-KEY-elasticsearch" \
|
||||
"https://artifacts.elastic.co/packages/7.x/apt" \
|
||||
"stable" \
|
||||
"main"
|
||||
"stable"
|
||||
$STD apt install -y elasticsearch
|
||||
echo "-Xms2g" >>/etc/elasticsearch/jvm.options
|
||||
echo "-Xmx2g" >>/etc/elasticsearch/jvm.options
|
||||
@ -57,35 +53,26 @@ $STD /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment
|
||||
systemctl enable -q --now elasticsearch
|
||||
msg_ok "Set up Elasticsearch"
|
||||
|
||||
setup_mariadb
|
||||
msg_info "Setting up MariaDB"
|
||||
$STD mariadb -u root -e "SET GLOBAL sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'";
|
||||
msg_ok "Set up MariaDB"
|
||||
|
||||
msg_info "Configuring Database"
|
||||
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||
$STD mariadb -u root -e "CREATE USER 'minthcm'@'localhost' IDENTIFIED BY '${DB_PASS}';"
|
||||
$STD mariadb -u root -e "GRANT ALL ON *.* TO 'minthcm'@'localhost'; FLUSH PRIVILEGES;"
|
||||
sed -i 's/^DB_HOST=.*/DB_HOST=localhost/' /var/www/script/.env
|
||||
sed -i 's/^DB_USER=.*/DB_USER=minthcm/' /var/www/script/.env
|
||||
sed -i "s/^DB_PASS=.*/DB_PASS=${DB_PASS}/" /var/www/script/.env
|
||||
sed -i 's/^ELASTICSEARCH_HOST=.*/ELASTICSEARCH_HOST=localhost/' /var/www/script/.env
|
||||
msg_ok "Configured MariaDB"
|
||||
{
|
||||
echo "MintHCM DB Credentials"
|
||||
echo "MariaDB User: minthcm"
|
||||
echo "MariaDB Password: $DB_PASS"
|
||||
} >>~/minthcm.creds
|
||||
sed -i "s/^DB_HOST=.*/DB_HOST=localhost/" /var/www/script/.env
|
||||
sed -i "s/^DB_USER=.*/DB_USER=minthcm/" /var/www/script/.env
|
||||
sed -i "s/^DB_PASS=.*/DB_PASS=$DB_PASS/" /var/www/script/.env
|
||||
sed -i "s/^ELASTICSEARCH_HOST=.*/ELASTICSEARCH_HOST=localhost/" /var/www/script/.env
|
||||
msg_ok "Configured Database"
|
||||
|
||||
msg_info "Generating configuration file"
|
||||
set -a
|
||||
source /var/www/script/.env
|
||||
set +a
|
||||
php /var/www/script/generate_config.php
|
||||
$STD php /var/www/script/generate_config.php
|
||||
msg_ok "Generated configuration file"
|
||||
|
||||
msg_info "Installing MintHCM"
|
||||
cd /var/www/MintHCM && su -s /bin/bash -c 'php /var/www/MintHCM/MintCLI install < /var/www/MintHCM/configMint4' www-data
|
||||
cd /var/www/MintHCM
|
||||
$STD sudo -u www-data php MintCLI install < /var/www/MintHCM/configMint4
|
||||
printf "* * * * * cd /var/www/MintHCM/legacy; php -f cron.php > /dev/null 2>&1\n" > /var/spool/cron/crontabs/www-data
|
||||
service cron start
|
||||
rm -f /var/www/MintHCM/configMint4
|
||||
|
||||
@ -17,7 +17,11 @@ msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
ripgrep \
|
||||
imagemagick \
|
||||
ffmpeg
|
||||
ffmpeg \
|
||||
libva-drm2 \
|
||||
libva2 \
|
||||
mesa-va-drivers \
|
||||
vainfo
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="24" setup_nodejs
|
||||
@ -108,6 +112,11 @@ SHOW_VOLUME_USAGE=true
|
||||
# FFMPEG_PATH=
|
||||
# FFPROBE_PATH=
|
||||
|
||||
## Hardware acceleration
|
||||
# FFMPEG_HWACCEL=vaapi
|
||||
# FFMPEG_HWACCEL_DEVICE=/dev/dri/renderD128
|
||||
# FFMPEG_HWACCEL_OUTPUT_FORMAT=nv12
|
||||
|
||||
FAVORITES_DEFAULT_ICON=outline.StarIcon
|
||||
|
||||
SHARES_ENABLED=true
|
||||
|
||||
69
install/nightscout-install.sh
Normal file
69
install/nightscout-install.sh
Normal file
@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: aendel
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/nightscout/cgm-remote-monitor
|
||||
|
||||
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 \
|
||||
libssl-dev \
|
||||
openssl
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
MONGO_VERSION="8.0" setup_mongodb
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
fetch_and_deploy_gh_release "nightscout" "nightscout/cgm-remote-monitor" "source"
|
||||
|
||||
msg_info "Installing Nightscout"
|
||||
$STD npm install --prefix /opt/nightscout
|
||||
msg_ok "Installed Nightscout"
|
||||
|
||||
msg_info "Creating Service"
|
||||
useradd -s /bin/bash -m nightscout
|
||||
chown -R nightscout:nightscout /opt/nightscout
|
||||
API_SECRET=$(openssl rand -hex 16)
|
||||
cat <<EOF >/opt/nightscout/my.env
|
||||
MONGO_CONNECTION=mongodb://127.0.0.1:27017/nightscout
|
||||
BASE_URL=http://localhost:1337
|
||||
API_SECRET=${API_SECRET}
|
||||
DISPLAY_UNITS=mg/dl
|
||||
ENABLE=careportal boluscalc food bwp cage sage iage iob cob basal ar2 rawbg pushover bgi pump openaps pvb linear custom
|
||||
INSECURE_USE_HTTP=true
|
||||
EOF
|
||||
chown nightscout:nightscout /opt/nightscout/my.env
|
||||
cat <<EOF >/etc/systemd/system/nightscout.service
|
||||
[Unit]
|
||||
Description=Nightscout CGM Service
|
||||
After=network.target mongodb.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=nightscout
|
||||
WorkingDirectory=/opt/nightscout
|
||||
EnvironmentFile=/opt/nightscout/my.env
|
||||
ExecStart=/usr/bin/npm start
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now nightscout
|
||||
msg_ok "Created Service"
|
||||
|
||||
{
|
||||
echo "Nightscout Credentials"
|
||||
echo "API_SECRET: ${API_SECRET}"
|
||||
} >> ~/nightscout.creds
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@ -1,46 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: luismco
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/technomancer702/nodecast-tv
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
fetch_and_deploy_gh_release "nodecast-tv" "technomancer702/nodecast-tv"
|
||||
setup_nodejs
|
||||
|
||||
msg_info "Installing Modules"
|
||||
cd /opt/nodecast-tv
|
||||
$STD npm install
|
||||
msg_ok "Installed Modules"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/nodecast-tv.service
|
||||
[Unit]
|
||||
Description=nodecast-tv
|
||||
After=network.target
|
||||
Wants=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/nodecast-tv
|
||||
ExecStart=/bin/npm run dev
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now nodecast-tv
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@ -57,7 +57,7 @@ echo "$COOLPASS" >~/.coolpass
|
||||
msg_ok "Installed Collabora Online"
|
||||
|
||||
# OpenCloud
|
||||
fetch_and_deploy_gh_release "opencloud" "opencloud-eu/opencloud" "singlefile" "v4.1.0" "/usr/bin" "opencloud-*-linux-amd64"
|
||||
fetch_and_deploy_gh_release "opencloud" "opencloud-eu/opencloud" "singlefile" "v5.0.1" "/usr/bin" "opencloud-*-linux-amd64"
|
||||
|
||||
msg_info "Configuring OpenCloud"
|
||||
DATA_DIR="/var/lib/opencloud/"
|
||||
|
||||
263
install/opencloud-install.sh.bak
Normal file
263
install/opencloud-install.sh.bak
Normal file
@ -0,0 +1,263 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: vhsdream
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://opencloud.eu
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
echo -e "${TAB3}${INFO}${YW} Leave empty to use IP-based localhost mode (no Collabora)${CL}"
|
||||
read -r -p "${TAB3}Enter the hostname of your OpenCloud server (eg cloud.domain.tld): " oc_host
|
||||
|
||||
if [[ -z "$oc_host" ]]; then
|
||||
# Localhost/IP mode - no TLS, no Collabora
|
||||
OC_HOST="${LOCAL_IP}"
|
||||
LOCALHOST_MODE=true
|
||||
msg_info "Using localhost mode with IP: ${LOCAL_IP}"
|
||||
msg_warn "Collabora requires TLS and will be skipped in localhost mode"
|
||||
else
|
||||
OC_HOST="$oc_host"
|
||||
LOCALHOST_MODE=false
|
||||
read -r -p "${TAB3}Enter the hostname of your Collabora server [collabora.${OC_HOST#*.}]: " collabora_host
|
||||
COLLABORA_HOST="${collabora_host:-collabora.${OC_HOST#*.}}"
|
||||
read -r -p "${TAB3}Enter the hostname of your WOPI server [wopiserver.${OC_HOST#*.}]: " wopi_host
|
||||
WOPI_HOST="${wopi_host:-wopiserver.${OC_HOST#*.}}"
|
||||
fi
|
||||
|
||||
# Collabora Online - only install if not in localhost mode (requires TLS)
|
||||
if [[ "$LOCALHOST_MODE" != true ]]; then
|
||||
msg_info "Installing Collabora Online"
|
||||
curl -fsSL https://collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg -o /etc/apt/keyrings/collaboraonline-release-keyring.gpg
|
||||
cat <<EOF >/etc/apt/sources.list.d/collaboraonline.sources
|
||||
Types: deb
|
||||
URIs: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-deb
|
||||
Suites: ./
|
||||
Signed-By: /etc/apt/keyrings/collaboraonline-release-keyring.gpg
|
||||
EOF
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y coolwsd code-brand
|
||||
systemctl stop coolwsd
|
||||
mkdir -p /etc/systemd/system/coolwsd.service.d
|
||||
cat <<EOF >/etc/systemd/system/coolwsd.service.d/override.conf
|
||||
[Unit]
|
||||
Before=opencloud-wopi.service
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
COOLPASS="$(openssl rand -base64 36)"
|
||||
$STD runuser -u cool -- coolconfig set-admin-password --user=admin --password="$COOLPASS"
|
||||
echo "$COOLPASS" >~/.coolpass
|
||||
msg_ok "Installed Collabora Online"
|
||||
fi
|
||||
|
||||
# OpenCloud
|
||||
fetch_and_deploy_gh_release "opencloud" "opencloud-eu/opencloud" "singlefile" "v5.0.1" "/usr/bin" "opencloud-*-linux-amd64"
|
||||
|
||||
msg_info "Configuring OpenCloud"
|
||||
DATA_DIR="/var/lib/opencloud/"
|
||||
CONFIG_DIR="/etc/opencloud"
|
||||
ENV_FILE="${CONFIG_DIR}/opencloud.env"
|
||||
mkdir -p "$DATA_DIR" "$CONFIG_DIR"/assets/apps
|
||||
|
||||
curl -fsSL https://raw.githubusercontent.com/opencloud-eu/opencloud-compose/refs/heads/main/config/opencloud/csp.yaml -o "$CONFIG_DIR"/csp.yaml
|
||||
curl -fsSL https://raw.githubusercontent.com/opencloud-eu/opencloud-compose/refs/heads/main/config/opencloud/proxy.yaml -o "$CONFIG_DIR"/proxy.yaml.bak
|
||||
|
||||
if [[ "$LOCALHOST_MODE" == true ]]; then
|
||||
OC_URL="http://${OC_HOST}:9200"
|
||||
OC_INSECURE="true"
|
||||
else
|
||||
OC_URL="https://${OC_HOST}"
|
||||
OC_INSECURE="false"
|
||||
fi
|
||||
|
||||
# Create web config directory and config.json
|
||||
mkdir -p "$CONFIG_DIR"/web
|
||||
cat <<EOF >"$CONFIG_DIR"/web/config.json
|
||||
{
|
||||
"server": "${OC_URL}",
|
||||
"theme": "https://raw.githubusercontent.com/opencloud-eu/opencloud-compose/refs/heads/main/config/opencloud/web/themes/opencloud/theme.json",
|
||||
"openIdConnect": {
|
||||
"metadata_url": "${OC_URL}/.well-known/openid-configuration",
|
||||
"authority": "${OC_URL}",
|
||||
"client_id": "web",
|
||||
"response_type": "code",
|
||||
"scope": "openid profile email"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
cat <<EOF >"$ENV_FILE"
|
||||
OC_URL=${OC_URL}
|
||||
OC_INSECURE=${OC_INSECURE}
|
||||
IDM_CREATE_DEMO_USERS=false
|
||||
OC_LOG_LEVEL=warning
|
||||
OC_CONFIG_DIR=${CONFIG_DIR}
|
||||
OC_BASE_DATA_PATH=${DATA_DIR}
|
||||
STORAGE_SYSTEM_OC_ROOT=${DATA_DIR}/storage/metadata
|
||||
|
||||
## Web
|
||||
WEB_ASSET_CORE_PATH=${CONFIG_DIR}/web/assets
|
||||
WEB_ASSET_APPS_PATH=${CONFIG_DIR}/web/assets/apps
|
||||
WEB_UI_CONFIG_FILE=${CONFIG_DIR}/web/config.json
|
||||
# WEB_ASSET_THEMES_PATH=${CONFIG_DIR}/web/assets/themes
|
||||
# WEB_UI_THEME_PATH=
|
||||
|
||||
## Frontend
|
||||
FRONTEND_DISABLE_RADICALE=true
|
||||
FRONTEND_GROUPWARE_ENABLED=false
|
||||
GRAPH_INCLUDE_OCM_SHAREES=true
|
||||
|
||||
## Proxy
|
||||
PROXY_TLS=false
|
||||
PROXY_CSP_CONFIG_FILE_LOCATION=${CONFIG_DIR}/csp.yaml
|
||||
|
||||
## Collaboration - requires VALID TLS (disabled in localhost mode)
|
||||
# COLLABORA_DOMAIN=
|
||||
# COLLABORATION_APP_NAME="CollaboraOnline"
|
||||
# COLLABORATION_APP_PRODUCT="Collabora"
|
||||
# COLLABORATION_APP_ADDR=
|
||||
# COLLABORATION_APP_INSECURE=false
|
||||
# COLLABORATION_HTTP_ADDR=0.0.0.0:9300
|
||||
# COLLABORATION_WOPI_SRC=
|
||||
# COLLABORATION_JWT_SECRET=
|
||||
|
||||
## Notifications - Email settings
|
||||
# NOTIFICATIONS_SMTP_HOST=
|
||||
# NOTIFICATIONS_SMTP_PORT=
|
||||
# NOTIFICATIONS_SMTP_SENDER=
|
||||
# NOTIFICATIONS_SMTP_USERNAME=
|
||||
# NOTIFICATIONS_SMTP_PASSWORD=
|
||||
# NOTIFICATIONS_SMTP_AUTHENTICATION=login
|
||||
## Encryption method. Possible values are 'starttls', 'ssltls' and 'none'
|
||||
# NOTIFICATIONS_SMTP_ENCRYPTION=starttls
|
||||
## Allow insecure connections. Defaults to false.
|
||||
# NOTIFICATIONS_SMTP_INSECURE=false
|
||||
|
||||
## Start additional services at runtime
|
||||
## Examples: notifications, antivirus etc.
|
||||
## Do not uncomment unless configured above.
|
||||
# OC_ADD_RUN_SERVICES="notifications"
|
||||
|
||||
## OpenID - via web browser
|
||||
## uncomment for OpenID in general
|
||||
# OC_EXCLUDE_RUN_SERVICES=idp
|
||||
# OC_OIDC_ISSUER=<your auth URL>
|
||||
# IDP_DOMAIN=<your auth URL>
|
||||
# PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD=none
|
||||
# PROXY_OIDC_REWRITE_WELLKNOWN=true
|
||||
# PROXY_USER_OIDC_CLAIM=preferred_username
|
||||
# PROXY_USER_CS3_CLAIM=username
|
||||
## automatically create accounts
|
||||
# PROXY_AUTOPROVISION_ACCOUNTS=true
|
||||
# WEB_OIDC_SCOPE=openid profile email groups
|
||||
# GRAPH_ASSIGN_DEFAULT_USER_ROLE=false
|
||||
#
|
||||
## uncomment below if using PocketID
|
||||
# WEB_OIDC_CLIENT_ID=<generated in PocketID>
|
||||
# WEB_OIDC_METADATA_URL=<your auth URL>/.well-known/openid-configuration
|
||||
|
||||
## Full Text Search - Apache Tika
|
||||
## Requires a separate install of Tika - see https://community-scripts.github.io/ProxmoxVE/scripts?id=apache-tika
|
||||
# SEARCH_EXTRACTOR_TYPE=tika
|
||||
# FRONTEND_FULL_TEXT_SEARCH_ENABLED=true
|
||||
# SEARCH_EXTRACTOR_TIKA_TIKA_URL=<your-tika-url>
|
||||
|
||||
## External storage test - Only NFS v4.2+ is supported
|
||||
## User files
|
||||
# STORAGE_USERS_POSIX_ROOT=<path-to-your-bind_mount>
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/systemd/system/opencloud.service
|
||||
[Unit]
|
||||
Description=OpenCloud server
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=opencloud
|
||||
Group=opencloud
|
||||
EnvironmentFile=${ENV_FILE}
|
||||
ExecStart=/usr/bin/opencloud server
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
if [[ "$LOCALHOST_MODE" != true ]]; then
|
||||
cat <<EOF >/etc/systemd/system/opencloud-wopi.service
|
||||
[Unit]
|
||||
Description=OpenCloud WOPI Server
|
||||
Wants=coolwsd.service
|
||||
After=opencloud.service coolwsd.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=opencloud
|
||||
Group=opencloud
|
||||
EnvironmentFile=${ENV_FILE}
|
||||
ExecStartPre=/bin/sleep 10
|
||||
ExecStart=/usr/bin/opencloud collaboration server
|
||||
Restart=always
|
||||
KillSignal=SIGKILL
|
||||
KillMode=mixed
|
||||
TimeoutStopSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
# Append active Collabora config to env file
|
||||
cat <<EOF >>"$ENV_FILE"
|
||||
|
||||
## Collaboration - active configuration
|
||||
COLLABORA_DOMAIN=${COLLABORA_HOST}
|
||||
COLLABORATION_APP_NAME="CollaboraOnline"
|
||||
COLLABORATION_APP_PRODUCT="Collabora"
|
||||
COLLABORATION_APP_ADDR=https://${COLLABORA_HOST}
|
||||
COLLABORATION_APP_INSECURE=false
|
||||
COLLABORATION_HTTP_ADDR=0.0.0.0:9300
|
||||
COLLABORATION_WOPI_SRC=https://${WOPI_HOST}
|
||||
COLLABORATION_JWT_SECRET=
|
||||
EOF
|
||||
|
||||
$STD runuser -u cool -- coolconfig set ssl.enable false
|
||||
$STD runuser -u cool -- coolconfig set ssl.termination true
|
||||
$STD runuser -u cool -- coolconfig set ssl.ssl_verification true
|
||||
sed -i "s|CSP2\"/>|CSP2\">frame-ancestors https://${OC_HOST}</content_security_policy>|" /etc/coolwsd/coolwsd.xml
|
||||
fi
|
||||
|
||||
useradd -r -M -s /usr/sbin/nologin opencloud
|
||||
chown -R opencloud:opencloud "$CONFIG_DIR" "$DATA_DIR"
|
||||
|
||||
if [[ "$LOCALHOST_MODE" == true ]]; then
|
||||
$STD runuser -u opencloud -- opencloud init --config-path "$CONFIG_DIR" --insecure yes
|
||||
else
|
||||
$STD runuser -u opencloud -- opencloud init --config-path "$CONFIG_DIR" --insecure no
|
||||
fi
|
||||
|
||||
OPENCLOUD_SECRET="$(sed -n '/jwt/p' "$CONFIG_DIR"/opencloud.yaml | awk '{print $2}')"
|
||||
if [[ "$LOCALHOST_MODE" != true ]]; then
|
||||
sed -i "s/COLLABORATION_JWT_SECRET=/&${OPENCLOUD_SECRET//&/\\&}/" "$ENV_FILE"
|
||||
fi
|
||||
msg_ok "Configured OpenCloud"
|
||||
|
||||
msg_info "Starting services"
|
||||
if [[ "$LOCALHOST_MODE" == true ]]; then
|
||||
systemctl enable -q --now opencloud
|
||||
else
|
||||
systemctl enable -q --now coolwsd opencloud
|
||||
sleep 5
|
||||
systemctl enable -q --now opencloud-wopi
|
||||
fi
|
||||
msg_ok "Started services"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@ -14,88 +14,63 @@ network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
$STD apt-get install -y \
|
||||
build-essential \
|
||||
tesseract-ocr \
|
||||
tesseract-ocr-all
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="24" setup_nodejs
|
||||
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/papra-hq/papra/releases | grep -oP '"tag_name":\s*"\K@papra/docker@[^"]+' | head -n1)
|
||||
fetch_and_deploy_gh_release "papra" "papra-hq/papra" "tarball" "${RELEASE}" "/opt/papra"
|
||||
|
||||
msg_info "Setup Papra"
|
||||
pnpm_version=$(grep -oP '"packageManager":\s*"pnpm@\K[^"]+' /opt/papra/package.json)
|
||||
NODE_VERSION="24" NODE_MODULE="pnpm@$pnpm_version" setup_nodejs
|
||||
|
||||
msg_info "Installing Papra (Patience)"
|
||||
cd /opt/papra
|
||||
export COREPACK_ENABLE_NETWORK=1
|
||||
$STD corepack enable
|
||||
$STD corepack prepare pnpm@10.19.0 --activate
|
||||
$STD pnpm install --frozen-lockfile
|
||||
$STD pnpm --filter "@papra/app-client..." run build
|
||||
$STD pnpm --filter "@papra/app-server..." run build
|
||||
msg_ok "Set up Papra"
|
||||
ln -sf /opt/papra/apps/papra-client/dist /opt/papra/apps/papra-server/public
|
||||
msg_ok "Installed Papra"
|
||||
|
||||
msg_info "Configuring Papra"
|
||||
CONTAINER_IP=$(hostname -I | awk '{print $1}')
|
||||
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
|
||||
|
||||
mkdir -p /opt/papra/app-data/db
|
||||
mkdir -p /opt/papra/app-data/documents
|
||||
|
||||
cat >/opt/papra/.env <<EOF
|
||||
mkdir -p /opt/papra_data/{db,documents,ingestion}
|
||||
[[ ! -f /opt/papra_data/.secret ]] && openssl rand -hex 32 >/opt/papra_data/.secret
|
||||
cat <<EOF >/opt/papra/apps/papra-server/.env
|
||||
NODE_ENV=production
|
||||
SERVER_SERVE_PUBLIC_DIR=true
|
||||
PORT=1221
|
||||
|
||||
# Database Configuration
|
||||
DATABASE_URL=file:./app-data/db/db.sqlite
|
||||
|
||||
# Storage Configuration
|
||||
DOCUMENT_STORAGE_FILESYSTEM_ROOT=./app-data/documents
|
||||
PAPRA_CONFIG_DIR=./app-data
|
||||
|
||||
# Authentication
|
||||
BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
|
||||
DATABASE_URL=file:/opt/papra_data/db/db.sqlite
|
||||
DOCUMENT_STORAGE_FILESYSTEM_ROOT=/opt/papra_data/documents
|
||||
PAPRA_CONFIG_DIR=/opt/papra_data
|
||||
AUTH_SECRET=$(cat /opt/papra_data/.secret)
|
||||
BETTER_AUTH_SECRET=$(cat /opt/papra_data/.secret)
|
||||
BETTER_AUTH_TELEMETRY=0
|
||||
|
||||
# Application Configuration
|
||||
CLIENT_BASE_URL=http://${CONTAINER_IP}:1221
|
||||
|
||||
# Email Configuration (dry-run mode)
|
||||
CLIENT_BASE_URL=http://${LOCAL_IP}:1221
|
||||
EMAILS_DRY_RUN=true
|
||||
|
||||
# Ingestion Folder
|
||||
INGESTION_FOLDER_ROOT=./ingestion
|
||||
INGESTION_FOLDER_ROOT=/opt/papra_data/ingestion
|
||||
EOF
|
||||
|
||||
mkdir -p /opt/papra/ingestion
|
||||
chown -R root:root /opt/papra
|
||||
msg_ok "Configured Papra"
|
||||
|
||||
msg_info "Creating Papra Service"
|
||||
cat >/etc/systemd/system/papra.service <<EOF
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/papra.service
|
||||
[Unit]
|
||||
Description=Papra Document Management
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/papra/apps/papra-server
|
||||
EnvironmentFile=/opt/papra/.env
|
||||
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
ExecStartPre=/usr/bin/corepack pnpm --silent run migration:apply
|
||||
ExecStart=/usr/bin/corepack pnpm --silent run start
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
EnvironmentFile=/opt/papra/apps/papra-server/.env
|
||||
ExecStartPre=/usr/bin/pnpm run migrate:up
|
||||
ExecStart=/usr/bin/node dist/index.js
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl enable -q --now papra
|
||||
echo "${RELEASE}" >/opt/Papra_version.txt
|
||||
msg_ok "Created and Started Papra Service"
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
@ -30,7 +30,7 @@ $STD apt install -y \
|
||||
gnupg
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
import_local_ip
|
||||
|
||||
setup_mariadb
|
||||
MARIADB_DB_NAME="piler" MARIADB_DB_USER="piler" setup_mariadb_db
|
||||
PHP_VERSION="8.3" PHP_FPM="YES" PHP_MODULE="ldap,gd,memcached,pdo,mysql,curl,zip" setup_php
|
||||
|
||||
@ -29,7 +29,7 @@ useradd -rU -s /bin/bash pixelfed
|
||||
usermod -aG redis pixelfed
|
||||
msg_ok "Created Pixelfed User"
|
||||
|
||||
import_local_ip
|
||||
|
||||
PG_VERSION="17" setup_postgresql
|
||||
PG_DB_NAME="pixelfed" PG_DB_USER="pixelfed" setup_postgresql_db
|
||||
PHP_VERSION="8.4" PHP_FPM="YES" PHP_MODULE="bcmath,ctype,exif,imagick,pgsql,redis,tokenizer" PHP_UPLOAD_MAX_FILESIZE="500M" PHP_POST_MAX_SIZE="500M" PHP_MAX_EXECUTION_TIME="600" setup_php
|
||||
|
||||
@ -15,13 +15,11 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing dependencies"
|
||||
$STD apt-get install -y \
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
acl \
|
||||
git \
|
||||
build-essential \
|
||||
gcc \
|
||||
g++ \
|
||||
make \
|
||||
libssl-dev \
|
||||
libffi-dev \
|
||||
libmagic-dev \
|
||||
@ -43,9 +41,9 @@ $STD apt-get install -y \
|
||||
p7zip-full \
|
||||
tzdata \
|
||||
nginx
|
||||
msg_ok "Installed dependencies"
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
UV_VERSION="0.7.19" PYTHON_VERSION="3.13" setup_uv
|
||||
PYTHON_VERSION="3.13" setup_uv
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
setup_mariadb
|
||||
MARIADB_DB_NAME="romm" MARIADB_DB_USER="romm" setup_mariadb_db
|
||||
@ -60,7 +58,7 @@ mkdir -p /opt/romm \
|
||||
msg_ok "Created directories"
|
||||
|
||||
msg_info "Creating configuration file"
|
||||
cat >/var/lib/romm/config/config.yml <<'CONFIGEOF'
|
||||
cat <<'EOF' >/var/lib/romm/config/config.yml
|
||||
# RomM Configuration File
|
||||
# Documentation: https://docs.romm.app/latest/Getting-Started/Configuration-File/
|
||||
# Only uncomment the lines you want to use/modify
|
||||
@ -116,15 +114,13 @@ cat >/var/lib/romm/config/config.yml <<'CONFIGEOF'
|
||||
# emulatorjs:
|
||||
# debug: false
|
||||
# cache_limit: null
|
||||
CONFIGEOF
|
||||
EOF
|
||||
chmod 644 /var/lib/romm/config/config.yml
|
||||
msg_ok "Created configuration file"
|
||||
|
||||
msg_info "Installing RAHasher (RetroAchievements)"
|
||||
fetch_and_deploy_gh_release "RetroAchievements" "RetroAchievements/RALibretro" "prebuild" "latest" "/opt/RALibretro" "RAHasher-x64-Linux-*.zip"
|
||||
fetch_and_deploy_gh_release "RAHasher" "RetroAchievements/RALibretro" "prebuild" "latest" "/opt/RALibretro" "RAHasher-x64-Linux-*.zip"
|
||||
cp /opt/RALibretro/RAHasher /usr/bin/RAHasher
|
||||
chmod +x /usr/bin/RAHasher
|
||||
msg_ok "Installed RAHasher"
|
||||
|
||||
fetch_and_deploy_gh_release "romm" "rommapp/romm"
|
||||
|
||||
@ -134,7 +130,7 @@ systemctl restart redis-server
|
||||
systemctl enable -q --now redis-server
|
||||
AUTH_SECRET_KEY=$(openssl rand -hex 32)
|
||||
|
||||
cat >/opt/romm/.env <<EOF
|
||||
cat <<EOF >/opt/romm/.env
|
||||
ROMM_BASE_PATH=/var/lib/romm
|
||||
ROMM_CONFIG_PATH=/var/lib/romm/config/config.yml
|
||||
WEB_CONCURRENCY=4
|
||||
@ -166,24 +162,25 @@ EOF
|
||||
chmod 600 /opt/romm/.env
|
||||
msg_ok "Created environment file"
|
||||
|
||||
msg_info "Setup Romm backend"
|
||||
msg_info "Setting up RomM Backend"
|
||||
cd /opt/romm
|
||||
export UV_CONCURRENT_DOWNLOADS=1
|
||||
$STD uv sync --all-extras
|
||||
cd /opt/romm/backend
|
||||
$STD uv run alembic upgrade head
|
||||
msg_ok "Installed backend"
|
||||
msg_ok "Set up RomM Backend"
|
||||
|
||||
msg_info "Setup Romm frontend"
|
||||
msg_info "Setting up RomM Frontend"
|
||||
cd /opt/romm/frontend
|
||||
$STD npm install
|
||||
$STD npm run build
|
||||
mkdir -p /opt/romm/frontend/dist/assets/romm
|
||||
ln -sfn /var/lib/romm/resources /opt/romm/frontend/dist/assets/romm/resources
|
||||
ln -sfn /var/lib/romm/assets /opt/romm/frontend/dist/assets/romm/assets
|
||||
msg_ok "Setup Romm frontend"
|
||||
msg_info "Configuring nginx"
|
||||
cat >/etc/nginx/sites-available/romm <<'EOF'
|
||||
msg_ok "Set up RomM Frontend"
|
||||
|
||||
msg_info "Configuring Nginx"
|
||||
cat <<'EOF' >/etc/nginx/sites-available/romm
|
||||
upstream romm_backend {
|
||||
server 127.0.0.1:5000;
|
||||
}
|
||||
@ -204,6 +201,14 @@ server {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# Static assets
|
||||
location /assets {
|
||||
alias /opt/romm/frontend/dist/assets;
|
||||
try_files $uri $uri/ =404;
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
|
||||
# EmulatorJS player - requires COOP/COEP headers for SharedArrayBuffer
|
||||
location ~ ^/rom/.*/ejs$ {
|
||||
add_header Cross-Origin-Embedder-Policy "require-corp";
|
||||
@ -247,13 +252,12 @@ EOF
|
||||
|
||||
rm -f /etc/nginx/sites-enabled/default
|
||||
ln -sf /etc/nginx/sites-available/romm /etc/nginx/sites-enabled/romm
|
||||
$STD nginx -t
|
||||
systemctl restart nginx
|
||||
systemctl enable -q nginx
|
||||
msg_ok "Configured nginx"
|
||||
systemctl enable -q --now nginx
|
||||
msg_ok "Configured Nginx"
|
||||
|
||||
msg_info "Creating services"
|
||||
cat >/etc/systemd/system/romm-backend.service <<EOF
|
||||
msg_info "Creating Services"
|
||||
cat <<EOF >/etc/systemd/system/romm-backend.service
|
||||
[Unit]
|
||||
Description=RomM Backend
|
||||
After=network.target mariadb.service redis-server.service
|
||||
@ -272,7 +276,7 @@ RestartSec=5
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
cat >/etc/systemd/system/romm-worker.service <<EOF
|
||||
cat <<EOF >/etc/systemd/system/romm-worker.service
|
||||
[Unit]
|
||||
Description=RomM RQ Worker
|
||||
After=network.target mariadb.service redis-server.service romm-backend.service
|
||||
@ -291,7 +295,7 @@ RestartSec=5
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
cat >/etc/systemd/system/romm-scheduler.service <<EOF
|
||||
cat <<EOF >/etc/systemd/system/romm-scheduler.service
|
||||
[Unit]
|
||||
Description=RomM RQ Scheduler
|
||||
After=network.target mariadb.service redis-server.service romm-backend.service
|
||||
@ -312,7 +316,7 @@ RestartSec=5
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
cat >/etc/systemd/system/romm-watcher.service <<EOF
|
||||
cat <<EOF >/etc/systemd/system/romm-watcher.service
|
||||
[Unit]
|
||||
Description=RomM Filesystem Watcher
|
||||
After=network.target romm-backend.service
|
||||
@ -331,9 +335,8 @@ RestartSec=5
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable -q --now romm-backend romm-worker romm-scheduler romm-watcher
|
||||
msg_ok "Created services"
|
||||
msg_ok "Created Services"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
@ -14,11 +14,12 @@ network_check
|
||||
update_os
|
||||
|
||||
fetch_and_deploy_gh_release "rustypaste" "orhun/rustypaste" "prebuild" "latest" "/opt/rustypaste" "*x86_64-unknown-linux-gnu.tar.gz"
|
||||
fetch_and_deploy_gh_release "rustypaste-cli" "orhun/rustypaste-cli" "prebuild" "latest" "/usr/local/bin" "*x86_64-unknown-linux-gnu.tar.gz"
|
||||
|
||||
msg_info "Setting up rustypaste"
|
||||
msg_info "Setting up RustyPaste"
|
||||
cd /opt/rustypaste
|
||||
sed -i 's|^address = ".*"|address = "0.0.0.0:8000"|' config.toml
|
||||
msg_ok "Set up rustypaste"
|
||||
msg_ok "Set up RustyPaste"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/rustypaste.service
|
||||
|
||||
217
install/shelfmark-install.sh
Normal file
217
install/shelfmark-install.sh
Normal file
@ -0,0 +1,217 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: vhsdream
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/calibrain/shelfmark
|
||||
|
||||
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 \
|
||||
unrar-free
|
||||
ln -sf /usr/bin/unrar-free /usr/bin/unrar
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
mkdir -p /etc/shelfmark
|
||||
cat <<EOF >/etc/shelfmark/.env
|
||||
DOCKERMODE=false
|
||||
CONFIG_DIR=/etc/shelfmark
|
||||
TMP_DIR=/tmp/shelfmark
|
||||
ENABLE_LOGGING=true
|
||||
FLASK_HOST=0.0.0.0
|
||||
FLASK_PORT=8084
|
||||
# SESSION_COOKIES_SECURE=true
|
||||
# CWA_DB_PATH=
|
||||
USE_CF_BYPASS=true
|
||||
USING_EXTERNAL_BYPASSER=false
|
||||
# EXT_BYPASSER_URL=
|
||||
# EXT_BYPASSER_PATH=/v1
|
||||
EOF
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo -e "${BL}Shelfmark Deployment Type${CL}"
|
||||
echo "─────────────────────────────────────────"
|
||||
echo "Please choose your deployment type:"
|
||||
echo ""
|
||||
echo " 1) Use Shelfmark's internal captcha bypasser (default)"
|
||||
echo " 2) Install FlareSolverr in this LXC"
|
||||
echo " 3) Use an existing Flaresolverr/Byparr LXC"
|
||||
echo " 4) Disable captcha bypassing altogether (not recommended)"
|
||||
echo ""
|
||||
|
||||
read -r -p "${TAB3}Select deployment type [1]: " DEPLOYMENT_TYPE
|
||||
DEPLOYMENT_TYPE="${DEPLOYMENT_TYPE:-1}"
|
||||
|
||||
case "$DEPLOYMENT_TYPE" in
|
||||
1)
|
||||
msg_ok "Using Shelfmark's internal captcha bypasser"
|
||||
;;
|
||||
2)
|
||||
msg_ok "Proceeding with FlareSolverr installation"
|
||||
;;
|
||||
3)
|
||||
echo ""
|
||||
echo -e "${BL}Use an existing FlareSolverr/Byparr LXC${CL}"
|
||||
echo "─────────────────────────────────────────"
|
||||
echo "Enter the URL/IP address with port of your Flaresolverr/Byparr instance"
|
||||
echo "Example: http://flaresoverr.homelab.lan:8191 or"
|
||||
echo "http://192.168.10.99:8191"
|
||||
echo ""
|
||||
read -r -p "FlareSolverr/Byparr URL: " BYPASSER_URL
|
||||
|
||||
if [[ -z "$BYPASSER_URL" ]]; then
|
||||
msg_warn "No Flaresolverr/Byparr URL provided. Falling back to Shelfmark's internal bypasser."
|
||||
else
|
||||
BYPASSER_URL="${BYPASSER_URL%/}"
|
||||
msg_ok "FlareSolverr/Byparr URL: ${BYPASSER_URL}"
|
||||
fi
|
||||
;;
|
||||
4)
|
||||
msg_warn "Disabling captcha bypass. This may cause the majority of searches and downloads to fail."
|
||||
;;
|
||||
*)
|
||||
msg_warn "Invalid selection. Reverting to default (internal bypasser)!"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$DEPLOYMENT_TYPE" == "2" ]]; then
|
||||
fetch_and_deploy_gh_release "flaresolverr" "FlareSolverr/FlareSolverr" "prebuild" "latest" "/opt/flaresolverr" "flaresolverr_linux_x64.tar.gz"
|
||||
msg_info "Installing FlareSolverr (please wait)"
|
||||
$STD apt install -y xvfb
|
||||
setup_deb822_repo \
|
||||
"google-chrome" \
|
||||
"https://dl.google.com/linux/linux_signing_key.pub" \
|
||||
"https://dl.google.com/linux/chrome/deb/" \
|
||||
"stable"
|
||||
$STD apt update
|
||||
$STD apt install -y google-chrome-stable
|
||||
# remove google-chrome.list added by google-chrome-stable
|
||||
rm /etc/apt/sources.list.d/google-chrome.list
|
||||
sed -i -e '/BYPASSER=/s/false/true/' \
|
||||
-e 's/^# EXT_/EXT_/' \
|
||||
-e "s|_URL=.*|_URL=http://localhost:8191|" /etc/shelfmark/.env
|
||||
msg_ok "Installed FlareSolverr"
|
||||
elif [[ "$DEPLOYMENT_TYPE" == "3" ]]; then
|
||||
sed -i -e '/BYPASSER=/s/false/true/' \
|
||||
-e 's/^# EXT_/EXT_/' \
|
||||
-e "s|_URL=.*|_URL=${BYPASSER_URL}|" /etc/shelfmark/.env
|
||||
elif [[ "$DEPLOYMENT_TYPE" == "4" ]]; then
|
||||
sed -i '/_BYPASS=/s/true/false/' /etc/shelfmark/.env
|
||||
else
|
||||
DEPLOYMENT_TYPE="1"
|
||||
msg_info "Installing internal bypasser dependencies"
|
||||
$STD apt install -y --no-install-recommends \
|
||||
xvfb \
|
||||
ffmpeg \
|
||||
chromium-common=143.0.7499.169-1~deb13u1 \
|
||||
chromium=143.0.7499.169-1~deb13u1 \
|
||||
chromium-driver=143.0.7499.169-1~deb13u1 \
|
||||
python3-tk
|
||||
msg_ok "Installed internal bypasser dependencies"
|
||||
fi
|
||||
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
|
||||
fetch_and_deploy_gh_release "shelfmark" "calibrain/shelfmark" "tarball" "latest" "/opt/shelfmark"
|
||||
RELEASE_VERSION=$(cat "$HOME/.shelfmark")
|
||||
|
||||
msg_info "Building Shelfmark frontend"
|
||||
cd /opt/shelfmark/src/frontend
|
||||
echo "RELEASE_VERSION=${RELEASE_VERSION}" >>/etc/shelfmark/.env
|
||||
$STD npm ci
|
||||
$STD npm run build
|
||||
mv /opt/shelfmark/src/frontend/dist /opt/shelfmark/frontend-dist
|
||||
msg_ok "Built Shelfmark frontend"
|
||||
|
||||
msg_info "Configuring Shelfmark"
|
||||
cd /opt/shelfmark
|
||||
$STD uv venv ./venv
|
||||
$STD source ./venv/bin/activate
|
||||
$STD uv pip install -r ./requirements-base.txt
|
||||
[[ "$DEPLOYMENT_TYPE" == "1" ]] && $STD uv pip install -r ./requirements-shelfmark.txt
|
||||
mkdir -p {/var/log/shelfmark,/tmp/shelfmark}
|
||||
msg_ok "Configured Shelfmark"
|
||||
|
||||
msg_info "Creating Services and start script"
|
||||
cat <<EOF >/etc/systemd/system/shelfmark.service
|
||||
[Unit]
|
||||
Description=Shelfmark server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/shelfmark
|
||||
EnvironmentFile=/etc/shelfmark/.env
|
||||
ExecStart=/usr/bin/bash /opt/shelfmark/start.sh
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
KillMode=mixed
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
if [[ "$DEPLOYMENT_TYPE" == "1" ]]; then
|
||||
cat <<EOF >/etc/systemd/system/chromium.service
|
||||
[Unit]
|
||||
Description=karakeep Headless Browser
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
ExecStart=/usr/bin/chromium --headless --no-sandbox --disable-gpu --disable-dev-shm-usage --remote-debugging-address=127.0.0.1 --remote-debugging-port=9222 --hide-scrollbars
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now chromium
|
||||
fi
|
||||
if [[ "$DEPLOYMENT_TYPE" == "2" ]]; then
|
||||
cat <<EOF >/etc/systemd/system/flaresolverr.service
|
||||
[Unit]
|
||||
Description=FlareSolverr
|
||||
After=network.target
|
||||
[Service]
|
||||
SyslogIdentifier=flaresolverr
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
Type=simple
|
||||
Environment="LOG_LEVEL=info"
|
||||
Environment="CAPTCHA_SOLVER=none"
|
||||
WorkingDirectory=/opt/flaresolverr
|
||||
ExecStart=/opt/flaresolverr/flaresolverr
|
||||
TimeoutStopSec=30
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now flaresolverr
|
||||
fi
|
||||
|
||||
cat <<EOF >/opt/shelfmark/start.sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source /opt/shelfmark/venv/bin/activate
|
||||
set -a
|
||||
source /etc/shelfmark/.env
|
||||
set +a
|
||||
|
||||
gunicorn --worker-class geventwebsocket.gunicorn.workers.GeventWebSocketWorker --workers 1 -t 300 -b 0.0.0.0:8084 shelfmark.main:app
|
||||
EOF
|
||||
chmod +x /opt/shelfmark/start.sh
|
||||
|
||||
systemctl enable -q --now shelfmark
|
||||
msg_ok "Created Services and start script"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@ -1,151 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: durzo
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/connorgallopo/Tracearr
|
||||
|
||||
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 redis-server
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PNPM_VERSION="$(curl -fsSL "https://raw.githubusercontent.com/connorgallopo/Tracearr/refs/heads/main/package.json" | jq -r '.packageManager | split("@")[1]')"
|
||||
NODE_VERSION="22" NODE_MODULE="pnpm@${PNPM_VERSION}" setup_nodejs
|
||||
PG_VERSION="18" setup_postgresql
|
||||
|
||||
msg_info "Installing TimescaleDB"
|
||||
setup_deb822_repo \
|
||||
"timescaledb" \
|
||||
"https://packagecloud.io/timescale/timescaledb/gpgkey" \
|
||||
"https://packagecloud.io/timescale/timescaledb/debian" \
|
||||
"$(get_os_info codename)" \
|
||||
"main"
|
||||
$STD apt install -y \
|
||||
timescaledb-2-postgresql-18 \
|
||||
timescaledb-tools \
|
||||
timescaledb-toolkit-postgresql-18
|
||||
total_ram_kb=$(grep MemTotal /proc/meminfo | awk '{print $2}')
|
||||
ram_for_tsdb=$((total_ram_kb / 1024 / 2))
|
||||
$STD timescaledb-tune -yes -memory "$ram_for_tsdb"MB
|
||||
$STD systemctl restart postgresql
|
||||
msg_ok "Installed TimescaleDB"
|
||||
|
||||
msg_info "Creating PostgreSQL Database"
|
||||
PG_DB_NAME="tracearr" PG_DB_USER="tracearr" PG_DB_EXTENSIONS="timescaledb,timescaledb_toolkit" setup_postgresql_db
|
||||
msg_ok "Created PostgreSQL Database"
|
||||
|
||||
fetch_and_deploy_gh_release "tracearr" "connorgallopo/Tracearr" "tarball" "latest" "/opt/tracearr.build"
|
||||
|
||||
msg_info "Building Tracearr"
|
||||
export TZ=$(cat /etc/timezone)
|
||||
cd /opt/tracearr.build
|
||||
$STD pnpm install --frozen-lockfile --force
|
||||
$STD pnpm turbo telemetry disable
|
||||
$STD pnpm turbo run build --no-daemon --filter=@tracearr/shared --filter=@tracearr/server --filter=@tracearr/web
|
||||
mkdir -p /opt/tracearr/{packages/shared,apps/server,apps/web,apps/server/src/db}
|
||||
cp -rf package.json /opt/tracearr/
|
||||
cp -rf pnpm-workspace.yaml /opt/tracearr/
|
||||
cp -rf pnpm-lock.yaml /opt/tracearr/
|
||||
cp -rf apps/server/package.json /opt/tracearr/apps/server/
|
||||
cp -rf apps/server/dist /opt/tracearr/apps/server/dist
|
||||
cp -rf apps/web/dist /opt/tracearr/apps/web/dist
|
||||
cp -rf packages/shared/package.json /opt/tracearr/packages/shared/
|
||||
cp -rf packages/shared/dist /opt/tracearr/packages/shared/dist
|
||||
cp -rf apps/server/src/db/migrations /opt/tracearr/apps/server/src/db/migrations
|
||||
cp -rf data /opt/tracearr/data
|
||||
mkdir -p /opt/tracearr/data/image-cache
|
||||
rm -rf /opt/tracearr.build
|
||||
cd /opt/tracearr
|
||||
$STD pnpm install --prod --frozen-lockfile --ignore-scripts
|
||||
msg_ok "Built Tracearr"
|
||||
|
||||
msg_info "Configuring Tracearr"
|
||||
$STD useradd -r -s /bin/false -U tracearr
|
||||
$STD chown -R tracearr:tracearr /opt/tracearr
|
||||
install -d -m 750 -o tracearr -g tracearr /data/tracearr
|
||||
export JWT_SECRET=$(openssl rand -hex 32)
|
||||
export COOKIE_SECRET=$(openssl rand -hex 32)
|
||||
cat <<EOF >/data/tracearr/.env
|
||||
DATABASE_URL=postgresql://${PG_DB_USER}:${PG_DB_PASS}@127.0.0.1:5432/${PG_DB_NAME}
|
||||
REDIS_URL=redis://127.0.0.1:6379
|
||||
PORT=3000
|
||||
HOST=0.0.0.0
|
||||
NODE_ENV=production
|
||||
TZ=${TZ}
|
||||
LOG_LEVEL=info
|
||||
JWT_SECRET=$JWT_SECRET
|
||||
COOKIE_SECRET=$COOKIE_SECRET
|
||||
APP_VERSION=$(cat /root/.tracearr)
|
||||
#CORS_ORIGIN=http://localhost:5173
|
||||
#MOBILE_BETA_MODE=true
|
||||
EOF
|
||||
chmod 600 /data/tracearr/.env
|
||||
chown -R tracearr:tracearr /data/tracearr
|
||||
msg_ok "Configured Tracearr"
|
||||
|
||||
msg_info "Creating Services"
|
||||
cat <<EOF >/data/tracearr/prestart.sh
|
||||
#!/usr/bin/env bash
|
||||
# =============================================================================
|
||||
# Tune PostgreSQL for available resources (runs every startup)
|
||||
# =============================================================================
|
||||
# timescaledb-tune automatically optimizes PostgreSQL settings based on
|
||||
# available RAM and CPU. Safe to run repeatedly - recalculates if resources change.
|
||||
if command -v timescaledb-tune &> /dev/null; then
|
||||
total_ram_kb=\$(grep MemTotal /proc/meminfo | awk '{print \$2}')
|
||||
ram_for_tsdb=\$((total_ram_kb / 1024 / 2))
|
||||
timescaledb-tune -yes -memory "\$ram_for_tsdb"MB --quiet 2>/dev/null \
|
||||
|| echo "Warning: timescaledb-tune failed (non-fatal)"
|
||||
fi
|
||||
# =============================================================================
|
||||
# Ensure TimescaleDB decompression limit is set (for existing databases)
|
||||
# =============================================================================
|
||||
# This setting allows migrations to modify compressed hypertable data.
|
||||
# Without it, bulk UPDATEs on compressed sessions will fail with
|
||||
# "tuple decompression limit exceeded" errors.
|
||||
pg_config_file="/etc/postgresql/18/main/postgresql.conf"
|
||||
if [ -f \$pg_config_file ]; then
|
||||
if ! grep -q "max_tuples_decompressed_per_dml_transaction" \$pg_config_file; then
|
||||
echo "" >> \$pg_config_file
|
||||
echo "# Allow unlimited tuple decompression for migrations on compressed hypertables" >> \$pg_config_file
|
||||
echo "timescaledb.max_tuples_decompressed_per_dml_transaction = 0" >> \$pg_config_file
|
||||
fi
|
||||
fi
|
||||
systemctl restart postgresql
|
||||
EOF
|
||||
chmod +x /data/tracearr/prestart.sh
|
||||
cat <<EOF >/lib/systemd/system/tracearr.service
|
||||
[Unit]
|
||||
Description=Tracearr Web Server
|
||||
After=network.target postgresql.service redis-server.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
KillMode=control-group
|
||||
EnvironmentFile=/data/tracearr/.env
|
||||
WorkingDirectory=/opt/tracearr
|
||||
ExecStartPre=+/data/tracearr/prestart.sh
|
||||
ExecStart=node /opt/tracearr/apps/server/dist/index.js
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
User=tracearr
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now postgresql
|
||||
systemctl enable -q --now redis-server
|
||||
systemctl enable -q --now tracearr
|
||||
msg_ok "Created Services"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
27
install/vikunja-install.sh
Normal file
27
install/vikunja-install.sh
Normal file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (Canbiz) | Co-Author: CrazyWolf13
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://vikunja.io/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
fetch_and_deploy_gh_release "vikunja" "go-vikunja/vikunja" "binary"
|
||||
|
||||
msg_info "Setting up Vikunja"
|
||||
sed -i 's|^# \(service:\)|\1|' /etc/vikunja/config.yml
|
||||
sed -i "s|^ # \(publicurl: \).*| \1\"http://$LOCAL_IP\"|" /etc/vikunja/config.yml
|
||||
sed -i "0,/^ # \(timezone: \).*/s|| \1${tz}|" /etc/vikunja/config.yml
|
||||
systemctl enable -q --now vikunja
|
||||
msg_ok "Set up Vikunja"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
121
install/wger-install.sh
Normal file
121
install/wger-install.sh
Normal file
@ -0,0 +1,121 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Slaviša Arežina (tremor021)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/wger-project/wger
|
||||
|
||||
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 \
|
||||
apache2 \
|
||||
libapache2-mod-wsgi-py3 \
|
||||
libpq-dev
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="22" NODE_MODULE="sass" setup_nodejs
|
||||
setup_uv
|
||||
|
||||
PG_VERSION="16" setup_postgresql
|
||||
PG_DB_NAME="wger" PG_DB_USER="wger" setup_postgresql_db
|
||||
|
||||
fetch_and_deploy_gh_release "wger" "wger-project/wger" "tarball" "latest" "/opt/wger"
|
||||
|
||||
msg_info "Setting up wger"
|
||||
mkdir -p /opt/wger/{static,media}
|
||||
chmod o+w /opt/wger/media
|
||||
cd /opt/wger
|
||||
$STD corepack enable
|
||||
$STD npm install
|
||||
$STD npm run build:css:sass
|
||||
$STD uv venv
|
||||
$STD uv pip install .
|
||||
SECRET_KEY=$(openssl rand -base64 40)
|
||||
cat <<EOF >/opt/wger/.env
|
||||
DJANGO_DB_ENGINE=django.db.backends.postgresql
|
||||
DJANGO_DB_DATABASE=${PG_DB_NAME}
|
||||
DJANGO_DB_USER=${PG_DB_USER}
|
||||
DJANGO_DB_PASSWORD=${PG_DB_PASS}
|
||||
DJANGO_DB_HOST=localhost
|
||||
DJANGO_DB_PORT=5432
|
||||
DJANGO_MEDIA_ROOT=/opt/wger/media
|
||||
DJANGO_STATIC_ROOT=/opt/wger/static
|
||||
SECRET_KEY=${SECRET_KEY}
|
||||
EOF
|
||||
cat <<'WSGI' >/opt/wger/wsgi_wrapper.py
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
env_file = Path('/opt/wger/.env')
|
||||
if env_file.exists():
|
||||
for line in env_file.read_text().splitlines():
|
||||
if line.strip() and not line.startswith('#') and '=' in line:
|
||||
key, value = line.split('=', 1)
|
||||
os.environ.setdefault(key.strip(), value.strip())
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings.main')
|
||||
|
||||
from wger.wsgi import application
|
||||
WSGI
|
||||
set -a && source /opt/wger/.env && set +a
|
||||
export DJANGO_SETTINGS_MODULE=settings.main
|
||||
$STD uv run python manage.py migrate
|
||||
$STD uv run python manage.py loaddata languages
|
||||
$STD uv run python manage.py loaddata gym_config
|
||||
$STD uv run python manage.py loaddata groups
|
||||
$STD uv run python manage.py loaddata site
|
||||
$STD uv run python manage.py collectstatic --no-input
|
||||
cat <<EOF | uv run python manage.py shell
|
||||
from django.contrib.auth import get_user_model
|
||||
UserModel = get_user_model()
|
||||
user = UserModel.objects.create_user('admin', email='admin@localhost', password='${PG_DB_PASS}')
|
||||
user.is_superuser = True
|
||||
user.is_staff = True
|
||||
user.save()
|
||||
EOF
|
||||
msg_ok "Set up wger"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/apache2/sites-available/wger.conf
|
||||
<Directory /opt/wger>
|
||||
<Files wsgi_wrapper.py>
|
||||
Require all granted
|
||||
</Files>
|
||||
</Directory>
|
||||
|
||||
<VirtualHost *:80>
|
||||
WSGIApplicationGroup %{GLOBAL}
|
||||
WSGIDaemonProcess wger python-path=/opt/wger python-home=/opt/wger/.venv
|
||||
WSGIProcessGroup wger
|
||||
WSGIScriptAlias / /opt/wger/wsgi_wrapper.py
|
||||
WSGIPassAuthorization On
|
||||
|
||||
Alias /static/ /opt/wger/static/
|
||||
<Directory /opt/wger/static>
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
Alias /media/ /opt/wger/media/
|
||||
<Directory /opt/wger/media>
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
ErrorLog /var/log/apache2/wger-error.log
|
||||
CustomLog /var/log/apache2/wger-access.log combined
|
||||
</VirtualHost>
|
||||
EOF
|
||||
$STD a2dissite 000-default.conf
|
||||
$STD a2ensite wger
|
||||
systemctl restart apache2
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@ -24,7 +24,7 @@ msg_ok "Installed dependencies"
|
||||
NODE_VERSION="24" NODE_MODULE="pnpm" setup_nodejs
|
||||
fetch_and_deploy_gh_release "wishlist" "cmintey/wishlist" "tarball"
|
||||
LATEST_APP_VERSION=$(get_latest_github_release "cmintey/wishlist" false)
|
||||
import_local_ip
|
||||
|
||||
|
||||
msg_info "Installing Wishlist"
|
||||
cd /opt/wishlist
|
||||
|
||||
@ -196,11 +196,17 @@ ensure_usr_local_bin_persist() {
|
||||
|
||||
download_with_progress() {
|
||||
# $1 url, $2 dest
|
||||
local url="$1" out="$2" cl
|
||||
local url="$1" out="$2" content_length
|
||||
need_tool curl pv || return 1
|
||||
cl=$(curl -fsSLI "$url" 2>/dev/null | awk 'tolower($0) ~ /^content-length:/ {print $2}' | tr -d '\r')
|
||||
if [ -n "$cl" ]; then
|
||||
curl -fsSL "$url" | pv -s "$cl" >"$out" || {
|
||||
|
||||
content_length=$(
|
||||
curl -fsSLI "$url" 2>/dev/null |
|
||||
awk '(tolower($1) ~ /^content-length:/) && ($2 + 0 > 0) {print $2+0}' |
|
||||
tail -1 | tr -cd '[:digit:]' || true
|
||||
)
|
||||
|
||||
if [ -n "$content_length" ]; then
|
||||
curl -fsSL "$url" | pv -s "$content_length" >"$out" || {
|
||||
msg_error "Download failed: $url"
|
||||
return 1
|
||||
}
|
||||
@ -277,7 +283,7 @@ fetch_and_deploy_gh_release() {
|
||||
# $1 app, $2 repo, [$3 mode], [$4 version], [$5 target], [$6 asset_pattern
|
||||
local app="$1" repo="$2" mode="${3:-tarball}" version="${4:-latest}" target="${5:-/opt/$1}" pattern="${6:-}"
|
||||
local app_lc
|
||||
app_lc="$(lower "$app" | tr -d ' ')"
|
||||
app_lc=$(lower "$app" | tr -d ' ')
|
||||
local vfile="$HOME/.${app_lc}"
|
||||
local json url filename tmpd unpack
|
||||
|
||||
@ -288,7 +294,7 @@ fetch_and_deploy_gh_release() {
|
||||
need_tool curl jq tar || return 1
|
||||
[ "$mode" = "prebuild" ] || [ "$mode" = "singlefile" ] && need_tool unzip >/dev/null 2>&1 || true
|
||||
|
||||
tmpd="$(mktemp -d)" || return 1
|
||||
tmpd=$(mktemp -d) || return 1
|
||||
mkdir -p "$target"
|
||||
|
||||
# Release JSON (with token/rate-limit handling)
|
||||
@ -305,10 +311,10 @@ fetch_and_deploy_gh_release() {
|
||||
return 1
|
||||
}
|
||||
fi
|
||||
json="$(cat "$tmpd/release.json")"
|
||||
json=$(cat "$tmpd/release.json")
|
||||
|
||||
# correct Version
|
||||
version="$(printf '%s' "$json" | jq -r '.tag_name // empty')"
|
||||
version=$(printf '%s' "$json" | jq -r '.tag_name // empty')
|
||||
version="${version#v}"
|
||||
|
||||
[ -z "$version" ] && {
|
||||
@ -317,9 +323,15 @@ fetch_and_deploy_gh_release() {
|
||||
return 1
|
||||
}
|
||||
|
||||
get_url() {
|
||||
printf '%s' "$json" | jq -r '.assets[].browser_download_url' |
|
||||
awk -v p="$pattern" 'BEGIN{IGNORECASE=1} $0 ~ p {print; exit}' |
|
||||
tr -d '[:cntrl:]'
|
||||
}
|
||||
|
||||
case "$mode" in
|
||||
tarball | source)
|
||||
url="$(printf '%s' "$json" | jq -r '.tarball_url // empty')"
|
||||
url=$(printf '%s' "$json" | jq -r '.tarball_url // empty')
|
||||
[ -z "$url" ] && url="https://github.com/$repo/archive/refs/tags/v$version.tar.gz"
|
||||
filename="${app_lc}-${version}.tar.gz"
|
||||
download_with_progress "$url" "$tmpd/$filename" || {
|
||||
@ -331,7 +343,7 @@ fetch_and_deploy_gh_release() {
|
||||
rm -rf "$tmpd"
|
||||
return 1
|
||||
}
|
||||
unpack="$(find "$tmpd" -mindepth 1 -maxdepth 1 -type d | head -n1)"
|
||||
unpack=$(find "$tmpd" -mindepth 1 -maxdepth 1 -type d | head -n1)
|
||||
[ "${CLEAN_INSTALL:-0}" = "1" ] && rm -rf "${target:?}/"*
|
||||
# copy content of unpack to target
|
||||
(cd "$unpack" && tar -cf - .) | (cd "$target" && tar -xf -) || {
|
||||
@ -342,7 +354,7 @@ fetch_and_deploy_gh_release() {
|
||||
;;
|
||||
binary)
|
||||
[ -n "$pattern" ] || pattern="*.apk"
|
||||
url="$(printf '%s' "$json" | jq -r '.assets[].browser_download_url' | awk -v p="$pattern" 'BEGIN{IGNORECASE=1} $0 ~ p {print; exit}')"
|
||||
url=$(get_url)
|
||||
[ -z "$url" ] && {
|
||||
msg_error "binary asset not found for pattern: $pattern"
|
||||
rm -rf "$tmpd"
|
||||
@ -374,10 +386,7 @@ fetch_and_deploy_gh_release() {
|
||||
rm -rf "$tmpd"
|
||||
return 1
|
||||
}
|
||||
url="$(printf '%s' "$json" | jq -r '.assets[].browser_download_url' | awk -v p="$pattern" '
|
||||
BEGIN{IGNORECASE=1}
|
||||
$0 ~ p {print; exit}
|
||||
')"
|
||||
url=$(get_url)
|
||||
[ -z "$url" ] && {
|
||||
msg_error "asset not found for pattern: $pattern"
|
||||
rm -rf "$tmpd"
|
||||
@ -411,7 +420,7 @@ fetch_and_deploy_gh_release() {
|
||||
[ "${CLEAN_INSTALL:-0}" = "1" ] && rm -rf "${target:?}/"*
|
||||
# top-level folder strippen
|
||||
if [ "$(find "$tmpd/unp" -mindepth 1 -maxdepth 1 -type d | wc -l)" -eq 1 ] && [ -z "$(find "$tmpd/unp" -mindepth 1 -maxdepth 1 -type f | head -n1)" ]; then
|
||||
unpack="$(find "$tmpd/unp" -mindepth 1 -maxdepth 1 -type d)"
|
||||
unpack=$(find "$tmpd/unp" -mindepth 1 -maxdepth 1 -type d)
|
||||
(cd "$unpack" && tar -cf - .) | (cd "$target" && tar -xf -) || {
|
||||
msg_error "copy failed"
|
||||
rm -rf "$tmpd"
|
||||
@ -431,10 +440,7 @@ fetch_and_deploy_gh_release() {
|
||||
rm -rf "$tmpd"
|
||||
return 1
|
||||
}
|
||||
url="$(printf '%s' "$json" | jq -r '.assets[].browser_download_url' | awk -v p="$pattern" '
|
||||
BEGIN{IGNORECASE=1}
|
||||
$0 ~ p {print; exit}
|
||||
')"
|
||||
url=$(get_url)
|
||||
[ -z "$url" ] && {
|
||||
msg_error "asset not found for pattern: $pattern"
|
||||
rm -rf "$tmpd"
|
||||
|
||||
155
misc/api.func
155
misc/api.func
@ -1,6 +1,6 @@
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: michelroegl-brunner
|
||||
# License: MIT | https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/LICENSE
|
||||
# License: MIT | https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/LICENSE
|
||||
|
||||
# ==============================================================================
|
||||
# API.FUNC - TELEMETRY & DIAGNOSTICS API
|
||||
@ -36,14 +36,16 @@
|
||||
#
|
||||
# - Maps numeric exit codes to human-readable error descriptions
|
||||
# - Supports:
|
||||
# * Generic/Shell errors (1, 2, 126, 127, 128, 130, 137, 139, 143)
|
||||
# * Package manager errors (APT, DPKG: 100, 101, 255)
|
||||
# * Node.js/npm errors (243-249, 254)
|
||||
# * Python/pip/uv errors (210-212)
|
||||
# * PostgreSQL errors (231-234)
|
||||
# * MySQL/MariaDB errors (241-244)
|
||||
# * MongoDB errors (251-254)
|
||||
# * Generic/Shell errors (1, 2, 124, 126-130, 134, 137, 139, 141, 143)
|
||||
# * curl/wget errors (6, 7, 22, 28, 35)
|
||||
# * Package manager errors (APT, DPKG: 100-102, 255)
|
||||
# * Systemd/Service errors (150-154)
|
||||
# * Python/pip/uv errors (160-162)
|
||||
# * PostgreSQL errors (170-173)
|
||||
# * MySQL/MariaDB errors (180-183)
|
||||
# * MongoDB errors (190-193)
|
||||
# * Proxmox custom codes (200-231)
|
||||
# * Node.js/npm errors (243, 245-249)
|
||||
# - Returns description string for given exit code
|
||||
# - Shared function with error_handler.func for consistency
|
||||
# ------------------------------------------------------------------------------
|
||||
@ -53,73 +55,98 @@ explain_exit_code() {
|
||||
# --- Generic / Shell ---
|
||||
1) echo "General error / Operation not permitted" ;;
|
||||
2) echo "Misuse of shell builtins (e.g. syntax error)" ;;
|
||||
126) echo "Command invoked cannot execute (permission problem?)" ;;
|
||||
127) echo "Command not found" ;;
|
||||
128) echo "Invalid argument to exit" ;;
|
||||
130) echo "Terminated by Ctrl+C (SIGINT)" ;;
|
||||
137) echo "Killed (SIGKILL / Out of memory?)" ;;
|
||||
139) echo "Segmentation fault (core dumped)" ;;
|
||||
143) echo "Terminated (SIGTERM)" ;;
|
||||
|
||||
# --- curl / wget errors (commonly seen in downloads) ---
|
||||
6) echo "curl: DNS resolution failed (could not resolve host)" ;;
|
||||
7) echo "curl: Failed to connect (network unreachable / host down)" ;;
|
||||
22) echo "curl: HTTP error returned (404, 429, 500+)" ;;
|
||||
28) echo "curl: Operation timeout (network slow or server not responding)" ;;
|
||||
35) echo "curl: SSL/TLS handshake failed (certificate error)" ;;
|
||||
|
||||
# --- Package manager / APT / DPKG ---
|
||||
100) echo "APT: Package manager error (broken packages / dependency problems)" ;;
|
||||
101) echo "APT: Configuration error (bad sources.list, malformed config)" ;;
|
||||
255) echo "DPKG: Fatal internal error" ;;
|
||||
102) echo "APT: Lock held by another process (dpkg/apt still running)" ;;
|
||||
|
||||
# --- Node.js / npm / pnpm / yarn ---
|
||||
# --- Common shell/system errors ---
|
||||
124) echo "Command timed out (timeout command)" ;;
|
||||
126) echo "Command invoked cannot execute (permission problem?)" ;;
|
||||
127) echo "Command not found" ;;
|
||||
128) echo "Invalid argument to exit" ;;
|
||||
130) echo "Terminated by Ctrl+C (SIGINT)" ;;
|
||||
134) echo "Process aborted (SIGABRT - possibly Node.js heap overflow)" ;;
|
||||
137) echo "Killed (SIGKILL / Out of memory?)" ;;
|
||||
139) echo "Segmentation fault (core dumped)" ;;
|
||||
141) echo "Broken pipe (SIGPIPE - output closed prematurely)" ;;
|
||||
143) echo "Terminated (SIGTERM)" ;;
|
||||
|
||||
# --- Systemd / Service errors (150-154) ---
|
||||
150) echo "Systemd: Service failed to start" ;;
|
||||
151) echo "Systemd: Service unit not found" ;;
|
||||
152) echo "Permission denied (EACCES)" ;;
|
||||
153) echo "Build/compile failed (make/gcc/cmake)" ;;
|
||||
154) echo "Node.js: Native addon build failed (node-gyp)" ;;
|
||||
|
||||
# --- Python / pip / uv (160-162) ---
|
||||
160) echo "Python: Virtualenv / uv environment missing or broken" ;;
|
||||
161) echo "Python: Dependency resolution failed" ;;
|
||||
162) echo "Python: Installation aborted (permissions or EXTERNALLY-MANAGED)" ;;
|
||||
|
||||
# --- PostgreSQL (170-173) ---
|
||||
170) echo "PostgreSQL: Connection failed (server not running / wrong socket)" ;;
|
||||
171) echo "PostgreSQL: Authentication failed (bad user/password)" ;;
|
||||
172) echo "PostgreSQL: Database does not exist" ;;
|
||||
173) echo "PostgreSQL: Fatal error in query / syntax" ;;
|
||||
|
||||
# --- MySQL / MariaDB (180-183) ---
|
||||
180) echo "MySQL/MariaDB: Connection failed (server not running / wrong socket)" ;;
|
||||
181) echo "MySQL/MariaDB: Authentication failed (bad user/password)" ;;
|
||||
182) echo "MySQL/MariaDB: Database does not exist" ;;
|
||||
183) echo "MySQL/MariaDB: Fatal error in query / syntax" ;;
|
||||
|
||||
# --- MongoDB (190-193) ---
|
||||
190) echo "MongoDB: Connection failed (server not running)" ;;
|
||||
191) echo "MongoDB: Authentication failed (bad user/password)" ;;
|
||||
192) echo "MongoDB: Database not found" ;;
|
||||
193) echo "MongoDB: Fatal query error" ;;
|
||||
|
||||
# --- Proxmox Custom Codes (200-231) ---
|
||||
200) echo "Proxmox: Failed to create lock file" ;;
|
||||
203) echo "Proxmox: Missing CTID variable" ;;
|
||||
204) echo "Proxmox: Missing PCT_OSTYPE variable" ;;
|
||||
205) echo "Proxmox: Invalid CTID (<100)" ;;
|
||||
206) echo "Proxmox: CTID already in use" ;;
|
||||
207) echo "Proxmox: Password contains unescaped special characters" ;;
|
||||
208) echo "Proxmox: Invalid configuration (DNS/MAC/Network format)" ;;
|
||||
209) echo "Proxmox: Container creation failed" ;;
|
||||
210) echo "Proxmox: Cluster not quorate" ;;
|
||||
211) echo "Proxmox: Timeout waiting for template lock" ;;
|
||||
212) echo "Proxmox: Storage type 'iscsidirect' does not support containers (VMs only)" ;;
|
||||
213) echo "Proxmox: Storage type does not support 'rootdir' content" ;;
|
||||
214) echo "Proxmox: Not enough storage space" ;;
|
||||
215) echo "Proxmox: Container created but not listed (ghost state)" ;;
|
||||
216) echo "Proxmox: RootFS entry missing in config" ;;
|
||||
217) echo "Proxmox: Storage not accessible" ;;
|
||||
218) echo "Proxmox: Template file corrupted or incomplete" ;;
|
||||
219) echo "Proxmox: CephFS does not support containers - use RBD" ;;
|
||||
220) echo "Proxmox: Unable to resolve template path" ;;
|
||||
221) echo "Proxmox: Template file not readable" ;;
|
||||
222) echo "Proxmox: Template download failed" ;;
|
||||
223) echo "Proxmox: Template not available after download" ;;
|
||||
224) echo "Proxmox: PBS storage is for backups only" ;;
|
||||
225) echo "Proxmox: No template available for OS/Version" ;;
|
||||
231) echo "Proxmox: LXC stack upgrade failed" ;;
|
||||
|
||||
# --- Node.js / npm / pnpm / yarn (243-249) ---
|
||||
243) echo "Node.js: Out of memory (JavaScript heap out of memory)" ;;
|
||||
245) echo "Node.js: Invalid command-line option" ;;
|
||||
246) echo "Node.js: Internal JavaScript Parse Error" ;;
|
||||
247) echo "Node.js: Fatal internal error" ;;
|
||||
248) echo "Node.js: Invalid C++ addon / N-API failure" ;;
|
||||
249) echo "Node.js: Inspector error" ;;
|
||||
254) echo "npm/pnpm/yarn: Unknown fatal error" ;;
|
||||
249) echo "npm/pnpm/yarn: Unknown fatal error" ;;
|
||||
|
||||
# --- Python / pip / uv ---
|
||||
210) echo "Python: Virtualenv / uv environment missing or broken" ;;
|
||||
211) echo "Python: Dependency resolution failed" ;;
|
||||
212) echo "Python: Installation aborted (permissions or EXTERNALLY-MANAGED)" ;;
|
||||
|
||||
# --- PostgreSQL ---
|
||||
231) echo "PostgreSQL: Connection failed (server not running / wrong socket)" ;;
|
||||
232) echo "PostgreSQL: Authentication failed (bad user/password)" ;;
|
||||
233) echo "PostgreSQL: Database does not exist" ;;
|
||||
234) echo "PostgreSQL: Fatal error in query / syntax" ;;
|
||||
|
||||
# --- MySQL / MariaDB ---
|
||||
241) echo "MySQL/MariaDB: Connection failed (server not running / wrong socket)" ;;
|
||||
242) echo "MySQL/MariaDB: Authentication failed (bad user/password)" ;;
|
||||
243) echo "MySQL/MariaDB: Database does not exist" ;;
|
||||
244) echo "MySQL/MariaDB: Fatal error in query / syntax" ;;
|
||||
|
||||
# --- MongoDB ---
|
||||
251) echo "MongoDB: Connection failed (server not running)" ;;
|
||||
252) echo "MongoDB: Authentication failed (bad user/password)" ;;
|
||||
253) echo "MongoDB: Database not found" ;;
|
||||
254) echo "MongoDB: Fatal query error" ;;
|
||||
|
||||
# --- Proxmox Custom Codes ---
|
||||
200) echo "Custom: Failed to create lock file" ;;
|
||||
203) echo "Custom: Missing CTID variable" ;;
|
||||
204) echo "Custom: Missing PCT_OSTYPE variable" ;;
|
||||
205) echo "Custom: Invalid CTID (<100)" ;;
|
||||
206) echo "Custom: CTID already in use (check 'pct list' and /etc/pve/lxc/)" ;;
|
||||
207) echo "Custom: Password contains unescaped special characters (-, /, \\, *, etc.)" ;;
|
||||
208) echo "Custom: Invalid configuration (DNS/MAC/Network format error)" ;;
|
||||
209) echo "Custom: Container creation failed (check logs for pct create output)" ;;
|
||||
210) echo "Custom: Cluster not quorate" ;;
|
||||
211) echo "Custom: Timeout waiting for template lock (concurrent download in progress)" ;;
|
||||
214) echo "Custom: Not enough storage space" ;;
|
||||
215) echo "Custom: Container created but not listed (ghost state - check /etc/pve/lxc/)" ;;
|
||||
216) echo "Custom: RootFS entry missing in config (incomplete creation)" ;;
|
||||
217) echo "Custom: Storage does not support rootdir (check storage capabilities)" ;;
|
||||
218) echo "Custom: Template file corrupted or incomplete download (size <1MB or invalid archive)" ;;
|
||||
220) echo "Custom: Unable to resolve template path" ;;
|
||||
221) echo "Custom: Template file exists but not readable (check file permissions)" ;;
|
||||
222) echo "Custom: Template download failed after 3 attempts (network/storage issue)" ;;
|
||||
223) echo "Custom: Template not available after download (storage sync issue)" ;;
|
||||
225) echo "Custom: No template available for OS/Version (check 'pveam available')" ;;
|
||||
231) echo "Custom: LXC stack upgrade/retry failed (outdated pve-container - check https://github.com/community-scripts/ProxmoxVE/discussions/8126)" ;;
|
||||
# --- DPKG ---
|
||||
255) echo "DPKG: Fatal internal error" ;;
|
||||
|
||||
# --- Default ---
|
||||
*) echo "Unknown error" ;;
|
||||
|
||||
1396
misc/build.func
1396
misc/build.func
File diff suppressed because it is too large
Load Diff
735
misc/core.func
735
misc/core.func
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# License: MIT | https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/LICENSE
|
||||
# License: MIT | https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/LICENSE
|
||||
|
||||
# ==============================================================================
|
||||
# CORE FUNCTIONS - LXC CONTAINER UTILITIES
|
||||
@ -123,9 +123,38 @@ icons() {
|
||||
CREATING="${TAB}🚀${TAB}${CL}"
|
||||
ADVANCED="${TAB}🧩${TAB}${CL}"
|
||||
FUSE="${TAB}🗂️${TAB}${CL}"
|
||||
GPU="${TAB}🎮${TAB}${CL}"
|
||||
HOURGLASS="${TAB}⏳${TAB}"
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# ensure_profile_loaded()
|
||||
#
|
||||
# - Sources /etc/profile.d/*.sh scripts if not already loaded
|
||||
# - Fixes PATH issues when running via pct enter/exec (non-login shells)
|
||||
# - Safe to call multiple times (uses guard variable)
|
||||
# - Should be called in update_script() or any script running inside LXC
|
||||
# ------------------------------------------------------------------------------
|
||||
ensure_profile_loaded() {
|
||||
# Skip if already loaded or running on Proxmox host
|
||||
[[ -n "${_PROFILE_LOADED:-}" ]] && return
|
||||
command -v pveversion &>/dev/null && return
|
||||
|
||||
# Source all profile.d scripts to ensure PATH is complete
|
||||
if [[ -d /etc/profile.d ]]; then
|
||||
for script in /etc/profile.d/*.sh; do
|
||||
[[ -r "$script" ]] && source "$script"
|
||||
done
|
||||
fi
|
||||
|
||||
# Also ensure /usr/local/bin is in PATH (common install location)
|
||||
if [[ ":$PATH:" != *":/usr/local/bin:"* ]]; then
|
||||
export PATH="/usr/local/bin:$PATH"
|
||||
fi
|
||||
|
||||
export _PROFILE_LOADED=1
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# default_vars()
|
||||
#
|
||||
@ -523,11 +552,8 @@ msg_info() {
|
||||
if ! declare -p MSG_INFO_SHOWN &>/dev/null || ! declare -A MSG_INFO_SHOWN &>/dev/null; then
|
||||
declare -gA MSG_INFO_SHOWN=()
|
||||
fi
|
||||
# Sanitize message for use as associative array key (remove ANSI codes and special chars)
|
||||
local sanitized_msg
|
||||
sanitized_msg=$(printf '%s' "$msg" | sed 's/\x1b\[[0-9;]*m//g; s/[^a-zA-Z0-9_]/_/g')
|
||||
[[ -n "${MSG_INFO_SHOWN["$sanitized_msg"]+x}" ]] && return
|
||||
MSG_INFO_SHOWN["$sanitized_msg"]=1
|
||||
[[ -n "${MSG_INFO_SHOWN["$msg"]+x}" ]] && return
|
||||
MSG_INFO_SHOWN["$msg"]=1
|
||||
|
||||
stop_spinner
|
||||
SPINNER_MSG="$msg"
|
||||
@ -572,7 +598,6 @@ msg_ok() {
|
||||
stop_spinner
|
||||
clear_line
|
||||
echo -e "$CM ${GN}${msg}${CL}"
|
||||
# Sanitize message for use as associative array key (remove ANSI codes and special chars)
|
||||
local sanitized_msg
|
||||
sanitized_msg=$(printf '%s' "$msg" | sed 's/\x1b\[[0-9;]*m//g; s/[^a-zA-Z0-9_]/_/g')
|
||||
unset 'MSG_INFO_SHOWN['"$sanitized_msg"']' 2>/dev/null || true
|
||||
@ -689,7 +714,7 @@ exit_script() {
|
||||
# ------------------------------------------------------------------------------
|
||||
get_header() {
|
||||
local app_name=$(echo "${APP,,}" | tr -d ' ')
|
||||
local app_type=${APP_TYPE:-ct} # Default zu 'ct' falls nicht gesetzt
|
||||
local app_type=${APP_TYPE:-ct} # Default to 'ct' if not set
|
||||
local header_url="https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/${app_type}/headers/${app_name}"
|
||||
local local_header_path="/usr/local/community-scripts/headers/${app_type}/${app_name}"
|
||||
|
||||
@ -785,6 +810,562 @@ is_verbose_mode() {
|
||||
[[ "$verbose" != "no" || ! -t 2 ]]
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# is_unattended()
|
||||
#
|
||||
# - Detects if script is running in unattended/non-interactive mode
|
||||
# - Checks MODE variable first (primary method)
|
||||
# - Falls back to legacy flags (PHS_SILENT, var_unattended)
|
||||
# - Returns 0 (true) if unattended, 1 (false) otherwise
|
||||
# - Used by prompt functions to auto-apply defaults
|
||||
#
|
||||
# Modes that are unattended:
|
||||
# - default (1) : Use script defaults, no prompts
|
||||
# - mydefaults (3) : Use user's default.vars, no prompts
|
||||
# - appdefaults (4) : Use app-specific defaults, no prompts
|
||||
#
|
||||
# Modes that are interactive:
|
||||
# - advanced (2) : Full wizard with all options
|
||||
#
|
||||
# Note: Even in advanced mode, install scripts run unattended because
|
||||
# all values are already collected during the wizard phase.
|
||||
# ------------------------------------------------------------------------------
|
||||
is_unattended() {
|
||||
# Primary: Check MODE variable (case-insensitive)
|
||||
local mode="${MODE:-${mode:-}}"
|
||||
mode="${mode,,}" # lowercase
|
||||
|
||||
case "$mode" in
|
||||
default|1)
|
||||
return 0
|
||||
;;
|
||||
mydefaults|userdefaults|3)
|
||||
return 0
|
||||
;;
|
||||
appdefaults|4)
|
||||
return 0
|
||||
;;
|
||||
advanced|2)
|
||||
# Advanced mode is interactive ONLY during wizard
|
||||
# Inside container (install scripts), it should be unattended
|
||||
# Check if we're inside a container (no pveversion command)
|
||||
if ! command -v pveversion &>/dev/null; then
|
||||
# We're inside the container - all values already collected
|
||||
return 0
|
||||
fi
|
||||
# On host during wizard - interactive
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Legacy fallbacks for compatibility
|
||||
[[ "${PHS_SILENT:-0}" == "1" ]] && return 0
|
||||
[[ "${var_unattended:-}" =~ ^(yes|true|1)$ ]] && return 0
|
||||
[[ "${UNATTENDED:-}" =~ ^(yes|true|1)$ ]] && return 0
|
||||
|
||||
# No TTY available = unattended
|
||||
[[ ! -t 0 ]] && return 0
|
||||
|
||||
# Default: interactive
|
||||
return 1
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# show_missing_values_warning()
|
||||
#
|
||||
# - Displays a summary of required values that used fallback defaults
|
||||
# - Should be called at the end of install scripts
|
||||
# - Only shows warning if MISSING_REQUIRED_VALUES array has entries
|
||||
# - Provides clear guidance on what needs manual configuration
|
||||
#
|
||||
# Global:
|
||||
# MISSING_REQUIRED_VALUES - Array of variable names that need configuration
|
||||
#
|
||||
# Example:
|
||||
# # At end of install script:
|
||||
# show_missing_values_warning
|
||||
# ------------------------------------------------------------------------------
|
||||
show_missing_values_warning() {
|
||||
if [[ ${#MISSING_REQUIRED_VALUES[@]} -gt 0 ]]; then
|
||||
echo ""
|
||||
echo -e "${YW}╔════════════════════════════════════════════════════════════╗${CL}"
|
||||
echo -e "${YW}║ ⚠️ MANUAL CONFIGURATION REQUIRED ║${CL}"
|
||||
echo -e "${YW}╠════════════════════════════════════════════════════════════╣${CL}"
|
||||
echo -e "${YW}║ The following values were not provided and need to be ║${CL}"
|
||||
echo -e "${YW}║ configured manually for the service to work properly: ║${CL}"
|
||||
echo -e "${YW}╟────────────────────────────────────────────────────────────╢${CL}"
|
||||
for val in "${MISSING_REQUIRED_VALUES[@]}"; do
|
||||
printf "${YW}║${CL} • %-56s ${YW}║${CL}\n" "$val"
|
||||
done
|
||||
echo -e "${YW}╟────────────────────────────────────────────────────────────╢${CL}"
|
||||
echo -e "${YW}║ Check the service configuration files or environment ║${CL}"
|
||||
echo -e "${YW}║ variables and update the placeholder values. ║${CL}"
|
||||
echo -e "${YW}╚════════════════════════════════════════════════════════════╝${CL}"
|
||||
echo ""
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# prompt_confirm()
|
||||
#
|
||||
# - Prompts user for yes/no confirmation with timeout and unattended support
|
||||
# - In unattended mode: immediately returns default value
|
||||
# - In interactive mode: waits for user input with configurable timeout
|
||||
# - After timeout: auto-applies default value
|
||||
#
|
||||
# Arguments:
|
||||
# $1 - Prompt message (required)
|
||||
# $2 - Default value: "y" or "n" (optional, default: "n")
|
||||
# $3 - Timeout in seconds (optional, default: 60)
|
||||
#
|
||||
# Returns:
|
||||
# 0 - User confirmed (yes)
|
||||
# 1 - User declined (no) or timeout with default "n"
|
||||
#
|
||||
# Example:
|
||||
# if prompt_confirm "Proceed with installation?" "y" 30; then
|
||||
# echo "Installing..."
|
||||
# fi
|
||||
#
|
||||
# # Unattended: prompt_confirm will use default without waiting
|
||||
# var_unattended=yes
|
||||
# prompt_confirm "Delete files?" "n" && echo "Deleting" || echo "Skipped"
|
||||
# ------------------------------------------------------------------------------
|
||||
prompt_confirm() {
|
||||
local message="${1:-Confirm?}"
|
||||
local default="${2:-n}"
|
||||
local timeout="${3:-60}"
|
||||
local response
|
||||
|
||||
# Normalize default to lowercase
|
||||
default="${default,,}"
|
||||
[[ "$default" != "y" ]] && default="n"
|
||||
|
||||
# Build prompt hint
|
||||
local hint
|
||||
if [[ "$default" == "y" ]]; then
|
||||
hint="[Y/n]"
|
||||
else
|
||||
hint="[y/N]"
|
||||
fi
|
||||
|
||||
# Unattended mode: apply default immediately
|
||||
if is_unattended; then
|
||||
if [[ "$default" == "y" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if running in a TTY
|
||||
if [[ ! -t 0 ]]; then
|
||||
# Not a TTY, use default
|
||||
if [[ "$default" == "y" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Interactive prompt with timeout
|
||||
echo -en "${YW}${message} ${hint} (auto-${default} in ${timeout}s): ${CL}"
|
||||
|
||||
if read -t "$timeout" -r response; then
|
||||
# User provided input
|
||||
response="${response,,}" # lowercase
|
||||
case "$response" in
|
||||
y|yes)
|
||||
return 0
|
||||
;;
|
||||
n|no)
|
||||
return 1
|
||||
;;
|
||||
"")
|
||||
# Empty response, use default
|
||||
if [[ "$default" == "y" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# Invalid input, use default
|
||||
echo -e "${YW}Invalid response, using default: ${default}${CL}"
|
||||
if [[ "$default" == "y" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
# Timeout occurred
|
||||
echo "" # Newline after timeout
|
||||
echo -e "${YW}Timeout - auto-selecting: ${default}${CL}"
|
||||
if [[ "$default" == "y" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# prompt_input()
|
||||
#
|
||||
# - Prompts user for text input with timeout and unattended support
|
||||
# - In unattended mode: immediately returns default value
|
||||
# - In interactive mode: waits for user input with configurable timeout
|
||||
# - After timeout: auto-applies default value
|
||||
#
|
||||
# Arguments:
|
||||
# $1 - Prompt message (required)
|
||||
# $2 - Default value (optional, default: "")
|
||||
# $3 - Timeout in seconds (optional, default: 60)
|
||||
#
|
||||
# Output:
|
||||
# Prints the user input or default value to stdout
|
||||
#
|
||||
# Example:
|
||||
# username=$(prompt_input "Enter username:" "admin" 30)
|
||||
# echo "Using username: $username"
|
||||
#
|
||||
# # With validation
|
||||
# while true; do
|
||||
# port=$(prompt_input "Enter port:" "8080" 30)
|
||||
# [[ "$port" =~ ^[0-9]+$ ]] && break
|
||||
# echo "Invalid port number"
|
||||
# done
|
||||
# ------------------------------------------------------------------------------
|
||||
prompt_input() {
|
||||
local message="${1:-Enter value:}"
|
||||
local default="${2:-}"
|
||||
local timeout="${3:-60}"
|
||||
local response
|
||||
|
||||
# Build display default hint
|
||||
local hint=""
|
||||
[[ -n "$default" ]] && hint=" (default: ${default})"
|
||||
|
||||
# Unattended mode: return default immediately
|
||||
if is_unattended; then
|
||||
echo "$default"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Check if running in a TTY
|
||||
if [[ ! -t 0 ]]; then
|
||||
# Not a TTY, use default
|
||||
echo "$default"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Interactive prompt with timeout
|
||||
echo -en "${YW}${message}${hint} (auto-default in ${timeout}s): ${CL}" >&2
|
||||
|
||||
if read -t "$timeout" -r response; then
|
||||
# User provided input (or pressed Enter for empty)
|
||||
if [[ -n "$response" ]]; then
|
||||
echo "$response"
|
||||
else
|
||||
echo "$default"
|
||||
fi
|
||||
else
|
||||
# Timeout occurred
|
||||
echo "" >&2 # Newline after timeout
|
||||
echo -e "${YW}Timeout - using default: ${default}${CL}" >&2
|
||||
echo "$default"
|
||||
fi
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# prompt_input_required()
|
||||
#
|
||||
# - Prompts user for REQUIRED text input with fallback support
|
||||
# - In unattended mode: Uses fallback value if no env var set (with warning)
|
||||
# - In interactive mode: loops until user provides non-empty input
|
||||
# - Tracks missing required values for end-of-script summary
|
||||
#
|
||||
# Arguments:
|
||||
# $1 - Prompt message (required)
|
||||
# $2 - Fallback/example value for unattended mode (optional)
|
||||
# $3 - Timeout in seconds (optional, default: 120)
|
||||
# $4 - Environment variable name hint for error messages (optional)
|
||||
#
|
||||
# Output:
|
||||
# Prints the user input or fallback value to stdout
|
||||
#
|
||||
# Returns:
|
||||
# 0 - Success (value provided or fallback used)
|
||||
# 1 - Failed (interactive timeout without input)
|
||||
#
|
||||
# Global:
|
||||
# MISSING_REQUIRED_VALUES - Array tracking fields that used fallbacks
|
||||
#
|
||||
# Example:
|
||||
# # With fallback - script continues even in unattended mode
|
||||
# token=$(prompt_input_required "Enter API Token:" "YOUR_TOKEN_HERE" 60 "var_api_token")
|
||||
#
|
||||
# # Check at end of script if any values need manual configuration
|
||||
# if [[ ${#MISSING_REQUIRED_VALUES[@]} -gt 0 ]]; then
|
||||
# msg_warn "Please configure: ${MISSING_REQUIRED_VALUES[*]}"
|
||||
# fi
|
||||
# ------------------------------------------------------------------------------
|
||||
# Global array to track missing required values
|
||||
declare -g -a MISSING_REQUIRED_VALUES=()
|
||||
|
||||
prompt_input_required() {
|
||||
local message="${1:-Enter required value:}"
|
||||
local fallback="${2:-CHANGE_ME}"
|
||||
local timeout="${3:-120}"
|
||||
local env_var_hint="${4:-}"
|
||||
local response=""
|
||||
|
||||
# Check if value is already set via environment variable (if hint provided)
|
||||
if [[ -n "$env_var_hint" ]]; then
|
||||
local env_value="${!env_var_hint:-}"
|
||||
if [[ -n "$env_value" ]]; then
|
||||
echo "$env_value"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Unattended mode: use fallback with warning
|
||||
if is_unattended; then
|
||||
if [[ -n "$env_var_hint" ]]; then
|
||||
echo -e "${YW}⚠ Required value '${env_var_hint}' not set - using fallback: ${fallback}${CL}" >&2
|
||||
MISSING_REQUIRED_VALUES+=("$env_var_hint")
|
||||
else
|
||||
echo -e "${YW}⚠ Required value not provided - using fallback: ${fallback}${CL}" >&2
|
||||
MISSING_REQUIRED_VALUES+=("(unnamed)")
|
||||
fi
|
||||
echo "$fallback"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Check if running in a TTY
|
||||
if [[ ! -t 0 ]]; then
|
||||
echo -e "${YW}⚠ Not interactive - using fallback: ${fallback}${CL}" >&2
|
||||
MISSING_REQUIRED_VALUES+=("${env_var_hint:-unnamed}")
|
||||
echo "$fallback"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Interactive prompt - loop until non-empty input or use fallback on timeout
|
||||
local attempts=0
|
||||
while [[ -z "$response" ]]; do
|
||||
attempts=$((attempts + 1))
|
||||
|
||||
if [[ $attempts -gt 3 ]]; then
|
||||
echo -e "${YW}Too many empty inputs - using fallback: ${fallback}${CL}" >&2
|
||||
MISSING_REQUIRED_VALUES+=("${env_var_hint:-manual_input}")
|
||||
echo "$fallback"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo -en "${YW}${message} (required, timeout ${timeout}s): ${CL}" >&2
|
||||
|
||||
if read -t "$timeout" -r response; then
|
||||
if [[ -z "$response" ]]; then
|
||||
echo -e "${YW}This field is required. Please enter a value. (attempt ${attempts}/3)${CL}" >&2
|
||||
fi
|
||||
else
|
||||
# Timeout occurred - use fallback
|
||||
echo "" >&2
|
||||
echo -e "${YW}Timeout - using fallback value: ${fallback}${CL}" >&2
|
||||
MISSING_REQUIRED_VALUES+=("${env_var_hint:-timeout}")
|
||||
echo "$fallback"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
echo "$response"
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# prompt_select()
|
||||
#
|
||||
# - Prompts user to select from a list of options with timeout support
|
||||
# - In unattended mode: immediately returns default selection
|
||||
# - In interactive mode: displays numbered menu and waits for choice
|
||||
# - After timeout: auto-applies default selection
|
||||
#
|
||||
# Arguments:
|
||||
# $1 - Prompt message (required)
|
||||
# $2 - Default option number, 1-based (optional, default: 1)
|
||||
# $3 - Timeout in seconds (optional, default: 60)
|
||||
# $4+ - Options to display (required, at least 2)
|
||||
#
|
||||
# Output:
|
||||
# Prints the selected option value to stdout
|
||||
#
|
||||
# Returns:
|
||||
# 0 - Success
|
||||
# 1 - No options provided or invalid state
|
||||
#
|
||||
# Example:
|
||||
# choice=$(prompt_select "Select database:" 1 30 "PostgreSQL" "MySQL" "SQLite")
|
||||
# echo "Selected: $choice"
|
||||
#
|
||||
# # With array
|
||||
# options=("Option A" "Option B" "Option C")
|
||||
# selected=$(prompt_select "Choose:" 2 60 "${options[@]}")
|
||||
# ------------------------------------------------------------------------------
|
||||
prompt_select() {
|
||||
local message="${1:-Select option:}"
|
||||
local default="${2:-1}"
|
||||
local timeout="${3:-60}"
|
||||
shift 3
|
||||
|
||||
local options=("$@")
|
||||
local num_options=${#options[@]}
|
||||
|
||||
# Validate options
|
||||
if [[ $num_options -eq 0 ]]; then
|
||||
echo "" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Validate default
|
||||
if [[ ! "$default" =~ ^[0-9]+$ ]] || [[ "$default" -lt 1 ]] || [[ "$default" -gt "$num_options" ]]; then
|
||||
default=1
|
||||
fi
|
||||
|
||||
# Unattended mode: return default immediately
|
||||
if is_unattended; then
|
||||
echo "${options[$((default - 1))]}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Check if running in a TTY
|
||||
if [[ ! -t 0 ]]; then
|
||||
echo "${options[$((default - 1))]}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Display menu
|
||||
echo -e "${YW}${message}${CL}" >&2
|
||||
local i
|
||||
for i in "${!options[@]}"; do
|
||||
local num=$((i + 1))
|
||||
if [[ $num -eq $default ]]; then
|
||||
echo -e " ${GN}${num})${CL} ${options[$i]} ${YW}(default)${CL}" >&2
|
||||
else
|
||||
echo -e " ${GN}${num})${CL} ${options[$i]}" >&2
|
||||
fi
|
||||
done
|
||||
|
||||
# Interactive prompt with timeout
|
||||
echo -en "${YW}Select [1-${num_options}] (auto-select ${default} in ${timeout}s): ${CL}" >&2
|
||||
|
||||
local response
|
||||
if read -t "$timeout" -r response; then
|
||||
if [[ -z "$response" ]]; then
|
||||
# Empty response, use default
|
||||
echo "${options[$((default - 1))]}"
|
||||
elif [[ "$response" =~ ^[0-9]+$ ]] && [[ "$response" -ge 1 ]] && [[ "$response" -le "$num_options" ]]; then
|
||||
# Valid selection
|
||||
echo "${options[$((response - 1))]}"
|
||||
else
|
||||
# Invalid input, use default
|
||||
echo -e "${YW}Invalid selection, using default: ${options[$((default - 1))]}${CL}" >&2
|
||||
echo "${options[$((default - 1))]}"
|
||||
fi
|
||||
else
|
||||
# Timeout occurred
|
||||
echo "" >&2 # Newline after timeout
|
||||
echo -e "${YW}Timeout - auto-selecting: ${options[$((default - 1))]}${CL}" >&2
|
||||
echo "${options[$((default - 1))]}"
|
||||
fi
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# prompt_password()
|
||||
#
|
||||
# - Prompts user for password input with hidden characters
|
||||
# - In unattended mode: returns default or generates random password
|
||||
# - Supports auto-generation of secure passwords
|
||||
# - After timeout: generates random password if allowed
|
||||
#
|
||||
# Arguments:
|
||||
# $1 - Prompt message (required)
|
||||
# $2 - Default value or "generate" for auto-generation (optional)
|
||||
# $3 - Timeout in seconds (optional, default: 60)
|
||||
# $4 - Minimum length for validation (optional, default: 0 = no minimum)
|
||||
#
|
||||
# Output:
|
||||
# Prints the password to stdout
|
||||
#
|
||||
# Example:
|
||||
# password=$(prompt_password "Enter password:" "generate" 30 8)
|
||||
# echo "Password set"
|
||||
#
|
||||
# # Require user input (no default)
|
||||
# db_pass=$(prompt_password "Database password:" "" 60 12)
|
||||
# ------------------------------------------------------------------------------
|
||||
prompt_password() {
|
||||
local message="${1:-Enter password:}"
|
||||
local default="${2:-}"
|
||||
local timeout="${3:-60}"
|
||||
local min_length="${4:-0}"
|
||||
local response
|
||||
|
||||
# Generate random password if requested
|
||||
local generated=""
|
||||
if [[ "$default" == "generate" ]]; then
|
||||
generated=$(openssl rand -base64 16 2>/dev/null | tr -dc 'a-zA-Z0-9' | head -c 16)
|
||||
[[ -z "$generated" ]] && generated=$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 16)
|
||||
default="$generated"
|
||||
fi
|
||||
|
||||
# Unattended mode: return default immediately
|
||||
if is_unattended; then
|
||||
echo "$default"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Check if running in a TTY
|
||||
if [[ ! -t 0 ]]; then
|
||||
echo "$default"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Build hint
|
||||
local hint=""
|
||||
if [[ -n "$generated" ]]; then
|
||||
hint=" (Enter for auto-generated)"
|
||||
elif [[ -n "$default" ]]; then
|
||||
hint=" (Enter for default)"
|
||||
fi
|
||||
[[ "$min_length" -gt 0 ]] && hint="${hint} [min ${min_length} chars]"
|
||||
|
||||
# Interactive prompt with timeout (silent input)
|
||||
echo -en "${YW}${message}${hint} (timeout ${timeout}s): ${CL}" >&2
|
||||
|
||||
if read -t "$timeout" -rs response; then
|
||||
echo "" >&2 # Newline after hidden input
|
||||
if [[ -n "$response" ]]; then
|
||||
# Validate minimum length
|
||||
if [[ "$min_length" -gt 0 ]] && [[ ${#response} -lt "$min_length" ]]; then
|
||||
echo -e "${YW}Password too short (min ${min_length}), using default${CL}" >&2
|
||||
echo "$default"
|
||||
else
|
||||
echo "$response"
|
||||
fi
|
||||
else
|
||||
echo "$default"
|
||||
fi
|
||||
else
|
||||
# Timeout occurred
|
||||
echo "" >&2 # Newline after timeout
|
||||
echo -e "${YW}Timeout - using generated password${CL}" >&2
|
||||
echo "$default"
|
||||
fi
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# SECTION 6: CLEANUP & MAINTENANCE
|
||||
# ==============================================================================
|
||||
@ -792,71 +1373,64 @@ is_verbose_mode() {
|
||||
# ------------------------------------------------------------------------------
|
||||
# cleanup_lxc()
|
||||
#
|
||||
# - Comprehensive cleanup of package managers, caches, and logs
|
||||
# - Supports Alpine (apk), Debian/Ubuntu (apt), Fedora/Rocky/CentOS (dnf/yum),
|
||||
# openSUSE (zypper), Gentoo (emerge), and language package managers
|
||||
# - Cleans: Python (pip/uv), Node.js (npm/yarn/pnpm), Go, Rust, Ruby, PHP
|
||||
# - Truncates log files and vacuums systemd journal
|
||||
# - Run at end of container creation to minimize disk usage
|
||||
# - Cleans package manager and language caches (safe for installs AND updates)
|
||||
# - Supports Alpine (apk), Debian/Ubuntu (apt), Python, Node.js, Go, Rust, Ruby, PHP
|
||||
# - Uses fallback error handling to prevent cleanup failures from breaking installs
|
||||
# ------------------------------------------------------------------------------
|
||||
cleanup_lxc() {
|
||||
msg_info "Cleaning up"
|
||||
# OS-specific package manager cleanup
|
||||
|
||||
if is_alpine; then
|
||||
$STD apk cache clean 2>/dev/null || true
|
||||
$STD apk cache clean || true
|
||||
rm -rf /var/cache/apk/*
|
||||
elif command -v apt &>/dev/null; then
|
||||
# Debian/Ubuntu/Devuan
|
||||
$STD apt -y autoremove 2>/dev/null || true
|
||||
$STD apt -y autoclean 2>/dev/null || true
|
||||
$STD apt -y clean 2>/dev/null || true
|
||||
elif command -v dnf &>/dev/null; then
|
||||
# Fedora/Rocky/AlmaLinux/CentOS 8+
|
||||
$STD dnf clean all 2>/dev/null || true
|
||||
$STD dnf autoremove -y 2>/dev/null || true
|
||||
elif command -v yum &>/dev/null; then
|
||||
# CentOS 7/older RHEL
|
||||
$STD yum clean all 2>/dev/null || true
|
||||
elif command -v zypper &>/dev/null; then
|
||||
# openSUSE
|
||||
$STD zypper clean --all 2>/dev/null || true
|
||||
elif command -v emerge &>/dev/null; then
|
||||
# Gentoo
|
||||
$STD emerge --quiet --depclean 2>/dev/null || true
|
||||
$STD eclean-dist -d 2>/dev/null || true
|
||||
$STD eclean-pkg -d 2>/dev/null || true
|
||||
else
|
||||
$STD apt -y autoremove 2>/dev/null || msg_warn "apt autoremove failed (non-critical)"
|
||||
$STD apt -y autoclean 2>/dev/null || msg_warn "apt autoclean failed (non-critical)"
|
||||
$STD apt -y clean 2>/dev/null || msg_warn "apt clean failed (non-critical)"
|
||||
fi
|
||||
|
||||
# Clear temp artifacts (keep sockets/FIFOs; ignore errors)
|
||||
find /tmp /var/tmp -type f -name 'tmp*' -delete 2>/dev/null || true
|
||||
find /tmp /var/tmp -type f -name 'tempfile*' -delete 2>/dev/null || true
|
||||
|
||||
# Truncate writable log files silently (permission errors ignored)
|
||||
if command -v truncate >/dev/null 2>&1; then
|
||||
find /var/log -type f -writable -print0 2>/dev/null |
|
||||
xargs -0 -n1 truncate -s 0 2>/dev/null || true
|
||||
# Python
|
||||
if command -v pip &>/dev/null; then
|
||||
rm -rf /root/.cache/pip 2>/dev/null || true
|
||||
fi
|
||||
if command -v uv &>/dev/null; then
|
||||
rm -rf /root/.cache/uv 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Node.js npm
|
||||
if command -v npm &>/dev/null; then
|
||||
# Node.js
|
||||
if command -v npm &>/dev/null; then
|
||||
rm -rf /root/.npm/_cacache /root/.npm/_logs 2>/dev/null || true
|
||||
fi
|
||||
# Node.js yarn
|
||||
#if command -v yarn &>/dev/null; then $STD yarn cache clean 2>/dev/null || true; fi
|
||||
# Node.js pnpm
|
||||
if command -v pnpm &>/dev/null; then $STD pnpm store prune 2>/dev/null || true; fi
|
||||
# Go
|
||||
if command -v go &>/dev/null; then $STD go clean -cache -modcache 2>/dev/null || true; fi
|
||||
# Rust cargo
|
||||
if command -v cargo &>/dev/null; then $STD cargo clean 2>/dev/null || true; fi
|
||||
# Ruby gem
|
||||
if command -v gem &>/dev/null; then $STD gem cleanup 2>/dev/null || true; fi
|
||||
# Composer (PHP)
|
||||
if command -v composer &>/dev/null; then $STD composer clear-cache 2>/dev/null || true; fi
|
||||
|
||||
if command -v journalctl &>/dev/null; then
|
||||
$STD journalctl --vacuum-time=10m 2>/dev/null || true
|
||||
if command -v yarn &>/dev/null; then
|
||||
rm -rf /root/.cache/yarn /root/.yarn/cache 2>/dev/null || true
|
||||
fi
|
||||
if command -v pnpm &>/dev/null; then
|
||||
pnpm store prune &>/dev/null || true
|
||||
fi
|
||||
|
||||
# Go (only build cache, not modules)
|
||||
if command -v go &>/dev/null; then
|
||||
$STD go clean -cache 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Rust (only registry cache, not build artifacts)
|
||||
if command -v cargo &>/dev/null; then
|
||||
rm -rf /root/.cargo/registry/cache /root/.cargo/.package-cache 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Ruby
|
||||
if command -v gem &>/dev/null; then
|
||||
rm -rf /root/.gem/cache 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# PHP
|
||||
if command -v composer &>/dev/null; then
|
||||
rm -rf /root/.composer/cache 2>/dev/null || true
|
||||
fi
|
||||
|
||||
msg_ok "Cleaned"
|
||||
}
|
||||
|
||||
@ -880,15 +1454,13 @@ check_or_create_swap() {
|
||||
|
||||
msg_error "No active swap detected"
|
||||
|
||||
read -p "Do you want to create a swap file? [y/N]: " create_swap
|
||||
create_swap="${create_swap,,}" # to lowercase
|
||||
|
||||
if [[ "$create_swap" != "y" && "$create_swap" != "yes" ]]; then
|
||||
if ! prompt_confirm "Do you want to create a swap file?" "n" 60; then
|
||||
msg_info "Skipping swap file creation"
|
||||
return 1
|
||||
fi
|
||||
|
||||
read -p "Enter swap size in MB (e.g., 2048 for 2GB): " swap_size_mb
|
||||
local swap_size_mb
|
||||
swap_size_mb=$(prompt_input "Enter swap size in MB (e.g., 2048 for 2GB):" "2048" 60)
|
||||
if ! [[ "$swap_size_mb" =~ ^[0-9]+$ ]]; then
|
||||
msg_error "Invalid size input. Aborting."
|
||||
return 1
|
||||
@ -926,14 +1498,14 @@ function get_lxc_ip() {
|
||||
get_current_ip() {
|
||||
local ip
|
||||
|
||||
# Try direct interface lookup for eth0 FIRST (most reliable for LXC)
|
||||
# Try direct interface lookup for eth0 FIRST (most reliable for LXC) - IPv4
|
||||
ip=$(ip -4 addr show eth0 2>/dev/null | awk '/inet / {print $2}' | cut -d/ -f1 | head -n1)
|
||||
if [[ -n "$ip" && "$ip" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "$ip"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Fallback: Try hostname -I
|
||||
# Fallback: Try hostname -I (returns IPv4 first if available)
|
||||
if command -v hostname >/dev/null 2>&1; then
|
||||
ip=$(hostname -I 2>/dev/null | awk '{print $1}')
|
||||
if [[ -n "$ip" && "$ip" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
@ -942,9 +1514,9 @@ function get_lxc_ip() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# Last resort: Use routing table
|
||||
local targets=("8.8.8.8" "1.1.1.1" "default")
|
||||
for target in "${targets[@]}"; do
|
||||
# Try routing table with IPv4 targets
|
||||
local ipv4_targets=("8.8.8.8" "1.1.1.1" "default")
|
||||
for target in "${ipv4_targets[@]}"; do
|
||||
if [[ "$target" == "default" ]]; then
|
||||
ip=$(ip route get 1 2>/dev/null | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}')
|
||||
else
|
||||
@ -956,6 +1528,32 @@ function get_lxc_ip() {
|
||||
fi
|
||||
done
|
||||
|
||||
# IPv6 fallback: Try direct interface lookup for eth0
|
||||
ip=$(ip -6 addr show eth0 scope global 2>/dev/null | awk '/inet6 / {print $2}' | cut -d/ -f1 | head -n1)
|
||||
if [[ -n "$ip" && "$ip" =~ : ]]; then
|
||||
echo "$ip"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# IPv6 fallback: Try hostname -I for IPv6
|
||||
if command -v hostname >/dev/null 2>&1; then
|
||||
ip=$(hostname -I 2>/dev/null | tr ' ' '\n' | grep -E ':' | head -n1)
|
||||
if [[ -n "$ip" && "$ip" =~ : ]]; then
|
||||
echo "$ip"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# IPv6 fallback: Use routing table with IPv6 targets
|
||||
local ipv6_targets=("2001:4860:4860::8888" "2606:4700:4700::1111")
|
||||
for target in "${ipv6_targets[@]}"; do
|
||||
ip=$(ip -6 route get "$target" 2>/dev/null | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}')
|
||||
if [[ -n "$ip" && "$ip" =~ : ]]; then
|
||||
echo "$ip"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
@ -969,7 +1567,6 @@ function get_lxc_ip() {
|
||||
export LOCAL_IP
|
||||
}
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# SIGNAL TRAPS
|
||||
# ==============================================================================
|
||||
|
||||
@ -907,23 +907,27 @@ EOF
|
||||
# Backup original inittab
|
||||
cp /etc/inittab /etc/inittab.bak 2>/dev/null || true
|
||||
|
||||
# First, enable autologin on tty1 (for direct access)
|
||||
sed -i 's|^1:[0-9]*:respawn:.*/\(a\?getty\).*|1:2345:respawn:/sbin/agetty --autologin root --noclear tty1 38400 linux|' /etc/inittab
|
||||
# Enable autologin on tty1 (for direct access) - handle various formats
|
||||
# Devuan uses format: 1:2345:respawn:/sbin/getty 38400 tty1
|
||||
sed -i 's|^\(1:[0-9]*:respawn:\).*getty.*tty1.*|1:2345:respawn:/sbin/agetty --autologin root --noclear tty1 38400 linux|' /etc/inittab
|
||||
|
||||
# CRITICAL: Add console entry for LXC - this is what pct console uses!
|
||||
# Check if there's already a console getty entry
|
||||
if ! grep -qE '^[^#].*respawn.*console' /etc/inittab; then
|
||||
# Add new console entry for LXC
|
||||
echo "" >>/etc/inittab
|
||||
echo "# LXC console autologin (added by community-scripts)" >>/etc/inittab
|
||||
echo "co:2345:respawn:/sbin/agetty --autologin root --noclear console 115200,38400,9600 linux" >>/etc/inittab
|
||||
else
|
||||
# Enable autologin on existing console entry
|
||||
sed -i 's|^[^#]*:[0-9]*:respawn:.*/\(a\?getty\).*console.*|co:2345:respawn:/sbin/agetty --autologin root --noclear console 115200,38400,9600 linux|' /etc/inittab
|
||||
fi
|
||||
# CRITICAL: Add/replace console entry for LXC - this is what pct console uses!
|
||||
# Remove any existing console entries first (commented or not)
|
||||
sed -i '/^[^#]*:.*:respawn:.*getty.*console/d' /etc/inittab
|
||||
sed -i '/^# LXC console autologin/d' /etc/inittab
|
||||
|
||||
# Force a reload of inittab - try multiple methods
|
||||
telinit q &>/dev/null || init q &>/dev/null || kill -1 1 &>/dev/null || true
|
||||
# Add new console entry for LXC at the end
|
||||
echo "" >>/etc/inittab
|
||||
echo "# LXC console autologin (added by community-scripts)" >>/etc/inittab
|
||||
echo "co:2345:respawn:/sbin/agetty --autologin root --noclear console 115200 linux" >>/etc/inittab
|
||||
|
||||
# Force a reload of inittab and respawn console getty
|
||||
# Kill existing getty on console to force respawn with new settings
|
||||
pkill -9 -f 'getty.*console' &>/dev/null || true
|
||||
pkill -9 -f 'agetty.*console' &>/dev/null || true
|
||||
|
||||
# Reload inittab - try multiple methods
|
||||
telinit q &>/dev/null || init q &>/dev/null || kill -HUP 1 &>/dev/null || true
|
||||
fi
|
||||
touch /root/.hushlogin
|
||||
;;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user