{"id":18151283,"url":"https://github.com/msantos/eventbot","last_synced_at":"2025-04-06T23:29:27.246Z","repository":{"id":136621405,"uuid":"217855786","full_name":"msantos/eventbot","owner":"msantos","description":"A bot for generating and interacting with event streams using XMPP","archived":false,"fork":false,"pushed_at":"2024-02-11T13:03:55.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T05:30:11.313Z","etag":null,"topics":["chatbot","monitoring"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msantos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-10-27T13:02:08.000Z","updated_at":"2024-08-22T22:10:59.000Z","dependencies_parsed_at":"2024-02-09T15:42:51.533Z","dependency_job_id":"ac950c27-94b9-43ae-a424-6f1e103fab2c","html_url":"https://github.com/msantos/eventbot","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/msantos%2Feventbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msantos%2Feventbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msantos%2Feventbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msantos%2Feventbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msantos","download_url":"https://codeload.github.com/msantos/eventbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247568836,"owners_count":20959753,"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":["chatbot","monitoring"],"created_at":"2024-11-02T01:07:13.042Z","updated_at":"2025-04-06T23:29:27.221Z","avatar_url":"https://github.com/msantos.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eventbot\n\neventbot is a bot for generating and interacting with event streams using\nXMPP.\n\n## Concepts\n\n### Runlets\n\n`runlets` are a simple command language for generating, filtering and\nperforming flow control on a stream of events:\n\n```\n\u003csource\u003e | \u003cfilter\u003e | \u003csink\u003e\n```\n\nCommands are chained together using the pipe operator (`|`).\n\nA `source` command generates an event stream, usually by connecting to\nan external service. A `source` typically will not terminate.\n\n`filters` perform operations on the stream of events. Examples of filters\nare selecting events or controlling the rate of events. For example,\nthe flow control filter discards events based on the rate. Zero or more\nfilters can be chained together.\n\nA `sink` outputs the event stream. The default sink displays the results\nof a stream in the channel where the request was made. Support for other\nsinks is experimental.\n\n### Processes\n\nEach `runlet` runs in an isolated process. A job control language is\nused to interact with the runlet.\n\n## Installing a Release\n\n1. Create a release for your platform.\n\n2. Extract the tarball to /usr/local/lib/eventbot:\n\n```bash\nmkdir -p /usr/local/lib/eventbot\ncd /usr/local/lib/eventbot\ntar zxf /path/to/eventbot.tar.gz\n```\n\n3. Create the eventbot user:\n\n```bash\nuseradd -r -c \"event bot pseudo-user\" -s /bin/false eventbot\n```\n\n4. Create the chroot and state directories.\n\nBy default, the directories will be created and symlink'ed under\n/usr/local/lib/eventbot so state is not lost if eventbot is re-installed. The\ndirectories can be manually created if you want to put them somewhere\nelse.\n\nIt is safe to re-run the postinstall script.\n\n```bash\ncd /usr/local/lib/eventbot\nlib/eventbot-*/priv/bin/postinstall\n```\n\n5. command line: run the bot.\n\nThe bot is configured using environment variables. See `Configuration`\nfor details.\n\nThe bot will run as a daemon and be restarted on exit. See `Booting`\nfor other options.\n\n```bash\nsudo -u eventbot \\\n  EVENTBOT_USERNAME=\"botname\" \\\n  EVENTBOT_PASSWORD=\"botpassword\" \\\n  EVENTBOT_JID=\"botname@example.com\" \\\n  EVENTBOT_ALIAS=\"^\" \\\n  EVENTBOT_ROOMS=\"test@conference.example.com:alert@conference.example.com\" \\\n  /usr/local/lib/eventbot/bin/eventbot start\n```\n\n6. systemd: run the bot as a systemd service.\n\nCopy the systemd service file (`priv/bin/eventbot.service`) to\n`/etc/systemd/system/eventbot.service`.\n\n```bash\ncp priv/bin/eventbot.service /etc/systemd/system/eventbot.service\n```\n\nCopy the example environment file and edit:\n\n```bash\nmkdir /etc/eventbot\ncp priv/bin/eventbot.env /etc/eventbot\nchown root:root /etc/eventbot/eventbot.env\nchmod 640 /etc/eventbot/eventbot.env\nvi /etc/eventbot/eventbot.env\n```\n\nEnable the service:\n\n```bash\nsystemctl daemon-reload\nsystemctl start eventbot\nsystemctl status eventbot\n```\n\n7. Stopping the bot.\n\n```bash\nsystemctl stop eventbot\n```\n\n## Configuration\n\nEVENTBOT_USERNAME\n: bot displayed name\n\nEVENTBOT_PASSWORD\n: bot XMPP password\n\nEVENTBOT_JID\n: fully qualified XMPP username\n\nEVENTBOT_ALIAS\n: The bot can be reference either by the name (EVENTBOT_USERNAME) or by a\nshort form alias. For example, if the name of the bot is \"foo\" and the\nshort form is \"^\", the following are equivalent:\n\n```\nfoo: runtime\n^runtime\n```\n\nEVENTBOT_ROOMS\n: A list of \":\"-separated conference rooms (MUCs):\n\n```\nmuc1@conference.example.com\nmuc1@conference.example.com:muc2@conference.example.com:muc3.conference.example.com\n```\n\nDefault: no conference rooms\n\nEVENTBOT_RIEMANN_HOST\n: IP address/hostname of Riemann service\n\nDefault: localhost\n\nEVENTBOT_RIEMANN_PORT\n: Port of riemann HTML5 SSE web service\n\nDefault: 8080\n\nEVENTBOT_TLS_SNI\n: Hostname in TLS certificate of XMPP server.\n\nDefault: none (Mandatory: must be set)\n\nEVENTBOT_RIEMANN_URL\n: Query URL for Riemann\n\nDefault: /event/index?query=\n\nEVENTBOT_PRX_ROOTDIR\n: chroot directory for containerized Unix processes\n\nDefault: priv/root\n\nEVENTBOT_PRX_EXEC\n: Command to grant eventbot privileges to create a container. By default,\neventbot uses a setuid binary. To use `sudo`:\n\n```bash\nvisudo -f /etc/sudoers.d/99_eventbot\neventbot ALL = NOPASSWD: /usr/local/lib/eventbot/lib/prx-*/priv/prx\nEVENTBOT_PRX_EXEC=\"sudo -n\"\n```\n\nDefault: \"\"\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed as:\n\n1. Add `eventbot` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:eventbot, \"~\u003e 2.1.1\"}]\nend\n```\n\n2. Ensure `eventbot` is started before your application:\n\n```elixir\ndef application do\n  [applications: [:eventbot]]\nend\n```\n\n## Building a Release\n\n1. Install dependencies:\n\n```bash\nsudo apt install build-essential automake autoconf git\nlibssl-dev libncurses5-dev libexpat1-dev\n```\n\n2. Install the [asdf](https://github.com/asdf-vm/asdf) language\n   runtime manager\n\n   See: https://asdf-vm.com/#/core-manage-asdf-vm\n\n```bash\ngit clone https://github.com/asdf-vm/asdf.git ~/.asdf\necho -e '\\n. $HOME/.asdf/asdf.sh' \u003e\u003e ~/.profile\necho -e '\\n. $HOME/.asdf/completions/asdf.bash' \u003e\u003e ~/.profile\n. ~/.profile\n```\n\n3. Clone the eventbot repository.\n\n4. Install the `erlang` and `elixir` compilers and runtime\n\n```bash\ncd eventbot\nasdf install\n```\n\n5. Build the release:\n\n```bash\n# development\nmix do deps.get, deps.compile, release\n\n# prod\n# clean up old releases:\nrm -rf _build\nMIX_ENV=prod mix do deps.get, deps.compile, release\n```\n\n6. Create the tarball:\n\n```bash\n#!/bin/bash\n\nset -o errexit\nset -o nounset\nset -o pipefail\n\nVERSION=$(grep \"version:\" mix.exs | grep -E -o \"[0-9]+.[0-9]+.[0-9]+\")\nRELEASE=${RELEASE-_build/prod/rel/eventbot/}\nARCHIVE=\"eventbot-$VERSION+$(uname -m).tar.gz\"\n\necho \"Creating release archive\"\n\n(cd \"$RELEASE\" \u0026\u0026 tar zcvf - .) \u003e \"$ARCHIVE\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsantos%2Feventbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsantos%2Feventbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsantos%2Feventbot/lists"}