chore(android): the Gitea contents URL becomes the first-run value

The saved settings win over the first-run constants, so a typed URL that never
survived a successful transport kept losing to the old PHP endpoint. The
device's settings.bin was removed (the vault cache was NOT - it is the only
offline copy on that phone, and wiping it is not needed to change an address).

The Android constant now points at the contents API rather than the repo URL:
it is the one that returns the file with its sha, and the client recognises
"/api/v1/repos/" to pick that transport. Windows keeps the local endpoint - the
machine hosts it, and nothing requires it to go out on the network to read
itself.

The token stays out of the repository, as does the sync password: both live in
the gitignored PMA.LocalConfig.inc, or get typed on the device.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-08-17 14:00:59 +01:00
parent 661aac744c
commit c2f7f47eba
+8 -5
View File
@@ -45,12 +45,15 @@ const
// remplace. Rien de secret ne doit vivre ici - le jeton et le mot de passe // remplace. Rien de secret ne doit vivre ici - le jeton et le mot de passe
// viennent du fichier local hors depot, plus bas. // viennent du fichier local hors depot, plus bas.
// //
// Le port differe selon la plateforme : sur Windows on attaque Apache // API DES CONTENUS DE GITEA, pas l'URL du depot : c'est elle qui rend le
// directement (80), sur Android on passe par "adb reverse tcp:8080 tcp:80", // fichier avec son sha. Le client la reconnait a "/api/v1/repos/" et bascule
// qui fait voir le PC comme 127.0.0.1 - ce qui satisfait au passage // sur ce transport (en-tete "token", corps JSON, base64) ; toute autre URL
// l'exemption HTTPS de l'endpoint, reservee a la boucle locale. // est traitee comme l'endpoint PHP.
//
// Sur Windows on garde l'endpoint local : c'est la machine qui l'heberge, et
// rien ne l'oblige a sortir sur le reseau pour se lire elle-meme.
{$IF DEFINED(ANDROID)} {$IF DEFINED(ANDROID)}
FIRSTRUN_URL = 'http://127.0.0.1:8080/server-php/sync.php'; FIRSTRUN_URL = 'https://git.ai-agents4you.com/api/v1/repos/Zaki/pm_sync/contents/vault-sync.json';
{$ELSE} {$ELSE}
FIRSTRUN_URL = 'http://127.0.0.1/server-php/sync.php'; FIRSTRUN_URL = 'http://127.0.0.1/server-php/sync.php';
{$ENDIF} {$ENDIF}