mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-05 08:08:52 +02:00
Compare commits
4 Commits
copilot/fi
...
2026-05-04
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9bf64f60b9 | ||
|
|
559cfff56a | ||
|
|
b353063720 | ||
|
|
26b41d74ee |
@@ -464,12 +464,14 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
- #### 🐞 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
|
||||
|
||||
@@ -35,7 +35,8 @@ function update_script() {
|
||||
msg_ok "Stopped Databasus"
|
||||
|
||||
msg_info "Backing up Configuration"
|
||||
cp /opt/databasus/.env /opt/databasus.env.bak
|
||||
cp /.env /opt/databasus.env.bak
|
||||
chmod 600 /opt/databasus.env.bak
|
||||
msg_ok "Backed up Configuration"
|
||||
|
||||
msg_info "Ensuring Database Clients"
|
||||
@@ -84,11 +85,18 @@ function update_script() {
|
||||
msg_ok "Updated Databasus"
|
||||
|
||||
msg_info "Restoring Configuration"
|
||||
cp /opt/databasus.env.bak /opt/databasus/.env
|
||||
cp /opt/databasus.env.bak /.env
|
||||
rm -f /opt/databasus.env.bak
|
||||
chown postgres:postgres /opt/databasus/.env
|
||||
chmod 600 /.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"
|
||||
|
||||
@@ -79,7 +79,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 >/opt/databasus/.env
|
||||
cat <<EOF >/.env
|
||||
# Environment
|
||||
ENV_MODE=production
|
||||
|
||||
@@ -109,8 +109,7 @@ 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
|
||||
chmod 600 /.env
|
||||
msg_ok "Configured Databasus"
|
||||
|
||||
msg_info "Configuring Valkey"
|
||||
@@ -148,7 +147,7 @@ Requires=postgresql.service valkey.service
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/databasus
|
||||
EnvironmentFile=/opt/databasus/.env
|
||||
EnvironmentFile=/.env
|
||||
ExecStart=/opt/databasus/databasus
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
|
||||
@@ -2079,15 +2079,33 @@ 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
|
||||
tag=$(jq -r --arg p "$prefix" '[.[] | select(.name | startswith($p))][0].name // empty' "$temp_file")
|
||||
# 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
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user