A cloud-native, asynchronous Telegram bot for tracking Tesla vehicle orders with granular detail.
Unlike simple tracking scripts, this system is architected to run permanently on Kubernetes, supporting multi-user environments, persistence, and deep inspection of "hidden" Tesla API data (Akamai Gateway).
🚀 Try it instantly: You don't need to install anything! Start using the public bot right now: @TeslaDeliveryTrackerBot
- 🔎 Deep Intel: Decodes
option codes(e.g., "Matrix Headlights", "LFP Battery", "HW4") and VIN factory data. - 🖼️ Visuals: Fetches the exact render (image) of your car configuration.
- ⚡ Async & Fast: Built on
python-telegram-botv20+ withasyncioandhttpx. - ☁️ K8s Native:
- Self-Healing: Liveness probes ensure 24/7 uptime.
- Persistent: SQLite/JSON database stored on PVCs (survives pod restarts).
- 👥 Multi-User: One bot instance serves multiple users, each with their own secure token.
- 🛡️ Secure:
- OAuth 2.0 PKCE flow.
- Non-root container execution.
- Secrets management via K8s Secrets.
The system is deployed as a single Microservice in the tesla-app namespace.
graph LR
User[Telegram User] -->|Commands| Bot[Tesla Tracker Pod]
Bot -->|Auth & Polling| Tesla[Tesla API / Akamai]
Bot -->|Read/Write| PVC[(Persistent Storage)]
subgraph Kubernetes
Bot
PVC
end
- Kubernetes Cluster (Minikube, K3s, or Cloud)
kubectlconfigured- Docker (for building the image)
git clone https://github.com/XaviFortes/tesla-tracker.git
cd tesla-trackerYou need a Telegram Bot Token (from @BotFather) and an initial Tesla Refresh Token.
Generate Tesla Token: Run the helper script locally to perform the OAuth flow:
uip install httpx
python get_initial_token.pySave the Refresh Token output!
Configure K8s Secrets: Copy the example and edit it:
cp k8s/secrets.example.yaml k8s/secrets.yaml
# Edit k8s/secrets.yaml with your BASE64 encoded Telegram Token
# (Tesla Token is now handled dynamically via /login command, not secrets!)If you are running on a remote cluster (VPS), cross-compile for AMD64:
# Build
docker build --platform linux/amd64 -t youruser/tesla-tracker:latest .
docker push youruser/tesla-tracker:latest
# Update deployment.yaml image to match 'youruser/tesla-tracker:latest'Deploy to Kubernetes:
kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/Open your bot in Telegram and authenticate:
- Start the bot:
/start - Login:
/login <YOUR_REFRESH_TOKEN>- The bot will validate it and begin polling.
- Check Status:
/status
| Command | Description |
|---|---|
/login <token> |
Required. Log in with your Tesla Refresh Token. |
/logout |
Remove your data from the bot. |
/status |
Check for updates immediately. |
/vin |
Decode VIN usage (Factory, Year). |
/options |
List all decoded hardware/software options. |
/image |
Generate a high-res image of your car. |
/interval <min> |
Set polling frequency (default 30m). |
ImagePullBackOff? Ensure your secret is base64 encoded correctly and your image is pushed to a registry accessible by the cluster.
403 Forbidden?
Tesla blocks old App Versions. Update APP_VERSION in main.py and rebuild.
Bot not replying?
Check logs: kubectl logs -l app=tesla-tracker -n tesla-app -f
MIT