Giter Club home page Giter Club logo

discorddockermanager's Introduction

Discord Docker Manager Bot

A mouth full, aye? Well, this simple python bot is made to run as a docker container, to manage said docker containers in the same environment.


1. Functionality

The currently supported actions are:

  • Retrieving a list of all containers, optionally filtered by status and name
  • Stopping, (re)starting, renaming or removing containers by name or id
  • Retrieve logs of a container in txt format
  • Run an image from Docker Hub with commands to execute
  • Run your own or publicly available code hosted on Github as a container (cannot contain env variables, see Limitations.)
  • A help menu that basically says what I'm writing here

2. How to use

The application is supposed to run as a docker container within the same environment as the containers you want to manage.

2.1 For running locally:

  1. Clone this project and make sure docker is running or available.
  2. Set up the .env file with the variables laid out in Environments.
  3. Execute docker compose up in the terminal.

You can also use this in tools like portainer.

2.2 Environments (.env)

This app relies on a couple of environment variables:

  • DISCORD_TOKEN ~ this is the token of your discord bot, as created in the discord developer portal
  • ADMINS ~ A list of user id's that are allowed to use the bot. It is comma seperated.
  • GUILDS ~ A list of guild (also known as a server) id's that the commands will be usable in. It is comma seperated.

See the example.env for.. well, examples.


3 Reasoning

So, as you can see this is all fairly easy to perform by using direct docker commands or using the docker desktop app. Why did I create this then? I am running most of my (docker container) services on my Raspberry Pi, and I don't want to open up a port to the internet. I still want to manage my services however, so what better way to do that then using a discord bot? Shhh. There is no better way. This is it.


4 Limitations

As of the time of writing (AUG 2023), this bot can be used to manage already existing containers, pull images from dockerhub and from you own/public coding projects on github with a docker-compose.yml file.

However, there is one big limitation. Because of Discord's security practises, users should not transmit any sensitive data like passwords, or environment variables. So, if your app needs environment variables to function, this bot cannot deploy it for you. You can of course still do this manually, and then manage the container through this bot.

If Discord changes their security practises (End-to-End Encryption for example), then this might change.


2023 Studio Stoy

discorddockermanager's People

Contributors

stijuh avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.