Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/development/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ GTT rotates trip IDs between daily exports while stop IDs stay stable, and most

### Publication

**Status (2026-11): no mirror is configured and the workflow is disabled.** GTT's static-export host refuses connections from GitHub-hosted runners (two runs failed with a TCP connect timeout while the same URL answered from an Italian connection), so the pipeline cannot build in GitHub Actions. `TIMETABLE_MIRRORS` is empty, so devices make no mirror requests; timetable freshness comes with app releases, and rotated trip IDs are handled by the direct GTT identity remap. Re-enabling requires running the pipeline from a host that can reach GTT and listing the mirrors again.

Mirrors are an optional freshness layer: boards work fully without them (bundled package, direct GTT identity remap below, GTT realtime). The app reads an ordered list of mirrors from `TIMETABLE_MIRRORS` in `src/transit-data/config.ts` and uses the next one only when one fails: GitHub Pages (`manifest.json`, `packages/gtt-<sha256>.json`), then the assets of one rolling GitHub **prerelease** tagged `gtt-timetable` (`manifest.json`, `gtt-<sha256>.json`; release assets cannot contain `/`). The data prerelease is created with `--prerelease --latest=false`, re-asserted on every run, and its assets are replaced in place (packages first, then the manifest, then stale assets removed), so release trackers such as Obtainium keep following the app's own latest release. Its notes say it is not an app release.

`.github/workflows/gtt-timetable.yml` runs at 03:15, 06:15, 12:15 and 18:15 UTC and on manual dispatch. `scripts/gtt-pipeline.py` downloads the ZIP with `If-None-Match`/`If-Modified-Since` from the published manifest, builds and validates the package, and publishes to GitHub Pages only when the package hash changed, or when the published upstream confirmation is older than 20 hours (a manifest-only heartbeat, so devices can tell an unchanged upstream from a stalled pipeline). Previous packages are re-downloaded, re-verified and kept beside the current one. The workflow uses no secrets and never receives signing credentials; the release-mirror job alone has `contents: write` (needed for release assets), checks out no code and only uploads the verified files. The Pages deployment is opt-in: set **Settings → Pages → Build and deployment → Source: GitHub Actions**, then the repository variable `GTT_PAGES_ENABLED` to `true`. Without it only the Releases mirror is updated, and because the pipeline reads the previous manifest from Pages, each run then publishes a fresh package set without carried rollback packages.
Expand Down
2 changes: 1 addition & 1 deletion src/services/notices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const PROVIDER_NOTICES = [
{ name: 'Luoghi', text: `Overture Maps Foundation. Pacchetto di ${manifest.places.count.toLocaleString('it-IT')} record, release ${manifest.places.release}; estensione indicata dal confine tratteggiato sulla mappa. Dati incompleti; fonti e licenze conservate per ogni luogo.`, url: 'https://docs.overturemaps.org/attribution/' },
{ name: 'Ricerca online', text: 'Photon / OpenStreetMap: se la ricerca online è abilitata, nomi e indirizzi cercati e area vengono inviati al servizio. Le categorie sono cercate nel pacchetto locale. Nessuna disponibilità garantita.', url: 'https://photon.komoot.io' },
{ name: 'Percorsi stradali', text: 'FOSSGIS / OpenStreetMap: partenza e destinazione inviate al servizio e registrate nei log. Massimo una richiesta al secondo; servizio pubblico per uso moderato.', url: 'https://www.openstreetmap.org/fixthemap' },
{ name: 'Fermate e previsioni', text: `Data source: GTT S.p.A. – Gruppo Torinese Trasporti. Dati per uso non commerciale. Orari programmati GTT ${manifest.gtt.version} inclusi nell’app; versioni più recenti verificate tramite hash vengono scaricate da ${mirrorHosts().join(', ')} (il server vede indirizzo IP e ora della richiesta, non la fermata né la posizione). Il feed tempo reale è scaricato per l’intera città: non contiene la tua posizione né la fermata scelta.`, url: 'https://www.gtt.to.it' },
{ name: 'Fermate e previsioni', text: `Data source: GTT S.p.A. – Gruppo Torinese Trasporti. Dati per uso non commerciale. Orari programmati GTT ${manifest.gtt.version} inclusi nell’app; ${mirrorHosts().length ? `versioni più recenti verificate tramite hash vengono scaricate da ${mirrorHosts().join(', ')} (il server vede indirizzo IP e ora della richiesta, non la fermata né la posizione).` : 'gli aggiornamenti arrivano con le nuove versioni dell’app; quando GTT cambia i codici delle corse l’app legge da gtt.to.it solo l’elenco corse e i calendari (non la fermata né la posizione).'} Il feed tempo reale è scaricato per l’intera città: non contiene la tua posizione né la fermata scelta.`, url: 'https://www.gtt.to.it' },
{ name: STOP_LIVE_SETTING, text: STOP_LIVE_DISCLOSURE, url: 'https://www.gtt.to.it' },
{ name: 'Orari GTT: identità delle corse', text: 'Quando GTT riassegna gli identificativi delle corse, l’app legge direttamente dall’archivio orari ufficiale GTT (www.gtt.to.it) solo l’elenco corse e i calendari, con richieste parziali condizionali al massimo una volta al giorno (con «Aggiorna orari», al massimo ogni 10 minuti) e solo con una bacheca aperta. Non invia fermata né posizione; GTT vede indirizzo IP e ora della richiesta.', url: 'https://www.gtt.to.it/open_data/gtt_gtfs.zip' },
{ name: 'Treni e ricerca su Transitous', text: 'Transitous (servizio comunitario, uso non commerciale) riceve solo su tua richiesta: il codice della stazione o fermata quando apri una bacheca treni o scegli «Cerca su Transitous», il codice della corsa quando ne apri le fermate, il testo digitato quando cerchi una fermata per nome. Mai la tua posizione. Transitous registra indirizzo IP, ora, URL della richiesta e User-Agent (nome e versione dell’app) e conserva i log fino a 2 giorni. Dati da BusOne (https://busone.app) and Trenitalia; BusOne (https://busone.app) and GTT. Fonti complete al link.', url: 'https://transitous.org/sources/' },
Expand Down
14 changes: 8 additions & 6 deletions src/transit-data/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ export interface TimetableMirror {
/** Hosts that also receive the request through redirects (for privacy notices). */
redirectHosts?: readonly string[];
}
export const TIMETABLE_MIRRORS: readonly TimetableMirror[] = [
{ base: 'https://avoid-quest.github.io/maps/gtt/', layout: 'tree' },
// Assets of the rolling `gtt-timetable` prerelease (never marked "latest").
// Release downloads redirect to GitHub's asset CDN, which also sees the request.
{ base: 'https://github.com/avoid-quest/maps/releases/download/gtt-timetable/', layout: 'flat', redirectHosts: ['release-assets.githubusercontent.com', 'objects.githubusercontent.com'] },
];
/**
* No mirror is configured: GTT's static-export host refuses connections from GitHub-hosted
* runners, so the CI pipeline cannot build packages (the workflow is disabled). Phones reach GTT
* directly, so boards rely on the bundled package plus the identity remap read from GTT. To
* re-enable, publish packages from a host that can reach GTT and list the mirrors here, e.g.
* `{ base: 'https://avoid-quest.github.io/maps/gtt/', layout: 'tree' }`.
*/
export const TIMETABLE_MIRRORS: readonly TimetableMirror[] = [];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep direct-GTT controls available without timetable mirrors

On Android, emptying this list makes ScheduleStatus.updateSupported false, but StopBoardPanel.tsx:47–54 gates the entire settings section on that flag, including the per-stop live-data switch, Wi-Fi preference and manual remap refresh. Repository-wide search confirms these controls have no other UI entry point. Consequently, new users cannot enable per-stop predictions, while existing users with persisted stopLive=true continue sending the viewed stop to GTT but cannot turn that disclosure off. The manual updateSchedulesNow() remap retry also becomes unreachable despite remaining supported. Decouple these direct-GTT controls from mirror availability before disabling the mirrors.

Useful? React with 👍 / 👎.


export const manifestUrl = (mirror: TimetableMirror) => `${mirror.base}manifest.json`;
/** `packagePath` is validated as `packages/gtt-<sha256>.json` before this is called. */
Expand Down
Loading