{"id":16132695,"url":"https://github.com/sbrl/consulstatus","last_synced_at":"2025-06-14T09:06:59.274Z","repository":{"id":87743611,"uuid":"322906524","full_name":"sbrl/consulstatus","owner":"sbrl","description":"Simple public-facing consul-backed status page","archived":false,"fork":false,"pushed_at":"2021-10-08T01:31:37.000Z","size":190,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T14:45:01.090Z","etag":null,"topics":["consul","consul-api","status-page"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbrl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":"FUNDING.yml","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},"funding":{"liberapay":"sbrl"}},"created_at":"2020-12-19T17:57:03.000Z","updated_at":"2024-08-21T03:31:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"1d4aab34-1bb9-4796-b5e7-8349910cec94","html_url":"https://github.com/sbrl/consulstatus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sbrl/consulstatus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbrl%2Fconsulstatus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbrl%2Fconsulstatus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbrl%2Fconsulstatus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbrl%2Fconsulstatus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbrl","download_url":"https://codeload.github.com/sbrl/consulstatus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbrl%2Fconsulstatus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259790454,"owners_count":22911547,"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":["consul","consul-api","status-page"],"created_at":"2024-10-09T22:32:58.171Z","updated_at":"2025-06-14T09:06:59.267Z","avatar_url":"https://github.com/sbrl.png","language":"PHP","funding_links":["https://liberapay.com/sbrl"],"categories":[],"sub_categories":[],"readme":"# consulstatus\n\n\u003e Public-facing consul-backed status page\n\nA simple status page for your Consul services. Displays whether they are up or not with a simple status page. You can choose which services are displayed by specifying their names.\n\n**DISCLAIMER:** This project is not associated with Hashicorp or the Consul project in any way. It just uses the API of your consul instance. Hashicorp do not endorse (or even know about, probably) this project. Hashicorp and Consul are trademarks of Hashicorp®.\n\n## System Requirements\n - Consul instance (authentication isn't yet supported)\n - PHP 7+ enabled web server\n - [Composer](https://getcomposer.org/)\n\n## Installation\nClone this git repo:\n\n```bash\ngit clone https://github.com/sbrl/consulstatus.git\n```\n\n`cd` into the repository:\n\n```bash\ncd consulstatus;\n```\n\nInstall the Composer dependencies:\n\n```bash\ncomposer install\n```\n\nThen, point your web server at the `src` directory. For example, to start a PHP development web server:\n\n```bash\n# Run this from the root of the repository\nphp -S [::1]:4567 -t src\n```\n\nFinally, create the settings file. Relative to the root of the repository, it should be located `data/settings.toml`. It should look like this:\n\n```toml\ntitle = \"ExampleCloud Status Page\"\n\n[consul]\n# The base URL of the Consul API\nbase_url = \"http://127.0.0.1:8500\"\n# The list of services to show the status of\n\n[[service_group]]\nname = \"A Group\"\n\n\t[[service_group.services]]\n\tname = \"dashboard\"\n\tdescription = \"some description text. The description field is optional.\"\n\n\t[[service_group.services]]\n\tname = \"another_service\"\n\n[[service_group]]\nname = \"Another Group\"\n\n\t[[service_group.services]]\n\tname = \"apple\"\n\tdescription = \"The apple service\"\n\n\t[[service_group.services]]\n\tname = \"orange\"\n\tdescription = \"The orange service\"\n```\n\nThen, you should be able to load `index.php` in your web browser and it should work!\n\nOptionally, add a background section to seet a background image:\n\n```toml\n[background]\nimage=\"URL_OF_IMAGE\"\n\nmode=\"cover\" # Default, causes the background to be enlarged to cover the entire page\n# OR, for a fixed background that doesn't move:\nmode=\"fixed\"\n```\n\n## consulalerter\n`consulalerter.sh` is a small Bash script whose purpose is writing service check status updates to an MQTT server - more methods may be added in the future.\n\n**Warning:** The directory used for persisting state gets a number of writes (though attempts have been made to optimise this), so try to avoid it being on an SSD / flash memory.\n\nIt writes to the mqtt topic `consul/checks/status_changes` by default whenever the number of failed checks for a services changes in the following format:\n\n```json\n{\n    \"service_name\": \"SERVICE_NAME_HERE\",\n    \"checks\": {\n        \"total\": \"2\",\n        \"failed\": \"0\"\n    }\n}\n```\n\n - `service_name`: The name of the service whose status has changed\n - `checks.total`: The total number of checks the service has\n - `checks.failed`: The number of aforementioned checks that failed\n\n### Setup\nCopy the logrotate \u0026 rsyslog config files into place:\n\n```bash\ncd path/to/consulstatus_repo_root;\nsudo cp consulalerter-logrotate /etc/logrotate.d/consulalerter\nsudo cp consulalerter-rsyslog.conf /etc/rsyslog.d/consulalerter.conf\n```\n\nCopy the systemd service file into place:\n\n```bash\nsudo cp consulalerter.service /etc/systemd/system\n```\n\nMake sure to edit the service file to match your filepaths:\n\n```bash\nsudo nano /etc/systemd/system/consulalerter.service\n```\n\nCreate the `consulalerter` user:\n\n```bash\nsudo useradd --no-create-home --system --home /srv/consulalerter consulalerter\n```\n\nCreate the data directory:\n\n```bash\nsudo mkdir -p /srv/consulalerter;\nsudo chown consulalerter:consulalerter /srv/consulalerter;\n```\n\nNow, write a config file:\n\n```bash\n#!/usr/bin/env bash\n\ninterval=\"60\";\n\nmqtt_enabled=\"true\";\nmqtt_user=\"consulalerter\";\nmqtt_password=\"CHANGE_ME\";\n```\n\nNote that consulalerter _requires_ a username \u0026 password to login to the MQTT server, and won't function without one.\n\nSave it to the right place:\n\n```bash\n# Write the config file....\nsudo nano /srv/consulalerter/config.sh\n# ....and set the correct permissions on it\nsudo chmod +x /srv/consulalerter/config.sh\n```\n\nFinally, start `consulalerter.service` and enable it on boot:\n\n```bash\nsudo systemctl enable --now consulalerter.service\n```\n\n\n## Contributing\nContributions are very welcome - both issues and pull requests! Please mention in your pull request that you release your work under the MPL-2.0 (see below).\n\nIf you're feeling that way inclined, the sponsor button at the top of the page (if you're on GitHub) will take you to my Liberapay profile if you'd like to donate to say an extra thank you :-)\n\n\n## License\nConsulstatus is released under the Mozilla Public License 2.0. The full license text is included in the `LICENSE` file in this repository. Tldr legal have a [great summary](https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)) of the license if you're interested.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbrl%2Fconsulstatus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbrl%2Fconsulstatus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbrl%2Fconsulstatus/lists"}