From 738dea431c6d7f351ecc718c32eedfa81cf25cf6 Mon Sep 17 00:00:00 2001 From: nakulbh Date: Wed, 17 Sep 2025 04:00:14 +0530 Subject: [PATCH] fix: add missing .env.example and service-alerts-url flag - Add .env.example with required REALTIME_AUTH_HEADER_VALUE - Add missing -service-alerts-url flag to main.go - Fix Makefile to properly use service-alerts-url flag Fixes #116 --- .env.example | 6 ++++++ Makefile | 4 ++-- cmd/api/main.go | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..adb9815 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +# Environment variables for Maglev OneBusAway API Server +# Copy this file to .env and fill in the required values + +# Real-time data authentication header value for Unitrans GTFS-RT feeds +# This is required for accessing the UMO IQ API for real-time transit data +REALTIME_AUTH_HEADER_VALUE=your_api_key_here \ No newline at end of file diff --git a/Makefile b/Makefile index 358d8a1..e737669 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,8 @@ run: build -trip-updates-url=https://webservices.umoiq.com/api/gtfs-rt/v1/trip-updates/unitrans \ -vehicle-positions-url=https://webservices.umoiq.com/api/gtfs-rt/v1/vehicle-positions/unitrans \ -realtime-auth-header-name=x-umo-iq-api-key \ - -realtime-auth-header-value=$(REALTIME_AUTH_HEADER_VALUE) - -service-alerts-url=https://webservices.umoiq.com/api/gtfs-rt/v1/service-alerts/unitrans \ + -realtime-auth-header-value=$(REALTIME_AUTH_HEADER_VALUE) \ + -service-alerts-url=https://webservices.umoiq.com/api/gtfs-rt/v1/service-alerts/unitrans build: go build -gcflags "all=-N -l" -o bin/maglev ./cmd/api diff --git a/cmd/api/main.go b/cmd/api/main.go index b302904..982cb11 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -34,6 +34,7 @@ func main() { flag.StringVar(>fsCfg.VehiclePositionsURL, "vehicle-positions-url", "https://api.pugetsound.onebusaway.org/api/gtfs_realtime/vehicle-positions-for-agency/40.pb?key=org.onebusaway.iphone", "URL for a GTFS-RT vehicle positions feed") flag.StringVar(>fsCfg.RealTimeAuthHeaderKey, "realtime-auth-header-name", "", "Optional header name for GTFS-RT auth") flag.StringVar(>fsCfg.RealTimeAuthHeaderValue, "realtime-auth-header-value", "", "Optional header value for GTFS-RT auth") + flag.StringVar(>fsCfg.ServiceAlertsURL, "service-alerts-url", "", "URL for a GTFS-RT service alerts feed") flag.StringVar(>fsCfg.GTFSDataPath, "data-path", "./gtfs.db", "Path to the SQLite database containing GTFS data") flag.Parse()