Skip to content

Does pushbits server support end-to-end encryption? Messages are sent unencrypted to Matrix. #24

@sunrisepi

Description

@sunrisepi

Hello! I like what I see so far with pushbits. Thanks very much for creating it. How I am using it:

  • Compiled my own docker image using the Dockerfile, for Raspberry Pi, to run on my ARM processor.
  • Using with Element web client (Firefox web browser) and Element app on iOS (iPhone)
  • I am able to create users and applications fine using pbcli. I can send messages fine using curl to the created application for the Matrix user.

I noticed the following:

  • When an application (Room) is created via pbcli, encryption for the Room is not enabled.
  • I manually enabled encryption for a room in Element.io's web app: Click "..." to right of Room name in Room list->Room Options->Settings->Security & Privacy->Select "Encrypted" slider to enable
  • After enabling encryption for the room manually via Element.io's web app, messages sent via my local pushbits server show up with a red exclamation mark. Hovering the mouse cursor on that the pop-up text indicates, Unencrypted
  • When I click on the unencrypted message in the Element iOS app, it shows:
    Curve25519 identity key
    none
    Claimed Ed25519 fingerprint key
    none
    Algorithm
    unencrypted

I am wondering why messages I send to my local pushbits server, are not relayed to Matrix using end-to-end encryption. Would it be possible to enable this in some way?

I also noticed when I built my own local Docker image that there was a warning in the SSL certificate section (in bold below). I wonder if this could be contributing to the lack of encryption. Thank you for any information you could share... much appreciated.

FYI, I modified the first line in the Dockerfile to the following: FROM arm32v7/golang:alpine as builder

 $ docker build -t pushbits .
Sending build context to Docker daemon  116.7kB
Step 1/15 : FROM arm32v7/golang:alpine as builder
 ---> 3acd86eb4cf4
Step 2/15 : WORKDIR /build
 ---> Using cache
 ---> 013fad3eabff
Step 3/15 : COPY . .
 ---> Using cache
 ---> 81c54ab0cc6c
Step 4/15 : RUN set -ex         && apk add --no-cache build-base        && go mod download      && go mod verify        && make build   && chmod +x /build/app
 ---> Running in 7a1c4aa05b65
+ apk add --no-cache build-base
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/armv7/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/armv7/APKINDEX.tar.gz
(1/20) Installing libgcc (10.2.1_pre1-r3)
(2/20) Installing libstdc++ (10.2.1_pre1-r3)
(3/20) Installing binutils (2.35.1-r1)
(4/20) Installing libmagic (5.39-r0)
(5/20) Installing file (5.39-r0)
(6/20) Installing libgomp (10.2.1_pre1-r3)
(7/20) Installing libatomic (10.2.1_pre1-r3)
(8/20) Installing libgphobos (10.2.1_pre1-r3)
(9/20) Installing gmp (6.2.1-r0)
(10/20) Installing isl22 (0.22-r0)
(11/20) Installing mpfr4 (4.1.0-r0)
(12/20) Installing mpc1 (1.2.0-r0)
(13/20) Installing gcc (10.2.1_pre1-r3)
(14/20) Installing musl-dev (1.2.2-r0)
(15/20) Installing libc-dev (0.7.2-r3)
(16/20) Installing g++ (10.2.1_pre1-r3)
(17/20) Installing make (4.3-r0)
(18/20) Installing fortify-headers (1.1-r0)
(19/20) Installing patch (2.7.6-r6)
(20/20) Installing build-base (0.5-r2)
Executing busybox-1.32.1-r3.trigger
OK: 137 MiB in 35 packages
+ go mod download
+ go mod verify
all modules verified
+ make build
go build -ldflags="-w -s" -o app ./cmd/pushbits
+ chmod +x /build/app
Removing intermediate container 7a1c4aa05b65
 ---> 495b734259a3
Step 5/15 : FROM alpine
 ---> 6ecc03ee95e9
Step 6/15 : ARG USER_ID=1000
 ---> Using cache
 ---> 023eb4422549
Step 7/15 : ENV PUSHBITS_HTTP_PORT="8080"
 ---> Using cache
 ---> aa898ce7fa9f
Step 8/15 : EXPOSE 8080
 ---> Using cache
 ---> abad2f4ff353
Step 9/15 : WORKDIR /app
 ---> Using cache
 ---> c94eb019b244
Step 10/15 : COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
 ---> Using cache
 ---> 8726a5d408b9
Step 11/15 : COPY --from=builder /build/app ./run
 ---> b44e07535f24
Step 12/15 : RUN set -ex        && apk add --no-cache ca-certificates curl     && update-ca-certificates        && mkdir -p /data       && ln -s /data/pushbits.db /app/pushbits.db     && ln -s /data/config.yml /app/config.yml
 ---> Running in ce0654bbb2d6
+ apk add --no-cache ca-certificates curl
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/armv7/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/armv7/APKINDEX.tar.gz
(1/5) Installing ca-certificates (20191127-r5)
(2/5) Installing brotli-libs (1.0.9-r3)
(3/5) Installing nghttp2-libs (1.42.0-r1)
(4/5) Installing libcurl (7.74.0-r1)
(5/5) Installing curl (7.74.0-r1)
Executing busybox-1.32.1-r3.trigger
Executing ca-certificates-20191127-r5.trigger
OK: 6 MiB in 19 packages

+ update-ca-certificates
WARNING: ca-certificates.crt does not contain exactly one certificate or CRL: skipping

+ mkdir -p /data
+ ln -s /data/pushbits.db /app/pushbits.db
+ ln -s /data/config.yml /app/config.yml
Removing intermediate container ce0654bbb2d6
 ---> bc69a4cf8780
Step 13/15 : USER ${USER_ID}
 ---> Running in ce7fe59f5fd8
Removing intermediate container ce7fe59f5fd8
 ---> 3ab00d75901c
Step 14/15 : HEALTHCHECK --interval=30s --timeout=5s --start-period=5s CMD curl --fail http://localhost:$PUSHBITS_HTTP_PORT/health || exit 1
 ---> Running in a6bc57a94b6e
Removing intermediate container a6bc57a94b6e
 ---> 65f07b171d20
Step 15/15 : ENTRYPOINT ["./run"]
 ---> Running in 837aa9b5cb9f
Removing intermediate container 837aa9b5cb9f
 ---> cbdc45f9e44b
Successfully built cbdc45f9e44b
Successfully tagged pushbits:latest

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingsecurity

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions