{"id":15058997,"url":"https://github.com/waynejz/teslamate-addr-fix","last_synced_at":"2025-04-22T12:28:29.829Z","repository":{"id":100535137,"uuid":"560689819","full_name":"WayneJz/teslamate-addr-fix","owner":"WayneJz","description":"To fix teslamate broken addresses caused by openstreetmap unavailability","archived":false,"fork":false,"pushed_at":"2024-07-22T16:14:21.000Z","size":375,"stargazers_count":74,"open_issues_count":8,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T15:11:17.465Z","etag":null,"topics":["golang","openstreetmap","teslamate"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WayneJz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-02T03:23:42.000Z","updated_at":"2025-03-26T09:39:03.000Z","dependencies_parsed_at":"2025-01-16T11:09:15.074Z","dependency_job_id":"36008554-7bcf-47f5-adaf-b9493528669f","html_url":"https://github.com/WayneJz/teslamate-addr-fix","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"1e3649d96664b6a20971280bfc616930d320b010"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WayneJz%2Fteslamate-addr-fix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WayneJz%2Fteslamate-addr-fix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WayneJz%2Fteslamate-addr-fix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WayneJz%2Fteslamate-addr-fix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WayneJz","download_url":"https://codeload.github.com/WayneJz/teslamate-addr-fix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250240167,"owners_count":21397826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","openstreetmap","teslamate"],"created_at":"2024-09-24T22:35:10.870Z","updated_at":"2025-04-22T12:28:29.786Z","avatar_url":"https://github.com/WayneJz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# teslamate-addr-fix\nTo fix teslamate broken addresses caused by openstreetmap unavailability\n\n[中文说明](README_CN.md)\n\n## Notice\n\n**Must create a [backup](https://docs.teslamate.org/docs/maintenance/backup_restore) before doing this.**\n\n\n## Pre-requisite\n- You have teslamate [broken address issue](https://github.com/adriankumpf/teslamate/issues/2956)\n\n- You have access to openstreetmap.org **via your HTTP proxy**\n\n\n## Demo\n\nBefore: (no start/destination info since OSM blocked)\n![Before](demo/before.jpg)\n\nAfter fixed:\n![After](demo/after.jpg)\n\n## Install Guide (Choose one only)\n\n### 1. Docker Compose (Recommended)\n\n- Ensure your HTTP proxy is set to **\"allow LAN use\"**, and find the **LAN IP:Port**. For example, a proxy LAN IP is set to `192.168.x.x`. Commonly **SHOULD NOT** be the localhost `127.x.x.x` or docker host `172.x.x.x`\n\n- Modify teslamate docker compose file:\n\n\t```\n\t# Insert below 'database' section\n\n\tteslamate-addr-fix:\n      image: waynejz/teslamate-addr-fix\n      restart: always\n      platform: linux/amd64\n      environment:\n\t    - PROXY=http://192.168.0.100:7890    # Set your HTTP proxy\n        - DATABASE_USER=teslamate\n        - DATABASE_PASS=123456               # Copy from 'teslamate' section\n        - DATABASE_NAME=teslamate\n        - DATABASE_HOST=database\n      depends_on:\n        - database\n\t```\n\n\tIf you have modified the other default values (such as DATABASE_HOST), then you should copy and replace them from 'teslamate' section as well.\n\n- Then execute `docker-compose up -d` to recreate docker. This tool will run with teslamate in the same subnetwork. After serveral minutes, check your teslamate grafana drive graph if anything correct.\n\n### 2. Binary Installation \n\n- Download this tool from [releases page](https://github.com/WayneJz/teslamate-addr-fix/releases). Ensure you download the right binary for your OS arch/version.\n\n- Expose your teslamate postgres port to your host. If you are using docker compose, just simply add port in the .yml file, then execute `docker-compose up -d` to recreate docker.\n\n\t```\n\tdatabase:\n\t\timage: postgres:14\n\t\trestart: always\n\t\tenvironment:\n\t\t- POSTGRES_USER=teslamate\n\t\t- POSTGRES_PASSWORD=xxxxxxxx\n\t\t- POSTGRES_DB=teslamate\n\n\t\t# add this\n\t\tports:\n\t\t- 5432:5432 \n\t```\n\n- Configure and turn your HTTP proxy on. You can either set the system proxy beforehand or set the proxy at runtime. System proxy setting is like:\n\n\t```\n\t# Your .bashrc/.zshrc\n\n\texport all_proxy=socks5://127.0.0.1:7890\n\texport http_proxy=http://127.0.0.1:7890\n\texport https_proxy=http://127.0.0.1:7890\n\t```\n\n- Run the help command by `./teslamate-addr-fix -h`. At least you should specify your teslamate psql password, otherwise it cannot connect to teslamate database. The other arguments should be specified if not same as default.\n\n\t```\n\tUsage of ./teslamate-addr-fix:\n\t-db string\n\t\t\tteslamate psql database (default \"teslamate\")\n\t-host string\n\t\t\tteslamate psql host (default \"127.0.0.1\")\n\t-interval int\n\t\t\tinterval (minutes) for running in daemon mode\n\t-password string\n\t\t\tteslamate psql password\n\t-port string\n\t\t\tteslamate psql port (default \"5432\")\n\t-proxy string\n\t\t\thttp proxy (default use system proxy)\n\t-timeout int\n\t\t\ttimeout of openstreetmap request (default 5)\n\t-user string\n\t\t\tteslamate psql user (default \"teslamate\")\n\t```\n\n- Follow the instruction and start fixing. Run the program with arguments such as `./teslamate-addr-fix -password 123456` , and the log will be printed in `teslamate-addr-fix.log`\n\n- After the program finished, check your teslamate grafana drive graph if anything correct.\n\n\n### 3. Native Docker (Not recommended)\n\nOf course you can use docker separately to run this tool, but since the tool has not join your teslamate subnetwork without docker compose, it could be hard and not recommended.\n\n- To run as native docker, the preparation includes **\"allow LAN use\"** AND **\"exposing teslamate postgres port to your host\"**, see content above for details\n\n- Pull the image and run in daemon mode:\n\n\t```\n\tdocker pull waynejz/teslamate-addr-fix:latest\n\n\tdocker run --name 'teslamate-addr-fix' --platform 'linux/amd64' \\\n\t-e PROXY='http://192.168.0.100:7890' \\ \n\t-e DATABASE_USER='teslamate' \\\n\t-e DATABASE_PASS='123456' \\\n\t-e DATABASE_NAME='teslamate' \\\n\t-e DATABASE_HOST='192.168.0.100' \\\n\t-e DATABASE_PORT='5432' \\\n\t-d waynejz/teslamate-addr-fix\n\t```\n\n\tNote both the `PROXY` and `DATABASE_HOST` should be LAN IPs. If encountered with syntax error, merge into one line and remove slashes and try again. \n\n- If run successfully, check your teslamate grafana drive graph if anything correct after serveral minutes.\n\n## FAQ\n\n- Q: My docker has problems when running, does the docker has other parameters to adjust?\n\n\tA: Extra parameters below can be set if necessary (DO NOT set if run properly):\n\n\t```\n\t- OSM_TIMEOUT=5          # timeout of openstreetmap request (default 5 seconds)\n\t- DATABASE_PORT=5432     # port of teslamate postgres (default 5432)\n\t- INTERVAL=5             # interval for running in daemon mode (default 5 minutes)\n\t```\n\n\tAfter adjust, a restart is required to take effect.\n\n- Q: This program has no log output, is it running correctly?\n\n\tA: If no broken address data to fix, then the program will not output any logs. You can check your drive graph.\n\n- Q: The addresses have been fixed, why I still cannot see the drive map?\n\n\tA: Drive map in Grafana is a frontend feature, so ensure your working computer (not NAS server) has access to openstreetmap, through web proxy if necessary.\n\n## Disclaimer\n\nOnly use this program after properly created backups, I am **not** responsible for any data loss or software failure related to this.\n\nThis project is only for study purpose, and **no web proxy (or its download link) provided**. If the network proxy is used in violation of local laws and regulations, the user is responsible for the consequences.\n\nWhen you download, copy, compile or execute the source code or binary program of this project, it means that you have accepted the disclaimer as mentioned.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaynejz%2Fteslamate-addr-fix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaynejz%2Fteslamate-addr-fix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaynejz%2Fteslamate-addr-fix/lists"}