From 35dc2e59609272a90e60b63ce3f4159d2caeca1e Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Mon, 7 Mar 2022 11:01:40 +0000 Subject: [PATCH 01/90] Configure Container Scanning in `.gitlab-ci.yml`, creating this file if it does not already exist --- .gitlab-ci.yml | 86 +++++++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 19eb4b3..212c519 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,61 +1,67 @@ -stages: # List of stages for jobs, and their order of execution - - build - - test - - deploy +# You can override the included template(s) by including variable overrides +# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings +# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings +# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings +# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings +# Note that environment variables can be set in several places +# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence +# container_scanning: +# variables: +# DOCKER_IMAGE: ... +# DOCKER_USER: ... +# DOCKER_PASSWORD: ... +stages: +- build +- test +- deploy image: debian - docker-build-push: - # Use the official docker image. image: docker:latest stage: build services: - - docker:dind + - docker:dind before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - # Default branch leaves tag empty (= latest tag) - # All other branches are tagged with the escaped branch name (commit ref slug) + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - | - if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then - tag="" - echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'" - else - tag=":$CI_COMMIT_REF_SLUG" - echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" - fi - - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" . - - docker push "$CI_REGISTRY_IMAGE${tag}" + - | + if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then + tag="" + echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'" + else + tag=":$CI_COMMIT_REF_SLUG" + echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" + fi + - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" . + - docker push "$CI_REGISTRY_IMAGE${tag}" only: - - master - - dev - + - master + - dev docker-build: image: docker:latest stage: build services: - - docker:dind + - docker:dind before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - docker build --pull -t "$CI_REGISTRY_IMAGE" . + - docker build --pull -t "$CI_REGISTRY_IMAGE" . except: - - master - - dev - + - master + - dev before_script: - - apt-get update -qq - # Setup SSH deploy keys - - 'which ssh-agent || ( apt-get install -qq openssh-client )' - - eval $(ssh-agent -s) - - ssh-add <(echo "$SSH_PRIVATE_KEY") - - mkdir -p ~/.ssh - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - +- apt-get update -qq +- which ssh-agent || ( apt-get install -qq openssh-client ) +- eval $(ssh-agent -s) +- ssh-add <(echo "$SSH_PRIVATE_KEY") +- mkdir -p ~/.ssh +- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' deploy_staging: stage: deploy script: - - ssh $SSH_SERVER "cd /root && docker-compose pull shbot && docker-compose up -d shbot && exit" + - ssh $SSH_SERVER "cd /root && docker-compose pull shbot && docker-compose up -d + shbot && exit" only: - - master - \ No newline at end of file + - master +include: +- template: Auto-DevOps.gitlab-ci.yml From 302496e3a031cd92e55323a5582b7f621ea99cad Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Mon, 7 Mar 2022 11:06:18 +0000 Subject: [PATCH 02/90] Update .gitlab-ci.yml --- .gitlab-ci.yml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 212c519..850b881 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,16 +1,3 @@ -# You can override the included template(s) by including variable overrides -# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings -# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings -# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings -# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings -# Note that environment variables can be set in several places -# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence - -# container_scanning: -# variables: -# DOCKER_IMAGE: ... -# DOCKER_USER: ... -# DOCKER_PASSWORD: ... stages: - build - test @@ -64,4 +51,4 @@ deploy_staging: only: - master include: -- template: Auto-DevOps.gitlab-ci.yml +- template: Security/Container-Scanning.gitlab-ci.yml From f315c79bebd1d2c15377a9283f39d5d7640b5cb7 Mon Sep 17 00:00:00 2001 From: Aaron Date: Mon, 7 Mar 2022 14:13:32 +0100 Subject: [PATCH 03/90] add numbers to emojilist --- bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 117762a..5f62157 100644 --- a/bot.py +++ b/bot.py @@ -55,7 +55,7 @@ def is_gm(): return commands.check(predicate) emojinumbers = ["0\u20E3", "1\u20E3" , "2\u20E3" , "3\u20E3" , "4\u20E3" , "5\u20E3" , "6\u20E3" , "7\u20E3" , "8\u20E3" , "9\u20E3"] -alphabet = {"a" : "🇦","b" : "🇧","c" : "🇨","d" : "🇩","e" : "🇪","f" : "🇫","g" : "🇬","h" : "🇭","i" : "🇮","j" : "🇯","k" : "🇰","l" : "🇱","m" : "🇲","n" : "🇳","o" : "🇴","p" : "🇵","q" : "🇶","r" : "🇷","s" : "🇸","t" : "🇹","u" : "🇺","v" : "🇻","w" : "🇼","x" : "🇽","y" : "🇾","z" : "🇿"} +alphabet = {"a" : "🇦","b" : "🇧","c" : "🇨","d" : "🇩","e" : "🇪","f" : "🇫","g" : "🇬","h" : "🇭","i" : "🇮","j" : "🇯","k" : "🇰","l" : "🇱","m" : "🇲","n" : "🇳","o" : "🇴","p" : "🇵","q" : "🇶","r" : "🇷","s" : "🇸","t" : "🇹","u" : "🇺","v" : "🇻","w" : "🇼","x" : "🇽","y" : "🇾","z" : "🇿","0" : "0\u20E3","1" : "1\u20E3","2" : "2\u20E3","3" : "3\u20E3","4" : "4\u20E3","5" : "5\u20E3","6" : "6\u20E3","7" : "7\u20E3","8" : "8\u20E3","9" : "9\u20E3"} bot.help_command = commands.DefaultHelpCommand(dm_help=False, no_category="Befehle die du nutzen kannst") @@ -443,4 +443,4 @@ async def roll(ctx, arg): em = discord.Embed(title=rolle, description=rolltotal, colour=0x009933) await ctx.send(embed=em) -bot.run(token) \ No newline at end of file +bot.run(token) From 5eb107a84aa7262fe449bd0fdd797973ac5a26bd Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Wed, 9 Mar 2022 05:20:26 +0000 Subject: [PATCH 04/90] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 19eb4b3..20796c7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,6 +43,14 @@ docker-build: - master - dev +container_scanning: + variables: + DOCKER_IMAGE: "$CI_REGISTRY_IMAGE${tag}" + stage: test + only: + - master + - dev + before_script: - apt-get update -qq # Setup SSH deploy keys From dab6b75c745f78d98856ef2fba7d00fdf0014c70 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Wed, 9 Mar 2022 06:22:14 +0000 Subject: [PATCH 05/90] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20796c7..ccee562 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,13 +43,12 @@ docker-build: - master - dev +include: + - template: Security/Container-Scanning.gitlab-ci.yml container_scanning: variables: DOCKER_IMAGE: "$CI_REGISTRY_IMAGE${tag}" stage: test - only: - - master - - dev before_script: - apt-get update -qq From f9bf004ba8a83ccd2ca92068ba41e0235811a0cb Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Wed, 9 Mar 2022 06:39:56 +0000 Subject: [PATCH 06/90] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ccee562..48a9483 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,6 +45,7 @@ docker-build: include: - template: Security/Container-Scanning.gitlab-ci.yml + - template: Security/SAST.gitlab-ci.yml container_scanning: variables: DOCKER_IMAGE: "$CI_REGISTRY_IMAGE${tag}" From f76de1849d2c4511fe8eee89e1d33384fa843bd1 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Wed, 9 Mar 2022 06:48:16 +0000 Subject: [PATCH 07/90] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 48a9483..5cf013a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,8 +3,6 @@ stages: # List of stages for jobs, and their order of execution - test - deploy -image: debian - docker-build-push: # Use the official docker image. image: docker:latest @@ -51,6 +49,8 @@ container_scanning: DOCKER_IMAGE: "$CI_REGISTRY_IMAGE${tag}" stage: test + +image: debian before_script: - apt-get update -qq # Setup SSH deploy keys From 6c7aeafecf6f794df541c573789ec268f66aff69 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Wed, 9 Mar 2022 07:00:44 +0000 Subject: [PATCH 08/90] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5cf013a..941353f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,26 +43,21 @@ docker-build: include: - template: Security/Container-Scanning.gitlab-ci.yml - - template: Security/SAST.gitlab-ci.yml container_scanning: variables: DOCKER_IMAGE: "$CI_REGISTRY_IMAGE${tag}" stage: test - - -image: debian -before_script: - - apt-get update -qq - # Setup SSH deploy keys - - 'which ssh-agent || ( apt-get install -qq openssh-client )' - - eval $(ssh-agent -s) - - ssh-add <(echo "$SSH_PRIVATE_KEY") - - mkdir -p ~/.ssh - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' deploy_staging: stage: deploy + image: debian script: + - apt-get update -qq + - 'which ssh-agent || ( apt-get install -qq openssh-client )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY") + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - ssh $SSH_SERVER "cd /root && docker-compose pull shbot && docker-compose up -d shbot && exit" only: - master From 46e75415d4b8f302e6c1bef7353490312de121b9 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Wed, 9 Mar 2022 07:16:27 +0000 Subject: [PATCH 09/90] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 941353f..43988a2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,6 +24,7 @@ docker-build-push: fi - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" . - docker push "$CI_REGISTRY_IMAGE${tag}" + allow_failure: false only: - master - dev @@ -37,6 +38,7 @@ docker-build: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - docker build --pull -t "$CI_REGISTRY_IMAGE" . + allow_failure: false except: - master - dev @@ -47,17 +49,19 @@ container_scanning: variables: DOCKER_IMAGE: "$CI_REGISTRY_IMAGE${tag}" stage: test + allow_failure: false deploy_staging: stage: deploy image: debian - script: + before_script: - apt-get update -qq - 'which ssh-agent || ( apt-get install -qq openssh-client )' - eval $(ssh-agent -s) - ssh-add <(echo "$SSH_PRIVATE_KEY") - mkdir -p ~/.ssh - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + script: - ssh $SSH_SERVER "cd /root && docker-compose pull shbot && docker-compose up -d shbot && exit" only: - master From 90a1522c2a339d1e6f4e98d2c12ce88e8d792e1a Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Wed, 9 Mar 2022 08:38:32 +0000 Subject: [PATCH 10/90] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 43988a2..8af10ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,6 +45,7 @@ docker-build: include: - template: Security/Container-Scanning.gitlab-ci.yml + - template: Security/SAST.gitlab-ci.yml container_scanning: variables: DOCKER_IMAGE: "$CI_REGISTRY_IMAGE${tag}" From 542c1a92614f0234206550987e27d7f1099e9147 Mon Sep 17 00:00:00 2001 From: Aaron Date: Mon, 14 Mar 2022 17:20:39 +0100 Subject: [PATCH 11/90] switch baseimage to python:alpine --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0fe06c5..59f4c77 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:slim +FROM python:alpine WORKDIR ./ ARG PUID=1000 From 8db08e8e16fd562c517c953ef58fd3e48d688ebc Mon Sep 17 00:00:00 2001 From: Aaron Date: Mon, 14 Mar 2022 17:26:59 +0100 Subject: [PATCH 12/90] fix adduser command --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 59f4c77..8c69a93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,11 @@ FROM python:alpine WORKDIR ./ ARG PUID=1000 +ENV GROUP dockergroup ENV USER docker ENV HOMEDIR "/home/${USER}" -RUN useradd -u "${PUID}" -m "${USER}" +RUN addgroup -S "${GROUP}" && adduser -S "${USER}" -G "${GROUP}" USER ${USER} WORKDIR ${HOMEDIR} COPY . . From 58306b1e72e3f64f24b37aaae9aa372da1bd7332 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Mon, 14 Mar 2022 16:31:53 +0000 Subject: [PATCH 13/90] switch base image to python:alpine --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0fe06c5..8c69a93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,12 @@ -FROM python:slim +FROM python:alpine WORKDIR ./ ARG PUID=1000 +ENV GROUP dockergroup ENV USER docker ENV HOMEDIR "/home/${USER}" -RUN useradd -u "${PUID}" -m "${USER}" +RUN addgroup -S "${GROUP}" && adduser -S "${USER}" -G "${GROUP}" USER ${USER} WORKDIR ${HOMEDIR} COPY . . From 343024f52393142d93f6c810f730562e47e105cc Mon Sep 17 00:00:00 2001 From: aaron Date: Thu, 31 Mar 2022 18:58:39 +0200 Subject: [PATCH 14/90] mein Bier brennt --- bot.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bot.py b/bot.py index 5f62157..786ce9d 100644 --- a/bot.py +++ b/bot.py @@ -73,6 +73,13 @@ async def on_command_error(ctx, error): async def on_ready(): print("Bot ready on Version %s..." % discord.__version__) +@bot.event +async def on_message(message): + if message.author.id == 274197471515639808: + await message.add_reaction(bot.get_emoji(844264772110909501)) + if message.author.id == 252179888969089024: + await message.add_reaction(bot.get_emoji(844264772110909501)) + class Confirm(discord.ui.View): def __init__(self): super().__init__() From b7678028e7224103d40fbfb08759f0dd360f544d Mon Sep 17 00:00:00 2001 From: aaron Date: Thu, 31 Mar 2022 18:59:15 +0200 Subject: [PATCH 15/90] mein Bier brennt only for Bergseppel --- bot.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/bot.py b/bot.py index 786ce9d..10f6f8b 100644 --- a/bot.py +++ b/bot.py @@ -77,8 +77,6 @@ async def on_ready(): async def on_message(message): if message.author.id == 274197471515639808: await message.add_reaction(bot.get_emoji(844264772110909501)) - if message.author.id == 252179888969089024: - await message.add_reaction(bot.get_emoji(844264772110909501)) class Confirm(discord.ui.View): def __init__(self): From a11024d9d905a7fd212e44106723bc26c1b4a80f Mon Sep 17 00:00:00 2001 From: aaron Date: Thu, 31 Mar 2022 19:17:51 +0200 Subject: [PATCH 16/90] Bergseppel approved --- bot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bot.py b/bot.py index 10f6f8b..5381b80 100644 --- a/bot.py +++ b/bot.py @@ -77,6 +77,7 @@ async def on_ready(): async def on_message(message): if message.author.id == 274197471515639808: await message.add_reaction(bot.get_emoji(844264772110909501)) + await message.add_reaction(bot.get_emoji(950386969614110770)) class Confirm(discord.ui.View): def __init__(self): From 5f8bcf0f93d995a32ce758f719d35b9723734225 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sat, 2 Apr 2022 19:40:52 +0000 Subject: [PATCH 17/90] remove bergseppel emojis --- bot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bot.py b/bot.py index 5381b80..dd50983 100644 --- a/bot.py +++ b/bot.py @@ -73,11 +73,11 @@ async def on_command_error(ctx, error): async def on_ready(): print("Bot ready on Version %s..." % discord.__version__) -@bot.event -async def on_message(message): - if message.author.id == 274197471515639808: - await message.add_reaction(bot.get_emoji(844264772110909501)) - await message.add_reaction(bot.get_emoji(950386969614110770)) +#@bot.event +#async def on_message(message): +# if message.author.id == 274197471515639808: +# await message.add_reaction(bot.get_emoji(844264772110909501)) +# await message.add_reaction(bot.get_emoji(950386969614110770)) class Confirm(discord.ui.View): def __init__(self): From ac0841c8bfa05e43bd09c57fed1b3ff182e6998c Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Fri, 15 Apr 2022 21:32:58 +0200 Subject: [PATCH 18/90] fix start command# --- bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index dd50983..e4c4b4e 100644 --- a/bot.py +++ b/bot.py @@ -271,11 +271,14 @@ async def start(ctx, role_mention): pnp_voice = await ctx.guild.fetch_channel(435869507123281920) role = ctx.message.role_mentions[0] em = discord.Embed(description='gespieltes PnP: %s\nTeilnehmer (zum Start):' % role.mention, colour=0x00770d) + move_members = [] for c in ctx.guild.voice_channels: for m in c.members: if role in m.roles: - await m.move_to(pnp_voice) + move_members.append(m) em.add_field(name=":white_check_mark: " + m.display_name, value = m.mention + " ist am Start! Juhu!", inline=False) + for m in move_members: + await m.move_to(pnp_voice) start_msg = await pnp_info.send(content=":game_die: **INFO: PnP Sitzung gestartet!**",embed=em) text_file = open("start_id.txt", "w") text_file.write(str(start_msg.id)) From f78cfa6853c27dd8a4509dc674a4d15d1660fe5f Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Fri, 15 Apr 2022 21:34:38 +0200 Subject: [PATCH 19/90] bump pycord version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 981d2f7..23eaf87 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.0.0b5 \ No newline at end of file +py-cord==2.0.0b7 \ No newline at end of file From 7afb17c5a7c369163e85ee0c50d6f49882284f2e Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sat, 16 Apr 2022 03:52:28 +0200 Subject: [PATCH 20/90] show a custom activity with prefix and help command --- bot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bot.py b/bot.py index e4c4b4e..fc003a3 100644 --- a/bot.py +++ b/bot.py @@ -72,6 +72,9 @@ async def on_command_error(ctx, error): @bot.event async def on_ready(): print("Bot ready on Version %s..." % discord.__version__) + activity = discord.Activity(name='%shelp' % prefix, type=discord.ActivityType.listening) + #activity = discord.Game('%shelp for Help' % prefix) + await bot.change_presence(status=discord.Status.online, activity=activity) #@bot.event #async def on_message(message): From 3962d978298d50b700984cad072e288ffdf4fd81 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sat, 16 Apr 2022 03:14:07 +0000 Subject: [PATCH 21/90] Fix clear_commands for current py-cord version --- clear_commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clear_commands.py b/clear_commands.py index ea9ddd6..8fd85e0 100644 --- a/clear_commands.py +++ b/clear_commands.py @@ -22,6 +22,7 @@ bot = commands.Bot(intents=intents, command_prefix=prefix) @bot.event async def on_connect(): print("Bot ready on Version %s..." % discord.__version__) - await bot.sync_commands(unregister_guilds=[261575556708040705]) + await bot.sync_commands(commands=[], check_guilds=[261575556708040705]) + print("Press Ctl+c to exit now") bot.run(token) \ No newline at end of file From 9421f0ab924f5581cc282e15135a6e473676bf2f Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Thu, 21 Apr 2022 06:58:20 +0000 Subject: [PATCH 22/90] add specific version tag for the docker base image --- Dockerfile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8c69a93..9fe3942 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,15 @@ -FROM python:alpine - -WORKDIR ./ -ARG PUID=1000 -ENV GROUP dockergroup -ENV USER docker -ENV HOMEDIR "/home/${USER}" - -RUN addgroup -S "${GROUP}" && adduser -S "${USER}" -G "${GROUP}" -USER ${USER} -WORKDIR ${HOMEDIR} -COPY . . -RUN pip install --no-cache-dir -r requirements.txt - -CMD [ "python", "./bot.py" ] \ No newline at end of file +FROM python:3.9.12-alpine3.15 + +WORKDIR ./ +ARG PUID=1000 +ENV GROUP dockergroup +ENV USER docker +ENV HOMEDIR "/home/${USER}" + +RUN addgroup -S "${GROUP}" && adduser -S "${USER}" -G "${GROUP}" +USER ${USER} +WORKDIR ${HOMEDIR} +COPY . . +RUN pip install --no-cache-dir -r requirements.txt + +CMD [ "python", "./bot.py" ] From c2b5410b4731365a473f98193352ce4763214ceb Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 21 Apr 2022 08:33:26 +0000 Subject: [PATCH 23/90] Add renovate.json --- renovate.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..7190a60 --- /dev/null +++ b/renovate.json @@ -0,0 +1,3 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json" +} From 0cf835ef4e2e77b224264cafe19e30352e0e1c6d Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 21 Apr 2022 09:03:30 +0000 Subject: [PATCH 24/90] Update dependency python to v3.10.4 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9fe3942..99e6acd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9.12-alpine3.15 +FROM python:3.10.4-alpine3.15 WORKDIR ./ ARG PUID=1000 From 31f17fa2cc61b9c9ab110f3832c2e35761dabd0f Mon Sep 17 00:00:00 2001 From: aaron Date: Mon, 25 Apr 2022 21:59:32 +0200 Subject: [PATCH 25/90] add hiebe command --- bot.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index fc003a3..36a046e 100644 --- a/bot.py +++ b/bot.py @@ -398,12 +398,21 @@ async def purge(ctx, *, arg): @bot.command(help="zeige einem User Liebe", usage="<@User1> <@User2> ...", hidden=True) @is_member() -async def love(ctx, *, arg): +async def liebe(ctx, *, arg): await ctx.message.delete() for user in ctx.message.mentions: if user.dm_channel == None: await user.create_dm() - await user.dm_channel.send("❤️") + await user.dm_channel.send("❤️ von {}".format(ctx.author.display_name)) + +@bot.command(help="zeige einem User Hiebe", usage="<@User1> <@User2> ...", hidden=True) +@is_member() +async def hiebe(ctx, *, arg): + await ctx.message.delete() + for user in ctx.message.mentions: + if user.dm_channel == None: + await user.create_dm() + await user.dm_channel.send("HIEBE :punch: von {}".format(ctx.author.display_name)) @bot.command(help="kickt Member ohne Rolle, die 30 Tage nicht online waren", usage="") @is_admin() From 285534811d3daec22782fa31a6fab111f6dc3f96 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 17 May 2022 19:03:55 +0000 Subject: [PATCH 26/90] Update dependency py-cord to v2.0.0rc1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 23eaf87..c6bb607 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.0.0b7 \ No newline at end of file +py-cord==2.0.0rc1 \ No newline at end of file From 9e45f698fcffb118c859d823d1722a44355511e1 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Wed, 18 May 2022 16:13:50 +0000 Subject: [PATCH 27/90] Revert "Merge branch 'renovate/py-cord-2.x' into 'master'" This reverts merge request !22 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c6bb607..23eaf87 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.0.0rc1 \ No newline at end of file +py-cord==2.0.0b7 \ No newline at end of file From 53c955122ada98ca8761992725dc3f170b5e9644 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Thu, 19 May 2022 01:18:04 +0200 Subject: [PATCH 28/90] edit ci --- .gitlab-ci.yml | 46 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8af10ab..93171ee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,23 +11,28 @@ docker-build-push: - docker:dind before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - # Default branch leaves tag empty (= latest tag) - # All other branches are tagged with the escaped branch name (commit ref slug) script: - - | - if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then - tag="" - echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'" - else - tag=":$CI_COMMIT_REF_SLUG" - echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" - fi - - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" . - - docker push "$CI_REGISTRY_IMAGE${tag}" + - docker build --pull -t "$CI_REGISTRY_IMAGE" . + - docker push "$CI_REGISTRY_IMAGE" allow_failure: false only: - master + +docker-build-push-dev: + # Use the official docker image. + image: docker:latest + stage: build + services: + - docker:dind + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build --pull -t "$CI_REGISTRY_IMAGE:dev" . + - docker push "$CI_REGISTRY_IMAGE:dev" + allow_failure: false + only: - dev + - merge_requests docker-build: image: docker:latest @@ -42,6 +47,7 @@ docker-build: except: - master - dev + - merge_requests include: - template: Security/Container-Scanning.gitlab-ci.yml @@ -52,6 +58,22 @@ container_scanning: stage: test allow_failure: false +deploy_dev: + stage: deploy + image: debian + before_script: + - apt-get update -qq + - 'which ssh-agent || ( apt-get install -qq openssh-client )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY") + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + script: + - ssh $SSH_SERVER "cd /root && docker-compose -f shbot-dev.yaml pull shbot-dev && docker-compose -f shbot-dev.yaml up -d shbot-dev && exit" + only: + - dev + - merge_requests + deploy_staging: stage: deploy image: debian From 4ee864dc28da7da501a0f708d9cde27cff140488 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Thu, 19 May 2022 01:20:08 +0200 Subject: [PATCH 29/90] bump pycord --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 23eaf87..027a78e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.0.0b7 \ No newline at end of file +py-cord==2.0.0rc1 From 142a49646cee8114ec72be82e2112337048aa196 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Thu, 19 May 2022 01:37:40 +0200 Subject: [PATCH 30/90] try to fix clear commands --- clear_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clear_commands.py b/clear_commands.py index 8fd85e0..bf9c2c7 100644 --- a/clear_commands.py +++ b/clear_commands.py @@ -22,7 +22,7 @@ bot = commands.Bot(intents=intents, command_prefix=prefix) @bot.event async def on_connect(): print("Bot ready on Version %s..." % discord.__version__) - await bot.sync_commands(commands=[], check_guilds=[261575556708040705]) + await bot.sync_commands(commands=[], guild_ids=[261575556708040705]) print("Press Ctl+c to exit now") bot.run(token) \ No newline at end of file From d25b3f9a54ef62b6395cd6c55e8b1a80616814d2 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Thu, 19 May 2022 01:59:27 +0200 Subject: [PATCH 31/90] try to fix clear commands --- clear_commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clear_commands.py b/clear_commands.py index bf9c2c7..5bb7e59 100644 --- a/clear_commands.py +++ b/clear_commands.py @@ -4,6 +4,7 @@ import time import datetime import random import os +import sys from os import system from os import environ from discord.ext import commands @@ -23,6 +24,6 @@ bot = commands.Bot(intents=intents, command_prefix=prefix) async def on_connect(): print("Bot ready on Version %s..." % discord.__version__) await bot.sync_commands(commands=[], guild_ids=[261575556708040705]) - print("Press Ctl+c to exit now") + os._exit(0) bot.run(token) \ No newline at end of file From 5591f8c02e971e76f5f39d21fba6714b62f4c75c Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Thu, 19 May 2022 02:10:09 +0200 Subject: [PATCH 32/90] fix bot and bump version to rc1 --- bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 36a046e..c7003a0 100644 --- a/bot.py +++ b/bot.py @@ -100,7 +100,7 @@ class Confirm(discord.ui.View): self.stop() @bot.slash_command(guild_ids=[261575556708040705]) -@permissions.has_role(member_role) +@commands.has_role(member_role) async def roll(ctx, dice: Option(str, "Würfel den/die du werfen willst. z.B. W20, 3d6", default="W20"), ): @@ -133,7 +133,7 @@ async def roll(ctx, await ctx.response.send_message(embed=em) @bot.slash_command(guild_ids=[261575556708040705]) -@permissions.has_role(gm_role) +@commands.has_role(gm_role) async def gmroll(ctx, dice: Option(str, "Würfel den/die du werfen willst. z.B. W20, 3d6", default="W20"), ): @@ -181,7 +181,7 @@ class MyModal(Modal): @bot.message_command(name="Emoji Text", guild_ids=[261575556708040705]) -@permissions.has_role(member_role) +@commands.has_role(member_role) async def emoji_text(ctx, message: discord.Message): modal = MyModal() modal.title = "Emoji Bot" From 3f78080118f1e6136b193153e35eb494fe511d55 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Thu, 19 May 2022 02:29:09 +0200 Subject: [PATCH 33/90] fix clear_commands --- clear_commands.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clear_commands.py b/clear_commands.py index 5bb7e59..f65dc72 100644 --- a/clear_commands.py +++ b/clear_commands.py @@ -24,6 +24,8 @@ bot = commands.Bot(intents=intents, command_prefix=prefix) async def on_connect(): print("Bot ready on Version %s..." % discord.__version__) await bot.sync_commands(commands=[], guild_ids=[261575556708040705]) + await bot.register_commands(commands=[], guild_id=261575556708040705) + await bot.close() os._exit(0) bot.run(token) \ No newline at end of file From b4619c2f26d44170b05a314f313d48d8b316a7d1 Mon Sep 17 00:00:00 2001 From: aaron Date: Fri, 27 May 2022 21:54:09 +0200 Subject: [PATCH 34/90] troll the Berg --- bot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bot.py b/bot.py index c7003a0..fc55318 100644 --- a/bot.py +++ b/bot.py @@ -23,6 +23,7 @@ def mid(s, offset, amount): intents = discord.Intents.default() intents.members = True intents.message_content = True +intents.presences = True token = os.environ['TOKEN'] prefix = os.environ['PREFIX'] @@ -76,11 +77,10 @@ async def on_ready(): #activity = discord.Game('%shelp for Help' % prefix) await bot.change_presence(status=discord.Status.online, activity=activity) -#@bot.event -#async def on_message(message): -# if message.author.id == 274197471515639808: -# await message.add_reaction(bot.get_emoji(844264772110909501)) -# await message.add_reaction(bot.get_emoji(950386969614110770)) +@bot.listen() +async def on_presence_update(before, after): + if not before.is_on_mobile() and after.id == 274197471515639808 and after.is_on_mobile(): + await bot.get_channel(512004326382632961).send("https://cdn.discordapp.com/attachments/512004326382632961/979468921985982514/unknown.png") class Confirm(discord.ui.View): def __init__(self): From 5f48a8e845b00fe7f6320e28af6baa495b3abbb1 Mon Sep 17 00:00:00 2001 From: aaron Date: Thu, 2 Jun 2022 02:06:39 +0200 Subject: [PATCH 35/90] fix modal --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index fc55318..685db0e 100644 --- a/bot.py +++ b/bot.py @@ -168,7 +168,7 @@ async def gmroll(ctx, class MyModal(Modal): def __init__(self) -> None: self.message_id = 0 - super().__init__("Emojitext") + super().__init__(title="Emojitext") self.add_item(InputText(label="Dein Text:", placeholder="Jeder Buchstabe nur einmal!")) def set_message_id(self, message_id): self.message_id = message_id From 2dcf61557c6fed5dd9155f0ec4bdcf2aace184f2 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 7 Jun 2022 19:03:40 +0000 Subject: [PATCH 36/90] Update dependency python to v3.10.5 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 99e6acd..6f2ad2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10.4-alpine3.15 +FROM python:3.10.5-alpine3.15 WORKDIR ./ ARG PUID=1000 From a9541b64e0971cb5c9da97ec6303261c0daf610b Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Wed, 8 Jun 2022 23:28:34 +0200 Subject: [PATCH 37/90] disable Bergtrolling --- bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 685db0e..5561142 100644 --- a/bot.py +++ b/bot.py @@ -77,10 +77,10 @@ async def on_ready(): #activity = discord.Game('%shelp for Help' % prefix) await bot.change_presence(status=discord.Status.online, activity=activity) -@bot.listen() -async def on_presence_update(before, after): - if not before.is_on_mobile() and after.id == 274197471515639808 and after.is_on_mobile(): - await bot.get_channel(512004326382632961).send("https://cdn.discordapp.com/attachments/512004326382632961/979468921985982514/unknown.png") +#@bot.listen() +#async def on_presence_update(before, after): +# if not before.is_on_mobile() and after.id == 274197471515639808 and after.is_on_mobile(): +# await bot.get_channel(512004326382632961).send("https://cdn.discordapp.com/attachments/512004326382632961/979468921985982514/unknown.png") class Confirm(discord.ui.View): def __init__(self): From 13dc5b3c50da24a2ec36638d96476e5b72127631 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Tue, 21 Jun 2022 20:29:58 +0200 Subject: [PATCH 38/90] change vote ping from here to everyone --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 5561142..b7d3939 100644 --- a/bot.py +++ b/bot.py @@ -220,7 +220,7 @@ async def survey(ctx, *, arg): z = z + 1 em = discord.Embed(title=question, description=desc, colour=0x00E0FF) em.set_author(name=ctx.author.display_name, url=discord.Embed.Empty, icon_url=ctx.author.avatar.url) - ask_msg = await ctx.send(content="||@here||",embed=em) + ask_msg = await ctx.send(content="||@everyone||",embed=em) a = 0 for x in emojinumbers: if a < z and a != 0: From 708036b2eb210b391812f4b9777bed60e389bb28 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Tue, 21 Jun 2022 20:40:27 +0200 Subject: [PATCH 39/90] here to everyone for survey + disable deploy CD --- .gitlab-ci.yml | 60 +++++++++++++++++++++++++------------------------- bot.py | 2 +- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 93171ee..0634399 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -58,34 +58,34 @@ container_scanning: stage: test allow_failure: false -deploy_dev: - stage: deploy - image: debian - before_script: - - apt-get update -qq - - 'which ssh-agent || ( apt-get install -qq openssh-client )' - - eval $(ssh-agent -s) - - ssh-add <(echo "$SSH_PRIVATE_KEY") - - mkdir -p ~/.ssh - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - script: - - ssh $SSH_SERVER "cd /root && docker-compose -f shbot-dev.yaml pull shbot-dev && docker-compose -f shbot-dev.yaml up -d shbot-dev && exit" - only: - - dev - - merge_requests - -deploy_staging: - stage: deploy - image: debian - before_script: - - apt-get update -qq - - 'which ssh-agent || ( apt-get install -qq openssh-client )' - - eval $(ssh-agent -s) - - ssh-add <(echo "$SSH_PRIVATE_KEY") - - mkdir -p ~/.ssh - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - script: - - ssh $SSH_SERVER "cd /root && docker-compose pull shbot && docker-compose up -d shbot && exit" - only: - - master +#deploy_dev: +# stage: deploy +# image: debian +# before_script: +# - apt-get update -qq +# - 'which ssh-agent || ( apt-get install -qq openssh-client )' +# - eval $(ssh-agent -s) +# - ssh-add <(echo "$SSH_PRIVATE_KEY") +# - mkdir -p ~/.ssh +# - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' +# script: +# - ssh $SSH_SERVER "cd /root && docker-compose -f shbot-dev.yaml pull shbot-dev && docker-compose -f shbot-dev.yaml up -d shbot-dev && exit" +# only: +# - dev +# - merge_requests +# +#deploy_staging: +# stage: deploy +# image: debian +# before_script: +# - apt-get update -qq +# - 'which ssh-agent || ( apt-get install -qq openssh-client )' +# - eval $(ssh-agent -s) +# - ssh-add <(echo "$SSH_PRIVATE_KEY") +# - mkdir -p ~/.ssh +# - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' +# script: +# - ssh $SSH_SERVER "cd /root && docker-compose pull shbot && docker-compose up -d shbot && exit" +# only: +# - master \ No newline at end of file diff --git a/bot.py b/bot.py index b7d3939..29c7387 100644 --- a/bot.py +++ b/bot.py @@ -254,7 +254,7 @@ async def vote(ctx, *, arg): await ctx.message.delete() em = discord.Embed(description=arg, colour=0x00E0FF) em.set_author(name=ctx.author.display_name, url=discord.Embed.Empty, icon_url=ctx.author.avatar.url) - ask_msg = await ctx.send(content="||@here||",embed=em) + ask_msg = await ctx.send(content="||@everyone||",embed=em) for x in ["✅", "❔", "❌"]: await ask_msg.add_reaction(x) await ask_msg.create_thread(name="Diskussion") From 9bac3c953a9b08ec3c83cd8ecdb1907d345aa770 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Tue, 21 Jun 2022 20:47:04 +0200 Subject: [PATCH 40/90] reenable cicd --- .gitlab-ci.yml | 60 +++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0634399..93171ee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -58,34 +58,34 @@ container_scanning: stage: test allow_failure: false -#deploy_dev: -# stage: deploy -# image: debian -# before_script: -# - apt-get update -qq -# - 'which ssh-agent || ( apt-get install -qq openssh-client )' -# - eval $(ssh-agent -s) -# - ssh-add <(echo "$SSH_PRIVATE_KEY") -# - mkdir -p ~/.ssh -# - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' -# script: -# - ssh $SSH_SERVER "cd /root && docker-compose -f shbot-dev.yaml pull shbot-dev && docker-compose -f shbot-dev.yaml up -d shbot-dev && exit" -# only: -# - dev -# - merge_requests -# -#deploy_staging: -# stage: deploy -# image: debian -# before_script: -# - apt-get update -qq -# - 'which ssh-agent || ( apt-get install -qq openssh-client )' -# - eval $(ssh-agent -s) -# - ssh-add <(echo "$SSH_PRIVATE_KEY") -# - mkdir -p ~/.ssh -# - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' -# script: -# - ssh $SSH_SERVER "cd /root && docker-compose pull shbot && docker-compose up -d shbot && exit" -# only: -# - master +deploy_dev: + stage: deploy + image: debian + before_script: + - apt-get update -qq + - 'which ssh-agent || ( apt-get install -qq openssh-client )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY") + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + script: + - ssh $SSH_SERVER "cd /root && docker-compose -f shbot-dev.yaml pull shbot-dev && docker-compose -f shbot-dev.yaml up -d shbot-dev && exit" + only: + - dev + - merge_requests + +deploy_staging: + stage: deploy + image: debian + before_script: + - apt-get update -qq + - 'which ssh-agent || ( apt-get install -qq openssh-client )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY") + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + script: + - ssh $SSH_SERVER "cd /root && docker-compose pull shbot && docker-compose up -d shbot && exit" + only: + - master \ No newline at end of file From 5cadf95f3c5da95b5f5e66b5933af4ad8b45ff92 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Fri, 1 Jul 2022 03:16:22 +0200 Subject: [PATCH 41/90] add simple drone config --- .drone.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..0382107 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,36 @@ +kind: pipeline +name: deploy +steps: +- name: docker + image: plugins/docker + settings: + username: + from_secret: DOCKER_USERNAME + password: + from_secret: DOCKER_PASSWORD + repo: aaronriedel/shbot + tags: latest + when: + branch: + include: + - master + event: + include: + - push +- name: docker-build + image: plugins/docker + settings: + username: + from_secret: DOCKER_USERNAME + password: + from_secret: DOCKER_PASSWORD + repo: aaronriedel/shbot + tags: latest + dry_run: true + when: + branch: + exclude: + - master + event: + exclude: + - push \ No newline at end of file From 218505b614e009641241f8fca6f842dc590fd63c Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sun, 3 Jul 2022 02:42:28 +0200 Subject: [PATCH 42/90] test cicd --- .drone.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 0382107..49c4280 100644 --- a/.drone.yml +++ b/.drone.yml @@ -33,4 +33,5 @@ steps: - master event: exclude: - - push \ No newline at end of file + - push +# test \ No newline at end of file From 9e18b3a0be76a8002ffaf84e88950a6bd0697abc Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sun, 3 Jul 2022 02:45:20 +0200 Subject: [PATCH 43/90] fix repo name --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 49c4280..f85755c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,7 +8,7 @@ steps: from_secret: DOCKER_USERNAME password: from_secret: DOCKER_PASSWORD - repo: aaronriedel/shbot + repo: secondhemd/shbot tags: latest when: branch: @@ -24,7 +24,7 @@ steps: from_secret: DOCKER_USERNAME password: from_secret: DOCKER_PASSWORD - repo: aaronriedel/shbot + repo: secondhemd/shbot tags: latest dry_run: true when: From a1c188d1b6b7b48b01e4ca9362f49ed51125b43e Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sun, 3 Jul 2022 03:11:36 +0200 Subject: [PATCH 44/90] add deploy ci --- .drone.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.drone.yml b/.drone.yml index f85755c..854b09b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -34,4 +34,39 @@ steps: event: exclude: - push +- name: dev docker + image: plugins/docker + settings: + username: + from_secret: DOCKER_USERNAME + password: + from_secret: DOCKER_PASSWORD + repo: secondhemd/shbot + tags: dev + when: + branch: + include: + - dev + event: + include: + - push +- name: deploy + image: appleboy/drone-ssh + settings: + host: + - s.ar21.de + username: root + key: + from_secret: DEPLOY_SSH_KEY + port: 22 + command_timeout: 2m + script: + - cd /root && docker-compose pull shbot && docker-compose up -d shbot + when: + branch: + include: + - master + event: + include: + - push # test \ No newline at end of file From 6e35a7c32b83c48a74db1367b89125d08b1de653 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sun, 3 Jul 2022 03:12:46 +0200 Subject: [PATCH 45/90] test --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 29c7387..04f4655 100644 --- a/bot.py +++ b/bot.py @@ -73,7 +73,7 @@ async def on_command_error(ctx, error): @bot.event async def on_ready(): print("Bot ready on Version %s..." % discord.__version__) - activity = discord.Activity(name='%shelp' % prefix, type=discord.ActivityType.listening) + activity = discord.Activity(name='%shund' % prefix, type=discord.ActivityType.listening) #activity = discord.Game('%shelp for Help' % prefix) await bot.change_presence(status=discord.Status.online, activity=activity) From 0f9179d3ec9529545b1f20c44e0d4da9b749a9f3 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sun, 3 Jul 2022 03:24:56 +0200 Subject: [PATCH 46/90] drone deploy for dev --- .drone.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 854b09b..5be9a4c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -69,4 +69,22 @@ steps: event: include: - push -# test \ No newline at end of file +- name: deploy dev + image: appleboy/drone-ssh + settings: + host: + - s.ar21.de + username: root + key: + from_secret: DEPLOY_SSH_KEY + port: 22 + command_timeout: 2m + script: + - cd /root && docker-compose -f shbot-dev.yaml pull shbot-dev && docker-compose -f shbot-dev.yaml up -d shbot-dev + when: + branch: + include: + - dev + event: + include: + - push \ No newline at end of file From 3d0d38eb30b701011f93049e6415c16aab8aa92c Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sun, 3 Jul 2022 03:28:09 +0200 Subject: [PATCH 47/90] remove test stuff --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 04f4655..29c7387 100644 --- a/bot.py +++ b/bot.py @@ -73,7 +73,7 @@ async def on_command_error(ctx, error): @bot.event async def on_ready(): print("Bot ready on Version %s..." % discord.__version__) - activity = discord.Activity(name='%shund' % prefix, type=discord.ActivityType.listening) + activity = discord.Activity(name='%shelp' % prefix, type=discord.ActivityType.listening) #activity = discord.Game('%shelp for Help' % prefix) await bot.change_presence(status=discord.Status.online, activity=activity) From cdc56b3cfdf20a8bf768e1fa6fd6a1f063780b15 Mon Sep 17 00:00:00 2001 From: drone Date: Sat, 9 Jul 2022 00:17:41 +0000 Subject: [PATCH 48/90] Update dependency py-cord to v2.0.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 027a78e..42cde26 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.0.0rc1 +py-cord==2.0.0 From 030072011116883f447955b3c967a1201bebfb10 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Thu, 21 Jul 2022 17:42:08 +0200 Subject: [PATCH 49/90] fix drone ci --- .drone.yml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5be9a4c..0f42d89 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,10 +12,8 @@ steps: tags: latest when: branch: - include: - master event: - include: - push - name: docker-build image: plugins/docker @@ -28,12 +26,11 @@ steps: tags: latest dry_run: true when: - branch: - exclude: - - master - event: - exclude: - - push + exclude: + branch: + - master + event: + - push - name: dev docker image: plugins/docker settings: @@ -45,10 +42,8 @@ steps: tags: dev when: branch: - include: - dev event: - include: - push - name: deploy image: appleboy/drone-ssh @@ -64,10 +59,8 @@ steps: - cd /root && docker-compose pull shbot && docker-compose up -d shbot when: branch: - include: - master event: - include: - push - name: deploy dev image: appleboy/drone-ssh @@ -83,8 +76,6 @@ steps: - cd /root && docker-compose -f shbot-dev.yaml pull shbot-dev && docker-compose -f shbot-dev.yaml up -d shbot-dev when: branch: - include: - dev event: - include: - push \ No newline at end of file From 06f099ca1801518a6f509d5f617938a8a1ff93bb Mon Sep 17 00:00:00 2001 From: drone Date: Tue, 2 Aug 2022 21:17:16 +0000 Subject: [PATCH 50/90] Update dependency python to v3.10.6 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6f2ad2a..1246ff1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10.5-alpine3.15 +FROM python:3.10.6-alpine3.15 WORKDIR ./ ARG PUID=1000 From faa702ce0536510d0cb0da827d8b299ad3c19d0d Mon Sep 17 00:00:00 2001 From: drone Date: Tue, 16 Aug 2022 21:18:17 +0000 Subject: [PATCH 51/90] Update dependency py-cord to v2.0.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 42cde26..8798123 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.0.0 +py-cord==2.0.1 From 1c09edb25b394fac22e27e5ab2d803c46e15157e Mon Sep 17 00:00:00 2001 From: drone Date: Thu, 25 Aug 2022 16:18:18 +0000 Subject: [PATCH 52/90] Update dependency py-cord to v2.1.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8798123..41e8ea6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.0.1 +py-cord==2.1.0 From 84b8379926f0f4f81a1d7d831f81ca6bd477f8ed Mon Sep 17 00:00:00 2001 From: drone Date: Thu, 25 Aug 2022 22:18:18 +0000 Subject: [PATCH 53/90] Update dependency py-cord to v2.1.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 41e8ea6..97e2aa0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.1.0 +py-cord==2.1.1 From 281ad8f957515bedadc980e8b050adb36d0b9a68 Mon Sep 17 00:00:00 2001 From: drone Date: Tue, 6 Sep 2022 21:18:18 +0000 Subject: [PATCH 54/90] Update dependency py-cord to v2.1.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 97e2aa0..f7d07ed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.1.1 +py-cord==2.1.2 From 7efe4b3c1340874ef48d9499d32049ea29254920 Mon Sep 17 00:00:00 2001 From: drone Date: Wed, 7 Sep 2022 14:18:18 +0000 Subject: [PATCH 55/90] Update dependency py-cord to v2.1.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f7d07ed..064372a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.1.2 +py-cord==2.1.3 From 2cb6af2062acf89d0d3b05e1265fad5195cd31c5 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Thu, 8 Sep 2022 00:30:25 +0200 Subject: [PATCH 56/90] add architecture to Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1246ff1..f0c6d71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10.6-alpine3.15 +FROM amd64/python:3.10.6-alpine3.15 WORKDIR ./ ARG PUID=1000 From 7cd2883dc03f53ee1c80339b808744f863c2849b Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Thu, 8 Sep 2022 00:32:14 +0200 Subject: [PATCH 57/90] update base image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f0c6d71..9516bef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM amd64/python:3.10.6-alpine3.15 +FROM amd64/python:3.10.7-alpine3.15 WORKDIR ./ ARG PUID=1000 From fd7b680eb8f2e7112142d358f1fbdba976981d57 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Thu, 8 Sep 2022 00:36:09 +0200 Subject: [PATCH 58/90] update base image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9516bef..f625242 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM amd64/python:3.10.7-alpine3.15 +FROM amd64/python:3.10.7-alpine3.16 WORKDIR ./ ARG PUID=1000 From c33714f2e714419ebb123a29614b7781e792c5e8 Mon Sep 17 00:00:00 2001 From: drone Date: Sun, 2 Oct 2022 22:12:42 +0000 Subject: [PATCH 59/90] Update dependency py-cord to v2.2.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 064372a..2820bfa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.1.3 +py-cord==2.2.0 From 7ec737640524a771ee5be5171aa009a0a6d776d1 Mon Sep 17 00:00:00 2001 From: drone Date: Thu, 6 Oct 2022 02:12:42 +0000 Subject: [PATCH 60/90] Update dependency py-cord to v2.2.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2820bfa..ee8d8d2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.2.0 +py-cord==2.2.1 From 533e45acaef9dd86830edf1f0006490fd8107b0a Mon Sep 17 00:00:00 2001 From: drone Date: Fri, 14 Oct 2022 01:27:51 +0000 Subject: [PATCH 61/90] Update python Docker tag to v3.10.8 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f625242..7374efc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM amd64/python:3.10.7-alpine3.16 +FROM amd64/python:3.10.8-alpine3.16 WORKDIR ./ ARG PUID=1000 From d91151f931803a53ac6ff4b282c7c758feba8f72 Mon Sep 17 00:00:00 2001 From: drone Date: Wed, 12 Oct 2022 22:13:41 +0000 Subject: [PATCH 62/90] Update dependency py-cord to v2.2.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ee8d8d2..1300958 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.2.1 +py-cord==2.2.2 From 65a7e9048eec6d0a01d7080bef3c812c098accec Mon Sep 17 00:00:00 2001 From: drone Date: Wed, 23 Nov 2022 22:05:20 +0000 Subject: [PATCH 63/90] Update dependency py-cord to v2.3.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1300958..5d6933b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.2.2 +py-cord==2.3.0 From b4116bf6a08d7c3bcb00f98efd6cc2b81fb3e220 Mon Sep 17 00:00:00 2001 From: drone Date: Thu, 8 Dec 2022 05:05:20 +0000 Subject: [PATCH 64/90] Update python Docker tag to v3.11.1 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7374efc..9a2e7e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM amd64/python:3.10.8-alpine3.16 +FROM amd64/python:3.11.1-alpine3.16 WORKDIR ./ ARG PUID=1000 From 81f84dddf431ea2ea3981719f5636f838d863281 Mon Sep 17 00:00:00 2001 From: drone Date: Tue, 13 Dec 2022 23:58:02 +0000 Subject: [PATCH 65/90] Update dependency py-cord to v2.3.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5d6933b..59e995e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.3.0 +py-cord==2.3.2 From a34af09bebb07b9ae118a257c92f949f10e580b0 Mon Sep 17 00:00:00 2001 From: drone Date: Thu, 9 Feb 2023 02:26:51 +0000 Subject: [PATCH 66/90] Update python Docker tag to v3.11.2 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9a2e7e9..2bed68e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM amd64/python:3.11.1-alpine3.16 +FROM amd64/python:3.11.2-alpine3.16 WORKDIR ./ ARG PUID=1000 From b4fbdc762897123e984093471f66d565da085546 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sat, 11 Feb 2023 03:15:50 +0000 Subject: [PATCH 67/90] Update dependency py-cord to v2.3.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 59e995e..1be895a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.3.2 +py-cord==2.3.3 From 5fdf2b666c005d2daecb5778332c960057cf1d8a Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sat, 11 Feb 2023 13:16:49 +0000 Subject: [PATCH 68/90] Update dependency py-cord to v2.4.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1be895a..bd223b0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.3.3 +py-cord==2.4.0 From a0aa24bb41c87b6908324bb50ed0f0ab1c3e58c8 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Mon, 13 Feb 2023 22:19:42 +0100 Subject: [PATCH 69/90] update README for gitea environment --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index baebe92..af469a1 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,22 @@ # SECOND BOT -[![pipeline status](https://git.cxservers.com/aaron-riedel/shbot/badges/master/pipeline.svg)](https://git.cxservers.com/aaron-riedel/shbot/-/commits/master) +[![Build Status](https://drone.ar21.de/api/badges/secondhemd/shbot/status.svg)](https://drone.ar21.de/secondhemd/shbot) der Bot für den SecondHemd Discord # Latest ## Build ``` -docker build -t docker-registry.cxservers.com/aaron-riedel/shbot:latest . +docker build -t secondhemd/shbot:latest . ``` ## Run ``` -sudo docker run -e 'TOKEN=' -e 'PREFIX=$' -t docker-registry.cxservers.com/aaron-riedel/shbot:latest +sudo docker run -e 'TOKEN=' -e 'PREFIX=$' -t secondhemd/shbot:latest ``` ## Docker compose ``` services: bot: - image: docker-registry.cxservers.com/aaron-riedel/shbot:latest + image: secondhemd/shbot:latest container_name: shbot restart: unless-stopped environment: @@ -27,17 +27,17 @@ services: # Development ## Build ``` -docker build -t docker-registry.cxservers.com/aaron-riedel/shbot:dev . +docker build -t secondhemd/shbot:dev . ``` ## Run ``` -sudo docker run -e 'TOKEN=' -e 'PREFIX=$' -t docker-registry.cxservers.com/aaron-riedel/shbot:dev +sudo docker run -e 'TOKEN=' -e 'PREFIX=$' -t secondhemd/shbot:dev ``` ## Docker compose ``` services: bot: - image: docker-registry.cxservers.com/aaron-riedel/shbot:dev + image: secondhemd/shbot:dev container_name: shbot restart: unless-stopped environment: From b5ec9bac9202747841926af54a84acc23483c0c6 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Mon, 20 Mar 2023 23:06:42 +0000 Subject: [PATCH 70/90] Update dependency py-cord to v2.4.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index bd223b0..5f27b6b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.4.0 +py-cord==2.4.1 From 4a029f3bcd7722ea7e2ba0d24ffd5ba9360afd4a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 6 Apr 2023 01:07:49 +0000 Subject: [PATCH 71/90] Update python Docker tag to v3.11.3 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2bed68e..f663dcc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM amd64/python:3.11.2-alpine3.16 +FROM amd64/python:3.11.3-alpine3.16 WORKDIR ./ ARG PUID=1000 From ee561c5356cf7b61b8ac4d53557c801dc9494f67 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Mon, 29 May 2023 23:04:45 +0200 Subject: [PATCH 72/90] reduce prune days to 7 --- bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 29c7387..7d58e3b 100644 --- a/bot.py +++ b/bot.py @@ -414,7 +414,7 @@ async def hiebe(ctx, *, arg): await user.create_dm() await user.dm_channel.send("HIEBE :punch: von {}".format(ctx.author.display_name)) -@bot.command(help="kickt Member ohne Rolle, die 30 Tage nicht online waren", usage="") +@bot.command(help="kickt Member ohne Rolle, die 7 Tage nicht online waren", usage="") @is_admin() async def prune(ctx): await ctx.message.delete() @@ -427,8 +427,8 @@ async def prune(ctx): await ctx.send(content="Zeit ausgelaufen", delete_after=5.0) elif view.value: await question.delete() - deleted = await ctx.guild.prune_members(days=30) - await ctx.send(content='Ich habe {} Leichen beseitigt.'.format(deleted), delete_after=5.0) + deleted = await ctx.guild.prune_members(days=7) + await ctx.send(content='Ich habe {} Leiche(n) beseitigt.'.format(deleted), delete_after=5.0) else: await question.delete() From e753423957fd8390199a60ed9993efa29a1bba84 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Mon, 29 May 2023 23:04:57 +0200 Subject: [PATCH 73/90] remove whitespace --- bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 7d58e3b..2a4c642 100644 --- a/bot.py +++ b/bot.py @@ -101,7 +101,7 @@ class Confirm(discord.ui.View): @bot.slash_command(guild_ids=[261575556708040705]) @commands.has_role(member_role) -async def roll(ctx, +async def roll(ctx, dice: Option(str, "Würfel den/die du werfen willst. z.B. W20, 3d6", default="W20"), ): """Rolle einen oder mehrere Würfel""" @@ -134,7 +134,7 @@ async def roll(ctx, @bot.slash_command(guild_ids=[261575556708040705]) @commands.has_role(gm_role) -async def gmroll(ctx, +async def gmroll(ctx, dice: Option(str, "Würfel den/die du werfen willst. z.B. W20, 3d6", default="W20"), ): """Rolle einen oder mehrere Würfel verdeckt""" @@ -178,7 +178,7 @@ class MyModal(Modal): original_message = await interaction.channel.fetch_message(self.message_id) for x in list(emojitext): await original_message.add_reaction(alphabet[x]) - + @bot.message_command(name="Emoji Text", guild_ids=[261575556708040705]) @commands.has_role(member_role) From f9c496d1589a9dee3b84fd6d10ab6272b75fc378 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sun, 24 Sep 2023 04:35:05 +0200 Subject: [PATCH 74/90] update pipeline --- .drone.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0f42d89..2fd10a7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,7 +1,7 @@ kind: pipeline name: deploy steps: -- name: docker +- name: docker image: plugins/docker settings: username: @@ -13,8 +13,6 @@ steps: when: branch: - master - event: - - push - name: docker-build image: plugins/docker settings: @@ -26,11 +24,9 @@ steps: tags: latest dry_run: true when: - exclude: - branch: + branch: + exclude: - master - event: - - push - name: dev docker image: plugins/docker settings: @@ -43,8 +39,6 @@ steps: when: branch: - dev - event: - - push - name: deploy image: appleboy/drone-ssh settings: @@ -60,8 +54,6 @@ steps: when: branch: - master - event: - - push - name: deploy dev image: appleboy/drone-ssh settings: @@ -77,5 +69,6 @@ steps: when: branch: - dev - event: - - push \ No newline at end of file +when: + event: + - push \ No newline at end of file From 74fe90b2423c3a395367d1796d0113ed4fc77ba9 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sat, 25 Nov 2023 21:21:35 +0100 Subject: [PATCH 75/90] update pipeline because of new docker compose --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2fd10a7..c585747 100644 --- a/.drone.yml +++ b/.drone.yml @@ -50,7 +50,7 @@ steps: port: 22 command_timeout: 2m script: - - cd /root && docker-compose pull shbot && docker-compose up -d shbot + - cd /root && docker compose pull shbot && docker compose up -d shbot when: branch: - master @@ -65,7 +65,7 @@ steps: port: 22 command_timeout: 2m script: - - cd /root && docker-compose -f shbot-dev.yaml pull shbot-dev && docker-compose -f shbot-dev.yaml up -d shbot-dev + - cd /root && docker compose -f shbot-dev.yaml pull shbot-dev && docker compose -f shbot-dev.yaml up -d shbot-dev when: branch: - dev From 2a46a5463705800fe6418e4ceac059cfb5e1f1e1 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sun, 24 Dec 2023 20:27:54 +0100 Subject: [PATCH 76/90] change container registry --- .drone.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.drone.yml b/.drone.yml index c585747..62e6d3e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,25 +2,23 @@ kind: pipeline name: deploy steps: - name: docker - image: plugins/docker - settings: + registry: git.ar21.de username: - from_secret: DOCKER_USERNAME + from_secret: REGISTRY_USER password: - from_secret: DOCKER_PASSWORD - repo: secondhemd/shbot + from_secret: REGISTRY_PASS + repo: git.ar21.de/secondhemd/shbot tags: latest when: branch: - master - name: docker-build - image: plugins/docker - settings: + registry: git.ar21.de username: - from_secret: DOCKER_USERNAME + from_secret: REGISTRY_USER password: - from_secret: DOCKER_PASSWORD - repo: secondhemd/shbot + from_secret: REGISTRY_PASS + repo: git.ar21.de/secondhemd/shbot tags: latest dry_run: true when: @@ -30,11 +28,12 @@ steps: - name: dev docker image: plugins/docker settings: + registry: git.ar21.de username: - from_secret: DOCKER_USERNAME + from_secret: REGISTRY_USER password: - from_secret: DOCKER_PASSWORD - repo: secondhemd/shbot + from_secret: REGISTRY_PASS + repo: git.ar21.de/secondhemd/shbot tags: dev when: branch: From 43a01a753ba9e2938f616ead079a92549bac6f17 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sun, 24 Dec 2023 20:29:10 +0100 Subject: [PATCH 77/90] fix container registry --- .drone.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 62e6d3e..4aa32d9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,7 +2,9 @@ kind: pipeline name: deploy steps: - name: docker - registry: git.ar21.de + image: plugins/docker + settings: + registry: git.ar21.de username: from_secret: REGISTRY_USER password: @@ -13,7 +15,9 @@ steps: branch: - master - name: docker-build - registry: git.ar21.de + image: plugins/docker + settings: + registry: git.ar21.de username: from_secret: REGISTRY_USER password: From 5948da8056edfa68868cef3ca2770fe2089df62a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 2 Mar 2024 09:19:30 +0000 Subject: [PATCH 78/90] Update dependency py-cord to v2.5.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5f27b6b..d519adb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.4.1 +py-cord==2.5.0 From b0a3e48890b120058fb049646bf113fa902f8abe Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Wed, 26 Jun 2024 00:17:25 +0200 Subject: [PATCH 79/90] change compose directory --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 4aa32d9..0621ecc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -53,7 +53,7 @@ steps: port: 22 command_timeout: 2m script: - - cd /root && docker compose pull shbot && docker compose up -d shbot + - cd ~/compose/shbot && docker compose pull shbot && docker compose up -d shbot when: branch: - master From a526ec91f51b19de708ab59f2684812f44f862ea Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 9 Jul 2024 19:10:23 +0000 Subject: [PATCH 80/90] Update dependency py-cord to v2.6.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d519adb..22c11d2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.5.0 +py-cord==2.6.0 From be7db764ecbf2a67da337c40299d1d35b39a8587 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Thu, 11 Jul 2024 21:37:12 +0200 Subject: [PATCH 81/90] roll back to 2.4.1 because of breaking changes --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 22c11d2..5f27b6b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.6.0 +py-cord==2.4.1 From f16042d81a212a384c842557b261375f0ca8dd51 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Fri, 12 Jul 2024 12:59:26 +0200 Subject: [PATCH 82/90] Update to pycord 2.6.0 and fix the embed --- bot.py | 6 +++--- requirements.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 2a4c642..b61ec1b 100644 --- a/bot.py +++ b/bot.py @@ -219,7 +219,7 @@ async def survey(ctx, *, arg): desc = desc + emojinumbers[z] + " - " + y + "\n" z = z + 1 em = discord.Embed(title=question, description=desc, colour=0x00E0FF) - em.set_author(name=ctx.author.display_name, url=discord.Embed.Empty, icon_url=ctx.author.avatar.url) + em.set_author(name=ctx.author.display_name, url=None, icon_url=ctx.author.avatar.url) ask_msg = await ctx.send(content="||@everyone||",embed=em) a = 0 for x in emojinumbers: @@ -244,7 +244,7 @@ async def surveyedit(ctx, *, arg): desc = desc + emojinumbers[z] + " - " + y + "\n" z = z + 1 em = discord.Embed(title=question, description=desc, colour=0x00E0FF) - em.set_author(name=ctx.author.display_name, url=discord.Embed.Empty, icon_url=ctx.author.avatar.url) + em.set_author(name=ctx.author.display_name, url=None, icon_url=ctx.author.avatar.url) survey_msg = await ctx.channel.fetch_message((int(survey_id))) await survey_msg.edit(embed=em) @@ -253,7 +253,7 @@ async def surveyedit(ctx, *, arg): async def vote(ctx, *, arg): await ctx.message.delete() em = discord.Embed(description=arg, colour=0x00E0FF) - em.set_author(name=ctx.author.display_name, url=discord.Embed.Empty, icon_url=ctx.author.avatar.url) + em.set_author(name=ctx.author.display_name, url=None, icon_url=ctx.author.avatar.url) ask_msg = await ctx.send(content="||@everyone||",embed=em) for x in ["✅", "❔", "❌"]: await ask_msg.add_reaction(x) diff --git a/requirements.txt b/requirements.txt index 5f27b6b..22c11d2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.4.1 +py-cord==2.6.0 From 91a75741bf1734f04ffe368053ecdd05f511ecf8 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Fri, 12 Jul 2024 13:02:21 +0200 Subject: [PATCH 83/90] remove old help and old yesno --- bot.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/bot.py b/bot.py index b61ec1b..ebe8d56 100644 --- a/bot.py +++ b/bot.py @@ -188,24 +188,6 @@ async def emoji_text(ctx, message: discord.Message): modal.set_message_id(message.id) await ctx.interaction.response.send_modal(modal) -@bot.command(help="veraltet", usage="", hidden=True) -@is_member() -async def yesno(ctx): - await ctx.message.delete() - await ctx.send(content="Sorry das geht so nicht. Der Befehl hat sich geändert in !vote... für mehr Informationen schreib bitte !help oder frage deinen Admin oder Apotheker. Liebste Grüße, SecondBot <3", delete_after=20.0) - -@bot.command(help="Zeigt alte Hilfe", usage="") -@is_member() -async def helpme(ctx): - if admin(ctx): - admin_text = "\n\n!add = Hinzufügen einer Rolle mit Textchannel und hinzufügen von Usern zur Rolle\nNutzung: !add \"\" \n\n!labor = bringt dich ins Labor :)\nNutzung: !labor\n\n!start = Starte ne Runde PnP\nNutzung: !start @Rolle\n\n!stop = Beende die gestartete Runde PnP\nNutzung: !stop\n\n!purge = Löschen von Nachrichten\nNutzung: !purge all||x minutes/hours/days/weeks\n\n!prune - kickt Member ohne Rolle, die 30 Tage nicht online waren\nNutzung: !prune" - else: - admin_text = "" - em = discord.Embed(title="Hilfe",description="!survey = Umfrage mit mehreren Antwortmöglichkeiten\nNutzung: !survey | | ...\n\n!vote = Ja/Nein Umfrage\nNutzung: !vote \n\n!love = zeige einem User Liebe\nNutzung: !love <@User1> <@User2> ...\n\n!roll = Rolle einen oder mehrere Würfel\nNutzung: !roll W (z.B. !roll W20 oder !roll 10W6)%s" % admin_text, colour=0x00FF00) - if ctx.author.dm_channel == None: - await ctx.author.create_dm() - await ctx.author.dm_channel.send(embed=em) - @bot.command(help="Umfrage mit mehreren Antwortmöglichkeiten", usage=" | | ...") @is_member() async def survey(ctx, *, arg): From 559d8c216928956458a7c58454a2cd08f7148471 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Fri, 12 Jul 2024 13:07:08 +0200 Subject: [PATCH 84/90] make hiebe and liebe visible in help --- bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index ebe8d56..3938732 100644 --- a/bot.py +++ b/bot.py @@ -378,7 +378,7 @@ async def purge(ctx, *, arg): deleted = await ctx.channel.purge(limit=limit) await ctx.send(content='Ich habe {} Nachrichten gelöscht.'.format(len(deleted)), delete_after=5.0) -@bot.command(help="zeige einem User Liebe", usage="<@User1> <@User2> ...", hidden=True) +@bot.command(help="zeige einem User Liebe", usage="<@User1> <@User2> ...") @is_member() async def liebe(ctx, *, arg): await ctx.message.delete() @@ -387,7 +387,7 @@ async def liebe(ctx, *, arg): await user.create_dm() await user.dm_channel.send("❤️ von {}".format(ctx.author.display_name)) -@bot.command(help="zeige einem User Hiebe", usage="<@User1> <@User2> ...", hidden=True) +@bot.command(help="zeige einem User Hiebe", usage="<@User1> <@User2> ...") @is_member() async def hiebe(ctx, *, arg): await ctx.message.delete() From a344db3ad1bcc64baff9d9e338c2fe53bd8e7c63 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Fri, 12 Jul 2024 14:20:28 +0200 Subject: [PATCH 85/90] add survey bot --- survey.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 survey.py diff --git a/survey.py b/survey.py new file mode 100644 index 0000000..8812b88 --- /dev/null +++ b/survey.py @@ -0,0 +1,42 @@ +import discord +import asyncio +import time +import datetime +import random +import os +from os import system +from os import environ +from discord.ext import commands +from discord.commands import Option +from discord.commands import permissions +from discord.ui import InputText, Modal + +def left(s, amount): + return s[:amount] + +def right(s, amount): + return s[-amount:] + +def mid(s, offset, amount): + return s[offset:offset+amount] + +token = os.environ['TOKEN'] +survey_channel = os.environ['SURVEY_CHANNEL'] +mention_id = os.environ['MENTION_ID'] +guild_id = os.environ['GUILD_ID'] +runtime = 48 + +bot = discord.Bot(description=None) + +@bot.event +async def on_ready(): + print("Bot ready on Version %s..." % discord.__version__) + # build survey + po = discord.Poll(question="Wie habt ihr nächste Woche Zeit?", answers=[discord.PollAnswer(text="Montag", emoji="1\u20E3"), discord.PollAnswer(text="Dienstag", emoji="2\u20E3"), discord.PollAnswer(text="Mittwoch", emoji="3\u20E3"), discord.PollAnswer(text="Donnerstag", emoji="4\u20E3"), discord.PollAnswer(text="Freitag", emoji="5\u20E3"), discord.PollAnswer(text="Samstag", emoji="6\u20E3"), discord.PollAnswer(text="Sonntag", emoji="7\u20E3"), discord.PollAnswer(text="keine Zeit", emoji="❌")], duration=runtime, allow_multiselect=True) + # send message + msg = await bot.get_channel(survey_channel).send(content="||%s||"% bot.get_guild(guild_id).get_role(mention_id).mention ,poll=po) + await msg.create_thread(name="Diskussion") + # close connection + await bot.close() + +bot.run(token) \ No newline at end of file From 4c261a30d4813e91cc4a837044b96b4dfab8e4f2 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Fri, 12 Jul 2024 14:37:49 +0200 Subject: [PATCH 86/90] fix issue with survey script --- survey.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/survey.py b/survey.py index 8812b88..1031c61 100644 --- a/survey.py +++ b/survey.py @@ -21,9 +21,9 @@ def mid(s, offset, amount): return s[offset:offset+amount] token = os.environ['TOKEN'] -survey_channel = os.environ['SURVEY_CHANNEL'] -mention_id = os.environ['MENTION_ID'] -guild_id = os.environ['GUILD_ID'] +survey_channel = int(os.environ['SURVEY_CHANNEL']) +mention_id = int(os.environ['MENTION_ID']) +guild_id = int(os.environ['GUILD_ID']) runtime = 48 bot = discord.Bot(description=None) From 836d6b1d3dac4369acb0469e9a1d3760091ef335 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 15 Sep 2024 20:22:12 +0000 Subject: [PATCH 87/90] Update dependency py-cord to v2.6.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 22c11d2..62f4ab2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -py-cord==2.6.0 +py-cord==2.6.1 From a39ea9e50b0e91260f5b7e7d523780a99786dde2 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Thu, 10 Oct 2024 21:15:00 +0200 Subject: [PATCH 88/90] woodpecker --- .drone.yml | 77 ---------------------------------------- .woodpecker/.build.yaml | 42 ++++++++++++++++++++++ .woodpecker/.deploy.yaml | 34 ++++++++++++++++++ 3 files changed, 76 insertions(+), 77 deletions(-) delete mode 100644 .drone.yml create mode 100644 .woodpecker/.build.yaml create mode 100644 .woodpecker/.deploy.yaml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 0621ecc..0000000 --- a/.drone.yml +++ /dev/null @@ -1,77 +0,0 @@ -kind: pipeline -name: deploy -steps: -- name: docker - image: plugins/docker - settings: - registry: git.ar21.de - username: - from_secret: REGISTRY_USER - password: - from_secret: REGISTRY_PASS - repo: git.ar21.de/secondhemd/shbot - tags: latest - when: - branch: - - master -- name: docker-build - image: plugins/docker - settings: - registry: git.ar21.de - username: - from_secret: REGISTRY_USER - password: - from_secret: REGISTRY_PASS - repo: git.ar21.de/secondhemd/shbot - tags: latest - dry_run: true - when: - branch: - exclude: - - master -- name: dev docker - image: plugins/docker - settings: - registry: git.ar21.de - username: - from_secret: REGISTRY_USER - password: - from_secret: REGISTRY_PASS - repo: git.ar21.de/secondhemd/shbot - tags: dev - when: - branch: - - dev -- name: deploy - image: appleboy/drone-ssh - settings: - host: - - s.ar21.de - username: root - key: - from_secret: DEPLOY_SSH_KEY - port: 22 - command_timeout: 2m - script: - - cd ~/compose/shbot && docker compose pull shbot && docker compose up -d shbot - when: - branch: - - master -- name: deploy dev - image: appleboy/drone-ssh - settings: - host: - - s.ar21.de - username: root - key: - from_secret: DEPLOY_SSH_KEY - port: 22 - command_timeout: 2m - script: - - cd /root && docker compose -f shbot-dev.yaml pull shbot-dev && docker compose -f shbot-dev.yaml up -d shbot-dev - when: - branch: - - dev -when: - event: - - push \ No newline at end of file diff --git a/.woodpecker/.build.yaml b/.woodpecker/.build.yaml new file mode 100644 index 0000000..32ff27f --- /dev/null +++ b/.woodpecker/.build.yaml @@ -0,0 +1,42 @@ +steps: +- name: docker + image: woodpeckerci/plugin-docker-buildx + settings: + registry: git.ar21.de + username: + from_secret: REGISTRY_USER + password: + from_secret: REGISTRY_PASS + repo: git.ar21.de/secondhemd/shbot + tags: latest + when: + - branch: master + event: [push, manual] +- name: docker-build + image: woodpeckerci/plugin-docker-buildx + settings: + registry: git.ar21.de + username: + from_secret: REGISTRY_USER + password: + from_secret: REGISTRY_PASS + repo: git.ar21.de/secondhemd/shbot + tags: latest + dry_run: true + when: + - branch: + exclude: [master, dev] + event: [push, manual] +- name: dev docker + image: woodpeckerci/plugin-docker-buildx + settings: + registry: git.ar21.de + username: + from_secret: REGISTRY_USER + password: + from_secret: REGISTRY_PASS + repo: git.ar21.de/secondhemd/shbot + tags: dev + when: + - branch: dev + event: [push, manual] diff --git a/.woodpecker/.deploy.yaml b/.woodpecker/.deploy.yaml new file mode 100644 index 0000000..fb99a19 --- /dev/null +++ b/.woodpecker/.deploy.yaml @@ -0,0 +1,34 @@ +skip_clone: true +steps: +- name: deploy + image: appleboy/drone-ssh + settings: + host: + - s.ar21.de + username: root + key: + from_secret: DEPLOY_SSH_KEY + port: 22 + command_timeout: 2m + script: + - cd ~/compose/shbot && docker compose pull shbot && docker compose up -d shbot + when: + - branch: master + event: [push, manual] +- name: deploy dev + image: appleboy/drone-ssh + settings: + host: + - s.ar21.de + username: root + key: + from_secret: DEPLOY_SSH_KEY + port: 22 + command_timeout: 2m + script: + - cd /root && docker compose -f shbot-dev.yaml pull shbot-dev && docker compose -f shbot-dev.yaml up -d shbot-dev + when: + - branch: dev + event: [push, manual] +depends_on: + - build From 98f491860da2fed27fd8896d0b5001fb5d0e397b Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Thu, 10 Oct 2024 21:19:16 +0200 Subject: [PATCH 89/90] remove gitlab ci --- .gitlab-ci.yml | 91 -------------------------------------------------- 1 file changed, 91 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 93171ee..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,91 +0,0 @@ -stages: # List of stages for jobs, and their order of execution - - build - - test - - deploy - -docker-build-push: - # Use the official docker image. - image: docker:latest - stage: build - services: - - docker:dind - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - script: - - docker build --pull -t "$CI_REGISTRY_IMAGE" . - - docker push "$CI_REGISTRY_IMAGE" - allow_failure: false - only: - - master - -docker-build-push-dev: - # Use the official docker image. - image: docker:latest - stage: build - services: - - docker:dind - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - script: - - docker build --pull -t "$CI_REGISTRY_IMAGE:dev" . - - docker push "$CI_REGISTRY_IMAGE:dev" - allow_failure: false - only: - - dev - - merge_requests - -docker-build: - image: docker:latest - stage: build - services: - - docker:dind - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - script: - - docker build --pull -t "$CI_REGISTRY_IMAGE" . - allow_failure: false - except: - - master - - dev - - merge_requests - -include: - - template: Security/Container-Scanning.gitlab-ci.yml - - template: Security/SAST.gitlab-ci.yml -container_scanning: - variables: - DOCKER_IMAGE: "$CI_REGISTRY_IMAGE${tag}" - stage: test - allow_failure: false - -deploy_dev: - stage: deploy - image: debian - before_script: - - apt-get update -qq - - 'which ssh-agent || ( apt-get install -qq openssh-client )' - - eval $(ssh-agent -s) - - ssh-add <(echo "$SSH_PRIVATE_KEY") - - mkdir -p ~/.ssh - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - script: - - ssh $SSH_SERVER "cd /root && docker-compose -f shbot-dev.yaml pull shbot-dev && docker-compose -f shbot-dev.yaml up -d shbot-dev && exit" - only: - - dev - - merge_requests - -deploy_staging: - stage: deploy - image: debian - before_script: - - apt-get update -qq - - 'which ssh-agent || ( apt-get install -qq openssh-client )' - - eval $(ssh-agent -s) - - ssh-add <(echo "$SSH_PRIVATE_KEY") - - mkdir -p ~/.ssh - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - script: - - ssh $SSH_SERVER "cd /root && docker-compose pull shbot && docker-compose up -d shbot && exit" - only: - - master - \ No newline at end of file From 7e4e23bdeaeaafb386006751e1fa22cf73e4510f Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Tue, 3 Dec 2024 21:47:16 +0100 Subject: [PATCH 90/90] update survey text --- survey.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/survey.py b/survey.py index 1031c61..7a19419 100644 --- a/survey.py +++ b/survey.py @@ -32,10 +32,10 @@ bot = discord.Bot(description=None) async def on_ready(): print("Bot ready on Version %s..." % discord.__version__) # build survey - po = discord.Poll(question="Wie habt ihr nächste Woche Zeit?", answers=[discord.PollAnswer(text="Montag", emoji="1\u20E3"), discord.PollAnswer(text="Dienstag", emoji="2\u20E3"), discord.PollAnswer(text="Mittwoch", emoji="3\u20E3"), discord.PollAnswer(text="Donnerstag", emoji="4\u20E3"), discord.PollAnswer(text="Freitag", emoji="5\u20E3"), discord.PollAnswer(text="Samstag", emoji="6\u20E3"), discord.PollAnswer(text="Sonntag", emoji="7\u20E3"), discord.PollAnswer(text="keine Zeit", emoji="❌")], duration=runtime, allow_multiselect=True) + po = discord.Poll(question="Habt ihr nächsten Dienstag Zeit?", answers=[discord.PollAnswer(text="Ja", emoji="✅"), discord.PollAnswer(text="keine Zeit", emoji="❌")], duration=runtime, allow_multiselect=False) # send message msg = await bot.get_channel(survey_channel).send(content="||%s||"% bot.get_guild(guild_id).get_role(mention_id).mention ,poll=po) - await msg.create_thread(name="Diskussion") + # await msg.create_thread(name="Diskussion") # close connection await bot.close()