Upload via GUI (267 Dateien)

This commit is contained in:
2026-10-19 18:05:57 +00:00
parent f3e53e6182
commit c800be9693
12 changed files with 2694 additions and 2082 deletions
+17 -1
View File
@@ -59,9 +59,25 @@ function update_find_assets(array $release, string $tag): array
return $out;
}
/**
* Zugangstoken für den Update-Server (nur nötig, wenn das Repository privat ist; Gitea antwortet sonst mit "404").
* Quelle: config/config.php ('update' => ['token' => '…']) hat Vorrang, sonst das in den Einstellungen der Update-Seite
* gespeicherte (verschlüsselt). Gibt [Token, Quelle] zurück, Quelle 'config', 'einstellungen' oder ''.
*
* @return array{0: string, 1: string}
*/
function update_token_info(): array
{
$fromConfig = trim((string) (config()['update']['token'] ?? ''));
if ($fromConfig !== '') return [$fromConfig, 'config'];
$stored = (string) get_setting('update_token', '');
$fromSettings = $stored !== '' ? trim(decrypt_secret($stored)) : '';
return $fromSettings !== '' ? [$fromSettings, 'einstellungen'] : ['', ''];
}
/** Kopfzeilen für Abrufe beim Update-Server; ein Zugangstoken ist nur nötig, wenn das Repository nicht öffentlich ist. */
function update_http_headers(): array
{
$token = (string) (config()['update']['token'] ?? '');
[$token] = update_token_info();
return $token !== '' ? ['Authorization: token ' . $token] : [];
}