updated transit api
Build and Push Docker Images / detect-changes (push) Successful in 10s
Build and Push Docker Images / build-auth-api (push) Successful in 1m0s
Build and Push Docker Images / build-employee-api (push) Successful in 1m3s
Build and Push Docker Images / build-transit-api (push) Successful in 59s
Build and Push Docker Images / build-error-log-api (push) Successful in 1m9s
Build and Push Docker Images / build-admin-ui (push) Successful in 1m20s
Build and Push Docker Images / deploy-test-node (push) Successful in 4s

This commit is contained in:
Sven laptop
2026-09-18 20:08:10 +02:00
parent 1154d1d658
commit f935bbeb8c
9 changed files with 144 additions and 13 deletions
+21 -3
View File
@@ -2,9 +2,13 @@
Native Win32 driver client targeting Windows XP-era systems.
The client authenticates with `https://auth.xtransit.testinstance.nl`, then requests
assigned weekly schedule templates from
`https://transit.xtransit.testinstance.nl/driver/schedules/daily`.
For Windows XP compatibility, the client temporarily uses the LAN services:
- Login: `http://192.168.68.66:5000/login`
- Assigned schedules: `http://192.168.68.66:5001/driver/schedules/daily`
- Route stops: `http://192.168.68.66:5001/bus-lines/:busLineId/stops`
This HTTP fallback avoids the TLS 1.2/certificate limitations of Windows XP.
Schedules are assigned through `transit.shifts`; the client does not expect a
`driver_id`, `bus_id`, or `weekdays` column on `transit.schedules`.
@@ -25,3 +29,17 @@ makensis installer.nsi
Distribute `TransitDriverXPSetup.exe`. It detects an existing installation,
stops the previous client, and replaces it in the same directory.
## Login diagnostics
If the app shows `Driver service unreachable`, open `driver_xp.log` in the same
folder as the installed `driver_xp.exe` and inspect the latest entries. The log
records the failing stage and WinHTTP or HTTP status code, but never writes the
password or JWT token.
Common codes:
- `12007`: hostname could not be resolved (DNS)
- `12029`: connection to the server failed
- `12175`: HTTPS certificate or TLS validation failed
- `401` or `403`: the server responded, but authentication was rejected
Binary file not shown.
+30 -6
View File
@@ -25,7 +25,7 @@
#define ID_ROUTES_LABEL 116
#define MAX_BUF 65535
#define API_HOST "auth.xtransit.testinstance.nl"
#define API_HOST "192.168.68.66"
#define AUTH_PORT 5000
#define TRANSIT_PORT 5001
@@ -52,6 +52,30 @@ static void SetOutputText(HWND hwnd, const char *text)
SetWindowTextA(GetDlgItem(hwnd, ID_OUTPUT), text);
}
static void LogDiagnostic(const char *stage, DWORD code)
{
char path[MAX_PATH];
char *separator;
FILE *file;
GetModuleFileNameA(NULL, path, sizeof(path));
separator = strrchr(path, '\\');
if (separator) {
*(separator + 1) = '\0';
} else {
snprintf(path, sizeof(path), ".\\");
}
strncat(path, "driver_xp.log", sizeof(path) - strlen(path) - 1);
file = fopen(path, "a");
if (!file) {
return;
}
fprintf(file, "%s: %lu\r\n", stage, (unsigned long)code);
fclose(file);
}
static void ShowControl(HWND hwnd, int id, int visible)
{
ShowWindow(GetDlgItem(hwnd, id), visible ? SW_SHOW : SW_HIDE);
@@ -516,8 +540,7 @@ static void ExtractTokenFromJson(const char *json, char *outToken, size_t outSiz
static void HttpErrorMessage(const char *context, DWORD error)
{
(void)context;
(void)error;
LogDiagnostic(context, error);
}
static int HttpRequestText(const char *method,
@@ -690,6 +713,7 @@ static int HttpRequestText(const char *method,
}
if (status >= 400) {
LogDiagnostic("HTTP response status", status);
snprintf(response, responseSize, "HTTP error %lu", status);
ok = 0;
goto cleanup;
@@ -749,7 +773,7 @@ static void PerformLogin(HWND hwnd, APPSTATE *state)
userCode, password);
SetStatusText(hwnd, "Logging in...");
if (!HttpRequestText("POST", "https://auth.xtransit.testinstance.nl/login", payload, NULL, response, sizeof(response))) {
if (!HttpRequestText("POST", "http://192.168.68.66:5000/login", payload, NULL, response, sizeof(response))) {
SetOutputText(hwnd, "Driver service unreachable. Please try again.");
SetStatusText(hwnd, "Login failed");
return;
@@ -786,7 +810,7 @@ static void PerformRefresh(HWND hwnd, APPSTATE *state)
if (date[0] == '\0') {
snprintf(date, sizeof(date), "2026-09-17");
}
snprintf(scheduleUrl, sizeof(scheduleUrl), "https://transit.xtransit.testinstance.nl/driver/schedules/daily?date=%s", date);
snprintf(scheduleUrl, sizeof(scheduleUrl), "http://192.168.68.66:5001/driver/schedules/daily?date=%s", date);
SetStatusText(hwnd, "Loading schedule...");
if (!HttpRequestText("GET", scheduleUrl, NULL, authHeader, response, sizeof(response))) {
@@ -827,7 +851,7 @@ static void PerformLoadStops(HWND hwnd, APPSTATE *state)
}
snprintf(authHeader, sizeof(authHeader), "Authorization: Bearer %s\r\n", state->token);
snprintf(stopsUrl, sizeof(stopsUrl), "https://transit.xtransit.testinstance.nl/bus-lines/%d/stops", lineId);
snprintf(stopsUrl, sizeof(stopsUrl), "http://192.168.68.66:5001/bus-lines/%d/stops", lineId);
SetStatusText(hwnd, "Loading stop details...");
if (!HttpRequestText("GET", stopsUrl, NULL, authHeader, response, sizeof(response))) {
Binary file not shown.