Skip to content

Commit

Permalink
refactor: remove built-in slack backend (#1581)
Browse files Browse the repository at this point in the history
* refactor: remove slack backend

* refactor: remove slack-rtm backend

* test: remove slack tests

* docs: remove slack and use slackv3

* chore: add slackv3 build to Dockerfile

* feat: enable backend plugins directory on --init

* chore: add slackv3 repo to backend image

* refactor: simplify the final image

* docs: fix slack refs in README

* docs: add info to CHANGES
  • Loading branch information
sijis authored Jul 21, 2022
1 parent 791a08b commit b1a6408
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 3,207 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
v9.9.9 (unreleased)
-------------------

breaking:

- backend/slack: remove slack and slack_rtm built-in backends (#1581)

features:

- core/plugins: detect plugins using entrypoints (#1590)
Expand Down
25 changes: 16 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
FROM python:3.9-slim as BUILD
FROM python:3.9-slim as build
WORKDIR /wheel
COPY . .
RUN apt update && apt install build-essential -y
RUN apt update && apt install -y build-essential git
RUN cd /tmp && \
git clone https://github.com/errbotio/err-backend-slackv3 slackv3
RUN pip3 wheel --wheel-dir=/wheel . \
errbot errbot[irc] errbot[slack] errbot[XMPP] errbot[telegram]
-r /tmp/slackv3/requirements.txt wheel \
errbot errbot[irc] errbot[XMPP] errbot[telegram] && \
cp /tmp/slackv3/requirements.txt /wheel/slackv3-requirements.txt

FROM python:3.9-slim
COPY --from=BUILD /wheel /wheel
FROM python:3.9-slim as base
COPY --from=build /wheel /wheel
RUN apt update && \
apt install -y git && \
cd /wheel && \
pip3 -vv install --no-cache-dir --no-index --find-links /wheel . \
errbot errbot[irc] errbot[slack] errbot[XMPP] errbot[telegram] && \
-r /wheel/slackv3-requirements.txt \
errbot errbot[irc] errbot[XMPP] errbot[telegram] && \
rm -rf /wheel /var/lib/apt/lists/*

RUN useradd -m errbot

FROM base
EXPOSE 3141 3142
VOLUME /home/errbot
WORKDIR /home/errbot
USER errbot
RUN errbot --init
EXPOSE 3141 3142
VOLUME /home/errbot
RUN git clone https://github.com/errbotio/err-backend-slackv3 backend-plugins/slackv3
ENTRYPOINT [ "/usr/local/bin/errbot" ]
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ Chat servers support
**Built-in**

- IRC support
- `Slack support <https://slack.com/>`_
- `Telegram support <https://www.telegram.org/>`_
- `XMPP support <http://xmpp.org>`_

**With add-ons**

- `Webex <https://www.webex.com/>`_ (See `instructions <https://github.com/marksull/err-backend-cisco-webex-teams>`__)
- `Discord <https://www.discordapp.com/>`_ (See `instructions <https://github.com/gbin/err-backend-discord>`__)
- `Slack support <https://slack.com/>`_ (See `instructions <https://github.com/errbotio/err-backend-slackv3>`__)
- `Discord <https://www.discordapp.com/>`_ (See `instructions <https://github.com/errbotio/err-backend-discord>`__)
- `Gitter support <https://gitter.im/>`_ (See `instructions <https://github.com/errbotio/err-backend-gitter>`__)
- `Webex <https://www.webex.com/>`_ (See `instructions <https://github.com/marksull/err-backend-cisco-webex-teams>`__)
- `Mattermost <https://about.mattermost.com/>`_ (See `instructions <https://github.com/Vaelor/errbot-mattermost-backend>`__)
- `RocketChat <https://rocket.chat/>`_ (See `instructions <https://github.com/cardoso/errbot-rocketchat>`__)
- `Skype <https://www.skype.com/>`_ (See `instructions <https://github.com/errbotio/errbot-backend-skype>`__)
Expand Down Expand Up @@ -130,12 +130,12 @@ It will show you a prompt `>>>` so you can talk to your bot directly! Try `!help
Adding support for a chat system
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For the built-ins, just use one of those options `slack, telegram, IRC, XMPP` with pip, you can still do it
For the built-ins, just use one of those options `telegram, IRC, XMPP` with pip, you can still do it
after the initial installation to add the missing support for example ::

$ pip install "errbot[slack]"
$ pip install "errbot[irc]"

For the external ones (Skype, Gitter, Discord etc ...), please follow their respective github pages for instructions.
For the external ones (Slack, Discord, Gitter, Skype, etc ...), please follow their respective github pages for instructions.

Configuration
~~~~~~~~~~~~~
Expand Down
7 changes: 3 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ sphinx>=1.2
sphinx-autodoc-annotation

-e .
slixmpp
irc
python-telegram-bot
slackclient
hypchat
irc
pytest
python-telegram-bot
slixmpp
90 changes: 0 additions & 90 deletions docs/user_guide/configuration/slack.rst

This file was deleted.

7 changes: 3 additions & 4 deletions docs/user_guide/configuration/slackv3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ You need to install Slackv3 dependencies before using Errbot with Slack. In the
it is assumed slackv3 has been download to the /opt/errbot/backends directory and errbot has been
installed in a python virtual environment (adjust the command to your errbot's installation)::

.. code::
git clone https://github.com/errbotio/err-backend-slackv3.git
source /opt/errbot/bin/activate
/opt/errbot/bin/pip install -r /opt/errbot/backends/err-backend-slackv3/requirements.txt

Connection Methods
------------------

Expand Down Expand Up @@ -87,7 +85,7 @@ The virtual environment is created in `/opt/errbot/virtualenv` and errbot initia
git clone https://github.com/errbotio/err-backend-slackv3
pip install -r /opt/errbot/backend/err-backend-slackv3/requirements.txt
5. Configure the slack bot token, signing secret (Events API with Request URLs) and/or app token (Events API with Socket-mode). Located in ``/opt/errbot/config.py``
5. Configure the slack bot token, signing secret (Events API with Request URLs) and/or app token (Events API with Socket-mode). Located in `/opt/errbot/config.py`

.. code::
Expand All @@ -97,6 +95,7 @@ The virtual environment is created in `/opt/errbot/virtualenv` and errbot initia
'app_token': "xapp-..."
}
Setting up Slack application
----------------------------

Expand Down
1 change: 0 additions & 1 deletion docs/user_guide/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ You can find here more details about configuring Errbot for some specific chat s
configuration/gitter
configuration/irc
configuration/mattermost
configuration/slack
configuration/slackv3
configuration/telegram
configuration/xmpp
Expand Down
6 changes: 0 additions & 6 deletions errbot/backends/slack.plug

This file was deleted.

Loading

0 comments on commit b1a6408

Please sign in to comment.