From 8681875d9811c3334d795590784f52cbfe4889d0 Mon Sep 17 00:00:00 2001 From: Thomas Legay Date: Mon, 30 Jan 2023 16:16:00 +0100 Subject: [PATCH] Add postfixadmin --- ressources/postfixadmin/README.MD | 20 +++++++ ressources/postfixadmin/debian/README | 6 ++ ressources/postfixadmin/debian/changelog | 59 +++++++++++++++++++ ressources/postfixadmin/debian/conffiles | 1 + ressources/postfixadmin/debian/control | 12 ++++ ressources/postfixadmin/debian/copyright | 29 +++++++++ .../debian/mautrix-whatsapp.install | 2 + .../debian/mautrix-whatsapp.service | 35 +++++++++++ ressources/postfixadmin/debian/postinst | 4 ++ ressources/postfixadmin/debian/rules | 28 +++++++++ ressources/postfixadmin/debian/source/format | 1 + ressources/postfixadmin/debmaker | 31 ++++++++++ 12 files changed, 228 insertions(+) create mode 100644 ressources/postfixadmin/README.MD create mode 100644 ressources/postfixadmin/debian/README create mode 100644 ressources/postfixadmin/debian/changelog create mode 100644 ressources/postfixadmin/debian/conffiles create mode 100644 ressources/postfixadmin/debian/control create mode 100644 ressources/postfixadmin/debian/copyright create mode 100644 ressources/postfixadmin/debian/mautrix-whatsapp.install create mode 100644 ressources/postfixadmin/debian/mautrix-whatsapp.service create mode 100755 ressources/postfixadmin/debian/postinst create mode 100755 ressources/postfixadmin/debian/rules create mode 100644 ressources/postfixadmin/debian/source/format create mode 100755 ressources/postfixadmin/debmaker diff --git a/ressources/postfixadmin/README.MD b/ressources/postfixadmin/README.MD new file mode 100644 index 0000000..8a75bd4 --- /dev/null +++ b/ressources/postfixadmin/README.MD @@ -0,0 +1,20 @@ +#### mautrix-whatsapp + +##### Information +Site : https://docs.mau.fi/bridges/go/whatsapp/index.html + +Source : https://github.com/mautrix/whatsapp + +##### Install + +``` +apt install -y wget ca-certificates +wget -qO - https://deb.lgy.fr/install.sh | bash +apt-get update +apt-get install -y mautrix-whatsapp + +#see https://docs.mau.fi/bridges/go/whatsapp/setup/index.html#configuring-and-running + +systemctl enable --now mautrix-whatsapp +``` + diff --git a/ressources/postfixadmin/debian/README b/ressources/postfixadmin/debian/README new file mode 100644 index 0000000..05ef0e4 --- /dev/null +++ b/ressources/postfixadmin/debian/README @@ -0,0 +1,6 @@ +The Debian Package vnctv +---------------------------- + +Comments regarding the Package + + -- Thomas Leagy Sun, 03 Apr 2022 12:36:14 +0200 diff --git a/ressources/postfixadmin/debian/changelog b/ressources/postfixadmin/debian/changelog new file mode 100644 index 0000000..d6e4eb7 --- /dev/null +++ b/ressources/postfixadmin/debian/changelog @@ -0,0 +1,59 @@ +mautrix-whatsapp (0.8.1) UNRELEASED; urgency=medium + + * First deb version + + -- Thomas Legay Mon, 17 Sep 2022 21:08:37 +0200 + +mautrix-whatsapp (0.8.0) UNRELEASED; urgency=medium + + * First deb version + + -- Thomas Legay Mon, 17 Sep 2022 21:08:37 +0200 + +mautrix-whatsapp (0.7.2) UNRELEASED; urgency=medium + + * First deb version + + -- Thomas Legay Mon, 17 Sep 2022 21:08:37 +0200 + +mautrix-whatsapp (0.7.1) UNRELEASED; urgency=medium + + * First deb version + + -- Thomas Legay Mon, 17 Sep 2022 21:08:37 +0200 + +mautrix-whatsapp (0.7) UNRELEASED; urgency=medium + + * First deb version + + -- Thomas Legay Mon, 17 Sep 2022 21:08:37 +0200 + +mautrix-whatsapp (0.6.1) UNRELEASED; urgency=medium + + * First deb version + + -- Thomas Legay Mon, 17 Jul 2022 21:08:37 +0200 + +mautrix-whatsapp (0.6.0) UNRELEASED; urgency=medium + + * First deb version + + -- Thomas Legay Mon, 17 Jul 2022 21:08:37 +0200 + +mautrix-whatsapp (0.5.0) UNRELEASED; urgency=medium + + * First deb version + + -- Thomas Legay Mon, 03 Jul 2022 21:08:37 +0200 + +mautrix-whatsapp (0.4.0) UNRELEASED; urgency=medium + + * First deb version + + -- Thomas Legay Mon, 17 May 2022 21:08:37 +0200 + +mautrix-whatsapp (0.3.1) UNRELEASED; urgency=medium + + * First deb version + + -- Thomas Legay Mon, 18 Apr 2022 00:26:37 +0200 diff --git a/ressources/postfixadmin/debian/conffiles b/ressources/postfixadmin/debian/conffiles new file mode 100644 index 0000000..6dd2818 --- /dev/null +++ b/ressources/postfixadmin/debian/conffiles @@ -0,0 +1 @@ +/etc/mautrix-whatsapp/config.yaml diff --git a/ressources/postfixadmin/debian/control b/ressources/postfixadmin/debian/control new file mode 100644 index 0000000..0305f32 --- /dev/null +++ b/ressources/postfixadmin/debian/control @@ -0,0 +1,12 @@ +Source: mautrix-whatsapp +Section: base +Priority: optional +Maintainer: Thomas Legay +Build-Depends: debhelper-compat (= 13), golang (>= 16) +Standards-Version: 3.9.8 + + +Package: mautrix-whatsapp +Architecture: all +Depends: libolm3 +Description: mautrix-whatsapp bridge diff --git a/ressources/postfixadmin/debian/copyright b/ressources/postfixadmin/debian/copyright new file mode 100644 index 0000000..3a3b409 --- /dev/null +++ b/ressources/postfixadmin/debian/copyright @@ -0,0 +1,29 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: mautrix-whatsapp +Upstream-Contact: +Source: + +Files: * +Copyright: 2022 tulir +License: GPL-3.0+ + +Files: debian/* +Copyright: 2022 Thomas Legay +License: GPL-3.0+ + +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". diff --git a/ressources/postfixadmin/debian/mautrix-whatsapp.install b/ressources/postfixadmin/debian/mautrix-whatsapp.install new file mode 100644 index 0000000..6ccbe91 --- /dev/null +++ b/ressources/postfixadmin/debian/mautrix-whatsapp.install @@ -0,0 +1,2 @@ +mautrix-whatsapp usr/lib/mautrix-whatsapp/ +config.yaml etc/mautrix-whatsapp/ diff --git a/ressources/postfixadmin/debian/mautrix-whatsapp.service b/ressources/postfixadmin/debian/mautrix-whatsapp.service new file mode 100644 index 0000000..2f1c8ed --- /dev/null +++ b/ressources/postfixadmin/debian/mautrix-whatsapp.service @@ -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 diff --git a/ressources/postfixadmin/debian/postinst b/ressources/postfixadmin/debian/postinst new file mode 100755 index 0000000..9aa9e5b --- /dev/null +++ b/ressources/postfixadmin/debian/postinst @@ -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/ diff --git a/ressources/postfixadmin/debian/rules b/ressources/postfixadmin/debian/rules new file mode 100755 index 0000000..f8114e7 --- /dev/null +++ b/ressources/postfixadmin/debian/rules @@ -0,0 +1,28 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +%: + dh $@ + +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- \ +# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) + +override_dh_auto_build: + ./build.sh + cp example-config.yaml config.yaml diff --git a/ressources/postfixadmin/debian/source/format b/ressources/postfixadmin/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/ressources/postfixadmin/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/ressources/postfixadmin/debmaker b/ressources/postfixadmin/debmaker new file mode 100755 index 0000000..d45a972 --- /dev/null +++ b/ressources/postfixadmin/debmaker @@ -0,0 +1,31 @@ +#!/bin/bash + +VERSION=3.3.13 +APP=postfixadmin +DEPOT=https://github.com/postfixadmin/postfixadmin.git +GIT_VERSION=postfixadmin-${VERSION} +DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M) +DEBIAN_VERSION_CODENAME=bullseye +IMAGE_SIZE=4 +PACKAGE_DEPENDENCY="debhelper-compat build-essential:native dh-apache2 composer php-sqlite3 php-mysql php-xml" + +main(){ + base_package_upgrade + install_package_dependency + get_git_source + build + makedeb +} + +build(){ + cd /tmp/${APP}/ + composer -n install + composer -n build + echo -e "postfixadmin (${DEB_VERSION}) unstable; urgency=medium\n\n * fake changelog\n\n Thomas Legay $(date -R)" > debian/changelog +} + +makedeb(){ + cd /tmp/${APP}/ + make -f debian/rules binary-indep + cp /tmp/*.deb /tmp/dist +}