From 2c73b5e086e0259be45f8b23f01abdfa459bfb87 Mon Sep 17 00:00:00 2001 From: kev Date: Tue, 14 May 2024 17:22:33 +0800 Subject: [PATCH] update errbot --- errbot/Dockerfile | 26 +++++++++++----------- errbot/README.md | 16 ++------------ errbot/arm/Dockerfile | 41 ----------------------------------- errbot/arm/docker-compose.yml | 8 ------- errbot/data/config.py | 9 ++++---- errbot/docker-compose.yml | 18 ++++++++------- 6 files changed, 30 insertions(+), 88 deletions(-) delete mode 100644 errbot/arm/Dockerfile delete mode 100644 errbot/arm/docker-compose.yml diff --git a/errbot/Dockerfile b/errbot/Dockerfile index fcee368..295848a 100644 --- a/errbot/Dockerfile +++ b/errbot/Dockerfile @@ -2,8 +2,8 @@ # Dockerfile for errbot # -FROM alpine -MAINTAINER kev +FROM alpine:3.19 +MAINTAINER EasyPi Software Foundation RUN set -xe \ && apk add --no-cache ca-certificates \ @@ -16,26 +16,26 @@ RUN set -xe \ python3-dev \ && pip3 install --no-cache-dir -U pip \ && pip3 install --no-cache-dir errbot \ - hypchat \ - irc \ - pyasn1 \ - pyasn1-modules \ - python-telegram-bot \ - slackclient \ - sleekxmpp \ - && adduser -s /bin/sh -D errbot \ + hypchat \ + irc \ + pyasn1 \ + pyasn1-modules \ + python-telegram-bot \ + slackclient \ + sleekxmpp \ + && adduser -s /bin/sh -h /opt/errbot -D errbot \ && apk del --purge build-base \ libffi-dev \ openssl-dev \ python3-dev USER errbot -WORKDIR /home/errbot +WORKDIR /opt/errbot RUN set -xe \ - && mkdir -p ~/.local/lib/python3.5/site-packages \ + && mkdir -p ~/.local/lib/python3.11/site-packages \ && errbot --init -VOLUME /home/errbot +VOLUME /opt/errbot ENTRYPOINT ["errbot"] diff --git a/errbot/README.md b/errbot/README.md index b89c88c..3572d48 100644 --- a/errbot/README.md +++ b/errbot/README.md @@ -7,18 +7,6 @@ errbot and brings your tools into the conversation. -## docker-compose.yml - -```yaml -errbot: - image: vimagick/errbot - volumes: - - ./data:/home/errbot - - /usr/lib/python3.5/site-packages - tty: yes - restart: always -``` - ## up and running ```bash @@ -28,8 +16,8 @@ $ vim data/config.py $ docker-compose up -d $ docker-compose exec --user root errbot sh >>> apk add -U py3-lxml ->>> chmod 777 /usr/lib/python3.5/site-packages ->>> chmod 777 /usr/lib/python3.5/site-packages/__pycache__ +>>> chmod 777 /usr/lib/python3.11/site-packages +>>> chmod 777 /usr/lib/python3.11/site-packages/__pycache__ >>> exit ``` diff --git a/errbot/arm/Dockerfile b/errbot/arm/Dockerfile deleted file mode 100644 index f920eac..0000000 --- a/errbot/arm/Dockerfile +++ /dev/null @@ -1,41 +0,0 @@ -# -# Dockerfile for errbot-arm -# - -FROM easypi/alpine-arm -MAINTAINER EasyPi Software Foundation - -RUN set -xe \ - && apk add --no-cache ca-certificates \ - build-base \ - git \ - libffi-dev \ - openssl \ - openssl-dev \ - python3 \ - python3-dev \ - && pip3 install --no-cache-dir -U pip \ - && pip3 install --no-cache-dir errbot \ - hypchat \ - irc \ - pyasn1 \ - pyasn1-modules \ - python-telegram-bot \ - slackclient \ - sleekxmpp \ - && adduser -s /bin/sh -D errbot \ - && apk del --purge build-base \ - libffi-dev \ - openssl-dev \ - python3-dev - -USER errbot -WORKDIR /home/errbot - -RUN set -xe \ - && mkdir -p ~/.local/lib/python3.5/site-packages \ - && errbot --init - -VOLUME /home/errbot - -ENTRYPOINT ["errbot"] diff --git a/errbot/arm/docker-compose.yml b/errbot/arm/docker-compose.yml deleted file mode 100644 index 26d9ff5..0000000 --- a/errbot/arm/docker-compose.yml +++ /dev/null @@ -1,8 +0,0 @@ -errbot: - image: easypi/errbot-arm - volumes: - - ./data:/home/errbot - - /usr/lib/python3.5/site-packages - stop_signal: SIGINT - tty: yes - restart: always diff --git a/errbot/data/config.py b/errbot/data/config.py index 9d6236b..b849652 100644 --- a/errbot/data/config.py +++ b/errbot/data/config.py @@ -5,7 +5,7 @@ import logging # the options in the more complete config-template.py from here: # https://raw.githubusercontent.com/errbotio/errbot/master/errbot/config-template.py -BACKEND = 'Slack' +BACKEND = 'SlackV3' BOT_IDENTITY = { 'token': 'xoxb-xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx' @@ -13,10 +13,11 @@ BOT_IDENTITY = { CHATROOM_FN = 'Errbot' -BOT_DATA_DIR = '/home/errbot/data' -BOT_EXTRA_PLUGIN_DIR = '/home/errbot/plugins' +BOT_DATA_DIR = '/opt/errbot/data' +BOT_EXTRA_BACKEND_DIR = '/opt/errbot/backend' +BOT_EXTRA_PLUGIN_DIR = '/opt/errbot/plugins' -BOT_LOG_FILE = '/home/errbot/errbot.log' +BOT_LOG_FILE = '/opt/errbot/errbot.log' BOT_LOG_LEVEL = logging.DEBUG BOT_ADMINS = ('@master', ) diff --git a/errbot/docker-compose.yml b/errbot/docker-compose.yml index 4a27415..d04e23c 100644 --- a/errbot/docker-compose.yml +++ b/errbot/docker-compose.yml @@ -1,8 +1,10 @@ -errbot: - image: vimagick/errbot - volumes: - - ./data:/home/errbot - - /usr/lib/python3.5/site-packages - stop_signal: SIGINT - tty: yes - restart: always +version: "3.8" +services: + errbot: + image: vimagick/errbot + volumes: + - ./data:/opt/errbot + - /usr/lib/python3.11/site-packages + stop_signal: SIGINT + tty: true + restart: unless-stopped