{"id":15914490,"url":"https://github.com/bbengfort/kekahu","last_synced_at":"2025-04-03T03:44:06.274Z","repository":{"id":69222752,"uuid":"96819755","full_name":"bbengfort/kekahu","owner":"bbengfort","description":"Keep alive client for the Kahu service.","archived":false,"fork":false,"pushed_at":"2018-08-23T19:57:20.000Z","size":3925,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T17:45:47.297Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/bbengfort.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":"2017-07-10T20:45:51.000Z","updated_at":"2018-08-23T19:57:22.000Z","dependencies_parsed_at":"2023-04-09T03:16:08.746Z","dependency_job_id":null,"html_url":"https://github.com/bbengfort/kekahu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fkekahu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fkekahu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fkekahu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fkekahu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbengfort","download_url":"https://codeload.github.com/bbengfort/kekahu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246933357,"owners_count":20857052,"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":[],"created_at":"2024-10-06T17:03:31.954Z","updated_at":"2025-04-03T03:44:06.228Z","avatar_url":"https://github.com/bbengfort.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KeKahu\n\n**Keep alive client for the Kahu service.**\n\nKeKahu is a client service for the [Kahu API](https://github.com/bbengfort/kahu) that manages hosts on our experimental test bed. KeKahu's primary role is to send a keep-alive heartbeat to Kahu at a routine interval. KeKahu also provides [DDNS](https://en.wikipedia.org/wiki/Dynamic_DNS) by using an public IP lookup and posting that IP address to Kahu. Finally KeKahu can be used to synchronize peers and access the Kahu API in a meaningful way.\n\n## Getting Started\n\nAs long as you have [go version 1.10](https://golang.org/dl/) or later installed you can get and install KeKahu as follows:\n\n```\n$ go get github.com/bbengfort/kekahu/...\n```\n\nThis command will build and install the kekahu binary in `$GOBIN`. In order for the command to be used with [systemd](https://wiki.ubuntu.com/SystemdForUpstartUsers), however, you must install it into a system path such as `/usr/local/bin`. I recommend using a symlink to make sure that the latest binary is used as follows:\n\n```\n$ sudo ln -s $GOBIN/kekahu /usr/local/bin/kekahu\n```\n\nNow that KeKahu is installed you can see its commands and options:\n\n```\n$ kekahu --help\n```\n\nMost of KeKahu is configured through the environment, though command line options can be specified. A `.env` file can be used for local use or development. Ensure the following environmental variables are set:\n\n- `$KEKAHU_API_KEY`: the Kahu API key for this machine\n- `$KEKAHU_URL` (optional): url of the Kahu API\n- `$KEKAHU_INTERVAL` (optional): interval between heartbeats\n\nFurther configuration can be specified by a JSON, YAML, or TOML file in either `/etc/kekahu.json` or `~/.kekahu.json` (with the appropriate extension). An example configuration is as follows:\n\n```json\n{\n  \"interval\": \"20s\",\n  \"api_key\": \"mysupersecretkey\",\n  \"url\": \"https://kahu.io\",\n  \"verbosity\": 2,\n  \"peers_path\": \"peers.json\",\n  \"api_timeout\": \"5s\",\n  \"ping_timeout\": \"10s\"\n}\n```\n\nNote that KeKahu won't run without an API key.\n\nOnce the configuration is set, you can use the `kekahu` application. For example, to synchronize network peers:\n\n```\n$ kekahu sync\n```\n\n## Systemd\n\nKekahu is configured to be managed by systemd on Linux systems. To get started create a file in `/etc/systemd/system/kekahu.service` as follows:\n\n```\n[Unit]\nDescription=KeKahu Service\nDocumentation=https://github.com/bbengfort/kekahu\n\n[Service]\nType=simple\nEnvironment=KEKAHU_API_KEY=mysupersecretkey\nExecStart=/usr/local/bin/kekahu run\nRestart=on-abort\n\n[Install]\nWantedBy=multi-user.target\n```\n\nNow reload the services and enable the kekahu service:\n\n```\n$ sudo systemctl enable kekahu\n$ sudo systemctl daemon-reload\n```\n\nThe service can be managed with the `start`, `stop`, `reload`, and `status` commands as follows:\n\n```\n$ sudo systemctl start kekahu\n```\n\nYou can check the status of the service to see if it started correctly, or use kekahu directly to check the status. In order to view the log files use the following command:\n\n```\n$ sudo journalctl -u kekahu\n```\n\nThis should show everything written to stdout and stderr from the application.\n\n## Launchd\n\nWe can also run kekahu as a user-agent on OS X - meaning that it will only run while the user is logged in. Create a file called `~/Library/LaunchAgents/com.bengfort.kekahu.plist` and add the following configuration:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003c!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"\u003e\n\u003cplist version=\"1.0\"\u003e\n\u003cdict\u003e\n    \u003ckey\u003eLabel\u003c/key\u003e\n    \u003cstring\u003ecom.bengfort.kekahu\u003c/string\u003e\n\n    \u003ckey\u003eProgramArguments\u003c/key\u003e\n    \u003carray\u003e\n        \u003cstring\u003e/usr/local/bin/kekahu\u003c/string\u003e\n        \u003cstring\u003estart\u003c/string\u003e\n    \u003c/array\u003e\n\n    \u003ckey\u003eRunAtLoad\u003c/key\u003e\n    \u003ctrue/\u003e\n\n    \u003ckey\u003eEnvironmentVariables\u003c/key\u003e\n    \u003cdict\u003e\n        \u003ckey\u003eKEKAHU_API_KEY\u003c/key\u003e\n        \u003cstring\u003emykey\u003c/string\u003e\n    \u003c/dict\u003e\n\n    \u003ckey\u003eStandardOutPath\u003c/key\u003e\n    \u003cstring\u003e/tmp/kekahu.log\u003c/string\u003e\n\n    \u003ckey\u003eStandardErrorPath\u003c/key\u003e\n    \u003cstring\u003e/tmp/kekahu.err\u003c/string\u003e\n\u003c/dict\u003e\n\u003c/plist\u003e\n```\n\n## Notes\n\n- [go install vs build](https://pocketgophers.com/go-install-vs-go-build/)\n- [Linux load averages](http://www.brendangregg.com/blog/2017-08-08/linux-load-averages.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbengfort%2Fkekahu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbengfort%2Fkekahu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbengfort%2Fkekahu/lists"}