From 0ee365014251fc0a08f8bf97b36fd2646df3d6e1 Mon Sep 17 00:00:00 2001
From: s3lph <s3lph@kabelsalat.ch>
Date: Sat, 18 Jan 2025 19:52:42 +0100
Subject: [PATCH] chore: remove duplicated config for http-mqtt-bridge

---
 http-mqtt-bridge/http-mqtt-bridge/build.sh    | 52 -------------------
 .../http-mqtt-bridge/debian.conffiles         |  2 -
 .../http-mqtt-bridge/debian.control           | 11 ----
 .../http-mqtt-bridge.defaults                 |  5 --
 .../http-mqtt-bridge/http-mqtt-bridge.service | 14 -----
 .../http-mqtt-bridge/http-mqtt-bridge.site    | 32 ------------
 6 files changed, 116 deletions(-)
 delete mode 100755 http-mqtt-bridge/http-mqtt-bridge/build.sh
 delete mode 100644 http-mqtt-bridge/http-mqtt-bridge/debian.conffiles
 delete mode 100644 http-mqtt-bridge/http-mqtt-bridge/debian.control
 delete mode 100644 http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.defaults
 delete mode 100644 http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.service
 delete mode 100644 http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.site

diff --git a/http-mqtt-bridge/http-mqtt-bridge/build.sh b/http-mqtt-bridge/http-mqtt-bridge/build.sh
deleted file mode 100755
index 2da139c..0000000
--- a/http-mqtt-bridge/http-mqtt-bridge/build.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-
-set -exo pipefail
-
-
-ROOT=$(pwd)
-function fetch() {
-    apt install --assume-yes --no-install-recommends git golang-go
-    cd "${SRCDIR}"
-    git clone https://github.com/subzerobo/http-mqtt-bridge
-    cd http-mqtt-bridge
-    export VERSION=0.$(git rev-list --count HEAD)
-    go get ./...
-    go build -o http-mqtt-bridge
-}
-
-function prepare() {
-    chmod +x "${SRCDIR}/http-mqtt-bridge/http-mqtt-bridge"
-    mkdir -p \
-          "${PKGDIR}/DEBIAN" \
-          "${PKGDIR}/usr/bin" \
-          "${PKGDIR}/etc/default" \
-          "${PKGDIR}/etc/apache2/sites-available" \
-          "${PKGDIR}/lib/systemd/system"
-    cp "${SRCDIR}/http-mqtt-bridge/http-mqtt-bridge" "${PKGDIR}/usr/bin/http-mqtt-bridge"
-    cp "${ROOT}/http-mqtt-bridge.defaults" "${PKGDIR}/etc/default/http-mqtt-bridge"
-    cp "${ROOT}/http-mqtt-bridge.service" "${PKGDIR}/lib/systemd/system/http-mqtt-bridge.service"
-    cp "${ROOT}/http-mqtt-bridge.site" "${PKGDIR}/etc/apache2/sites-available/http-mqtt-bridge.site"
-    cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control"
-    cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles"
-    sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control"
-    sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control"
-    find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \;
-}
-
-function package() {
-    cd "${BUILDDIR}"
-    dpkg-deb --build "${PKGDIR}" "${BUILDDIR}"
-}
-
-function build() {
-    export BUILDDIR=${ROOT}/build
-    export SRCDIR=${ROOT}/build/srcdir
-    export PKGDIR=${ROOT}/build/pkgdir
-    mkdir -p ${SRCDIR} ${PKGDIR}
-    fetch
-    prepare
-    package
-}
- 
-
-build
diff --git a/http-mqtt-bridge/http-mqtt-bridge/debian.conffiles b/http-mqtt-bridge/http-mqtt-bridge/debian.conffiles
deleted file mode 100644
index 77730e5..0000000
--- a/http-mqtt-bridge/http-mqtt-bridge/debian.conffiles
+++ /dev/null
@@ -1,2 +0,0 @@
-/etc/default/http-mqtt-bridge
-/etc/apache2/sites-available/http-mqtt-bridge.site
diff --git a/http-mqtt-bridge/http-mqtt-bridge/debian.control b/http-mqtt-bridge/http-mqtt-bridge/debian.control
deleted file mode 100644
index c399dbe..0000000
--- a/http-mqtt-bridge/http-mqtt-bridge/debian.control
+++ /dev/null
@@ -1,11 +0,0 @@
-Package: http-mqtt-bridge
-Version: __VERSION__
-Maintainer: __MAINTAINER__
-Section: web
-Priority: optional
-Architecture: amd64
-Recommends: apache2
-Description: Rewrite HTTP POST requests into MQTT PUB requests
- The HTTP to MQTT bridge should fill that gap of IFTTT Actions for
- your Custom IoT Hardwares.  The idea is to receive signals using HTTP
- requests and transfer them to your MQTT broker.
diff --git a/http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.defaults b/http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.defaults
deleted file mode 100644
index 3ab50a1..0000000
--- a/http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.defaults
+++ /dev/null
@@ -1,5 +0,0 @@
-MQTT_HOST=localhost:1883
-#MQTT_USER=
-#MQTT_PASS=
-AUTH_USERNAME=hmb
-AUTH_PASSWORD=hmb
\ No newline at end of file
diff --git a/http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.service b/http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.service
deleted file mode 100644
index ed0a8e1..0000000
--- a/http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.service
+++ /dev/null
@@ -1,14 +0,0 @@
-[Unit]
-Description=HTTP to MQTT Bridge
-After=network-online.target
-Wants=network-online.target
-
-[Service]
-EnvironmentFile=-/etc/default/http-mqtt-bridge
-ExecStart=/usr/bin/http-mqtt-bridge start
-DynamicUser=true
-CapabilityBoundingSet=
-Restart=on-failure
-
-[Install]
-WantedBy=multi-user.target
\ No newline at end of file
diff --git a/http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.site b/http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.site
deleted file mode 100644
index 899c383..0000000
--- a/http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.site
+++ /dev/null
@@ -1,32 +0,0 @@
-<VirtualHost *:80>
-	ServerName mqtt.example.com
-	ServerAdmin webmaster@localhost
-	
-	DocumentRoot /var/www/html
-
-	# Reverse Proxy for HTTP-MQTT-Bridge
-	ProxyPass / http://localhost:8090/
-	ProxyPassReverse / http://localhost:8090/
-	# Static auth header (hmb:hmb)
-	#RequestHeader set "Authorization" "Basic aG1iOmhtYg=="
-
-	# Configure CORS headers
-	Header always set "Access-Control-Allow-Origin" "*"
-	Header always set "Access-Control-Allow-Methods" "GET, POST, OPTIONS"
-	Header always set "Access-Control-Allow-Headers" "Content-Type"
-
-	# Stop CORB complaints by overwriting text/html with application/json
-	Header always set "Content-Type" "application/json"
-
-	# Make OPTIONS request work by forcibly returning a 200 OK header
-	# even though the backend returns a 405
-	RewriteEngine on
-	RewriteCond %{REQUEST_METHOD} OPTIONS
-	RewriteRule ^(.*)$ $1 [R=200,L]
-
-	ErrorLog ${APACHE_LOG_DIR}/error.log
-	CustomLog ${APACHE_LOG_DIR}/access.log combined
-
-</VirtualHost>
-
-# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
\ No newline at end of file