This commit is contained in:
root 2022-01-23 21:49:01 +01:00
commit 363a876c22
88 changed files with 783 additions and 0 deletions

View file

@ -0,0 +1,4 @@
#/bin/bash
cd /tmp/whatsapp/
git checkout $1
PATH=$PATH:/usr/local/go/bin ./build.sh

View file

@ -0,0 +1,3 @@
#/bin/bash
apt install -y ca-certificates git libolm3 libolm-dev build-essential wget
wget -qO - https://go.dev/dl/go1.17.3.linux-amd64.tar.gz | tar -C /usr/local -xz

View file

@ -0,0 +1,7 @@
#!/bin/bash
PATH_BUILD=$1
PATH_DEB=$2
GIT_VERSION=$3
cp ${PATH_BUILD}/tmp/whatsapp/mautrix-whatsapp ${PATH_DEB}/usr/lib/mautrix-whatsapp/mautrix-whatsapp
cp ${PATH_BUILD}/tmp/whatsapp/example-config.yaml ${PATH_DEB}/etc/mautrix-whatsapp/config.yaml

View file

@ -0,0 +1,6 @@
#!/bin/bash
VERSION=$1
cd /tmp/
git clone https://github.com/mautrix/whatsapp.git
cd whatsapp/
git checkout $VERSION

View file

@ -0,0 +1 @@
/etc/mautrix-whatsapp/config.yaml

View file

@ -0,0 +1,8 @@
Package: mautrix-whatsapp
Version: %VERSION%
Section: base
Priority: optional
Architecture: all
Depends: libolm3
Maintainer: Thomas Legay <thomas@syngate.fr>
Description: mautrix-whatsapp bridge

View file

@ -0,0 +1,4 @@
#!/bin/bash
id mautrix-whatsapp &> /dev/null || useradd mautrix-whatsapp -r -s /bin/false -md /var/lib/mautrix-whatsapp
chown mautrix-whatsapp:mautrix-whatsapp /etc/mautrix-whatsapp/

View file

@ -0,0 +1,35 @@
[Unit]
Description=mautrix-whatsapp bridge
[Service]
Type=exec
User=mautrix-whatsapp
WorkingDirectory=/var/lib/mautrix-whatsapp
ExecStart=/usr/lib/mautrix-whatsapp/mautrix-whatsapp -c /etc/mautrix-whatsapp/config.yaml
Restart=on-failure
RestartSec=30s
# Optional hardening to improve security
ReadWritePaths=/var/lib/mautrix-whatsapp /etc/mautrix-whatsapp
NoNewPrivileges=yes
MemoryDenyWriteExecute=true
PrivateDevices=yes
PrivateTmp=yes
ProtectHome=yes
ProtectSystem=strict
ProtectControlGroups=true
RestrictSUIDSGID=true
RestrictRealtime=true
LockPersonality=true
ProtectKernelLogs=true
ProtectKernelTunables=true
ProtectHostname=true
ProtectKernelModules=true
PrivateUsers=true
ProtectClock=true
SystemCallArchitectures=native
SystemCallErrorNumber=EPERM
SystemCallFilter=@system-service
[Install]
WantedBy=multi-user.target