Yet another project management Discord bot.
- Manages Docker containers on the host machine.
- Intended for communities that make extensive use of Docker containers to deploy services.
This bot provides a global /container <list/start/restart/stop/update> <container>
command on Discord.
Containers on the host machine can be interacted with by Discord users based on bot permissions.
- User executes
/container update discordsrv-heads
- Bot checks if user has permission to interact with this container, in the following order:
docker.container.discordsrv.heads
docker.container.discordsrv
docker.container
docker
- Permission checks are skipped for users defined in the
SUPERUSERS
environment variable
- If the user has permission, update the target container using
containrrr/watchtower
I prefix my Docker containers with prefix-
for my different services. This works well with the above permission system
because:
- A group of trusted contributors a certain group of containers can just be granted the
docker.container.[group]
permission to have access to manage all of that group's Docker containers - Individual permissions can be granted on a per-situation scenario using
docker.container.discordsrv.heads
if a contributor only needed access todiscordsrv-heads
, for example.
See included docker-compose.yml
and .env
files.
- Create a new (private) Discord bot at https://discord.com/developers/applications
- Build the bot image with
docker build -t scarsz/marina https://github.com/Scarsz/Marina.git
- Optionally uncomment the
build
directive in the included docker-compose.yml to have Compose build the image - Won't be necessary once I get around to adding the bot to a registry
- Optionally uncomment the
- Save docker-compose.yml to a fresh directory
- Save example.env as .env and fill in your values
TOKEN
Bot token Marina should use.WATCHING
/PLAYING
Activity status the bot will display on Discord. If unset, defaults towatching 🚢 ⛵
SUPERUSERS
Comma-separated list of user IDs that always pass permission checks within the bot.LOGGING_CHANNEL
Channel ID of a logging channel for the bot.GITHUB_CLIENT
/GITHUB_SECRET
GitHub application credentials, used when making GitHub API calls.DOCKER_USER
User on host machine that has logged-in registry credentials. Only necessary when updating containers using private images.- Used when updating containers as volume mount
/home/DOCKER_USER/.docker/config.json
- Used when updating containers as volume mount
- Start the stack with
docker-compose up
and ensure bot starts successfully- Optionally start with
docker-compose up -d && docker-compose logs -f marina
to be able to Ctrl+C without stopping
- Optionally start with