Compare commits

..

4 Commits

Author SHA1 Message Date
MickLesk
f1c8c7b7b4 Optimize PyTorch URL extraction: only parse for selected GPU type
Instead of extracting all three GPU URLs unconditionally, now only
extracts the URL for the user's selected GPU type. More efficient:
- Only one grep execution instead of three
- Less code duplication
- Faster execution
2026-02-07 18:05:14 +01:00
MickLesk
a2a435041a Simplify PyTorch version extraction: use local README instead of curl
Use the already-downloaded README.md from /opt/ComfyUI instead of
fetching it separately via curl. Much simpler and more reliable.

Benefits:
- No extra network request needed
- Guaranteed to match the installed ComfyUI version
- Fewer dependencies (no curl check)
- Faster execution
2026-02-07 18:03:59 +01:00
MickLesk
87324564c6 Make ComfyUI PyTorch versions dynamic from upstream README
Instead of hardcoding CUDA/ROCm/XPU versions, now dynamically extracts
the recommended PyTorch wheel URLs from ComfyUI's README.md at install time.

Benefits:
- Automatically stays up-to-date with upstream recommendations
- No manual updates needed when ComfyUI changes PyTorch versions
- Fallback to known-good versions (cu130, rocm6.4, xpu) if fetch fails

Implementation:
- Fetches https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/README.md
- Parses stable (non-nightly) pip install commands with regex
- Gracefully degrades to hardcoded fallbacks on network/parse errors
2026-02-07 18:03:16 +01:00
MickLesk
c8dc7f2196 Update ComfyUI PyTorch versions to match upstream recommendations
- NVIDIA: cu128 → cu130 (requires driver ≥ 570)
- AMD: rocm6.3 → rocm6.4 (stable version)
- Intel: xpu (unchanged, already matches upstream)

Fixes NVML version mismatch issues when host driver is upgraded
Aligns with ComfyUI upstream: https://github.com/Comfy-Org/ComfyUI#manual-install-windows-linux
2026-02-07 18:00:08 +01:00
20 changed files with 55 additions and 545 deletions

View File

@@ -400,30 +400,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
## 2026-02-07
### 🚀 Updated Scripts
- #### 🐞 Bug Fixes
- NocoDB: pin to v0.301.1 [@MickLesk](https://github.com/MickLesk) ([#11655](https://github.com/community-scripts/ProxmoxVE/pull/11655))
- Pin Memos to v0.25.3 - last version with release binaries [@MickLesk](https://github.com/MickLesk) ([#11658](https://github.com/community-scripts/ProxmoxVE/pull/11658))
- Downgrade: OpenProject | NginxProxyManager | Semaphore to Debian 12 due to persistent SHA1 issues [@MickLesk](https://github.com/MickLesk) ([#11654](https://github.com/community-scripts/ProxmoxVE/pull/11654))
### 💾 Core
- #### ✨ New Features
- tools: fallback to previous release when asset is missing [@MickLesk](https://github.com/MickLesk) ([#11660](https://github.com/community-scripts/ProxmoxVE/pull/11660))
### 📚 Documentation
- fix(setup): correctly auto-detect username when using --full [@ls-root](https://github.com/ls-root) ([#11650](https://github.com/community-scripts/ProxmoxVE/pull/11650))
### 🌐 Website
- #### ✨ New Features
- feat(frontend): add JSON script import functionality [@ls-root](https://github.com/ls-root) ([#11563](https://github.com/community-scripts/ProxmoxVE/pull/11563))
## 2026-02-06
### 🆕 New Scripts

View File

@@ -1,55 +0,0 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2026 community-scripts ORG
# Author: Slaviša Arežina (tremor021)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/rustmailer/bichon
APP="Bichon"
var_tags="${var_tags:-email;archive}"
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/bichon ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "bichon" "rustmailer/bichon"; then
msg_info "Stopping service"
systemctl stop bichon
msg_ok "Stopped service"
cp /opt/bichon/bichon.env /tmp/bichon.env.backup
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "bichon" "rustmailer/bichon" "prebuild" "latest" "/opt/bichon" "bichon-*-x86_64-unknown-linux-gnu.tar.gz"
cp /tmp/bichon.env.backup /opt/bichon/bichon.env
msg_info "Starting service"
systemctl start bichon
msg_ok "Service started"
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}:15630${CL}"

View File

@@ -27,12 +27,12 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "memos" "usememos/memos" "v0.25.3"; then
if check_for_gh_release "memos" "usememos/memos"; then
msg_info "Stopping service"
systemctl stop memos
msg_ok "Service stopped"
fetch_and_deploy_gh_release "memos" "usememos/memos" "prebuild" "v0.25.3" "/opt/memos" "memos*linux_amd64.tar.gz"
fetch_and_deploy_gh_release "memos" "usememos/memos" "prebuild" "latest" "/opt/memos" "memos*linux_amd64.tar.gz"
msg_info "Starting service"
systemctl start memos

View File

@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"

View File

@@ -27,12 +27,12 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "nocodb" "nocodb/nocodb" "0.301.1"; then
if check_for_gh_release "nocodb" "nocodb/nocodb"; then
msg_info "Stopping Service"
systemctl stop nocodb
msg_ok "Stopped Service"
fetch_and_deploy_gh_release "nocodb" "nocodb/nocodb" "singlefile" "0.301.1" "/opt/nocodb/" "Noco-linux-x64"
fetch_and_deploy_gh_release "nocodb" "nocodb/nocodb" "singlefile" "latest" "/opt/nocodb/" "Noco-linux-x64"
msg_info "Starting Service"
systemctl start nocodb

View File

@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"

View File

@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"

View File

@@ -237,6 +237,7 @@ if [[ $# -gt 0 ]]; then
# Check for --full flag
if [[ "$1" == "--full" ]]; then
UPDATE_ALL=true
AUTO_DETECT=true
shift # Remove --full from arguments
fi
@@ -249,10 +250,8 @@ if [[ $# -gt 0 ]]; then
REPO_NAME="$2"
fi
fi
fi
# Try auto-detection
if [[ -z "$USERNAME" ]]; then
else
# Try auto-detection
if username=$(detect_username); then
USERNAME="$username"
print_success "Detected GitHub username: $USERNAME"
@@ -262,15 +261,14 @@ if [[ -z "$USERNAME" ]]; then
echo " ./setup-fork.sh YOUR_USERNAME"
exit 1
fi
fi
# Auto-detect repo name if needed
if repo_name=$(detect_repo_name); then
REPO_NAME="$repo_name"
if [[ "$REPO_NAME" != "ProxmoxVE" ]]; then
print_info "Detected custom repo name: $REPO_NAME"
else
print_success "Using default repo name: ProxmoxVE"
if repo_name=$(detect_repo_name); then
REPO_NAME="$repo_name"
if [[ "$REPO_NAME" != "ProxmoxVE" ]]; then
print_info "Detected custom repo name: $REPO_NAME"
else
print_success "Using default repo name: ProxmoxVE"
fi
fi
fi

View File

@@ -1,40 +0,0 @@
{
"name": "Bichon",
"slug": "bichon",
"categories": [
7
],
"date_created": "2026-02-07",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 15630,
"documentation": "https://github.com/rustmailer/bichon/wiki",
"config_path": "/opt/bichon/bichon.env",
"website": "https://github.com/rustmailer/bichon",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/bichon.webp",
"description": "Bichon is an open-source email archiving system that synchronizes emails from IMAP servers, indexes them for full-text search, and provides a REST API for programmatic access. Unlike email clients, Bichon is designed for archiving and searching rather than sending/receiving emails. It runs as a standalone server application that continuously synchronizes configured email accounts and maintains a searchable local archive.",
"install_methods": [
{
"type": "default",
"script": "ct/bichon.sh",
"resources": {
"cpu": 1,
"ram": 1024,
"hdd": 4,
"os": "Debian",
"version": "13"
}
}
],
"default_credentials": {
"username": "admin",
"password": "admin@bichon"
},
"notes": [
{
"text": "The Disk space initially allocated by the script is only a placeholder, as we can't know how much space you will ever need. You should increase it to match your workload.",
"type": "info"
}
]
}

View File

@@ -1,5 +1,5 @@
{
"generated": "2026-02-07T18:08:02Z",
"generated": "2026-02-07T12:07:39Z",
"versions": [
{
"slug": "2fauth",
@@ -774,16 +774,16 @@
{
"slug": "memos",
"repo": "usememos/memos",
"version": "v0.25.3",
"pinned": true,
"date": "2025-11-25T00:00:00Z"
"version": "v0.26.0",
"pinned": false,
"date": "2026-01-31T15:28:09Z"
},
{
"slug": "metube",
"repo": "alexta69/metube",
"version": "2026.02.07",
"version": "2026.02.06",
"pinned": false,
"date": "2026-02-07T16:24:37Z"
"date": "2026-02-06T14:20:34Z"
},
{
"slug": "miniflux",
@@ -851,8 +851,8 @@
{
"slug": "nocodb",
"repo": "nocodb/nocodb",
"version": "0.301.1",
"pinned": true,
"version": "0.301.2",
"pinned": false,
"date": "2026-01-21T16:23:04Z"
},
{
@@ -1117,9 +1117,9 @@
{
"slug": "pulse",
"repo": "rcourtman/Pulse",
"version": "v5.1.3",
"version": "v5.1.2",
"pinned": false,
"date": "2026-02-07T14:59:29Z"
"date": "2026-02-05T00:18:57Z"
},
{
"slug": "pve-scripts-local",
@@ -1432,9 +1432,9 @@
{
"slug": "trip",
"repo": "itskovacs/TRIP",
"version": "1.39.0",
"version": "1.38.1",
"pinned": false,
"date": "2026-02-07T16:59:51Z"
"date": "2026-02-04T18:10:15Z"
},
{
"slug": "tududi",

View File

@@ -25,7 +25,7 @@
"ram": 2048,
"hdd": 8,
"os": "debian",
"version": "12"
"version": "13"
}
}
],

View File

@@ -23,7 +23,7 @@
"ram": 4096,
"hdd": 8,
"os": "Debian",
"version": "12"
"version": "13"
}
}
],

View File

@@ -23,7 +23,7 @@
"ram": 2048,
"hdd": 4,
"os": "debian",
"version": "12"
"version": "13"
}
}
],

View File

@@ -32,11 +32,6 @@ import Note from "./_components/note";
import { githubGist, nord } from "react-syntax-highlighter/dist/esm/styles/hljs";
import SyntaxHighlighter from "react-syntax-highlighter";
import { ScriptItem } from "../scripts/_components/script-item";
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
import { search } from "@/components/command-menu";
import { basePath } from "@/config/site-config";
import Image from "next/image";
import { useTheme } from "next-themes";
const initialScript: Script = {
@@ -70,35 +65,8 @@ export default function JSONGenerator() {
const [isValid, setIsValid] = useState(false);
const [categories, setCategories] = useState<Category[]>([]);
const [currentTab, setCurrentTab] = useState<"json" | "preview">("json");
const [selectedCategory, setSelectedCategory] = useState<string>("");
const [searchQuery, setSearchQuery] = useState<string>("");
const [isImportDialogOpen, setIsImportDialogOpen] = useState(false);
const [zodErrors, setZodErrors] = useState<z.ZodError | null>(null);
const selectedCategoryObj = useMemo(
() => categories.find(cat => cat.id.toString() === selectedCategory),
[categories, selectedCategory]
);
const allScripts = useMemo(
() => categories.flatMap(cat => cat.scripts || []),
[categories]
);
const scripts = useMemo(() => {
const query = searchQuery.trim()
if (query) {
return search(allScripts, query)
}
if (selectedCategoryObj) {
return selectedCategoryObj.scripts || []
}
return []
}, [allScripts, selectedCategoryObj, searchQuery]);
useEffect(() => {
fetchCategories()
.then(setCategories)
@@ -152,53 +120,6 @@ export default function JSONGenerator() {
if (isValid) toast.success("Copied metadata to clipboard");
}, [script]);
const importScript = (script: Script) => {
try {
const result = ScriptSchema.safeParse(script);
if (!result.success) {
setIsValid(false);
setZodErrors(result.error);
toast.error("Imported JSON is invalid according to the schema.");
return;
}
setScript(result.data);
setIsValid(true);
setZodErrors(null);
toast.success("Imported JSON successfully");
} catch (error) {
toast.error("Failed to read or parse the JSON file.");
}
}
const handleFileImport = useCallback(() => {
const input = document.createElement("input");
input.type = "file";
input.accept = "application/json";
input.onchange = (e: Event) => {
const target = e.target as HTMLInputElement;
const file = target.files?.[0];
if (!file) return;
const reader = new FileReader();
reader.onload = (event) => {
try {
const content = event.target?.result as string;
const parsed = JSON.parse(content);
importScript(parsed);
toast.success("Imported JSON successfully");
} catch (error) {
toast.error("Failed to read the JSON file.");
}
};
reader.readAsText(file);
};
input.click();
}, [setScript]);
const handleDownload = useCallback(() => {
if (isValid === false) {
toast.error("Cannot download invalid JSON");
@@ -256,94 +177,7 @@ export default function JSONGenerator() {
return (
<div className="flex h-screen mt-20">
<div className="w-1/2 p-4 overflow-y-auto">
<div className="flex justify-between items-center mb-4">
<h2 className="text-2xl font-bold">JSON Generator</h2>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button>Import</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className="w-52" align="start">
<DropdownMenuGroup>
<DropdownMenuItem onSelect={handleFileImport}>Import local JSON file</DropdownMenuItem>
<Dialog
open={isImportDialogOpen}
onOpenChange={setIsImportDialogOpen}
>
<DialogTrigger asChild>
<DropdownMenuItem onSelect={(e) => e.preventDefault()}>
Import existing script
</DropdownMenuItem>
</DialogTrigger>
<DialogContent className="sm:max-w-md w-full">
<DialogHeader>
<DialogTitle>Import existing script</DialogTitle>
<DialogDescription>
Select one of the puplished scripts to import its metadata.
</DialogDescription>
</DialogHeader>
<div className="flex items-center gap-2">
<div className="grid flex-1 gap-2">
<Select
value={selectedCategory}
onValueChange={setSelectedCategory}
>
<SelectTrigger>
<SelectValue placeholder="Category" />
</SelectTrigger>
<SelectContent>
{categories.map((category) => (
<SelectItem key={category.id} value={category.id.toString()}>
{category.name}
</SelectItem>
))}
</SelectContent>
</Select>
<Input
placeholder="Search for a script..."
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
/>
{!selectedCategory && !searchQuery ? (
<p className="text-muted-foreground text-sm text-center">
Select a category or search for a script
</p>
) : scripts.length === 0 ? (
<p className="text-muted-foreground text-sm text-center">
No scripts found
</p>
) : (
<div className="grid grid-cols-3 auto-rows-min h-64 overflow-y-auto gap-4">
{scripts.map(script => (
<div
key={script.slug}
className="p-2 border rounded cursor-pointer hover:bg-accent hover:text-accent-foreground"
onClick={() => {
importScript(script);
setIsImportDialogOpen(false);
}}
>
<Image
src={script.logo || `/${basePath}/logo.png`}
alt={script.name}
className="w-full h-12 object-contain mb-2"
width={16}
height={16}
unoptimized
/>
<p className="text-sm text-center">{script.name}</p>
</div>
))}
</div>
)}
</div>
</div>
</DialogContent>
</Dialog>
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
</div>
<h2 className="text-2xl font-bold mb-4">JSON Generator</h2>
<form className="space-y-4">
<div className="grid grid-cols-2 gap-4">
<div>

View File

@@ -23,7 +23,7 @@ import { Button } from "./ui/button";
import { Badge } from "./ui/badge";
import Link from "next/link";
export function search(scripts: Script[], query: string): Script[] {
function search(scripts: Script[], query: string): Script[] {
const queryLower = query.toLowerCase().trim();
const searchWords = queryLower.split(/\s+/).filter(Boolean);

View File

@@ -1,65 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: Slaviša Arežina (tremor021)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/rustmailer/bichon
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
fetch_and_deploy_gh_release "bichon" "rustmailer/bichon" "prebuild" "latest" "/opt/bichon" "bichon-*-x86_64-unknown-linux-gnu.tar.gz"
read -r -p "${TAB3}Enter the public URL for Bichon (e.g., https://bichon.yourdomain.com) or leave empty to use container IP: " bichon_url
if [[ -z "$bichon_url" ]]; then
msg_info "No URL provided"
BICHON_PUBLIC_URL="http://$LOCAL_IP:15630"
msg_ok "Using local IP: http://$LOCAL_IP:15630\n"
else
msg_info "URL provided"
BICHON_PUBLIC_URL="$bichon_url"
msg_ok "Using provided URL: $BICHON_PUBLIC_URL\n"
fi
msg_info "Setting up Bichon"
mkdir -p /opt/bichon-data
BICHON_ENC_PASSWORD=$(openssl rand -base64 32 | tr -d "=+/" | cut -c1-32)
cat <<EOF >/opt/bichon/bichon.env
BICHON_ROOT_DIR=/opt/bichon-data
BICHON_LOG_LEVEL=info
BICHON_ENCRYPT_PASSWORD=$BICHON_ENC_PASSWORD
BICHON_PUBLIC_URL=$BICHON_PUBLIC_URL
BICHON_CORS_ORIGINS=$BICHON_PUBLIC_URL
EOF
msg_ok "Setup Bichon"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/bichon.service
[Unit]
Description=Bichon service
After=network.target
[Service]
Type=simple
User=root
EnvironmentFile=/opt/bichon/bichon.env
WorkingDirectory=/opt/bichon
ExecStart=/opt/bichon/bichon
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now bichon
msg_info "Created Service"
motd_ssh
customize
cleanup_lxc

View File

@@ -37,26 +37,42 @@ fetch_and_deploy_gh_release "ComfyUI" "comfyanonymous/ComfyUI" "tarball" "latest
msg_info "Python dependencies"
$STD uv venv "/opt/ComfyUI/venv"
if [[ "${comfyui_gpu_type,,}" == "nvidia" ]]; then
pytorch_url="https://download.pytorch.org/whl/cu130"
if [[ -f "/opt/ComfyUI/README.md" ]]; then
extracted=$(grep -oP 'pip install.*?--extra-index-url\s+\Khttps://download\.pytorch\.org/whl/cu\d+' /opt/ComfyUI/README.md | head -1 || true)
[[ -n "$extracted" ]] && pytorch_url="$extracted"
fi
$STD uv pip install \
torch \
torchvision \
torchaudio \
--extra-index-url "https://download.pytorch.org/whl/cu128" \
--extra-index-url "$pytorch_url" \
--python="/opt/ComfyUI/venv/bin/python"
elif [[ "${comfyui_gpu_type,,}" == "amd" ]]; then
pytorch_url="https://download.pytorch.org/whl/rocm6.4"
if [[ -f "/opt/ComfyUI/README.md" ]]; then
extracted=$(grep -oP 'pip install.*?--index-url\s+\Khttps://download\.pytorch\.org/whl/rocm[\d.]+' /opt/ComfyUI/README.md | grep -v 'nightly' | head -1 || true)
[[ -n "$extracted" ]] && pytorch_url="$extracted"
fi
$STD uv pip install \
torch \
torchvision \
torchaudio \
--index-url "https://download.pytorch.org/whl/rocm6.3" \
--index-url "$pytorch_url" \
--python="/opt/ComfyUI/venv/bin/python"
elif [[ "${comfyui_gpu_type,,}" == "intel" ]]; then
pytorch_url="https://download.pytorch.org/whl/xpu"
if [[ -f "/opt/ComfyUI/README.md" ]]; then
extracted=$(grep -oP 'pip install.*?--index-url\s+\Khttps://download\.pytorch\.org/whl/xpu' /opt/ComfyUI/README.md | head -1 || true)
[[ -n "$extracted" ]] && pytorch_url="$extracted"
fi
$STD uv pip install \
torch \
torchvision \
torchaudio \
--index-url "https://download.pytorch.org/whl/xpu" \
--index-url "$pytorch_url" \
--python="/opt/ComfyUI/venv/bin/python"
fi
$STD uv pip install -r "/opt/ComfyUI/requirements.txt" --python="/opt/ComfyUI/venv/bin/python"

View File

@@ -14,7 +14,7 @@ setting_up_container
network_check
update_os
fetch_and_deploy_gh_release "memos" "usememos/memos" "prebuild" "v0.25.3" "/opt/memos" "memos*linux_amd64.tar.gz"
fetch_and_deploy_gh_release "memos" "usememos/memos" "prebuild" "latest" "/opt/memos" "memos*linux_amd64.tar.gz"
mkdir -p /opt/memos_data
msg_info "Creating Service"

View File

@@ -13,7 +13,7 @@ setting_up_container
network_check
update_os
fetch_and_deploy_gh_release "nocodb" "nocodb/nocodb" "singlefile" "0.301.1" "/opt/nocodb/" "Noco-linux-x64"
fetch_and_deploy_gh_release "nocodb" "nocodb/nocodb" "singlefile" "latest" "/opt/nocodb/" "Noco-linux-x64"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/nocodb.service

View File

@@ -2317,106 +2317,8 @@ function fetch_and_deploy_codeberg_release() {
#
# # 4. Single binary (chmod +x) like Argus, Promtail etc.
# fetch_and_deploy_gh_release "argus" "release-argus/Argus" "singlefile" "0.26.3" "/opt/argus" "Argus-.*linux-amd64"
#
# Notes:
# - For binary/prebuild/singlefile modes: if the target release has no
# matching asset, the function scans older releases and prompts the user
# (60s timeout, default yes) to use a previous version that has the asset.
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Scans older GitHub releases for a matching asset when the latest release
# is missing the expected file. Used internally by fetch_and_deploy_gh_release.
#
# Arguments:
# $1 - GitHub repo (owner/repo)
# $2 - mode (binary|prebuild|singlefile)
# $3 - asset_pattern (glob pattern for asset filename)
# $4 - tag to skip (the already-checked release)
#
# Output:
# Prints the release JSON of the first older release that has a matching asset.
# Returns 0 on success, 1 if no matching release found or user declined.
# ------------------------------------------------------------------------------
_gh_scan_older_releases() {
local repo="$1"
local mode="$2"
local asset_pattern="$3"
local skip_tag="$4"
local header=()
[[ -n "${GITHUB_TOKEN:-}" ]] && header=(-H "Authorization: token $GITHUB_TOKEN")
local releases_list
releases_list=$(curl --connect-timeout 10 --max-time 30 -fsSL \
-H 'Accept: application/vnd.github+json' \
-H 'X-GitHub-Api-Version: 2022-11-28' \
"${header[@]}" \
"https://api.github.com/repos/${repo}/releases?per_page=15" 2>/dev/null) || return 1
local count
count=$(echo "$releases_list" | jq 'length')
for ((i = 0; i < count; i++)); do
local rel_tag rel_draft rel_prerelease
rel_tag=$(echo "$releases_list" | jq -r ".[$i].tag_name")
rel_draft=$(echo "$releases_list" | jq -r ".[$i].draft")
rel_prerelease=$(echo "$releases_list" | jq -r ".[$i].prerelease")
# Skip drafts, prereleases, and the tag we already checked
[[ "$rel_draft" == "true" || "$rel_prerelease" == "true" ]] && continue
[[ "$rel_tag" == "$skip_tag" ]] && continue
local has_match=false
if [[ "$mode" == "binary" ]]; then
local arch
arch=$(dpkg --print-architecture 2>/dev/null || uname -m)
[[ "$arch" == "x86_64" ]] && arch="amd64"
[[ "$arch" == "aarch64" ]] && arch="arm64"
# Check with explicit pattern first, then arch heuristic, then any .deb
if [[ -n "$asset_pattern" ]]; then
has_match=$(echo "$releases_list" | jq -r --arg pat "$asset_pattern" ".[$i].assets[].name" | while read -r name; do
case "$name" in $asset_pattern) echo true; break ;; esac
done)
fi
if [[ "$has_match" != "true" ]]; then
has_match=$(echo "$releases_list" | jq -r ".[$i].assets[].browser_download_url" | grep -qE "($arch|amd64|x86_64|aarch64|arm64).*\.deb$" && echo true)
fi
if [[ "$has_match" != "true" ]]; then
has_match=$(echo "$releases_list" | jq -r ".[$i].assets[].browser_download_url" | grep -qE '\.deb$' && echo true)
fi
elif [[ "$mode" == "prebuild" || "$mode" == "singlefile" ]]; then
has_match=$(echo "$releases_list" | jq -r ".[$i].assets[].name" | while read -r name; do
case "$name" in $asset_pattern) echo true; break ;; esac
done)
fi
if [[ "$has_match" == "true" ]]; then
local rel_version="$rel_tag"
[[ "$rel_tag" =~ ^v ]] && rel_version="${rel_tag:1}"
local use_fallback="y"
if [[ -t 0 ]]; then
msg_warn "Release ${skip_tag} has no matching asset. Previous release ${rel_tag} has a compatible asset."
read -rp "Use version ${rel_tag} instead? [Y/n] (auto-yes in 60s): " -t 60 use_fallback || use_fallback="y"
use_fallback="${use_fallback:-y}"
fi
if [[ "${use_fallback,,}" == "y" || "${use_fallback,,}" == "yes" ]]; then
echo "$releases_list" | jq ".[$i]"
return 0
else
return 1
fi
fi
done
return 1
}
function fetch_and_deploy_gh_release() {
local app="$1"
local repo="$2"
@@ -2556,33 +2458,6 @@ function fetch_and_deploy_gh_release() {
done
fi
# Fallback: scan older releases for a matching .deb asset
if [[ -z "$url_match" ]]; then
local fallback_json
if fallback_json=$(_gh_scan_older_releases "$repo" "binary" "$asset_pattern" "$tag_name"); then
json="$fallback_json"
tag_name=$(echo "$json" | jq -r '.tag_name // .name // empty')
[[ "$tag_name" =~ ^v ]] && version="${tag_name:1}" || version="$tag_name"
msg_info "Fetching GitHub release: $app ($version)"
assets=$(echo "$json" | jq -r '.assets[].browser_download_url')
if [[ -n "$asset_pattern" ]]; then
for u in $assets; do
case "${u##*/}" in $asset_pattern) url_match="$u"; break ;; esac
done
fi
if [[ -z "$url_match" ]]; then
for u in $assets; do
if [[ "$u" =~ ($arch|amd64|x86_64|aarch64|arm64).*\.deb$ ]]; then url_match="$u"; break; fi
done
fi
if [[ -z "$url_match" ]]; then
for u in $assets; do
[[ "$u" =~ \.deb$ ]] && url_match="$u" && break
done
fi
fi
fi
if [[ -z "$url_match" ]]; then
msg_error "No suitable .deb asset found for $app"
rm -rf "$tmpdir"
@@ -2631,21 +2506,6 @@ function fetch_and_deploy_gh_release() {
esac
done
# Fallback: scan older releases for a matching asset
if [[ -z "$asset_url" ]]; then
local fallback_json
if fallback_json=$(_gh_scan_older_releases "$repo" "prebuild" "$pattern" "$tag_name"); then
json="$fallback_json"
tag_name=$(echo "$json" | jq -r '.tag_name // .name // empty')
[[ "$tag_name" =~ ^v ]] && version="${tag_name:1}" || version="$tag_name"
msg_info "Fetching GitHub release: $app ($version)"
for u in $(echo "$json" | jq -r '.assets[].browser_download_url'); do
filename_candidate="${u##*/}"
case "$filename_candidate" in $pattern) asset_url="$u"; break ;; esac
done
fi
fi
[[ -z "$asset_url" ]] && {
msg_error "No asset matching '$pattern' found"
rm -rf "$tmpdir"
@@ -2743,20 +2603,6 @@ function fetch_and_deploy_gh_release() {
esac
done
# Fallback: scan older releases for a matching asset
if [[ -z "$asset_url" ]]; then
local fallback_json
if fallback_json=$(_gh_scan_older_releases "$repo" "singlefile" "$pattern" "$tag_name"); then
json="$fallback_json"
tag_name=$(echo "$json" | jq -r '.tag_name // .name // empty')
[[ "$tag_name" =~ ^v ]] && version="${tag_name:1}" || version="$tag_name"
msg_info "Fetching GitHub release: $app ($version)"
for u in $(echo "$json" | jq -r '.assets[].browser_download_url'); do
filename_candidate="${u##*/}"
case "$filename_candidate" in $pattern) asset_url="$u"; break ;; esac
done
fi
fi
[[ -z "$asset_url" ]] && {
msg_error "No asset matching '$pattern' found"
rm -rf "$tmpdir"