Add mautrix-syncproxy and mautrix-wsproxy
This commit is contained in:
parent
eaba9effe3
commit
51bcd703d6
18 changed files with 185 additions and 5 deletions
30
ressources/mautrix-wsproxy/mautrix-wsproxy
Executable file
30
ressources/mautrix-wsproxy/mautrix-wsproxy
Executable 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
|
||||
}
|
0
ressources/mautrix-wsproxy/rootfs/DEBIAN/changelog
Normal file
0
ressources/mautrix-wsproxy/rootfs/DEBIAN/changelog
Normal file
1
ressources/mautrix-wsproxy/rootfs/DEBIAN/conffiles
Normal file
1
ressources/mautrix-wsproxy/rootfs/DEBIAN/conffiles
Normal file
|
@ -0,0 +1 @@
|
|||
/etc/mautrix-wsproxy.yaml
|
7
ressources/mautrix-wsproxy/rootfs/DEBIAN/control
Normal file
7
ressources/mautrix-wsproxy/rootfs/DEBIAN/control
Normal 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
|
4
ressources/mautrix-wsproxy/rootfs/DEBIAN/postinst
Executable file
4
ressources/mautrix-wsproxy/rootfs/DEBIAN/postinst
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
id mautrix-wsproxy &> /dev/null || useradd mautrix-wsproxy -r -s /bin/false -d /
|
||||
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue