diff options
Diffstat (limited to '')
-rw-r--r-- | .drone.yml | 191 | ||||
-rw-r--r-- | .github/workflows/docker.yaml | 2 | ||||
-rw-r--r-- | CHANGELOG.md | 99 | ||||
-rw-r--r-- | Dockerfile.debian | 158 | ||||
-rw-r--r-- | Dockerfile.debug | 531 | ||||
-rw-r--r-- | README.md | 161 | ||||
-rwxr-xr-x | build_dbg.sh | 3 | ||||
-rw-r--r-- | docker-compose.yaml | 60 | ||||
-rw-r--r-- | gdb_commands | 2 | ||||
-rw-r--r-- | matrix-e2e.c.patch | 20 | ||||
-rw-r--r-- | plugin_versions | 7 |
11 files changed, 753 insertions, 481 deletions
diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index b8de386..0000000 --- a/.drone.yml +++ /dev/null @@ -1,191 +0,0 @@ ---- -kind: pipeline -type: docker -name: alpine - -steps: - - name: docker - image: docker:dind - privileged: true - detach: true - command: [ "dockerd", "--host=tcp://0.0.0.0:2375" ] - - - name: test - image: ezkrg/buildx:latest - environment: - USER: - from_secret: DHU - PASSWORD: - from_secret: DHP - DOCKER_HOST: tcp://docker:2375 - commands: - - while ! docker info; do sleep 1; done - - docker buildx create --use --name docker --node docker --platform linux/amd64 --driver docker-container $DOCKER_HOST - - echo $PASSWORD | docker login --username $USER --password-stdin - - apk add --update --no-cache bash - - BUILD_ARGS=$(for BUILD_ARG in $(cat plugin_versions); do echo -n "--build-arg $BUILD_ARG "; done) - - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:cache --cache-to ezkrg/bitlbee-libpurple:cache --tag ezkrg/bitlbee-libpurple:test --platform linux/amd64 --build-arg ALPINE_VERSION=3.15 $BUILD_ARGS . - when: - event: - - push - - - name: latest - image: ezkrg/buildx:latest - environment: - USER: - from_secret: DHU - PASSWORD: - from_secret: DHP - DOCKER_HOST: tcp://docker:2375 - commands: - - while ! docker info; do sleep 1; done - - docker buildx create --use --name docker --node docker --platform linux/amd64 --driver docker-container $DOCKER_HOST - - echo $PASSWORD | docker login --username $USER --password-stdin - - apk add --update --no-cache bash - - BUILD_ARGS=$(for BUILD_ARG in $(cat plugin_versions); do echo -n "--build-arg $BUILD_ARG "; done) - - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:cache --cache-to ezkrg/bitlbee-libpurple:cache --tag ezkrg/bitlbee-libpurple:$DRONE_TAG --tag ezkrg/bitlbee-libpurple:latest --tag ezkrg/bitlbee-libpurple:alpine --platform linux/amd64 --build-arg ALPINE_VERSION=3.15 $BUILD_ARGS . - when: - event: - - tag - ---- -kind: pipeline -type: docker -name: alpine3.12 - -steps: - - name: docker - image: docker:dind - privileged: true - detach: true - command: [ "dockerd", "--host=tcp://0.0.0.0:2375" ] - - - name: test - image: ezkrg/buildx:latest - environment: - USER: - from_secret: DHU - PASSWORD: - from_secret: DHP - DOCKER_HOST: tcp://docker:2375 - commands: - - while ! docker info; do sleep 1; done - - docker buildx create --use --name docker --node docker --platform linux/amd64 --driver docker-container $DOCKER_HOST - - echo $PASSWORD | docker login --username $USER --password-stdin - - apk add --update --no-cache bash - - BUILD_ARGS=$(for BUILD_ARG in $(cat plugin_versions); do echo -n "--build-arg $BUILD_ARG "; done) - - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:alpine3.12-cache --cache-to ezkrg/bitlbee-libpurple:alpine3.12-cache --tag ezkrg/bitlbee-libpurple:alpine3.12-test --platform linux/amd64,linux/arm64,linux/armhf --build-arg ALPINE_VERSION=3.12 $BUILD_ARGS . - when: - event: - - push - - - name: latest - image: ezkrg/buildx:latest - environment: - USER: - from_secret: DHU - PASSWORD: - from_secret: DHP - DOCKER_HOST: tcp://docker:2375 - commands: - - while ! docker info; do sleep 1; done - - docker buildx create --use --name docker --node docker --platform linux/amd64 --driver docker-container $DOCKER_HOST - - echo $PASSWORD | docker login --username $USER --password-stdin - - apk add --update --no-cache bash - - BUILD_ARGS=$(for BUILD_ARG in $(cat plugin_versions); do echo -n "--build-arg $BUILD_ARG "; done) - - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:alpine3.12-cache --cache-to ezkrg/bitlbee-libpurple:alpine3.12-cache --tag ezkrg/bitlbee-libpurple:alpine3.12-$DRONE_TAG --tag ezkrg/bitlbee-libpurple:alpine3.12 --platform linux/amd64,linux/arm64,linux/armhf --build-arg ALPINE_VERSION=3.12 $BUILD_ARGS . - when: - event: - - tag - ---- -kind: pipeline -type: docker -name: debian - -steps: - - name: docker - image: docker:dind - privileged: true - detach: true - command: [ "dockerd", "--host=tcp://0.0.0.0:2375" ] - - - - name: test - image: ezkrg/buildx:latest - environment: - USER: - from_secret: DHU - PASSWORD: - from_secret: DHP - DOCKER_HOST: tcp://docker:2375 - commands: - - while ! docker info; do sleep 1; done - - docker run --rm --privileged tonistiigi/binfmt --install all - - docker buildx create --use --name docker --node docker --platform linux/amd64,linux/arm64,linux/armhf --driver docker-container $DOCKER_HOST - - echo $PASSWORD | docker login --username $USER --password-stdin - - apk add --update --no-cache bash - - BUILD_ARGS=$(for BUILD_ARG in $(cat plugin_versions); do echo -n "--build-arg $BUILD_ARG "; done) - - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:debian-cache --cache-to ezkrg/bitlbee-libpurple:debian-cache --tag ezkrg/bitlbee-libpurple:debian-test --platform linux/amd64,linux/arm64,linux/armhf -f Dockerfile.debian $BUILD_ARGS . - when: - event: - - push - - - name: latest - image: ezkrg/buildx:latest - environment: - USER: - from_secret: DHU - PASSWORD: - from_secret: DHP - DOCKER_HOST: tcp://docker:2375 - commands: - - while ! docker info; do sleep 1; done - - docker run --rm --privileged tonistiigi/binfmt --install all - - docker buildx create --use --name docker --node docker --platform linux/amd64,linux/arm64,linux/armhf --driver docker-container $DOCKER_HOST - - echo $PASSWORD | docker login --username $USER --password-stdin - - apk add --update --no-cache bash - - BUILD_ARGS=$(for BUILD_ARG in $(cat plugin_versions); do echo -n "--build-arg $BUILD_ARG "; done) - - docker buildx build --push --cache-from ezkrg/bitlbee-libpurple:debian-cache --cache-to ezkrg/bitlbee-libpurple:debian-cache --tag ezkrg/bitlbee-libpurple:debian-$DRONE_TAG --tag ezkrg/bitlbee-libpurple:debian --platform linux/amd64,linux/arm64,linux/armhf -f Dockerfile.debian $BUILD_ARGS . - when: - event: - - tag - ---- -kind: pipeline -type: docker -name: notification - -clone: - disable: true - -steps: - - name: telegram - image: appleboy/drone-telegram:1.3.10 - failure: ignore - settings: - token: - from_secret: TT - to: - from_secret: TID - message: | - *{{commit.author}} ({{commit.email}})* - *{{repo.namespace}}/{{repo.name}}* - [Pipeline #{{build.number}} has {{#success build.status}}passed{{else}}failed{{/success}} in {{since build.started}}]({{build.link}}) {{#success build.status}}✅{{else}}❌{{/success}} - *Branch:* [{{commit.branch}}](https://github.com/{{repo.namespace}}/{{repo.name}}/commits/{{commit.branch}}) *Commit:* [{{commit.message}}]({{commit.link}}) - -trigger: - status: - - success - - failure - -depends_on: - - alpine - - alpine3.12 - - debian - ---- -kind: signature -hmac: bbb9015868c7b2e451c5f3a0b8473ea3565a5000ffd3c5d4a9914f220628e4c2 - -... diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index c10133c..aecb5c9 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -42,6 +42,6 @@ jobs: # - name: Generate artifact attestation # uses: actions/attest-build-provenance@v1 # with: - # subject-name: index.docker.io/milla + # subject-name: index.docker.io/bitlbee_purple # subject-digest: ${{ steps.push.outputs.digest }} # push-to-registry: true diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index f0c36c8..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,99 +0,0 @@ -# Changelog - -## 2022-04-08 14:37:31 -- use alpine 3.15 -- remove arm build from alpine3.15 based images -- update whatsapp to whatsmeow -- update telegram to tdlib -- update skypeweb -- update hangouts -- update slack -- update discord -- update rocket.chat -- update mastodon -- update matrix -- update signal -- new alpine3.12 tag for arm build -- other build process related changes - -## 2021-09-14 22:52:43 ([markrawls](https://github.com/markrawls)) -- build for ARM platforms - -## 2021-07-13 23:38:45 ([mooomooo](https://github.com/mooomooo)) -- add flag and deps to enable attachment handling for Signal plugin - -## 2021-06-11 19:23:13 -- update hangouts -- update slack -- update rocket.chat -- update olm and matrix -- update signal - -## 2021-05-14 17:05:39 -- add icyque - -## 2021-05-06 15:21:19 -- update facebook version to 1.2.2 -- update skypeweb to c4906b8 - -## 2020-11-04 03:16:34 ([heywoodlh](https://github.com/heywoodlh)) -- add signal - -## 2020-04-09 20:27:51 -- add otr - -## 2020-04-06 10:19:50 -- upgrade discord version from aa0bbf2 to 0.4.3 -- upgrade mastodon version from 83dee0b to v1.4.4 -- upgrade matrix version from 4494ba2 to 1d23385 - -## 2020-04-05 14:01:52 -- upgrade telegram version from b101bbb to 1.4.3 -- upgrade slack version from 8acc4eb to e6e5427 -- upgrade sipe version from upstream/1.23.3 to 1.25.0 -- change sipe clone url - -## 2019-11-25 18:13:41 ([revmischa](https://github.com/revmischa)) -- add matrix - -## 2019-11-25 13:39:21 ([revmischa](https://github.com/revmischa)) -- add mastodon - -## 2018-09-10 08:52:53 -- add rocket.chat plugin -- use alpine 3.8 - -## 2018-08-21 10:59:17 ([needo37](https://github.com/needo37)) -- add discord plugin -- run as bitlbee user - -## 2018-08-17 17:59:13 ([Waester](https://github.com/Waester)) -- add libsipe support - -## 2018-04-19 23:01:49 ([friek](https://github.com/friek)) -- updated README -- moved changelog to CHANGELOG.md - -## 2018-04-19 14:17:23 -- use alpine 3.7 -- add slack-libpurple - -## 2017-09-18 12:30:45 -- trigger rebuild related to https://github.com/bitlbee/bitlbee-facebook/issues/151 - -## 2017-07-30 20:52:55 -- adding purple-hangouts - -## 2017-07-29 18:14:51 -- using alpine 3.6 -- remove libpurple-ymsg -- adding telegram-purple - -## 2017-04-21 12:57:42 -- trigger rebuild - -## 2017-04-04 12:59:58 -- trigger rebuild cause of facebook fix - -## 2017-03-30 11:43:46 -- trigger rebuild cause of facebook fix
\ No newline at end of file diff --git a/Dockerfile.debian b/Dockerfile.debian index 1212e78..4d93dc9 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -83,27 +83,6 @@ RUN echo STEAM=${STEAM} > /tmp/status \ # --- -FROM bitlbee-build AS skypeweb-build - -ARG SKYPEWEB=1 -ARG SKYPEWEB_VERSION - -RUN echo SKYPEWEB=${SKYPEWEB} > /tmp/status \ - && if [ ${SKYPEWEB} -eq 1 ]; \ - then cd /tmp \ - && git clone -n https://github.com/EionRobb/skype4pidgin.git \ - && cd skype4pidgin \ - && git checkout ${SKYPEWEB_VERSION} \ - && cd skypeweb \ - && make -j$(nproc --ignore 2) \ - && make install \ - && strip /usr/lib/x86_64-linux-gnu/purple-2/libskypeweb.so; \ - else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ - && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libskypeweb.so; \ - fi - -# --- - FROM bitlbee-build AS telegram-build ARG TELEGRAM=1 @@ -117,37 +96,41 @@ RUN echo TELEGRAM=${TELEGRAM} > /tmp/status \ && git clone https://github.com/BenWiederhake/tdlib-purple/ \ && cd tdlib-purple \ && ./build_and_install.sh \ - # && cd tdlib-purple \ - # && git checkout ${TELEGRAM_VERSION} \ - # && TDLIB_REQ_VERSION=$(grep -o "tdlib version.*" CMakeLists.txt| tail -1 | awk '{print $3}') \ - # && cd /tmp \ - # && git clone -n https://github.com/tdlib/td.git tdlib \ - # && cd tdlib \ - # && TDLIB_VERSION=$(git log --pretty=format:"%h%x09%s" | grep "Update version to ${TDLIB_REQ_VERSION}" | awk '{print $1}') \ - # && git checkout ${TDLIB_VERSION} \ - # && mkdir build \ - # && cd build \ - # && cmake -DCMAKE_BUILD_TYPE=Release .. \ - # && make -j$(nproc --ignore 2) \ - # && make install \ - # && cd /tmp/tdlib-purple \ - # && mkdir build \ - # && cd build \ - # && cmake -DTd_DIR=/usr/local/lib/cmake/Td -DNoLottie=True -DNoVoip=True .. \ - # && make -j$(nproc --ignore 2)\ - # && make install \ && strip /usr/lib/x86_64-linux-gnu/purple-2/libtelegram-tdlib.so; \ else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libtelegram-tdlib.so \ - && ln -sf /nowhere /usr/local/share/metainfo/tdlib-purple.metainfo.xml \ + # && ln -sf /nowhere /usr/local/share/metainfo/tdlib-purple.metainfo.xml \ && ln -sf /nowhere /usr/local/share/locale; \ fi # --- +FROM bitlbee-build AS purple-teams-build + +ARG PURPLETEAMS=1 +ARG PURPLETEAMS_VERSION= + +RUN echo PURPLETEAMS=${PURPLETEAMS} > /tmp/status \ + && if [ ${PURPLETEAMS} -eq 1 ]; \ + then cd /tmp \ + && apt-get update \ + && git clone -n https://github.com/EionRobb/purple-teams \ + && cd purple-teams \ + && git checkout ${PURPLETEAMS_VERSION} \ + && make -j$(nproc --ignore 2) \ + && make install \ + && strip /usr/lib/x86_64-linux-gnu/purple-2/libteams.so \ + && strip /usr/lib/x86_64-linux-gnu/purple-2/libteams-personal.so; \ + else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libteams.so \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libteams-personal.so; \ + fi + +# --- + FROM bitlbee-build AS hangouts-build -ARG HANGOUTS=0 +ARG HANGOUTS=1 ARG HANGOUTS_VERSION RUN echo HANGOUTS=${HANGOUTS} > /tmp/status \ @@ -220,30 +203,28 @@ RUN echo SIPE=${SIPE} > /tmp/status \ FROM bitlbee-build AS discord-build ARG DISCORD=1 -ARG DISCORD_VERSION +ARG DISCORD_VERSION=nightly-465575dda13a187f5f65ced4b11af89ffdb94351 RUN echo DISCORD=${DISCORD} > /tmp/status \ && if [ ${DISCORD} -eq 1 ]; \ then cd /tmp \ - && git clone -n https://github.com/sm00th/bitlbee-discord.git \ - && cd bitlbee-discord \ + && apt-get update \ + && apt-get install -y --no-install-recommends libqrencode-dev libnss3-dev \ + && git clone -n https://github.com/EionRobb/purple-discord \ + && cd purple-discord \ && git checkout ${DISCORD_VERSION} \ - && ./autogen.sh \ - && ./configure --prefix=/usr \ && make -j$(nproc --ignore 2) \ - && make install \ - && strip /usr/lib/bitlbee/discord.so; \ + && cp /tmp/purple-discord/libdiscord.so /usr/lib/x86_64-linux-gnu/purple-2/libdiscord.so \ + && strip /usr/lib/x86_64-linux-gnu/purple-2/libdiscord.so; \ else mkdir -p /usr/lib/bitlbee \ - && ln -sf /nowhere /usr/lib/bitlbee/discord.so \ - && ln -sf /nowhere /usr/lib/bitlbee/discord.la \ - && ln -sf /nowhere /usr/share/bitlbee/discord-help.txt; \ + && ln -sf /nowhere /usr/lib/bitlbee/libdiscord.so; \ fi # --- FROM bitlbee-build AS rocketchat-build -ARG ROCKETCHAT=0 +ARG ROCKETCHAT=1 ARG ROCKETCHAT_VERSION RUN echo ROCKETCHAT=${ROCKETCHAT} > /tmp/status \ @@ -314,33 +295,6 @@ RUN echo MATRIX=${MATRIX} > /tmp/status \ # --- -# FROM bitlbee-build AS signald-build - -# ARG SIGNAL=0 -# ARG SIGNAL_VERSION=master - -# RUN echo SIGNAL=${SIGNAL} > /tmp/status \ -# && if [ ${SIGNAL} -eq 1 ]; \ -# then cd /tmp \ -# && apt-get update \ -# && apt-get install -y --no-install-recommends cmake \ -# && git clone -n https://github.com/hoehermann/purple-signald \ -# && cd purple-signald \ -# && git checkout ${SIGNAL_VERSION} \ -# && git submodule init \ -# && git submodule update \ -# && mkdir -p build \ -# && cd build \ -# && cmake .. \ -# && make -j$(nproc --ignore 2) \ -# && make install \ -# && strip /usr/lib/x86_64-linux-gnu/purple-2/libsignald.so; \ -# else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ -# && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libsignald.so; \ -# fi - -# --- - FROM bitlbee-build AS signal-presage ARG SIGNAL=1 @@ -410,14 +364,14 @@ RUN echo ICYQUE=${ICYQUE} > /tmp/status \ FROM bitlbee-build AS whatsapp-build ARG WHATSAPP=1 -ARG WHATSAPP_VERSION=v1.15.0 +ARG WHATSAPP_VERSION=v1.18.0 RUN echo WHATSAPP=${WHATSAPP} > /tmp/status \ && if [ ${WHATSAPP} -eq 1 ]; \ then cd /tmp \ && apt-get install -y wget \ - && wget -q https://go.dev/dl/go1.22.4.linux-amd64.tar.gz \ - && tar -C /usr/local -xzf go1.22.4.linux-amd64.tar.gz \ + && wget -q https://go.dev/dl/go1.24.2.linux-amd64.tar.gz \ + && tar -C /usr/local -xzf go1.24.2.linux-amd64.tar.gz \ && echo "deb http://deb.debian.org/debian bookworm-backports main" | tee -a /etc/apt/sources.list \ && apt-get update \ && apt-get install -y -t bookworm-backports \ @@ -431,7 +385,6 @@ RUN echo WHATSAPP=${WHATSAPP} > /tmp/status \ && cd build \ && cmake .. \ && cmake --build . \ - # && cmake -DCMAKE_Go_COMPILER=/usr/lib/go-1.22/bin/go -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON --build \ && make install/strip \ && strip /usr/lib/x86_64-linux-gnu/purple-2/libwhatsmeow.so; \ else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ @@ -483,16 +436,13 @@ COPY --from=otr-install /tmp/status /tmp/plugin/otr # COPY --from=steam-build /usr/lib/bitlbee/steam.la /tmp/usr/lib/bitlbee/steam.la # COPY --from=steam-build /tmp/status /tmp/plugin/steam -COPY --from=skypeweb-build /usr/lib/x86_64-linux-gnu/purple-2/libskypeweb.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libskypeweb.so -COPY --from=skypeweb-build /tmp/status /tmp/plugin/skypeweb - COPY --from=telegram-build /usr/lib/x86_64-linux-gnu/purple-2/libtelegram-tdlib.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libtelegram-tdlib.so -COPY --from=telegram-build /usr/local/share/metainfo/tdlib-purple.metainfo.xml /tmp/usr/local/share/metainfo/tdlib-purple.metainfo.xml +# COPY --from=telegram-build /usr/local/share/metainfo/tdlib-purple.metainfo.xml /tmp/usr/local/share/metainfo/tdlib-purple.metainfo.xml COPY --from=telegram-build /usr/local/share/locale /tmp/usr/local/share/locale COPY --from=telegram-build /tmp/status /tmp/plugin/telegram -# COPY --from=hangouts-build /usr/lib/x86_64-linux-gnu/purple-2/libhangouts.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libhangouts.so -# COPY --from=hangouts-build /tmp/status /tmp/plugin/hangouts +COPY --from=hangouts-build /usr/lib/x86_64-linux-gnu/purple-2/libhangouts.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libhangouts.so +COPY --from=hangouts-build /tmp/status /tmp/plugin/hangouts COPY --from=slack-build /usr/lib/x86_64-linux-gnu/purple-2/libslack.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libslack.so COPY --from=slack-build /tmp/status /tmp/plugin/slack @@ -502,31 +452,25 @@ COPY --from=slack-build /tmp/status /tmp/plugin/slack # COPY --from=sipe-build /usr/share/locale /tmp/usr/share/locale # COPY --from=sipe-build /tmp/status /tmp/plugin/sipe -COPY --from=discord-build /usr/lib/bitlbee/discord.so /tmp/usr/lib/bitlbee/discord.so -COPY --from=discord-build /usr/lib/bitlbee/discord.la /tmp/usr/lib/bitlbee/discord.la -COPY --from=discord-build /usr/share/bitlbee/discord-help.txt /tmp/usr/share/bitlbee/discord-help.txt -COPY --from=discord-build /tmp/status /tmp/plugin/discord +COPY --from=discord-build /usr/lib/x86_64-linux-gnu/purple-2/libdiscord.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libdiscord.so -# COPY --from=rocketchat-build /usr/lib/x86_64-linux-gnu/purple-2/librocketchat.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/librocketchat.so -# COPY --from=rocketchat-build /tmp/status /tmp/plugin/rocketchat +COPY --from=rocketchat-build /usr/lib/x86_64-linux-gnu/purple-2/librocketchat.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/librocketchat.so +COPY --from=rocketchat-build /tmp/status /tmp/plugin/rocketchat COPY --from=mastodon-build /usr/lib/bitlbee/mastodon.so /tmp/usr/lib/bitlbee/mastodon.so COPY --from=mastodon-build /usr/lib/bitlbee/mastodon.la /tmp/usr/lib/bitlbee/mastodon.la COPY --from=mastodon-build /usr/share/bitlbee/mastodon-help.txt /tmp/usr/share/bitlbee/mastodon-help.txt COPY --from=mastodon-build /tmp/status /tmp/plugin/mastodon -# COPY --from=matrix-build /usr/lib/x86_64-linux-gnu/purple-2/libmatrix.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libmatrix.so -# COPY --from=matrix-build /tmp/status /tmp/plugin/matrix - -# COPY --from=signald-build /usr/lib/x86_64-linux-gnu/purple-2/libsignald.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libsignald.so -# COPY --from=signald-build /tmp/status /tmp/plugin/signald - -COPY --from=signal-presage /usr/lib/x86_64-linux-gnu/purple-2/libpresage.so /tmp/usr/lib/bitlbee/libpresage.so -COPY --from=signal-presage /usr/lib/x86_64-linux-gnu/purple-2/libpurple_presage_backend.a /tmp/usr/lib/bitlbee/libpurple_presage_backend.a +COPY --from=signal-presage /usr/lib/x86_64-linux-gnu/purple-2/libpresage.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libpresage.so # COPY --from=icyque-build /usr/lib/x86_64-linux-gnu/purple-2/libicyque.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libicyque.so # COPY --from=icyque-build /tmp/status /tmp/plugin/icyque +COPY --from=purple-teams-build /usr/lib/x86_64-linux-gnu/purple-2/libteams.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libteams.so +COPY --from=purple-teams-build /usr/lib/x86_64-linux-gnu/purple-2/libteams-personal.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libteams-personal.so +COPY --from=purple-teams-build /tmp/status /tmp/plugin/teams + COPY --from=whatsapp-build /usr/lib/x86_64-linux-gnu/purple-2/libwhatsmeow.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libwhatsmeow.so COPY --from=whatsapp-build /tmp/status /tmp/plugin/whatsapp @@ -566,12 +510,14 @@ RUN groupadd -g 101 -r bitlbee \ && if [ ${STEAM} -eq 1 ] || [ ${TELEGRAM} -eq 1 ] || [ ${MATRIX} -eq 1 ]; then PKGS="${PKGS} libgcrypt20"; fi \ && if [ ${TELEGRAM} -eq 1 ]; then PKGS="${PKGS} zlib1g libwebp7 libpng16-16 libstdc++6"; fi \ && if [ ${HANGOUTS} -eq 1 ] || [ ${SIGNAL} -eq 1 ]; then PKGS="${PKGS} libprotobuf-c1"; fi \ - && if [ ${SIGNAL} -eq 1 ]; then PKGS="${PKGS} libqrencode4"; fi \ + && if [ ${SIGNAL} -eq 1 || [ ${DISCORD} -eq 1 ] ]; then PKGS="${PKGS} libqrencode4"; fi \ + && if [ ${DISCORD} -eq 1 ]; then PKGS="%{PKGS} libnss3"; fi \ && if [ ${WHATSAPP} -eq 1 ]; then PKGS="${PKGS} libopusfile-dev libgdk-pixbuf2.0-dev"; fi \ && if [ ${SIPE} -eq 1 ]; then PKGS="${PKGS} libxml2"; fi \ && if [ ${ROCKETCHAT} -eq 1 ]; then PKGS="${PKGS} libmarkdown2"; fi \ && if [ ${MATRIX} -eq 1 ]; then PKGS="${PKGS} libsqlite3-0 libhttp-parser2.9 libolm2"; fi \ && if [ ${WHATSAPP} -eq 1 ]; then PKGS="${PKGS} libgdk-pixbuf2.0-dev libopusfile-dev"; fi \ + && if [ ${PURPLETEAMS} -eq 1 ]; then PKGS="${PKGS} libjson-glib-1.0-0"; fi \ && if [ ${LURCH} -eq 1 ]; then PKGS="${PKGS} libxml2 libmxml1 libsqlite3-0 libgcrypt20"; fi \ && PKGS="${PKGS} vim libqrencode4" \ && apt-get update \ @@ -579,6 +525,4 @@ RUN groupadd -g 101 -r bitlbee \ && apt-get clean \ && rm /plugins -EXPOSE 6667 - # CMD [ "/usr/sbin/bitlbee", "-F", "-n", "-u", "bitlbee" ] diff --git a/Dockerfile.debug b/Dockerfile.debug new file mode 100644 index 0000000..8dbeb07 --- /dev/null +++ b/Dockerfile.debug @@ -0,0 +1,531 @@ +FROM debian:bookworm-slim AS base-image + +FROM base-image AS bitlbee-build + +ARG BITLBEE_VERSION=3.6-1 + +ENV PYTHON=/usr/bin/python3 + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + build-essential git python3 autoconf automake libtool intltool flex libglib2.0-dev \ + libssl-dev libpurple-dev libjson-glib-dev libgcrypt20-dev libotr5-dev \ + && cd /tmp \ + && git clone -n https://github.com/bitlbee/bitlbee.git \ + && cd bitlbee \ + && git checkout ${BITLBEE_VERSION} \ + && ./configure --debug=1 --purple=1 --otr=plugin --ssl=openssl --prefix=/usr --etcdir=/etc/bitlbee \ + && make -j$(nproc --ignore 2) \ + && make install-bin \ + && make install-doc \ + && make install-dev \ + && make install-etc \ + && touch /nowhere + +# --- + +FROM bitlbee-build AS otr-install + +ARG OTR=1 + +RUN echo OTR=${OTR} > /tmp/status \ + && if [ ${OTR} -eq 1 ]; \ + then cd /tmp/bitlbee \ + && make install-plugin-otr; \ + else mkdir -p /usr/lib/bitlbee \ + && ln -sf /nowhere /usr/lib/bitlbee/otr.so; \ + fi + +# --- + +FROM bitlbee-build AS facebook-build + +ARG FACEBOOK=0 +ARG FACEBOOK_VERSION + +RUN echo FACEBOOK=${FACEBOOK} > /tmp/status \ + && if [ ${FACEBOOK} -eq 1 ]; \ + then cd /tmp \ + && git clone -n https://github.com/bitlbee/bitlbee-facebook.git \ + && cd bitlbee-facebook \ + && git checkout ${FACEBOOK_VERSION} \ + && ./autogen.sh \ + && make -j$(nproc --ignore 2) \ + && make install; \ + else mkdir -p /usr/lib/bitlbee \ + && ln -sf /nowhere /usr/lib/bitlbee/facebook.so \ + && ln -sf /nowhere /usr/lib/bitlbee/facebook.la; \ + fi + +# --- + +FROM bitlbee-build AS steam-build + +ARG STEAM=0 +ARG STEAM_VERSION + +RUN echo STEAM=${STEAM} > /tmp/status \ + && if [ ${STEAM} -eq 1 ]; \ + then cd /tmp \ + && git clone -n https://github.com/bitlbee/bitlbee-steam.git \ + && cd bitlbee-steam \ + && git checkout ${STEAM_VERSION} \ + && ./autogen.sh \ + && make -j$(nproc --ignore 2) \ + && make install; \ + else mkdir -p /usr/lib/bitlbee \ + && ln -sf /nowhere /usr/lib/bitlbee/steam.so \ + && ln -sf /nowhere /usr/lib/bitlbee/steam.la; \ + fi + +# --- + +FROM bitlbee-build AS skypeweb-build + +ARG SKYPEWEB=0 +ARG SKYPEWEB_VERSION + +RUN echo SKYPEWEB=${SKYPEWEB} > /tmp/status \ + && if [ ${SKYPEWEB} -eq 1 ]; \ + then cd /tmp \ + && git clone -n https://github.com/EionRobb/skype4pidgin.git \ + && cd skype4pidgin \ + && git checkout ${SKYPEWEB_VERSION} \ + && cd skypeweb \ + && make -j$(nproc --ignore 2) \ + && make install; \ + else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libskypeweb.so; \ + fi + +# --- + +FROM bitlbee-build AS telegram-build + +ARG TELEGRAM=0 +ARG TELEGRAM_VERSION=v0.4 + +RUN echo TELEGRAM=${TELEGRAM} > /tmp/status \ + && if [ ${TELEGRAM} -eq 1 ]; \ + then cd /tmp \ + && apt-get update \ + && apt-get install -y --no-install-recommends cmake gperf libwebp-dev libpng-dev sudo \ + && git clone https://github.com/BenWiederhake/tdlib-purple/ \ + && cd tdlib-purple \ + && ./build_and_install.sh; \ + else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libtelegram-tdlib.so \ + && ln -sf /nowhere /usr/local/share/metainfo/tdlib-purple.metainfo.xml \ + && ln -sf /nowhere /usr/local/share/locale; \ + fi + +# --- + +FROM bitlbee-build AS purple-teams-build + +ARG PURPLETEAMS=0 +ARG PURPLETEAMS_VERSION= + +RUN echo PURPLETEAMS=${PURPLETEAMS} > /tmp/status \ + && if [ ${PURPLETEAMS} -eq 1 ]; \ + then cd /tmp \ + && apt-get update \ + && git clone -n https://github.com/EionRobb/purple-teams \ + && cd purple-teams \ + && git checkout ${PURPLETEAMS_VERSION} \ + && make -j$(nproc --ignore 2) \ + && make install; \ + else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libteams.so \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libteams-personal.so; \ + fi + +# --- + +FROM bitlbee-build AS hangouts-build + +ARG HANGOUTS=0 +ARG HANGOUTS_VERSION + +RUN echo HANGOUTS=${HANGOUTS} > /tmp/status \ + && if [ ${HANGOUTS} -eq 1 ]; \ + then cd /tmp \ + && apt-get update \ + && apt-get install -y --no-install-recommends libprotobuf-c-dev protobuf-c-compiler \ + && git clone -n https://github.com/EionRobb/purple-hangouts.git \ + && cd purple-hangouts \ + && git checkout ${HANGOUTS_VERSION} \ + && make -j$(nproc --ignore 2) \ + && make install; \ + else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libhangouts.so; \ + fi + +# --- + +FROM bitlbee-build AS slack-build + +ARG SLACK=0 +ARG SLACK_VERSION + +SHELL [ "/bin/bash", "-c" ] + +RUN echo SLACK=${SLACK} > /tmp/status \ + && if [ ${SLACK} -eq 1 ]; \ + then cd /tmp \ + && git clone -n https://github.com/dylex/slack-libpurple.git \ + && cd slack-libpurple \ + && git fetch origin pull/162/head:162 \ + && git checkout 162 \ + && make -j$(nproc --ignore 2) \ + && install -d /usr/share/pixmaps/pidgin/protocols/{16,22,48} \ + && make install; \ + else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libslack.so; \ + fi + +# --- + +FROM bitlbee-build AS sipe-build + +ARG SIPE=0 +ARG SIPE_VERSION + +RUN echo SIPE=${SIPE} > /tmp/status \ + && if [ ${SIPE} -eq 1 ]; \ + then cd /tmp \ + && apt-get update \ + && apt-get install -y --no-install-recommends libxml2-dev autopoint \ + && git clone -n https://repo.or.cz/siplcs.git \ + && cd siplcs \ + && git checkout ${SIPE_VERSION} \ + && ./autogen.sh \ + && ./configure --prefix=/usr \ + && make -j$(nproc --ignore 2) \ + && make install; \ + else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libsipe.so \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libsipe.la \ + && ln -sf /nowhere /usr/share/locale; \ + fi + +# --- + +FROM bitlbee-build AS discord-build + +ARG DISCORD=1 +ARG DISCORD_VERSION=nightly-465575dda13a187f5f65ced4b11af89ffdb94351 + +RUN echo DISCORD=${DISCORD} > /tmp/status \ + && if [ ${DISCORD} -eq 1 ]; \ + then cd /tmp \ + && apt-get update \ + && apt-get install -y --no-install-recommends libqrencode-dev libnss3-dev \ + && git clone -n https://github.com/EionRobb/purple-discord \ + && cd purple-discord \ + && git checkout ${DISCORD_VERSION} \ + && make -j$(nproc --ignore 2) \ + && cp /tmp/purple-discord/libdiscord.so /usr/lib/x86_64-linux-gnu/purple-2/libdiscord.so; \ + else mkdir -p /usr/lib/bitlbee \ + && ln -sf /nowhere /usr/lib/bitlbee/libdiscord.so; \ + fi + +# --- + +FROM bitlbee-build AS rocketchat-build + +ARG ROCKETCHAT=0 +ARG ROCKETCHAT_VERSION + +RUN echo ROCKETCHAT=${ROCKETCHAT} > /tmp/status \ + && if [ ${ROCKETCHAT} -eq 1 ]; \ + then cd /tmp \ + && apt-get update \ + && apt-get install -y --no-install-recommends libmarkdown2-dev \ + && git clone -n https://github.com/EionRobb/purple-rocketchat.git \ + && cd purple-rocketchat \ + && git checkout ${ROCKETCHAT_VERSION} \ + && make -j$(nproc --ignore 2) \ + && make install; \ + else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/librocketchat.so; \ + fi + +# --- + +FROM bitlbee-build AS mastodon-build + +ARG MASTODON=0 +ARG MASTODON_VERSION + +RUN echo MASTODON=${MASTODON} > /tmp/status \ + && if [ ${MASTODON} -eq 1 ]; \ + then cd /tmp \ + && git clone -n https://github.com/kensanata/bitlbee-mastodon \ + && cd bitlbee-mastodon \ + && git checkout ${MASTODON_VERSION} \ + && sh ./autogen.sh \ + && ./configure \ + && make -j$(nproc --ignore 2) \ + && make install; \ + else mkdir -p /usr/lib/bitlbee \ + && ln -sf /nowhere /usr/lib/bitlbee/mastodon.so \ + && ln -sf /nowhere /usr/lib/bitlbee/mastodon.la \ + && ln -sf /nowhere /usr/share/bitlbee/mastodon-help.txt; \ + fi + +# --- + +FROM bitlbee-build AS matrix-build + +ARG MATRIX=0 +ARG MATRIX_VERSION + +SHELL [ "/bin/bash", "-c" ] + +COPY matrix-e2e.c.patch /tmp/matrix-e2e.c.patch + +RUN echo MATRIX=${MATRIX} > /tmp/status \ + && if [ ${MATRIX} -eq 1 ]; \ + then cd /tmp \ + && apt-get update \ + && apt-get install -y --no-install-recommends libsqlite3-dev libhttp-parser-dev libolm-dev patch \ + && git clone -n https://github.com/matrix-org/purple-matrix \ + && cd purple-matrix \ + && git checkout ${MATRIX_VERSION} \ + && if [ $(uname -m) == "armv7l" ]; then patch < ../matrix-e2e.c.patch; fi \ + && make -j$(nproc --ignore 2) \ + && make install; \ + else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libmatrix.so; \ + fi + +# --- + +FROM bitlbee-build AS signal-presage + +ARG SIGNAL=0 +ARG SIGNAL_VERSION=master + +RUN echo SIGNAL=${SIGNAL} > /tmp/status \ + && if [ ${SIGNAL} -eq 1 ]; \ + then cd /tmp \ + && apt-get update \ + && apt-get install -y --no-install-recommends cmake libqrencode-dev protobuf-compiler curl \ + && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ + && git clone --recurse-submodules https://github.com/hoehermann/purple-presage \ + && mkdir purple-presage/build \ + && cd purple-presage/build \ + && cmake .. \ + && cmake --build . \ + && cmake --install .; \ + else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libpresage.so; \ + fi + +# --- + +FROM bitlbee-build AS mattermost-build + +ARG MATTERMOST=0 +ARG MATTERMOST_VERSION=v2.1 + +RUN echo MATTERMOST=${MATTERMOST} > /tmp/status \ + && if [ ${MATTERMOST} -eq 1 ]; \ + then cd /tmp \ + && apt-get update \ + && apt-get install -y libjson-glib-dev libglib2.0-dev git make libmarkdown2-dev build-essential \ + && git clone https://github.com/EionRobb/purple-mattermost.git \ + && cd purple-mattermost \ + && git checkout ${MATTERMOST_VERSION} \ + && make -j$(nproc --ignore 2) \ + && make install; \ + else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libmattermost.so; \ + fi + +# --- + +FROM bitlbee-build AS icyque-build + +ARG ICYQUE=0 +ARG ICYQUE_VERSION + +RUN echo ICYQUE=${ICYQUE} > /tmp/status \ + && if [ ${ICYQUE} -eq 1 ]; \ + then cd /tmp \ + && git clone -n https://github.com/EionRobb/icyque.git \ + && cd icyque \ + && git checkout ${ICYQUE_VERSION} \ + && make -j$(nproc --ignore 2) \ + && make install; \ + else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libicyque.so; \ + fi + +# --- + +FROM bitlbee-build AS whatsapp-build + +ARG WHATSAPP=0 +ARG WHATSAPP_VERSION=v1.15.0 + +RUN echo WHATSAPP=${WHATSAPP} > /tmp/status \ + && if [ ${WHATSAPP} -eq 1 ]; \ + then cd /tmp \ + && apt-get install -y wget \ + && wget -q https://go.dev/dl/go1.22.4.linux-amd64.tar.gz \ + && tar -C /usr/local -xzf go1.22.4.linux-amd64.tar.gz \ + && echo "deb http://deb.debian.org/debian bookworm-backports main" | tee -a /etc/apt/sources.list \ + && apt-get update \ + && apt-get install -y -t bookworm-backports \ + && apt-get install -y --no-install-recommends cmake pkg-config libgdk-pixbuf2.0-dev libopusfile-dev \ + && git clone -n https://github.com/hoehermann/purple-gowhatsapp.git \ + && cd purple-gowhatsapp \ + && git checkout ${WHATSAPP_VERSION} \ + && export PATH=$PATH:/usr/local/go/bin \ + && git submodule update --init \ + && mkdir build \ + && cd build \ + && cmake .. \ + && cmake --build . \ + && make install/strip; \ + else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/libwhatsmeow.so; \ + fi + +# --- + +FROM bitlbee-build AS lurch-build + +ARG LURCH=0 +ARG LURCH_VERSION=master + +RUN echo LURCH=${LURCH} > /tmp/status \ + && if [ ${LURCH} -eq 1 ]; \ + then cd /tmp \ + && echo "deb http://deb.debian.org/debian bookworm-backports main" | tee -a /etc/apt/sources.list \ + && apt-get update \ + && apt-get install -y git cmake libpurple-dev libmxml-dev libxml2-dev libsqlite3-dev libgcrypt20-dev build-essential \ + && git clone -n https://github.com/gkdr/lurch \ + && cd lurch \ + && git checkout ${LURCH_VERSION} \ + && git submodule update --init --recursive \ + && make \ + && cp /tmp/lurch/build/lurch.so /usr/lib/x86_64-linux-gnu/purple-2/lurch.so ; \ + else mkdir -p /usr/lib/x86_64-linux-gnu/purple-2 \ + && ln -sf /nowhere /usr/lib/x86_64-linux-gnu/purple-2/liblurch.so; \ + fi + +# --- + +FROM base-image AS bitlbee-plugins + +COPY --from=bitlbee-build /usr/sbin/bitlbee /tmp/usr/sbin/bitlbee +COPY --from=bitlbee-build /usr/share/man/man8/bitlbee.8 /tmp/usr/share/man/man8/bitlbee.8 +COPY --from=bitlbee-build /usr/share/man/man5/bitlbee.conf.5 /tmp/usr/share/man/man5/bitlbee.conf.5 +COPY --from=bitlbee-build /usr/share/bitlbee /tmp/usr/share/bitlbee +COPY --from=bitlbee-build /usr/lib/pkgconfig/bitlbee.pc /tmp/usr/lib/pkgconfig/bitlbee.pc +COPY --from=bitlbee-build /etc/bitlbee /tmp/etc/bitlbee + +COPY --from=otr-install /usr/lib/bitlbee/otr.so /tmp/usr/lib/bitlbee/otr.so +COPY --from=otr-install /tmp/status /tmp/plugin/otr + +# COPY --from=facebook-build /usr/lib/bitlbee/facebook.so /tmp/usr/lib/bitlbee/facebook.so +# COPY --from=facebook-build /usr/lib/bitlbee/facebook.la /tmp/usr/lib/bitlbee/facebook.la +# COPY --from=facebook-build /tmp/status /tmp/plugin/facebook + +# COPY --from=steam-build /usr/lib/bitlbee/steam.so /tmp/usr/lib/bitlbee/steam.so +# COPY --from=steam-build /usr/lib/bitlbee/steam.la /tmp/usr/lib/bitlbee/steam.la +# COPY --from=steam-build /tmp/status /tmp/plugin/steam + +COPY --from=skypeweb-build /usr/lib/x86_64-linux-gnu/purple-2/libskypeweb.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libskypeweb.so +COPY --from=skypeweb-build /tmp/status /tmp/plugin/skypeweb + +# COPY --from=telegram-build /usr/lib/x86_64-linux-gnu/purple-2/libtelegram-tdlib.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libtelegram-tdlib.so +# COPY --from=telegram-build /usr/local/share/metainfo/tdlib-purple.metainfo.xml /tmp/usr/local/share/metainfo/tdlib-purple.metainfo.xml +# COPY --from=telegram-build /usr/local/share/locale /tmp/usr/local/share/locale +# COPY --from=telegram-build /tmp/status /tmp/plugin/telegram + +COPY --from=hangouts-build /usr/lib/x86_64-linux-gnu/purple-2/libhangouts.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libhangouts.so +COPY --from=hangouts-build /tmp/status /tmp/plugin/hangouts + +COPY --from=slack-build /usr/lib/x86_64-linux-gnu/purple-2/libslack.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libslack.so +COPY --from=slack-build /tmp/status /tmp/plugin/slack + +# COPY --from=sipe-build /usr/lib/x86_64-linux-gnu/purple-2/libsipe.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libsipe.so +# COPY --from=sipe-build /usr/lib/x86_64-linux-gnu/purple-2/libsipe.la /tmp/usr/lib/x86_64-linux-gnu/purple-2/libsipe.la +# COPY --from=sipe-build /usr/share/locale /tmp/usr/share/locale +# COPY --from=sipe-build /tmp/status /tmp/plugin/sipe + +COPY --from=discord-build /usr/lib/x86_64-linux-gnu/purple-2/libdiscord.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libdiscord.so +# COPY --from=discord-build /usr/lib/bitlbee/discord.la /tmp/usr/lib/bitlbee/discord.la +# COPY --from=discord-build /usr/share/bitlbee/discord-help.txt /tmp/usr/share/bitlbee/discord-help.txt +# COPY --from=discord-build /tmp/status /tmp/plugin/discord + +COPY --from=rocketchat-build /usr/lib/x86_64-linux-gnu/purple-2/librocketchat.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/librocketchat.so +COPY --from=rocketchat-build /tmp/status /tmp/plugin/rocketchat + +COPY --from=mastodon-build /usr/lib/bitlbee/mastodon.so /tmp/usr/lib/bitlbee/mastodon.so +COPY --from=mastodon-build /usr/lib/bitlbee/mastodon.la /tmp/usr/lib/bitlbee/mastodon.la +COPY --from=mastodon-build /usr/share/bitlbee/mastodon-help.txt /tmp/usr/share/bitlbee/mastodon-help.txt +COPY --from=mastodon-build /tmp/status /tmp/plugin/mastodon + +# COPY --from=matrix-build /usr/lib/x86_64-linux-gnu/purple-2/libmatrix.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libmatrix.so +# COPY --from=matrix-build /tmp/status /tmp/plugin/matrix + +# COPY --from=signald-build /usr/lib/x86_64-linux-gnu/purple-2/libsignald.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libsignald.so +# COPY --from=signald-build /tmp/status /tmp/plugin/signald + +# COPY --from=signal-presage /usr/lib/x86_64-linux-gnu/purple-2/libpresage.so /tmp/usr/lib/bitlbee/libpresage.so +COPY --from=signal-presage /usr/lib/x86_64-linux-gnu/purple-2/libpresage.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libpresage.so +# COPY --from=signal-presage /usr/lib/x86_64-linux-gnu/purple-2/libpurple_presage_backend.a /tmp/usr/lib/bitlbee/libpurple_presage_backend.a + +# COPY --from=icyque-build /usr/lib/x86_64-linux-gnu/purple-2/libicyque.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libicyque.so +# COPY --from=icyque-build /tmp/status /tmp/plugin/icyque + +COPY --from=purple-teams-build /usr/lib/x86_64-linux-gnu/purple-2/libteams.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libteams.so +COPY --from=purple-teams-build /usr/lib/x86_64-linux-gnu/purple-2/libteams-personal.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libteams-personal.so +COPY --from=purple-teams-build /tmp/status /tmp/plugin/teams + +COPY --from=whatsapp-build /usr/lib/x86_64-linux-gnu/purple-2/libwhatsmeow.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libwhatsmeow.so +COPY --from=whatsapp-build /tmp/status /tmp/plugin/whatsapp + +# COPY --from=lurch-build /usr/lib/x86_64-linux-gnu/purple-2/lurch.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/lurch.so +# COPY --from=lurch-build /tmp/status /tmp/plugin/lurch + +COPY --from=mattermost-build /usr/lib/x86_64-linux-gnu/purple-2/libmattermost.so /tmp/usr/lib/x86_64-linux-gnu/purple-2/libmattermost.so +COPY --from=mattermost-build /tmp/status /tmp/plugin/mattermost + +RUN apt-get update \ + && apt-get install -y --no-install-recommends findutils \ + && find /tmp/ -type f -empty -delete \ + && find /tmp/ -type d -empty -delete \ + && cat /tmp/plugin/* > /tmp/plugins \ + && rm -rf /tmp/plugin + +# --- + +FROM base-image AS bitlbee-libpurple + +COPY --from=bitlbee-plugins /tmp/ / + +ARG PKGS="tzdata libglib2.0-0 libssl3 libpurple0 libtcl8.6 libtk8.6" + +SHELL [ "/bin/bash", "-c" ] + +RUN groupadd -g 101 -r bitlbee \ + && useradd -u 101 -r -g bitlbee -m -d /var/lib/bitlbee bitlbee \ + && install -d -m 750 -o bitlbee -g bitlbee /var/lib/bitlbee \ + && groupadd -g 102 -r signald \ + && usermod -aG signald bitlbee \ + && source /plugins \ + && PKGS="${PKGS} libotr5 libjson-glib-1.0-0 libgcrypt20 zlib1g libwebp7 libpng16-16 libstdc++6 libprotobuf-c1 libqrencode4 libnss3 libopusfile-dev libgdk-pixbuf2.0-dev libxml2 libmarkdown2 libsqlite3-0 libhttp-parser2.9 libolm2 libmxml1 vim gdb" \ + && apt-get update \ + && apt-get install -y --no-install-recommends ${PKGS} \ + && apt-get clean \ + && rm /plugins + +EXPOSE 6667 + +# CMD [ "/usr/sbin/bitlbee", "-F", "-n", "-u", "bitlbee" ] @@ -1,72 +1,121 @@ # docker-bitlbee-libpurple -This docker image includes bitlbee with a bunch of useful plugins: - - [facebook](https://github.com/jgeboski/bitlbee-facebook) - - [steam](https://github.com/jgeboski/bitlbee-steam) - - [skypeweb](https://github.com/EionRobb/skype4pidgin) - - [telegram](https://github.com/majn/telegram-purple) - - [hangouts](https://bitbucket.org/EionRobb/purple-hangouts) - - [slack](https://github.com/dylex/slack-libpurple) - - [sipe](https://github.com/tieto/sipe) - - [discord](https://github.com/sm00th/bitlbee-discord) - - [rocket.chat](https://bitbucket.org/EionRobb/purple-rocketchat) - - [mastodon](https://github.com/kensanata/bitlbee-mastodon) - - [matrix](https://github.com/matrix-org/purple-matrix) - - [signal](https://github.com/hoehermann/libpurple-signald) - - [icyque](https://github.com/EionRobb/icyque) - - [whatsapp](https://github.com/hoehermann/purple-gowhatsapp) (only in debian based images) - -The most significant being the [libpurple Slack plugin](https://github.com/dylex/slack-libpurple). As Slack is turning off its IRC gateway on May 15 2018, now is the time to spin up your own docker image and start using bitlbee instead. - -## Building and running the image -Build the image and tag it: -```bash -docker build -t bitlbee:latest . -``` +This repo is a [fork](https://github.com/ezkrg/docker-bitlbee-libpurple) -Then run it: -```bash -docker run -p 6667:6667 --name bitlbee -v /local/path/to/configurations:/var/lib/bitlbee \ - --restart=always --detach bitlbee:latest -``` +**NOTE**: the alpine image is currently unmaintained. -The local path to the configurations will contain the configuration as saved by -bitlbee. It is advisable to do so, as your configuration will be gone when -the docker image gets deleted. +The images are built and pushed to [dockerhub](https://hub.docker.com/r/terminaldweller/bitlbee_purple) automatically via github workflows. -## Setting up a Slack account -Connect with your IRC client to the host running the image. Then register with a password in the &bitlbee channel: -``` -/join &bitlbee -register <your password> -``` +Included plugins: -Then, go to [the Slack legacy token site](https://api.slack.com/custom-integrations/legacy-tokens) to acquire -an API token, which is necessary in order to log in. +- telegram via [tdlib-purple](https://github.com/BenWiederhake/tdlib-purple/) +- hangouts via [purple-hangouts](https://bitbucket.org/EionRobb/purple-hangouts) +- slack via dylex's fork of [slack-libpurple](https://github.com/dylex/slack-libpurple) +- discord via [purple-discord](https://github.com/EionRobb/purple-discord) +- rocket.chat via [purple-rocketchat](https://bitbucket.org/EionRobb/purple-rocketchat) +- mastodon via [bitlbee-mastodon](https://github.com/kensanata/bitlbee-mastodon) +- signal via [purple-presage](https://github.com/hoehermann/purple-presage) +- whatsapp via [purple-gowhatsmeow](https://github.com/hoehermann/purple-gowhatsapp.git) +- microsoft teams via [purple-teams](https://github.com/EionRobb/purple-teams) +- [icyque](https://github.com/EionRobb/icyque) +- [facebook](https://github.com/jgeboski/bitlbee-facebook) +- [steam](https://github.com/jgeboski/bitlbee-steam) +- [sipe](https://github.com/tieto/sipe) -Copy the token, register your slack account in bitlbee and enable the account: -``` -account add slack yourusername@whatever.slack.com thetoken -account on +for mattermost, use [matterircd](https://github.com/42wim/matterircd). + +for matrix, use [matrix2051](https://github.com/progval/matrix2051). + +## Building and Running + +```sh +docker build -f ./Dockerfile.debian -t bitlbee-purple . ``` -This should log your account in right away: +```sh +docker run -p 6667:6667 --name bitlbee -v /local/path/to/configurations:/var/lib/bitlbee --restart=always --detach bitlbee-purple ``` -<@root> Trying to get all accounts connected... -<@root> slack - Logging in: Requesting RTM -<@root> slack - Logging in: Connecting to RTM -<@root> slack - Logging in: RTM Connected -<@root> slack - Logging in: Loading Users -<@root> slack - Logging in: Loading conversations -<@root> slack - Logging in: Logged in + +An example compose file: + +```yaml +services: + bitlbee: + image: bitlbee-purple + deploy: + resources: + limits: + memory: 384M + logging: + driver: "json-file" + options: + max-size: "100m" + networks: + - bitlbeenet + ports: + - "127.0.0.1:8667:6667" + - "172.17.0.1:8667:6667" + restart: unless-stopped + user: "bitlbee:bitlbee" + command: + [ + "/usr/sbin/bitlbee", + "-F", + "-n", + "-u", + "bitlbee", + "-c", + "/var/lib/bitlbee/bitlbee.conf", + "-d", + "/var/lib/bitlbee", + ] + volumes: + - ./conf/bitlbee.conf:/var/lib/bitlbee/bitlbee.conf:ro + - userdata:/var/lib/bitlbee +networks: + bitlbeenet: +volumes: + userdata: ``` -By default, none of the channels you normally reside in will be joined. To join them, you first need to add them: +You can use [grype](https://github.com/anchore/grype) to check for CVEs affecting the image: + +```sh +grype bitlbee-purple --scope all-layers ``` -<@you> chat add slack general -<@root> Chatroom successfully added. + +## Debugging + +For debugging, you can use the docker compose file provided in the repo. Enable the plugin you want, and run. + +This command will run until we crash, after which it will print the backtrace and exit: + +```yaml +command: + [ + "gdb", + "-ex", + "'handle SIGPIPE nostop noprint pass'", + "-ex", + "run", + "-ex", + "bt", + "--args", + "/usr/sbin/bitlbee", + "-Dnv", + "-d", + "/var/lib/bitlbee", + ] ``` -Don't add the leading #. Adding private channels works the same way as public channels, both without the leading #. -Now, join the channel with /join #channnelname and you'll be good to go. +This command prints debug information for bitlbee: +```yaml +command: + [ + "/usr/sbin/bitlbee", + "-Dnv", + "-d", + "/var/lib/bitlbee", + ] +``` diff --git a/build_dbg.sh b/build_dbg.sh new file mode 100755 index 0000000..9057497 --- /dev/null +++ b/build_dbg.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +docker build -f ./Dockerfile.debug -t bb_dbg . diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..3033246 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,60 @@ +# DO NOT RUN THIS FOR ANYTHING OTHER THAN DEBUGGING. SERIOUSLY. +# https://wiki.bitlbee.org/DebuggingCrashes +# https://wiki.bitlbee.org/Debugging +services: + bb_dbg: + image: bb_dbg + build: + context: . + dockerfile: ./Dockerfile.debug + deploy: + resources: + limits: + memory: 1024M + logging: + driver: "json-file" + options: + max-size: "100m" + networks: + - bb_dbg_net + privileged: true + environment: + - BITLBEE_DEBUG=1 + ports: + - "127.0.0.1:9667:6667" + - "172.17.0.1:9667:6667" + # command: + # [ + # "gdb", + # "-ex", + # "'handle SIGPIPE nostop noprint pass'", + # "-ex", + # "run", + # "-ex", + # "bt", + # "--args", + # "/usr/sbin/bitlbee", + # "-Dnv", + # "-d", + # "/var/lib/bitlbee", + # ] + command: + [ + "/usr/sbin/bitlbee", + "-Dnv", + "-d", + "/var/lib/bitlbee", + ] + volumes: + - bb_dbg_userdata:/var/lib/bitlbee + - ./gdb_commands:/gdb_commands + - /etc/ssl/certs:/etc/ssl/certs + cap_add: + - ALL + dns: + - 1.1.1.1 + - 8.8.8.8 +networks: + bb_dbg_net: +volumes: + bb_dbg_userdata: diff --git a/gdb_commands b/gdb_commands new file mode 100644 index 0000000..c2d4647 --- /dev/null +++ b/gdb_commands @@ -0,0 +1,2 @@ + +#set follow-fork-mode parent diff --git a/matrix-e2e.c.patch b/matrix-e2e.c.patch deleted file mode 100644 index 8dd7c47..0000000 --- a/matrix-e2e.c.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- matrix-e2e.c -+++ matrix-e2e.c.new -@@ -949,7 +949,7 @@ - to_create = (max_keys / 2) - count; - need_to_send = TRUE; - } -- purple_debug_info("matrixprpl", "%s: %s: %ld\n", -+ purple_debug_info("matrixprpl", "%s: %s: %lld\n", - __func__, key_algo, count); - } - } -@@ -1520,7 +1520,7 @@ - plaintext[pt_len] = '\0'; - handle_decrypted_olm(pc, conn, cevent_sender, sender_key, plaintext); - } else { -- purple_debug_info("matrixprpl", "%s: Type %zd olm\n", __func__, type); -+ purple_debug_info("matrixprpl", "%s: Type %lld olm\n", __func__, type); - } - if (plaintext) { - clear_mem(plaintext, max_plaintext_len);
\ No newline at end of file diff --git a/plugin_versions b/plugin_versions index f704a84..0d77561 100644 --- a/plugin_versions +++ b/plugin_versions @@ -1,15 +1,8 @@ -BITLBEE_VERSION=3.6 -DISCORD_VERSION=607f988 FACEBOOK_VERSION=v1.2.2 HANGOUTS_VERSION=55b9f01 ICYQUE_VERSION=4fc08a0 MASTODON_VERSION=v1.4.5 -MATRIX_VERSION=034ebf8 ROCKETCHAT_VERSION=484e5bf -SIGNAL_VERSION=v0.12.0 SIPE_VERSION=3db5111 -SKYPEWEB_VERSION=8b29d7b SLACK_VERSION=3433ac5 STEAM_VERSION=a6444d2 -TELEGRAM_VERSION=v0.8.1 -WHATSAPP_VERSION=v1.2.0 |