Compare commits

..

3 Commits

Author SHA1 Message Date
Tobias
961d4d3637 Merge branch 'main' into CrazyWolf13-patch-wealthfolio-3-0-4 2026-03-06 14:31:42 +01:00
Tobias
d1569bf15c Update wealthfolio.sh 2026-03-06 14:24:43 +01:00
Tobias
2bf2d07564 Update wealthfolio-install.sh 2026-03-06 14:17:05 +01:00
3 changed files with 13 additions and 29 deletions

View File

@@ -29,8 +29,11 @@ function update_script() {
exit
fi
RELEASE="3.0.3"
if check_for_gh_release "wealthfolio" "afadil/wealthfolio" "${RELEASE}"; then
if grep -q '^WF_CORS_ALLOW_ORIGINS=\*$' /opt/wealthfolio/.env; then
sed -i "s|^WF_CORS_ALLOW_ORIGINS=\*$|WF_CORS_ALLOW_ORIGINS=http://${LOCAL_IP}:8080|" /opt/wealthfolio/.env
fi
if check_for_gh_release "wealthfolio" "afadil/wealthfolio"; then
msg_info "Stopping Service"
systemctl stop wealthfolio
msg_ok "Stopped Service"
@@ -40,7 +43,7 @@ function update_script() {
cp /opt/wealthfolio/.env /opt/wealthfolio_env_backup
msg_ok "Backed up Data"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "wealthfolio" "afadil/wealthfolio" "tarball" "v${RELEASE}"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "wealthfolio" "afadil/wealthfolio" "tarball"
msg_info "Building Frontend (patience)"
cd /opt/wealthfolio

View File

@@ -51,8 +51,8 @@ WF_DB_PATH=/opt/wealthfolio_data/wealthfolio.db
WF_SECRET_KEY=${SECRET_KEY}
WF_AUTH_PASSWORD_HASH=${WF_PASSWORD_HASH}
WF_STATIC_DIR=/opt/wealthfolio/dist
WF_CORS_ALLOW_ORIGINS=*
WF_REQUEST_TIMEOUT_MS=30000
WF_CORS_ALLOW_ORIGINS=http://${LOCAL_IP}:8080
EOF
echo "WF_PASSWORD=${WF_PASSWORD}" >~/wealthfolio.creds
msg_ok "Configured Wealthfolio"

View File

@@ -2008,8 +2008,6 @@ verify_gpg_fingerprint() {
# 0 on success (tag printed to stdout), 1 on failure
#
# Notes:
# - When a prefix is given, uses the matching-refs API for server-side
# filtering (avoids pagination issues with repos that have 100+ tags)
# - Skips tags containing "rc", "alpha", "beta", "dev", "test"
# - Sorts by version number (sort -V) to find the latest
# - Respects GITHUB_TOKEN for rate limiting
@@ -2023,21 +2021,11 @@ get_latest_gh_tag() {
[[ -n "${GITHUB_TOKEN:-}" ]] && header_args=(-H "Authorization: Bearer $GITHUB_TOKEN")
local http_code=""
local api_url=""
# When a prefix is given, use the matching-refs API for server-side filtering.
# This avoids pagination issues with repos that have hundreds of tags (e.g. mongodb/mongo-tools).
if [[ -n "$prefix" ]]; then
api_url="https://api.github.com/repos/${repo}/git/matching-refs/tags/${prefix}"
else
api_url="https://api.github.com/repos/${repo}/tags?per_page=100"
fi
http_code=$(curl -sSL --max-time 20 -w "%{http_code}" -o /tmp/gh_tags.json \
-H 'Accept: application/vnd.github+json' \
-H 'X-GitHub-Api-Version: 2022-11-28' \
"${header_args[@]}" \
"$api_url" 2>/dev/null) || true
"https://api.github.com/repos/${repo}/tags?per_page=100" 2>/dev/null) || true
if [[ "$http_code" == "401" ]]; then
msg_error "GitHub API authentication failed (HTTP 401)."
@@ -2075,19 +2063,12 @@ get_latest_gh_tag() {
tags_json=$(</tmp/gh_tags.json)
rm -f /tmp/gh_tags.json
# Extract tag names depending on API response format
# Extract tag names, filter by prefix, exclude pre-release patterns, sort by version
local latest=""
if [[ -n "$prefix" ]]; then
# matching-refs API returns {"ref": "refs/tags/100.14.1", ...}
latest=$(echo "$tags_json" | grep -oP '"ref":\s*"refs/tags/\K[^"]+' |
grep -viE '(rc|alpha|beta|dev|test|preview|snapshot)' |
sort -V | tail -n1)
else
# tags API returns {"name": "v1.2.3", ...}
latest=$(echo "$tags_json" | grep -oP '"name":\s*"\K[^"]+' |
grep -viE '(rc|alpha|beta|dev|test|preview|snapshot)' |
sort -V | tail -n1)
fi
latest=$(echo "$tags_json" | grep -oP '"name":\s*"\K[^"]+' |
{ [[ -n "$prefix" ]] && grep "^${prefix}" || cat; } |
grep -viE '(rc|alpha|beta|dev|test|preview|snapshot)' |
sort -V | tail -n1)
if [[ -z "$latest" ]]; then
msg_warn "No matching tags found for ${repo}${prefix:+ (prefix: $prefix)}"