From e06256670a45d325a72a1dae78c68a2b56562b29 Mon Sep 17 00:00:00 2001 From: MrUnknownDE Date: Thu, 28 Apr 2022 17:22:33 +0200 Subject: [PATCH] v1.0 --- .gitignore | 2 ++ Lavalink/application.yml | 49 ++++++++++++++++++++++++++++++++++++++++ README.md | 38 +++++++++++++++++++++++++++++-- config.json | 9 ++++++++ core/logs/latest.log | 14 ++++++++++++ core/logs/red.log | 14 ++++++++++++ core/settings.json | 1 + docker-compose.yml | 21 +++++++++++++++++ 8 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 Lavalink/application.yml create mode 100644 config.json create mode 100644 core/logs/latest.log create mode 100644 core/logs/red.log create mode 100644 core/settings.json create mode 100644 docker-compose.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3eeacf1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/Lavalink/Lavalink.jar +*.zip \ No newline at end of file diff --git a/Lavalink/application.yml b/Lavalink/application.yml new file mode 100644 index 0000000..b720d6d --- /dev/null +++ b/Lavalink/application.yml @@ -0,0 +1,49 @@ +server: # REST and WS server + port: 6665 + address: 0.0.0.0 +lavalink: + server: + password: "localpassword" + sources: + youtube: true + bandcamp: true + soundcloud: true + twitch: true + vimeo: true + http: true + local: false + bufferDurationMs: 500 # The duration of the NAS buffer. Higher values fare better against longer GC pauses + frameBufferDurationMs: 5000 # How many milliseconds of audio to keep buffered + youtubePlaylistLoadLimit: 1 # Number of pages at 100 each + playerUpdateInterval: 5 # How frequently to send player updates to clients, in seconds + youtubeSearchEnabled: true + soundcloudSearchEnabled: true + gc-warnings: true + #ratelimit: + #ipBlocks: ["1.0.0.0/8", "..."] # list of ip blocks + #excludedIps: ["...", "..."] # ips which should be explicit excluded from usage by lavalink + #strategy: "RotateOnBan" # RotateOnBan | LoadBalance | NanoSwitch | RotatingNanoSwitch + #searchTriggersFail: true # Whether a search 429 should trigger marking the ip as failing + #retryLimit: -1 # -1 = use default lavaplayer value | 0 = infinity | >0 = retry will happen this numbers times + +metrics: + prometheus: + enabled: false + endpoint: /metrics + +sentry: + dsn: "https://5b9ad8051e9d41feac8794c6403a62fd@o447623.ingest.sentry.io/6312454" + environment: "production" +# tags: +# some_key: some_value +# another_key: another_value + +logging: + file: + max-history: 30 + max-size: 1GB + path: ./logs/ + + level: + root: INFO + lavalink: INFO \ No newline at end of file diff --git a/README.md b/README.md index 1ef9224..1eee7e0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,36 @@ -# redbot-docker-compose -One Step Redbot in Docker + Lavalink +# Redbot + Docker = LOVE + + +Here is a quick guide on how to install Redbot in a few quick steps. + +**1. Install Docker and Docker-Compose** +``` +curl -fsSL https://get.docker.com -o get-docker.sh +sh get-docker.sh +curl -SL https://github.com/docker/compose/releases/download/v2.4.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose +sudo chmod +x /usr/local/bin/docker-compose +sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose +``` + +**2. Download this Repo or Release** +`wget https://github.com/MrUnknownDE/redbot-docker-compose/releases/v1.0.zip` + +**3. Unpacking** +`unzip v1.0.zip` + +**4. Edit docker-compose.yml** +![](https://trash.mrunknown.de/qUcA9/CeRitEza80.png/raw) + + +**5. Edit the Core.json** +![](https://trash.mrunknown.de/qUcA9/xUkINOYu37.png/raw) +*The bot owner is automatically replaced in the file with the inserted ID in docker-compose.yml.* + +**6. Bot start** +`docker-compose up` ~ Can you start the bot for the first time and see if it shows many errors at startup. +`docker-compose up -d` ~ If the bot is started in the background. +`docker-compose down` ~ Stop the bot + +## Troubleshooting +If the bot does not automatically connect to the Lavalink instance, you need to do the following on the Discord server: +![](https://trash.mrunknown.de/qUcA9/TUqUKumu20.png/raw) \ No newline at end of file diff --git a/config.json b/config.json new file mode 100644 index 0000000..2699134 --- /dev/null +++ b/config.json @@ -0,0 +1,9 @@ +{ + "docker": { + "DATA_PATH": "/data", + "COG_PATH_APPEND": "cogs", + "CORE_PATH_APPEND": "core", + "STORAGE_TYPE": "JSON", + "STORAGE_DETAILS": {} + } +} \ No newline at end of file diff --git a/core/logs/latest.log b/core/logs/latest.log new file mode 100644 index 0000000..65b16c2 --- /dev/null +++ b/core/logs/latest.log @@ -0,0 +1,14 @@ +[2022-04-28 16:42:11] [CRITICAL] red.main: The main bot task didn't handle an exception and has crashed +Traceback (most recent call last): + File "/data/venv/lib/python3.9/site-packages/redbot/__main__.py", line 475, in red_exception_handler + red_task.result() + File "/data/venv/lib/python3.9/site-packages/redbot/__main__.py", line 374, in run_bot + new_token = await interactive_config( + File "/data/venv/lib/python3.9/site-packages/redbot/core/cli.py", line 50, in interactive_config + token = input("> ") +EOFError: EOF when reading a line +[2022-04-28 16:42:11] [WARNING] red.main: Attempting to die as gracefully as possible... +[2022-04-28 16:42:11] [INFO] red.main: Shutting down from unhandled exception +[2022-04-28 16:42:20] [INFO] red.main: Signals.SIGTERM received. Quitting... +[2022-04-28 16:42:20] [INFO] red.main: Shutting down with exit code: ExitCodes.SHUTDOWN +[2022-04-28 16:42:20] [INFO] red.main: Please wait, cleaning up a bit more diff --git a/core/logs/red.log b/core/logs/red.log new file mode 100644 index 0000000..65b16c2 --- /dev/null +++ b/core/logs/red.log @@ -0,0 +1,14 @@ +[2022-04-28 16:42:11] [CRITICAL] red.main: The main bot task didn't handle an exception and has crashed +Traceback (most recent call last): + File "/data/venv/lib/python3.9/site-packages/redbot/__main__.py", line 475, in red_exception_handler + red_task.result() + File "/data/venv/lib/python3.9/site-packages/redbot/__main__.py", line 374, in run_bot + new_token = await interactive_config( + File "/data/venv/lib/python3.9/site-packages/redbot/core/cli.py", line 50, in interactive_config + token = input("> ") +EOFError: EOF when reading a line +[2022-04-28 16:42:11] [WARNING] red.main: Attempting to die as gracefully as possible... +[2022-04-28 16:42:11] [INFO] red.main: Shutting down from unhandled exception +[2022-04-28 16:42:20] [INFO] red.main: Signals.SIGTERM received. Quitting... +[2022-04-28 16:42:20] [INFO] red.main: Shutting down with exit code: ExitCodes.SHUTDOWN +[2022-04-28 16:42:20] [INFO] red.main: Please wait, cleaning up a bit more diff --git a/core/settings.json b/core/settings.json new file mode 100644 index 0000000..5bd759f --- /dev/null +++ b/core/settings.json @@ -0,0 +1 @@ +{"0": {"GLOBAL": {"schema_version": 2, "token": "PASTE YOUR DISCORD BOT TOKEN", "prefix": ["sys."], "locale": "de-DE", "owner": 155076323612688384, "last_system_info": {"python_version": [3, 9], "machine": "x86_64", "system": "Linux"}, "packages": ["audio"]}, "CUSTOM_GROUPS": {"CogManager": {"2938473984732": {}}, "Core": {"0": {"COG_DISABLE_SETTINGS": 2, "CUSTOM_GROUPS": 2, "COMMAND": 2, "SHARED_API_TOKENS": 2}}, "ModLog": {"1354799444": {"CASETYPES": 1, "CASES": 2}}, "Bank": {"384734293238749": {}}, "Audio": {"2711759130": {"EQUALIZER": 1, "GLOBALPLAYLIST": 1, "GUILDPLAYLIST": 2, "USERPLAYLIST": 2}}}}} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5e93069 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: "3.2" +services: + redbot: + container_name: redbot + image: phasecorex/red-discordbot + links: + - redbot_lavalink + restart: unless-stopped + volumes: + - ./:/data + environment: + - OWNER=155076323612688384 #your Discord ID + - TZ=Europe/Berlin #your Timezone + - PUID=1000 + + redbot_lavalink: + container_name: redbot_lavalink + image: fredboat/lavalink:dev + restart: unless-stopped + volumes: + - ./Lavalink:/opt/Lavalink