{"id":13586900,"url":"https://github.com/rhardih/pong","last_synced_at":"2025-10-01T18:31:33.300Z","repository":{"id":39699204,"uuid":"169740526","full_name":"rhardih/pong","owner":"rhardih","description":"Basic uptime monitoring system, with email alerts and/or push notifications","archived":false,"fork":false,"pushed_at":"2023-08-19T00:30:51.000Z","size":121,"stargazers_count":96,"open_issues_count":3,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T11:21:08.777Z","etag":null,"topics":["docker","docker-compose","mailgun","rails","rails5","telegram","telegram-bot","telegram-bot-api","uptime","uptime-monitor"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/rhardih.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-02-08T13:39:55.000Z","updated_at":"2024-02-16T23:57:32.000Z","dependencies_parsed_at":"2024-01-14T16:07:42.282Z","dependency_job_id":"a3c25ef2-5aa2-48eb-a648-22e96df90193","html_url":"https://github.com/rhardih/pong","commit_stats":{"total_commits":100,"total_committers":2,"mean_commits":50.0,"dds":"0.19999999999999996","last_synced_commit":"de759fc30a8e9bbdfba3c6fc2be8b5a7bd34ea25"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhardih%2Fpong","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhardih%2Fpong/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhardih%2Fpong/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhardih%2Fpong/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhardih","download_url":"https://codeload.github.com/rhardih/pong/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234724090,"owners_count":18877136,"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":["docker","docker-compose","mailgun","rails","rails5","telegram","telegram-bot","telegram-bot-api","uptime","uptime-monitor"],"created_at":"2024-08-01T15:05:53.511Z","updated_at":"2025-10-01T18:31:32.907Z","avatar_url":"https://github.com/rhardih.png","language":"Ruby","funding_links":[],"categories":["docker","Ruby"],"sub_categories":[],"readme":"# Pong\n\n[![Build Status](https://travis-ci.org/rhardih/pong.svg?branch=master)](https://travis-ci.org/rhardih/pong)\n\nA minimal availability monitoring system with email alerts and push notifications.\n\n- [Changelog](https://github.com/rhardih/pong/blob/master/CHANGELOG.md)\n- [Screenshots](https://github.com/rhardih/pong/blob/master/screenshots)\n\n## Requirements\n\nPong is a dockerized Rails application run via docker-compose, so both a host\nrunning [docker](https://www.docker.com/get-started) and a client with\n[compose](https://docs.docker.com/compose/install/) are required.\n\n## Configuration\n\n### Notifications\n\n#### EMail\n\nBy default Pong uses [mailgun](https://www.mailgun.com/) as delivery method for\nActionMailer. There's no specific reason other than easy integration via\nmailgun-ruby, and because they have a free plan with more than enough monthly\nsends for the purpose of occasional email alerts.\n\nSince the free plan doesn't allow ad-hoc delivery, it's necessary to add the\nalert receiver as an [Authorized\nRecipient](https://help.mailgun.com/hc/en-us/articles/217531258-Authorized-Recipients)\nin the mailgun account settings.\n\nThe application expects the following environment variables, either added in the\ndefault compose file, or added in the\n[.env](https://github.com/rhardih/pong/blob/master/.env) file.\n\n```\nMAILGUN_API_KEY\nMAILGUN_DOMAIN\nEMAIL_SENDER\nEMAIL_RECEIVER\n```\n\nThe sender is set as as default *from* address for all alerts, and the receiver\nis the target address for all alert mailings.\n\nFor now Pong only supports a single global receiver.\n\n#### Push (via [Telegram](telegram.org))\n\nPong supports push notifications, via direct chat messages over Telegram. This\nrequires creating a dedicated [Telegram bot and corresponding API key](https://core.telegram.org/#bot-api).\n\nHere's the necessary steps:\n\n|\u0026nbsp;|\u0026nbsp;|\n|:--|---|\n|1. Open the application, search for *botfather* and start a chat. | ![Start chat](https://media.githubusercontent.com/media/rhardih/pong/master/screenshots/telegram0.png)|\n|2. Create a new bot by issuing the `/newbot` command. | ![Create new bot](https://media.githubusercontent.com/media/rhardih/pong/master/screenshots/telegram1.png) |\n|3. Go through the naming steps. Any name will do, but you'll need it shortly, so make it something you can remember. Once done, you'll be given a token to access the HTTP API.\u003cbr\u003e\u003cbr\u003e4. Copy the API key into the the `.env` file for Pong.\u003cbr\u003e\u003cbr\u003e5. We need the *id*, of the chat we're going to use for notifications. Pong includes a rake task, that runs the bot and replies with the id when a chat is started. Run this before the next step:\u003cbr\u003e\u003cbr\u003e**$ docker-compose run web bin/rake telegram:run** | ![Copy api key](https://media.githubusercontent.com/media/rhardih/pong/master/screenshots/telegram2.png)|\n|6. Next open a chat with the newly created bot. Here you need the name you chose in step 3. | ![Open bot chat](https://media.githubusercontent.com/media/rhardih/pong/master/screenshots/telegram3.png)|\n|7. Upon joining the chat with the bot, you will be given the chat id we need.\u003cbr\u003e\u003cbr\u003e8. Copy the chat id into the `.env` file, as you did with the api key and you're all set. Now Pong will send you notifications via this chat. | ![Get chat id](https://media.githubusercontent.com/media/rhardih/pong/master/screenshots/telegram4.png)|\n\n### Docker image\n\nFor easier deployment, Pong is packaged as a fully self-contained docker image\nin production mode. A default image build is available on the\n[dockerhub](https://hub.docker.com/r/rhardih/pong), but a custom or self built\nimage can be used by setting the corresponding environment variable:\n\n```\nPROD_IMAGE=rhardih/pong:latest\n```\n\n## Run\n\nBring up all compose services with:\n\n```bash\ndocker-compose up -d\n```\n\n### Database creation \u0026 initialization\n\n```bash\ndocker-compose run web bin/rake db:create\ndocker-compose run web bin/rake db:migrate\n```\n\n### How to run the test suite\n\nThis app uses the default minitest framework.\n\nIn development mode, a test compose service with a spring preloaded environment\nis added for running tests faster.\n\nTo run all tests:\n\n```bash\ndocker-compose exec test bin/rake test\n```\n\nTo run specific test:\n\n```bash\ndocker-compose exec test bin/rake test TEST=test/jobs/request_job_test.rb\n```\n\n## Services\n\nThe default application stack, as can also be seen in\n[docker-compose.yml](https://github.com/rhardih/pong/blob/master/docker-compose.yml),\nconsists of the following components:\n\n* Database server running [PostgreSQL](https://www.postgresql.org/).\n* Key value store running [redis](https://redis.io/).\n* A worker instance, running a [resque](https://github.com/resque/resque) worker.\n* A static job scheduler running\n  [resque-scheduler](https://github.com/resque/resque-scheduler).\n* Default Puma web server.\n\n### Development\n\nAside from the services listed above, these are added for local development:\n\n* A test instance, with a preloaded spring environment.\n* A [MailCatcher](https://mailcatcher.me/) instance.\n\n## Deployment instructions\n\nAssuming the production host is reachable and running docker, setting the\nfollowing should be enough to let compose do deploys:\n\n```\nDOCKER_HOST=tcp://\u003curl-or-ip-of-remote-host\u003e:2376\nDOCKER_TLS_VERIFY=1\n```\n\nThen adding reference to the production config:\n\n```bash\ndocker-compose -f docker-compose.yml -f production.yml up -d\n```\n\nRemember to create and initialize the database as well.\n\n## System design notes\n\n### Check\n\nIn order to somewhat alleviate spurious alert triggerings, when a request for a\ncheck fails, it is put into an intermediate state of *limbo*. If a set number of\nsubsequent request attempts are still failing, the check will then be marked as\nbeing *down*\n\nBelow is transition diagram illustrating how the status of a Check changes:\n\n\n![Check status](https://media.githubusercontent.com/media/rhardih/pong/master/diagrams/check-status-transition.png)\n\nOne thing to note, is that when a check is either in *limbo* or is *down*, its\ninterval is disregarded, and a request is triggered every time the queue job is\nrunning, which is roughly once every minute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhardih%2Fpong","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhardih%2Fpong","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhardih%2Fpong/lists"}