Skip to content

Commit

Permalink
v2: add stub
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jul 20, 2024
1 parent c4aafe8 commit 5d66f86
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
include:
- project: 'mautrix/ci'
file: '/go.yml'
- project: 'mautrix/ci'
file: '/gov2.yml'

variables:
BINARY_NAME_V2: mautrix-whatsapp
15 changes: 15 additions & 0 deletions Dockerfile.v2.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM alpine:3.20

ENV UID=1337 \
GID=1337

RUN apk add --no-cache ffmpeg su-exec ca-certificates bash jq curl yq-go

ARG EXECUTABLE=./mautrix-whatsapp
COPY $EXECUTABLE /usr/bin/mautrix-whatsapp
COPY ./docker-run.sh /docker-run.sh
ENV BRIDGEV2=1
VOLUME /data
WORKDIR /data

CMD ["/docker-run.sh"]
4 changes: 4 additions & 0 deletions build-v2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
MAUTRIX_VERSION=$(cat go.mod | grep 'maunium.net/go/mautrix ' | awk '{ print $2 }')
GO_LDFLAGS="-s -w -X main.Tag=$(git describe --exact-match --tags 2>/dev/null) -X main.Commit=$(git rev-parse HEAD) -X 'main.BuildTime=`date -Iseconds`' -X 'maunium.net/go/mautrix.GoModVersion=$MAUTRIX_VERSION'"
go build -ldflags="$GO_LDFLAGS" ./cmd/mautrix-whatsapp "$@"
4 changes: 4 additions & 0 deletions cmd/mautrix-whatsapp/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package main

func main() {
}
6 changes: 5 additions & 1 deletion docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ function fixperms {
}

if [[ ! -f /data/config.yaml ]]; then
cp /opt/mautrix-whatsapp/example-config.yaml /data/config.yaml
if [[ "$BRIDGEV2" == "1" ]]; then
/usr/bin/mautrix-whatsapp -c /data/config.yaml -e
else
cp /opt/mautrix-whatsapp/example-config.yaml /data/config.yaml
fi
echo "Didn't find a config file."
echo "Copied default config file to /data/config.yaml"
echo "Modify that config file to your liking."
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ require (
github.com/rs/zerolog v1.33.0
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
github.com/tidwall/gjson v1.17.1
go.mau.fi/util v0.6.0
go.mau.fi/util v0.6.1-0.20240719175439-20a6073e1dd4
go.mau.fi/webp v0.1.0
go.mau.fi/whatsmeow v0.0.0-20240716084021-eb41d1f09552
golang.org/x/exp v0.0.0-20240707233637-46b078467d37
golang.org/x/image v0.18.0
golang.org/x/net v0.27.0
golang.org/x/sync v0.7.0
google.golang.org/protobuf v1.34.2
maunium.net/go/mautrix v0.19.0
maunium.net/go/mautrix v0.19.1-0.20240720173515-24ead553b23b
)

require (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ github.com/yuin/goldmark v1.7.4 h1:BDXOHExt+A7gwPCJgPIIq7ENvceR7we7rOS9TNoLZeg=
github.com/yuin/goldmark v1.7.4/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
go.mau.fi/libsignal v0.1.1 h1:m/0PGBh4QKP/I1MQ44ti4C0fMbLMuHb95cmDw01FIpI=
go.mau.fi/libsignal v0.1.1/go.mod h1:QLs89F/OA3ThdSL2Wz2p+o+fi8uuQUz0e1BRa6ExdBw=
go.mau.fi/util v0.6.0 h1:W6SyB3Bm/GjenQ5iq8Z8WWdN85Gy2xS6L0wmnR7SVjg=
go.mau.fi/util v0.6.0/go.mod h1:ljYdq3sPfpICc3zMU+/mHV/sa4z0nKxc67hSBwnrk8U=
go.mau.fi/util v0.6.1-0.20240719175439-20a6073e1dd4 h1:CYKYs5jwJ0bFJqh6pRoWtC9NIJ0lz0/6i2SC4qEBFaU=
go.mau.fi/util v0.6.1-0.20240719175439-20a6073e1dd4/go.mod h1:ljYdq3sPfpICc3zMU+/mHV/sa4z0nKxc67hSBwnrk8U=
go.mau.fi/webp v0.1.0 h1:BHObH/DcFntT9KYun5pDr0Ot4eUZO8k2C7eP7vF4ueA=
go.mau.fi/webp v0.1.0/go.mod h1:e42Z+VMFrUMS9cpEwGRIor+lQWO8oUAyPyMtcL+NMt8=
go.mau.fi/whatsmeow v0.0.0-20240716084021-eb41d1f09552 h1:3cI+n5D79nOlS3hef6PD1D8wkXEyxSIW0mvotE8ymVE=
Expand Down Expand Up @@ -103,5 +103,5 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
maunium.net/go/mauflag v1.0.0 h1:YiaRc0tEI3toYtJMRIfjP+jklH45uDHtT80nUamyD4M=
maunium.net/go/mauflag v1.0.0/go.mod h1:nLivPOpTpHnpzEh8jEdSL9UqO9+/KBJFmNRlwKfkPeA=
maunium.net/go/mautrix v0.19.0 h1:67eSJWam93mw44Q0/1SiOG7zQzXMUknUv5UaWkrODDU=
maunium.net/go/mautrix v0.19.0/go.mod h1:UE+mSQ4sDUuJMbjN0aB9EjQSGgXd48AzMvZ6+QJV1k8=
maunium.net/go/mautrix v0.19.1-0.20240720173515-24ead553b23b h1:Di+oGGsfDOdyCdKxFMVentY49lLIGyyWl2k6Kpx/S6w=
maunium.net/go/mautrix v0.19.1-0.20240720173515-24ead553b23b/go.mod h1:xP3DCXdPBUe1sPiugLbd5mRh/mJQWfGWyED1S8s9V7c=
1 change: 1 addition & 0 deletions pkg/connector/connector.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package connector

0 comments on commit 5d66f86

Please sign in to comment.