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:
+8
-5
@@ -45,12 +45,15 @@ const
|
||||
// remplace. Rien de secret ne doit vivre ici - le jeton et le mot de passe
|
||||
// viennent du fichier local hors depot, plus bas.
|
||||
//
|
||||
// Le port differe selon la plateforme : sur Windows on attaque Apache
|
||||
// directement (80), sur Android on passe par "adb reverse tcp:8080 tcp:80",
|
||||
// qui fait voir le PC comme 127.0.0.1 - ce qui satisfait au passage
|
||||
// l'exemption HTTPS de l'endpoint, reservee a la boucle locale.
|
||||
// API DES CONTENUS DE GITEA, pas l'URL du depot : c'est elle qui rend le
|
||||
// fichier avec son sha. Le client la reconnait a "/api/v1/repos/" et bascule
|
||||
// sur ce transport (en-tete "token", corps JSON, base64) ; toute autre URL
|
||||
// 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)}
|
||||
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}
|
||||
FIRSTRUN_URL = 'http://127.0.0.1/server-php/sync.php';
|
||||
{$ENDIF}
|
||||
|
||||
Reference in New Issue
Block a user