v2.3.8: auto-update agent from GitHub releases, add dl1 mirror fallback

- Agent auto-update: check GitHub releases API for new versions, download
  only when update available, track version in .version file
- Add dl1.htdwnldsan.top as backup-2 mirror in patches config sources
- Add dl1.htdwnldsan.top as primary non-Cloudflare mirror
- Graceful fallback: use existing agent if update check or download fails

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
sanasol
2026-02-21 23:31:28 +01:00
parent 9b20c454d3
commit cb7f7e51bf
2 changed files with 69 additions and 17 deletions

View File

@@ -7,16 +7,17 @@ const { getOS, getArch } = require('../utils/platformUtils');
// Patches base URL fetched dynamically via multi-source fallback chain
const AUTH_DOMAIN = process.env.HYTALE_AUTH_DOMAIN || 'auth.sanasol.ws';
const PATCHES_CONFIG_SOURCES = [
{ type: 'http', url: `https://${AUTH_DOMAIN}/api/patches-config`, name: 'auth-server' },
{ type: 'http', url: 'https://htdwnldsan.top/patches-config', name: 'backup-http' },
{ type: 'http', url: `https://${AUTH_DOMAIN}/api/patches-config`, name: 'primary' },
{ type: 'http', url: 'https://htdwnldsan.top/patches-config', name: 'backup-1' },
{ type: 'http', url: 'https://dl1.htdwnldsan.top/patches-config', name: 'backup-2' },
{ type: 'doh', name: '_patches.htdwnldsan.top', name_label: 'dns-txt' },
];
const HARDCODED_FALLBACK = 'https://dl.vboro.de/patches';
// Non-Cloudflare mirrors for users where Cloudflare IPs are blocked (Russia, Ukraine, etc.)
// These redirect to MEGA S3 which is not behind Cloudflare
// Alternative mirrors (non-Cloudflare) for regions where CF is blocked
const NON_CF_MIRRORS = [
'https://htdwnldsan.top/patches', // Direct IP VPS → MEGA redirect
'https://dl1.htdwnldsan.top',
'https://htdwnldsan.top/patches',
];
// Fallback: latest known build number if manifest is unreachable