{"id":48925405,"url":"https://github.com/dfontana/disbot","last_synced_at":"2026-04-17T06:36:49.330Z","repository":{"id":39617408,"uuid":"303164965","full_name":"dfontana/disbot","owner":"dfontana","description":"A silly discord bot, but with some game server management","archived":false,"fork":false,"pushed_at":"2025-09-17T23:33:02.000Z","size":1793,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-18T01:19:53.586Z","etag":null,"topics":["bot","docker","hacktoberfest","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/dfontana.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-10-11T16:34:08.000Z","updated_at":"2025-09-17T23:33:06.000Z","dependencies_parsed_at":"2023-10-19T04:45:28.074Z","dependency_job_id":"535ef95d-e055-4cad-b015-fa0c92c50ceb","html_url":"https://github.com/dfontana/disbot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dfontana/disbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfontana%2Fdisbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfontana%2Fdisbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfontana%2Fdisbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfontana%2Fdisbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfontana","download_url":"https://codeload.github.com/dfontana/disbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfontana%2Fdisbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31918830,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bot","docker","hacktoberfest","rust"],"created_at":"2026-04-17T06:36:49.083Z","updated_at":"2026-04-17T06:36:49.315Z","avatar_url":"https://github.com/dfontana.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DisBot\n\nA Discord Bot, that I'm not sure what it'll do yet - but I wanted to have something that:\n\n- Powered by Rust\n- Deployed via Systemctl \n- To a locally running Raspberry Pi\n\nThe rest I don't really care about at the moment :shrug-cat:\n\n## Building (Optional Before Deploying)\n\nFor ArmV7 (eg Raspberry Pi) or `x86_64` Linux (eg Linux Server). \n\n- __Github Actions__\n  - Builds on the remote server whenever you push a tag. You can then download this from releases. See `.github/workflows`\n  ```\n  ./bin/build_on_git {commit-sha} {message}\n  ```\n  - Note: Running `./bin/deploy` will NOT build this for you, it'll just download the latest release from CI\n- __Cross__\n  - Only works on non-`aarch64` machines (Eg NOT M1 Macs). [`cross`](https://github.com/rust-embedded/cross), simply put: \n  ```\n  cargo install cross\n  cross build --release --target armv7-unknown-linux-gnueabihf\n  ```\n  - Note: Running `./bin/deploy` WILL do this for you\n- __Native Toolchains__ (Eg from an aarch64 machine)\n  - Uses [`filosottile/musl-cross`](https://github.com/FiloSottile/homebrew-musl-cross)\n  ```\n  brew install filosottile/musl-cross/musl-cross\n  ./bin/build_for_arm\n  ./bin/build_for_x86_64\n  ```\n  - Note: tools are installed as `x86_64-linux-musl-gcc` (without `unknown` in the prefix)\n- __Native__ (Eg Machine matches host)\n  - When native hosts matches deploy host, can just run `cargo build --release`\n\n## Deploying\n \n1. Define a `prod.toml` file inside the root of this repo:\n\n```toml\n# prod.toml\napi_key = \"\u003cYour Bot's Token Here\u003e\"\napp_id = \u003cYour Bot's Application Id Here\u003e\nemote_name = \"\u003cyour-emote || shrug_cat\u003e\"\nemote_users = [\"User1\", \"User2\", \"User3\"]\nserver_mac = \"\u003cgame-server-mac\u003e\"\nserver_ip = \"\u003cgame-server-ip\u003e\"\nserver_docker_port = \u003cdocker-tcp-port-on-game-server\u003e\nserver_user = \"\u003cgame-server-user\u003e\"\nlog_level = \"INFO\"\nvoice_channel_timeout_seconds = 600\n\n# You can repeat this for dev.toml as well\n```\n\n1. `ARCH={armv7-unknown-linux-gnueabihf|x86_64-unknown-linux-musl} ./bin/deploy {dev|prod} {server.local|raspberrypi.local}`\n  - You can use github to download a release made in CI with `BUILD_GITHUB=1`\n  - Otherwise this will detect the correct way to build from your host system\n  - Uses user services (no sudo password prompts during deployment)\n\n\n### (First time Deploy Setup on Remote Host)\n\nInstall required dependencies for the songbird functionality to work:\n\n```\napt install libopus-dev ffmpeg\nsudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o ~/.local/bin/yt-dlp\nsudo chmod a+rx ~/.local/bin/yt-dlp\n```\n\n(If you need to update `yt-dlp` use the `-U` flag)\n\n1. Create a user systemd service directory and file:\n\n```bash\n# Create user systemd directory\nmkdir -p ~/.config/systemd/user\n\n# Create service file (you might repeat for dev)\n# (replace the %i with your user name)\ncat \u003e ~/.config/systemd/user/disbot-prod.service \u003c\u003c 'EOF'\n[Unit]\nDescription=Disbot Service File\nAfter=network.target\n\n[Service]\nType=simple\nRestart=always\nRestartSec=1\nExecStart=/home/%i/deploy/disbot-prod prod --web-bind-address lan\nWorkingDirectory=/home/%i/deploy\nEnvironment=\"PATH=/usr/local/bin:/usr/bin:/home/%i/.local/bin\"\n\n[Install]\nWantedBy=default.target\nEOF\n\n# Create a timer to keep yt-dlp updated (optional but helpful)\ncat \u003e ~/.config/systemd/user/yt-dlp-update.service \u003c\u003c 'EOF'\n[Unit]\nDescription=Update yt-dlp\n\n[Service]\nType=oneshot\nExecStart=/home/%i/.local/bin/yt-dlp --update\nEOF\n\ncat \u003e ~/.config/systemd/user/yt-dlp-update.timer \u003c\u003c 'EOF'\n[Unit]\nDescription=Run yt-dlp update daily at 9 AM\n\n[Timer]\nOnCalendar=*-*-* 09:00\nPersistent=true\n\n[Install]\nWantedBy=timers.target\nEOF\n```\n\n1. Enable lingering so the service starts at boot (without requiring user login):\n   ```bash\n   sudo loginctl enable-linger $USER\n   ```\n\n1. Enable and start the user service:\n   ```bash\n   systemctl --user daemon-reload\n   systemctl --user enable disbot-prod.service\n   systemctl --user start disbot-prod.service\n   ```\n\n1. View logs: `journalctl --user -u disbot-prod -f`\n\n### (First time admin UI setup)\n\nIf you want to use the admin UI the port exposed needs to be unblocked by the firewall. For Fedora this means the port is listed under `ports` in: `sudo firewall-cmd --list-all`. If not:\n\n```\nsudo firewall-cmd --permanent --add-port=3450/tcp\nsudo firewall-cmd --reload\n```\n\n### Accessing the Admin UI\n\nWhen the bot starts successfully, it prints the admin URL to stdout:\n\n```\nAdmin web server running on http://\u003caddress\u003e:3450/admin\n```\n\nCheck the logs to find the exact URL:\n\n```bash\njournalctl --user -u disbot-prod -f\n```\n\n**Default access** (when no `--web-bind-address` is set, binds to all interfaces):\n\n```\nhttp://localhost:3450/admin\n```\n\n**With `--web-bind-address lan`** (as used in the systemd service): the bot binds to your machine's LAN IP. The exact URL is printed in the logs on startup — look for the `Admin web server running on` line and open that URL from any device on the same network.\n\n### Docker interactions\n\nFor docker interactions to work over the local network you'll need to edit the systemd service to enable TCP access over the local network:\n\n```\nsudo vim /etc/systemd/system/snap.docker.dockerd.service\n\n...\nExecStart=/usr/bin/snap run docker.dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock\n```\n\nAnd then reload the daemon:\n\n```\nsudo systemctl daemon-reload\nsudo systemctl restart snap.docker.dockerd.service\n```\n\nValidate: `curl http://localhost:2375/v1.40/containers/json`. This will need to be repeated each time the snap is updated. Ideally this isn't a problem if the daemon can be configured from outside the snap, however it's unclear if that's plausible at this point in time.\n\n### Gotchas\n\n- Ensure the `SERVER_USER` has sudo-er privileged to run `shutdown` without a password. (Eg: `sudo visudo -\u003e [user]\\tALL=NOPASSWD:[pathToBin1],[pathtoBin2],...`)\n- Equally, ensure the bot's host can run `ssh` without a password (eg setup it's SSH keys).\n\n## Invite Binkies to Your Server\n\n[Invite Link](https://discord.com/api/oauth2/authorize?client_id=764937518570536990\u0026permissions=545430961264\u0026scope=bot%20applications.commands)\n\n## This Project Uses\n\n- [Serenity](https://github.com/serenity-rs/serenity) for the Discord API\n- [cross](https://github.com/rust-embedded/cross) for local compilation in docker\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfontana%2Fdisbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfontana%2Fdisbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfontana%2Fdisbot/lists"}