diff --git a/README.MD b/README.MD index 50c0760..dca08af 100644 --- a/README.MD +++ b/README.MD @@ -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 diff --git a/grocy2deb b/grocy2deb old mode 100644 new mode 100755 diff --git a/mautrix-syncproxy2deb b/mautrix-syncproxy2deb new file mode 100755 index 0000000..6cd16cb --- /dev/null +++ b/mautrix-syncproxy2deb @@ -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 diff --git a/mautrix-wsproxy2deb b/mautrix-wsproxy2deb new file mode 100755 index 0000000..e15beb5 --- /dev/null +++ b/mautrix-wsproxy2deb @@ -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 diff --git a/ressources/mautrix-syncproxy/mautrix-syncproxy b/ressources/mautrix-syncproxy/mautrix-syncproxy new file mode 100755 index 0000000..9d17dd7 --- /dev/null +++ b/ressources/mautrix-syncproxy/mautrix-syncproxy @@ -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 +} diff --git a/ressources/mautrix-syncproxy/rootfs/DEBIAN/changelog b/ressources/mautrix-syncproxy/rootfs/DEBIAN/changelog new file mode 100644 index 0000000..e69de29 diff --git a/ressources/mautrix-syncproxy/rootfs/DEBIAN/conffiles b/ressources/mautrix-syncproxy/rootfs/DEBIAN/conffiles new file mode 100644 index 0000000..f1998a8 --- /dev/null +++ b/ressources/mautrix-syncproxy/rootfs/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/default/mautrix-syncproxy diff --git a/ressources/mautrix-syncproxy/rootfs/DEBIAN/control b/ressources/mautrix-syncproxy/rootfs/DEBIAN/control new file mode 100644 index 0000000..00fb783 --- /dev/null +++ b/ressources/mautrix-syncproxy/rootfs/DEBIAN/control @@ -0,0 +1,7 @@ +Package: mautrix-syncproxy +Version: %VERSION% +Section: base +Priority: optional +Architecture: all +Maintainer: Thomas Legay +Description: mautrix-syncproxy diff --git a/ressources/mautrix-syncproxy/rootfs/DEBIAN/postinst b/ressources/mautrix-syncproxy/rootfs/DEBIAN/postinst new file mode 100755 index 0000000..80b24b6 --- /dev/null +++ b/ressources/mautrix-syncproxy/rootfs/DEBIAN/postinst @@ -0,0 +1,4 @@ +#!/bin/bash + +id mautrix-syncproxy &> /dev/null || useradd mautrix-syncproxy -r -s /bin/false -d / + diff --git a/ressources/mautrix-syncproxy/rootfs/etc/default/mautrix-syncproxy b/ressources/mautrix-syncproxy/rootfs/etc/default/mautrix-syncproxy new file mode 100644 index 0000000..93de775 --- /dev/null +++ b/ressources/mautrix-syncproxy/rootfs/etc/default/mautrix-syncproxy @@ -0,0 +1,5 @@ +DATABASE_URL=postgres://syncproxy:xxxxxxxxxx@postgres/syncproxy +HOMESERVER_URL=https://domaine.fr/ +LISTEN_ADDRESS=:29331 +SHARED_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +#DEBUG=true diff --git a/ressources/mautrix-syncproxy/rootfs/etc/systemd/system/mautrix-syncproxy.service b/ressources/mautrix-syncproxy/rootfs/etc/systemd/system/mautrix-syncproxy.service new file mode 100644 index 0000000..be4b33f --- /dev/null +++ b/ressources/mautrix-syncproxy/rootfs/etc/systemd/system/mautrix-syncproxy.service @@ -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 diff --git a/ressources/mautrix-wsproxy/mautrix-wsproxy b/ressources/mautrix-wsproxy/mautrix-wsproxy new file mode 100755 index 0000000..625c481 --- /dev/null +++ b/ressources/mautrix-wsproxy/mautrix-wsproxy @@ -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 +} diff --git a/ressources/mautrix-wsproxy/rootfs/DEBIAN/changelog b/ressources/mautrix-wsproxy/rootfs/DEBIAN/changelog new file mode 100644 index 0000000..e69de29 diff --git a/ressources/mautrix-wsproxy/rootfs/DEBIAN/conffiles b/ressources/mautrix-wsproxy/rootfs/DEBIAN/conffiles new file mode 100644 index 0000000..ac642c8 --- /dev/null +++ b/ressources/mautrix-wsproxy/rootfs/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/mautrix-wsproxy.yaml diff --git a/ressources/mautrix-wsproxy/rootfs/DEBIAN/control b/ressources/mautrix-wsproxy/rootfs/DEBIAN/control new file mode 100644 index 0000000..a2ed599 --- /dev/null +++ b/ressources/mautrix-wsproxy/rootfs/DEBIAN/control @@ -0,0 +1,7 @@ +Package: mautrix-wsproxy +Version: %VERSION% +Section: base +Priority: optional +Architecture: all +Maintainer: Thomas Legay +Description: mautrix-wsproxy diff --git a/ressources/mautrix-wsproxy/rootfs/DEBIAN/postinst b/ressources/mautrix-wsproxy/rootfs/DEBIAN/postinst new file mode 100755 index 0000000..79145c8 --- /dev/null +++ b/ressources/mautrix-wsproxy/rootfs/DEBIAN/postinst @@ -0,0 +1,4 @@ +#!/bin/bash + +id mautrix-wsproxy &> /dev/null || useradd mautrix-wsproxy -r -s /bin/false -d / + diff --git a/ressources/mautrix-wsproxy/rootfs/etc/systemd/system/mautrix-wsproxy.service b/ressources/mautrix-wsproxy/rootfs/etc/systemd/system/mautrix-wsproxy.service new file mode 100644 index 0000000..6b54c31 --- /dev/null +++ b/ressources/mautrix-wsproxy/rootfs/etc/systemd/system/mautrix-wsproxy.service @@ -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 diff --git a/ressources/tt-rss/rootfs/usr/share/doc/tt-rss/apache2-tt-rss.conf b/ressources/tt-rss/rootfs/usr/share/doc/tt-rss/apache2-tt-rss.conf index ce014d3..83faf11 100644 --- a/ressources/tt-rss/rootfs/usr/share/doc/tt-rss/apache2-tt-rss.conf +++ b/ressources/tt-rss/rootfs/usr/share/doc/tt-rss/apache2-tt-rss.conf @@ -1,12 +1,17 @@ - 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 - + Options -Indexes -MultiViews +FollowSymLinks AllowOverride all Require all granted - + + + + Require all denied + +