Compare commits

..

6 Commits

Author SHA1 Message Date
MickLesk
28aa85ebbe fix(tools): add missing _gl_scan_older_releases helper for GitLab fallback 2026-05-04 17:12:33 +02:00
MickLesk
47d781ca41 fix(tools): fix GitLab helpers syntax errors - stray lines and wrong variable in check_for_gl_release 2026-05-04 16:49:51 +02:00
CanbiZ (MickLesk)
ee3cf9e4eb Update misc/tools.func
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2026-05-04 16:49:51 +02:00
CanbiZ (MickLesk)
19d30f13a3 Update misc/tools.func
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2026-05-04 16:49:50 +02:00
CanbiZ (MickLesk)
5dfd738371 Update misc/tools.func
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2026-05-04 16:49:50 +02:00
CanbiZ (MickLesk)
bbde6424b7 Add GitLab release check/fetch/deploy helpers
Add utilities to query and deploy GitLab releases: get_latest_gitlab_release, check_for_gl_release, and fetch_and_deploy_gl_release. Features include support for GITLAB_TOKEN, HTTP error handling and retries, jq/curl-based JSON parsing, detection/migration of legacy version files, and setting CHECK_UPDATE_RELEASE when updates are available. fetch_and_deploy_gl_release supports multiple modes (tarball/source, binary, prebuild, singlefile), asset pattern matching, architecture-aware .deb selection, installation via apt/dpkg, archive extraction, and optional clean installs. Helpful messages are emitted for auth/rate-limit/network errors and required dependencies (jq, unzip) are ensured when needed.
2026-05-04 16:49:50 +02:00
4 changed files with 19 additions and 66 deletions

View File

@@ -458,22 +458,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
</details>
## 2026-05-04
### 🚀 Updated Scripts
- #### 🐞 Bug Fixes
- Databasus: move .env to filesystem root so service starts correctly [@Copilot](https://github.com/Copilot) ([#14252](https://github.com/community-scripts/ProxmoxVE/pull/14252))
- Databasus: update mongo-tools fallback to 100.16.1 and use now pnpm instead of npm ci [@MickLesk](https://github.com/MickLesk) ([#14240](https://github.com/community-scripts/ProxmoxVE/pull/14240))
### 💾 Core
- #### ✨ New Features
- tools.func get_latest_gh_tag - add pagination to find prefixed tags beyond first 50 [@MickLesk](https://github.com/MickLesk) ([#14241](https://github.com/community-scripts/ProxmoxVE/pull/14241))
- tools.func: add GitLab release check/fetch/deploy helpers [@MickLesk](https://github.com/MickLesk) ([#14242](https://github.com/community-scripts/ProxmoxVE/pull/14242))
## 2026-05-03
### 🚀 Updated Scripts

View File

@@ -35,8 +35,7 @@ function update_script() {
msg_ok "Stopped Databasus"
msg_info "Backing up Configuration"
cp /.env /opt/databasus.env.bak
chmod 600 /opt/databasus.env.bak
cp /opt/databasus/.env /opt/databasus.env.bak
msg_ok "Backed up Configuration"
msg_info "Ensuring Database Clients"
@@ -47,7 +46,7 @@ function update_script() {
# Install MongoDB Database Tools via direct .deb (no APT repo for Debian 13)
if ! command -v mongodump &>/dev/null; then
[[ "$(get_os_info id)" == "ubuntu" ]] && MONGO_DIST="ubuntu2204" || MONGO_DIST="debian12"
fetch_and_deploy_from_url "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-${MONGO_DIST}-x86_64-100.16.1.deb"
fetch_and_deploy_from_url "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-${MONGO_DIST}-x86_64-100.14.1.deb"
fi
[[ -f /usr/bin/mongodump ]] && ln -sf /usr/bin/mongodump /usr/local/mongodb-database-tools/bin/mongodump
[[ -f /usr/bin/mongorestore ]] && ln -sf /usr/bin/mongorestore /usr/local/mongodb-database-tools/bin/mongorestore
@@ -67,12 +66,9 @@ function update_script() {
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "databasus" "databasus/databasus" "tarball" "latest" "/opt/databasus"
msg_info "Updating Databasus"
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
cd /opt/databasus/frontend
$STD corepack enable
$STD corepack prepare pnpm@latest --activate
$STD pnpm install --frozen-lockfile
$STD pnpm run build
$STD npm ci
$STD npm run build
cd /opt/databasus/backend
$STD go mod download
$STD /root/go/bin/swag init -g cmd/main.go -o swagger
@@ -85,18 +81,11 @@ function update_script() {
msg_ok "Updated Databasus"
msg_info "Restoring Configuration"
cp /opt/databasus.env.bak /.env
cp /opt/databasus.env.bak /opt/databasus/.env
rm -f /opt/databasus.env.bak
chmod 600 /.env
chown postgres:postgres /opt/databasus/.env
msg_ok "Restored Configuration"
if ! grep -q "EnvironmentFile=/.env" /etc/systemd/system/databasus.service; then
msg_info "Updating Service"
sed -i 's|EnvironmentFile=.*|EnvironmentFile=/.env|' /etc/systemd/system/databasus.service
$STD systemctl daemon-reload
msg_ok "Updated Service"
fi
msg_info "Starting Databasus"
$STD systemctl start databasus
msg_ok "Started Databasus"

View File

@@ -32,7 +32,7 @@ for v in 12 13 14 15 16 18; do
done
# Install MongoDB Database Tools via direct .deb (no APT repo for Debian 13)
[[ "$(get_os_info id)" == "ubuntu" ]] && MONGO_DIST="ubuntu2204" || MONGO_DIST="debian12"
MONGO_VERSION=$(get_latest_gh_tag "mongodb/mongo-tools" "100." || echo "100.16.1")
MONGO_VERSION=$(get_latest_gh_tag "mongodb/mongo-tools" "100." || echo "100.14.1")
fetch_and_deploy_from_url "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-${MONGO_DIST}-x86_64-${MONGO_VERSION}.deb" ""
mkdir -p /usr/local/mongodb-database-tools/bin
[[ -f /usr/bin/mongodump ]] && ln -sf /usr/bin/mongodump /usr/local/mongodb-database-tools/bin/mongodump
@@ -52,12 +52,9 @@ msg_ok "Installed Database Clients"
fetch_and_deploy_gh_release "databasus" "databasus/databasus" "tarball" "latest" "/opt/databasus"
msg_info "Building Databasus (Patience)"
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
cd /opt/databasus/frontend
$STD corepack enable
$STD corepack prepare pnpm@latest --activate
$STD pnpm install --frozen-lockfile
$STD pnpm run build
$STD npm ci
$STD npm run build
cd /opt/databasus/backend
$STD go mod tidy
$STD go mod download
@@ -79,7 +76,7 @@ ENCRYPTION_KEY=$(openssl rand -hex 32)
# Install goose for migrations
$STD go install github.com/pressly/goose/v3/cmd/goose@latest
ln -sf /root/go/bin/goose /usr/local/bin/goose
cat <<EOF >/.env
cat <<EOF >/opt/databasus/.env
# Environment
ENV_MODE=production
@@ -109,7 +106,8 @@ DATA_DIR=/databasus-data/data
BACKUP_DIR=/databasus-data/backups
LOG_DIR=/databasus-data/logs
EOF
chmod 600 /.env
chown postgres:postgres /opt/databasus/.env
chmod 600 /opt/databasus/.env
msg_ok "Configured Databasus"
msg_info "Configuring Valkey"
@@ -147,7 +145,7 @@ Requires=postgresql.service valkey.service
[Service]
Type=simple
WorkingDirectory=/opt/databasus
EnvironmentFile=/.env
EnvironmentFile=/opt/databasus/.env
ExecStart=/opt/databasus/databasus
Restart=always
RestartSec=5

View File

@@ -2079,33 +2079,15 @@ get_latest_gh_tag() {
local temp_file
temp_file=$(mktemp)
if ! github_api_call "https://api.github.com/repos/${repo}/tags?per_page=50" "$temp_file"; then
rm -f "$temp_file"
return 22
fi
local tag=""
if [[ -n "$prefix" ]]; then
# Use git/matching-refs API for server-side prefix filtering. This avoids
# paging through unrelated tags (e.g. mongodb/mongo-tools where 100.x tags
# only appear after page 4 of /tags). Returns ALL tags matching the prefix
# in a single call, sorted lexicographically ascending; we pick the
# highest version using `sort -V`.
if ! github_api_call "https://api.github.com/repos/${repo}/git/matching-refs/tags/${prefix}" "$temp_file"; then
rm -f "$temp_file"
return 22
fi
local count
count=$(jq 'length' "$temp_file" 2>/dev/null || echo 0)
if [[ "$count" -gt 0 ]]; then
tag=$(jq -r '.[].ref' "$temp_file" \
| sed 's|^refs/tags/||' \
| sort -V \
| tail -n1)
fi
tag=$(jq -r --arg p "$prefix" '[.[] | select(.name | startswith($p))][0].name // empty' "$temp_file")
else
# No prefix: just take the first (newest) tag from /tags
if ! github_api_call "https://api.github.com/repos/${repo}/tags?per_page=1" "$temp_file"; then
rm -f "$temp_file"
return 22
fi
tag=$(jq -r '.[0].name // empty' "$temp_file")
fi