Add mautrix-syncproxy and mautrix-wsproxy

This commit is contained in:
thomas 2022-02-26 04:53:01 +01:00
parent eaba9effe3
commit 51bcd703d6
18 changed files with 185 additions and 5 deletions

View File

@ -19,6 +19,7 @@ debmaker_run
- [gotify](#gotify)
- [grocy](#grocy)
- [joplin-server](#joplin-server)
- [mautrix-syncproxy and mautrix-wsproxy](#mautrix-syncproxy-and-mautrix-wsproxy)
- [rss-bridge](#rss-bridge)
- [tt-rss](#tt-rss)
- [vaultwarden and vaultwarden-web](#vaultwarden-and-vaultwarden-web)
@ -98,6 +99,18 @@ apt-get install -y joplin-server
systemctl enable --now joplin-server
```
#### mautrix-syncproxy and mautrix-wsproxy
```bash
apt install -y python wget ca-certificates
wget -qO - https://deb.lgy.fr/install.sh | bash
apt-get update
apt-get install -y mautrix-syncproxy mautrix-wsproxy
#Edit /etc/mautrix-wsproxy.yaml and /etc/default/mautrix-syncproxy
systemctl enable --now mautrix-wsproxy mautrix-syncproxy
```
#### rss-bridge
```bash

0
grocy2deb Normal file → Executable file
View File

10
mautrix-syncproxy2deb Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
APP=mautrix-syncproxy
VERSION=0.0.1
GIT_VERSION=$VERSION
DEB_VERSION=$VERSION-1
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=2
source ./lib/function.sh

10
mautrix-wsproxy2deb Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
APP=mautrix-wsproxy
VERSION=1.0.0
GIT_VERSION=$VERSION
DEB_VERSION=$VERSION-1
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=2
source ./lib/function.sh

View File

@ -0,0 +1,29 @@
#!/bin/bash
STEP="envinit prebuild build makedeb"
envinit() {
apt install -y --no-install-recommends build-essential git wget ca-certificates dpkg fakeroot
wget -qO - https://go.dev/dl/go1.17.7.linux-amd64.tar.gz | tar -C /usr/local -xz
}
prebuild(){
GIT_VERSION=$1
git clone --depth 1 https://github.com/mautrix/syncproxy.git /tmp/mautrix-syncproxy
}
build() {
cd /tmp/mautrix-syncproxy/
PATH=$PATH:/usr/local/go/bin
go build -o mautrix-syncproxy
}
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
cp /tmp/mautrix-syncproxy/mautrix-syncproxy ${PATH_DEB}/usr/bin/mautrix-syncproxy
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}

View File

@ -0,0 +1 @@
/etc/default/mautrix-syncproxy

View File

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

View File

@ -0,0 +1,4 @@
#!/bin/bash
id mautrix-syncproxy &> /dev/null || useradd mautrix-syncproxy -r -s /bin/false -d /

View File

@ -0,0 +1,5 @@
DATABASE_URL=postgres://syncproxy:xxxxxxxxxx@postgres/syncproxy
HOMESERVER_URL=https://domaine.fr/
LISTEN_ADDRESS=:29331
SHARED_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#DEBUG=true

View File

@ -0,0 +1,37 @@
[Unit]
Description=service mautrix-syncproxy
Documentation=https://github.com/mautrix/syncproxy
After=network.target
[Service]
User=mautrix-syncproxy
Group=mautrix-syncproxy
EnvironmentFile=/etc/default/mautrix-syncproxy
ExecStart=/usr/bin/mautrix-syncproxy
WorkingDirectory=/tmp
Restart=on-failure
RestartSec=30s
#ReadWritePaths=/tmp
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

View File

@ -0,0 +1,30 @@
#!/bin/bash
STEP="envinit prebuild build makedeb"
envinit() {
apt install -y --no-install-recommends build-essential git wget ca-certificates dpkg fakeroot
wget -qO - https://go.dev/dl/go1.17.7.linux-amd64.tar.gz | tar -C /usr/local -xz
}
prebuild(){
GIT_VERSION=$1
git clone --depth 1 https://github.com/mautrix/wsproxy.git /tmp/mautrix-wsproxy
}
build() {
cd /tmp/mautrix-wsproxy/
PATH=$PATH:/usr/local/go/bin
go build -o mautrix-wsproxy
}
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
cp /tmp/mautrix-wsproxy/mautrix-wsproxy ${PATH_DEB}/usr/bin/mautrix-wsproxy
cp /tmp/mautrix-wsproxy/example-config.yaml ${PATH_DEB}/etc/mautrix-wsproxy.yaml
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}

View File

@ -0,0 +1 @@
/etc/mautrix-wsproxy.yaml

View File

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

View File

@ -0,0 +1,4 @@
#!/bin/bash
id mautrix-wsproxy &> /dev/null || useradd mautrix-wsproxy -r -s /bin/false -d /

View File

@ -0,0 +1,17 @@
[Unit]
Description=wsproxy
Documentation=https://github.com/mautrix/wsproxy
After=network.target
[Service]
User=mautrix-wsproxy
Group=mautrix-wsproxy
ExecStart=/usr/bin/mautrix-wsproxy --config /etc/mautrix-wsproxy.yaml
WorkingDirectory=/tmp
Restart=on-failure
RestartSec=60
[Install]
WantedBy=multi-user.target

View File

@ -1,12 +1,17 @@
<VirtualHost *:80>
servername tt-rss.domain.com
servername tt-rss.domain.com
DocumentRoot /usr/share/tt-rss/
Protocols h2c http/1.1
DocumentRoot /usr/share/tt-rss/
Protocols h2c http/1.1
<directory /usr/share/tt-rss/>
<directory /usr/share/tt-rss/>
Options -Indexes -MultiViews +FollowSymLinks
AllowOverride all
Require all granted
</directory>
</directory>
<Directory /usr/share/tt-rss/cache>
Require all denied
</Directory>
</VirtualHost>