You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update README
* Add docker run to README
* Add permission based access for the list-container command - controlled via setting.json
* Update README with settings section - also reformat for better flow
* Update README - labels are necessary
* Update control-containers to work with the AllowedRoles section control
* Change control-container log statements for view filtering to debug
* Change list-containers to be ephemeral w/ 30 sec deletion
You can find an example in [docker-compose-example.yml](https://github.com/thisismygithubok/DiscContainerController/blob/main/docker-compose-example.yml)
25
+
9
26
## Environment Variables ##
10
27
- REQUIRED
11
28
- DISCORD_GUILD_ID
@@ -19,27 +36,51 @@ A docker-based discord bot to control other docker containers on the host. Built
19
36
- This is optional, but you can specify this for the container/logging output timezone
20
37
- Must use IANA standard timezones
21
38
39
+
```
40
+
environment:
41
+
DISCORD_BOT_TOKEN: ${DISCORD_BOT_TOKEN}
42
+
DISCORD_GUILD_ID: ${DISCORD_GUILD_ID}
43
+
TZ: ${TZ}
44
+
```
45
+
22
46
## Volumes ##
23
-
You also need to mount the docker sock as a volume to the container to be able to control containers.
24
-
- /var/run/docker.sock:/var/run/docker.sock
47
+
You need to mount the docker sock as a volume to the container to be able to control containers. You also need to mount a config directory for the setting.json to be generated into
48
+
```
49
+
volumes:
50
+
- /var/run/docker.sock:/var/run/docker.sock
51
+
- ./config:config
52
+
```
25
53
26
54
## Labels ##
27
-
You can optionally add container labels called 'section' to categorize and list your containers in a more friendly manner.
28
-
- Example
29
-
- labels:
30
-
- section: "Game Servers"
31
-
32
-
## Slash Commands ##
33
-
This bot has several slash commands to use:
34
-
- /ping - does a simple check to see if the bot is online and responding
35
-
- /list-containers - lists the containers on the host system
36
-
- /control-container - this is an interative command:
37
-
- First: You choose a container
38
-
- Second: You choose an action of start, stop, or restart
39
-
- Third: The bot will reply to you with a mention message once the action has been completed.
55
+
You need to add container labels called 'section' to categorize and list your containers in a more friendly manner.
56
+
```
57
+
labels:
58
+
section: "Game Servers"
59
+
```
40
60
41
-
## Docker Compose ##
42
-
You can find an example in [docker-compose-example.yml](https://github.com/thisismygithubok/DiscContainerController/blob/main/docker-compose-example.yml)
61
+
## Settings ##
62
+
A settings.json file will be generated in your mounted config folder.
63
+
- AdminIDs - this is a discord user ID, and these IDs will have permissions to see/control all containers within all sections.
64
+
- AllowedRoles - this is a dict of role IDs and the sections those roles are allowed to see/control
65
+
- Sections - these are the sections you've defined via container labels. These are necessary to see/control containers.
66
+
- Example:
67
+
```
68
+
{
69
+
"AdminIDs": [
70
+
"1234567890101010"
71
+
],
72
+
"AllowedRoles": {
73
+
"0101010987654321": [
74
+
"Game Servers"
75
+
]
76
+
},
77
+
"Sections": [
78
+
"Backend",
79
+
"Frontend",
80
+
"Game Servers"
81
+
]
82
+
}
83
+
```
43
84
44
85
## Setting Up a Discord Bot ##
45
86
1. Navigate to the [Discord Developer Portal](https://discord.com/developers/applications)
0 commit comments