{"id":24811188,"url":"https://github.com/thin-edge/tedge-config2mqtt-watcher","last_synced_at":"2025-03-25T13:24:17.940Z","repository":{"id":215478851,"uuid":"739032208","full_name":"thin-edge/tedge-config2mqtt-watcher","owner":"thin-edge","description":"thin-edge.io plugin to monitor the tedge config and publish the values as MQTT messages","archived":false,"fork":false,"pushed_at":"2024-02-08T18:49:24.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-30T12:19:48.737Z","etag":null,"topics":["community","iot","thin-edge"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thin-edge.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}},"created_at":"2024-01-04T16:04:48.000Z","updated_at":"2024-01-16T17:16:24.000Z","dependencies_parsed_at":"2024-01-04T17:49:23.510Z","dependency_job_id":null,"html_url":"https://github.com/thin-edge/tedge-config2mqtt-watcher","commit_stats":null,"previous_names":["thin-edge/tedge-config2mqtt-watcher"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Ftedge-config2mqtt-watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Ftedge-config2mqtt-watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Ftedge-config2mqtt-watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Ftedge-config2mqtt-watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thin-edge","download_url":"https://codeload.github.com/thin-edge/tedge-config2mqtt-watcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245468781,"owners_count":20620450,"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":["community","iot","thin-edge"],"created_at":"2025-01-30T12:19:36.097Z","updated_at":"2025-03-25T13:24:17.885Z","avatar_url":"https://github.com/thin-edge.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tedge-config2mqtt-watcher\n\n## Plugin summary\n\nThe watcher subscribes to file changes to the thin-edge.io tedge.toml file (under `/etc/tedge/tedge.toml`) and on any changes it reads the files, and publishes each of the configuration sections as individual MQTT messages on the `config/\u003csection_name\u003e` topic. This enables users to access any thin-edge.io configuration values directly via MQTT.\n\nWhen ever there is a file change on the /etc/tedge/tedge.toml there will be send out retained messages on the topic 'config/{{SECTION}}'. Below shows an example of how to subscribe to the configuration via MQTT:\n\n```sh\ntedge mqtt sub 'config/#'\n```\n\n```text\n[config/config] {\"version\": \"2\"}\n[config/c8y] {\"url\": \"test-ci-runner01.latest.stage.c8y.io\", \"proxy\": {\"bind\": {\"address\": \"0.0.0.0\"}, \"client\": {\"host\": \"tedge\"}}}\n[config/mqtt] {\"bind\": {\"address\": \"0.0.0.0\", \"port\": 1883}, \"client\": {\"host\": \"tedge\"}}\n[config/http] {\"bind\": {\"address\": \"0.0.0.0\"}, \"client\": {\"host\": \"tedge\"}}\n[config/apt] {\"name\": \"(tedge|c8y|python|wget|vim|curl|apt|mosquitto|ssh|sudo).*\"}\n[config/enable] {\"sudo\": true}\n```\n\n**Technical summary**\n\nThe following details the technical aspects of the plugin to get an idea what systems it supports.\n\n|||\n|--|--|\n|**Languages**|`python3`|\n|**CPU Architectures**|`all/noarch`. Not CPU specific|\n|**Supported init systems**|`systemd`|\n|**Required Dependencies**|`python3`|\n|**Optional Dependencies (feature specific)**|-|\n\n### How to do I get it?\n\nThe following linux package formats are provided on the releases page and also in the [tedge-community](https://cloudsmith.io/~thinedge/repos/community/packages/) repository:\n\n|Operating System|Repository link|\n|--|--|\n|Debian/Ubuntu|[![Latest version of 'tedge-config2mqtt-watcher' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/thinedge/community/deb/tedge-config2mqtt-watcher/latest/a=all;d=any-distro%252Fany-version;t=binary/?render=true\u0026show_latest=true)](https://cloudsmith.io/~thinedge/repos/community/packages/detail/deb/tedge-config2mqtt-watcher/latest/a=all;d=any-distro%252Fany-version;t=binary/)|\n|RHEL/CentOS/Fedora/openSUSE|[![Latest version of 'tedge-config2mqtt-watcher' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/thinedge/community/rpm/tedge-config2mqtt-watcher/latest/a=noarch;d=any-distro%252Fany-version;t=binary/?render=true\u0026show_latest=true)](https://cloudsmith.io/~thinedge/repos/community/packages/detail/rpm/tedge-config2mqtt-watcher/latest/a=noarch;d=any-distro%252Fany-version;t=binary/)|\n|Alpine Linux|[![Latest version of 'tedge-config2mqtt-watcher' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/thinedge/community/alpine/tedge-config2mqtt-watcher/latest/a=noarch;d=alpine%252Fany-version/?render=true\u0026show_latest=true)](https://cloudsmith.io/~thinedge/repos/community/packages/detail/alpine/tedge-config2mqtt-watcher/latest/a=noarch;d=alpine%252Fany-version/)|\n\n\n### What will be deployed to the device?\n\n* The following systemd services are installed:\n    * `tedge-config2mqtt-watcher``\n\n## Plugin Dependencies\n\nThe following packages are required to use the plugin:\n\n* python3\n\n## Development\n\nThe following tools are requires for local development. Please install them before following the instructions:\n\n* [nfpm](https://nfpm.goreleaser.com/tips/) - Tool to build linux packages\n* [go-c8y-cli](https://goc8ycli.netlify.app/) - A Cumulocity IoT CLI app\n* [c8y-tedge extension](https://github.com/thin-edge/c8y-tedge) - go-c8y-cli extension for thin-edge.io to help with bootstrapping\n\n### Start demo\n\n1. Build the package\n\n    ```sh\n    just build\n    ```\n\n2. Start the demo\n\n    ```sh\n    just up\n    ```\n\n3. Activate your Cumulocity IoT session in go-c8y-cli where you want to bootstrap the device to\n\n    ```sh\n    set-session\n    ```\n\n    `set-session` is part of [go-c8y-cli](https://goc8ycli.netlify.app/), check out the documentation for instructions on how to install and create your session if you don't already have one.\n\n4. Bootstrap the device\n\n    ```sh\n    just bootstrap\n    ```\n\n    The bootstrap command used the [c8y-tedge extension](https://github.com/thin-edge/c8y-tedge).\n\n### Stop demo\n\n```sh\njust down\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthin-edge%2Ftedge-config2mqtt-watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthin-edge%2Ftedge-config2mqtt-watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthin-edge%2Ftedge-config2mqtt-watcher/lists"}