firmware: v4 — fix OTA repo privado
- Añadido token de autenticacion a todas las peticiones Gitea - version.txt y firmware.bin se solicitan con ?token=... - Sin token el repo privado devuelve 404 y el OTA no arrancaba Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,11 +10,12 @@
|
||||
// ================================================================
|
||||
// OTA CONFIG
|
||||
// ================================================================
|
||||
#define FW_VERSION 3
|
||||
#define FW_VERSION 4
|
||||
#define GITEA_HOST "https://git.nacho.myds.me"
|
||||
#define GITEA_OWNER "Natxo"
|
||||
#define GITEA_REPO "Arduino-Car"
|
||||
#define GITEA_BRANCH "main"
|
||||
#define GITEA_TOKEN "d3b0b32eb0311c9b4ef569f22c8392c373ff3f9f"
|
||||
// ================================================================
|
||||
|
||||
const char *ssid = "Natxo";
|
||||
@@ -29,10 +30,11 @@ static void checkOTA() {
|
||||
client.setInsecure(); // cert Let's Encrypt/autofirmado — OK para LAN privada
|
||||
HTTPClient http;
|
||||
|
||||
String base = String(GITEA_HOST) + "/" + GITEA_OWNER + "/" + GITEA_REPO
|
||||
+ "/raw/branch/" + GITEA_BRANCH + "/firmware/esp32cam/";
|
||||
String base = String(GITEA_HOST) + "/" + GITEA_OWNER + "/" + GITEA_REPO
|
||||
+ "/raw/branch/" + GITEA_BRANCH + "/firmware/esp32cam/";
|
||||
String token = "?token=" + String(GITEA_TOKEN);
|
||||
|
||||
http.begin(client, base + "version.txt");
|
||||
http.begin(client, base + "version.txt" + token);
|
||||
http.setTimeout(10000);
|
||||
int code = http.GET();
|
||||
String body;
|
||||
@@ -59,7 +61,7 @@ static void checkOTA() {
|
||||
updateClient.setInsecure();
|
||||
httpUpdate.setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS);
|
||||
httpUpdate.rebootOnUpdate(true);
|
||||
httpUpdate.update(updateClient, base + "firmware.bin");
|
||||
httpUpdate.update(updateClient, base + "firmware.bin" + token);
|
||||
// Si llega aquí, el update falló — continúa arranque normal
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user