From 4fe6ccd91ca6cc7f31a33bbc277a7b1f0c786964 Mon Sep 17 00:00:00 2001 From: s3lph Date: Tue, 5 Dec 2023 23:40:22 +0100 Subject: [PATCH] feat:migration from gitlab --- .forgejo/workflows/package.yml | 70 + .gitignore | 1 + .skel/helpers.sh | 9 + .skel/maubot-plugin.sh | 44 + LICENSE | 20 + README.md | 47 + ansible-semaphore/build.sh | 65 + ansible-semaphore/config.json | 1 + ansible-semaphore/debian.conffiles | 1 + ansible-semaphore/debian.control | 11 + ansible-semaphore/debian.postinst | 25 + ansible-semaphore/debian.postrm | 9 + ansible-semaphore/debian.prerm | 9 + ansible-semaphore/semaphore.service | 19 + atlasswprobe/atlasswprobe/build.sh | 16 + atlasswprobe/build.sh | 16 + daliserver/build.sh | 35 + daliserver/daliserver/build.sh | 35 + forgejo-runner/build.sh | 56 + forgejo-runner/debian.conffiles | 1 + forgejo-runner/debian.control | 10 + forgejo-runner/debian.postinst | 25 + forgejo-runner/debian.postrm | 9 + forgejo-runner/debian.prerm | 9 + forgejo-runner/forgejo-runner-cli | 4 + forgejo-runner/forgejo-runner.service | 14 + forgejo/app.ini | 0 forgejo/build.sh | 62 + forgejo/debian.conffiles | 1 + forgejo/debian.control | 13 + forgejo/debian.postinst | 25 + forgejo/debian.postrm | 9 + forgejo/debian.prerm | 9 + forgejo/forgejo/app.ini | 0 forgejo/forgejo/build.sh | 62 + forgejo/forgejo/debian.conffiles | 1 + forgejo/forgejo/debian.control | 13 + forgejo/forgejo/debian.postinst | 25 + forgejo/forgejo/debian.postrm | 9 + forgejo/forgejo/debian.prerm | 9 + forgejo/forgejo/gitea.service | 32 + forgejo/gitea.service | 32 + http-mqtt-bridge/build.sh | 52 + http-mqtt-bridge/debian.conffiles | 2 + http-mqtt-bridge/debian.control | 11 + http-mqtt-bridge/http-mqtt-bridge.defaults | 5 + http-mqtt-bridge/http-mqtt-bridge.service | 14 + http-mqtt-bridge/http-mqtt-bridge.site | 32 + 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 + keycloak-23/build.sh | 68 + keycloak-23/debian.conffiles | 3 + keycloak-23/debian.control | 16 + keycloak-23/debian.copyright | 6 + keycloak-23/debian.postinst | 22 + keycloak-23/keycloak-23/build.sh | 68 + keycloak-23/keycloak-23/debian.conffiles | 3 + keycloak-23/keycloak-23/debian.control | 16 + keycloak-23/keycloak-23/debian.copyright | 6 + keycloak-23/keycloak-23/debian.postinst | 22 + keycloak-23/keycloak-23/keycloak.service | 22 + keycloak-23/keycloak-23/keycloak.site.conf | 31 + keycloak-23/keycloak.service | 22 + keycloak-23/keycloak.site.conf | 31 + .../ath_regd.patch | 34 + linux-diversion-ath-regd-optional/build.sh | 116 ++ .../debian.meta/changelog | 5 + .../debian.meta/control | 14 + .../debian.meta/copyright | 20 + .../debian/changelog | 5 + .../debian/control | 14 + .../debian/copyright | 20 + .../debian/postinst | 17 + .../debian/postrm | 20 + .../debian/preinst | 7 + lottieconverter/build.sh | 47 + lottieconverter/debian.control | 9 + lottieconverter/lottieconverter/build.sh | 47 + .../lottieconverter/debian.control | 9 + matrix-element-web/debian.conffiles | 2 + matrix-element-web/debian.control | 9 + .../matrix-element-web.site.conf | 24 + .../matrix-element-web/debian.conffiles | 2 + .../matrix-element-web/debian.control | 9 + .../matrix-element-web.site.conf | 24 + .../matrix-element-web/package.sh | 55 + matrix-element-web/package.sh | 55 + matrix-hydrogen/build.sh | 55 + matrix-hydrogen/debian.conffiles | 2 + matrix-hydrogen/debian.control | 10 + matrix-hydrogen/matrix-hydrogen.site.conf | 47 + matrix-hydrogen/matrix-hydrogen/build.sh | 55 + .../matrix-hydrogen/debian.conffiles | 2 + .../matrix-hydrogen/debian.control | 10 + .../matrix-hydrogen/matrix-hydrogen.site.conf | 47 + matrix.to/build.sh | 66 + matrix.to/debian.control | 11 + matterbridge/build.sh | 62 + matterbridge/debian.conffiles | 2 + matterbridge/debian.control | 9 + matterbridge/debian.postinst | 26 + matterbridge/debian.postrm | 9 + matterbridge/debian.prerm | 9 + .../matterbridge-upload-cleanup.service | 10 + .../matterbridge-upload-cleanup.timer | 9 + matterbridge/matterbridge.default | 20 + matterbridge/matterbridge.service | 14 + matterbridge/matterbridge.toml | 9 + matterbridge/matterbridge.toml.sample | 1828 +++++++++++++++++ matterbridge/matterbridge/build.sh | 62 + matterbridge/matterbridge/debian.conffiles | 2 + matterbridge/matterbridge/debian.control | 9 + matterbridge/matterbridge/debian.postinst | 26 + matterbridge/matterbridge/debian.postrm | 9 + matterbridge/matterbridge/debian.prerm | 9 + .../matterbridge-upload-cleanup.service | 10 + .../matterbridge-upload-cleanup.timer | 9 + .../matterbridge/matterbridge.default | 20 + .../matterbridge/matterbridge.service | 14 + matterbridge/matterbridge/matterbridge.toml | 9 + .../matterbridge/matterbridge.toml.sample | 1828 +++++++++++++++++ maubot-plugin-spaceapi/build.sh | 5 + maubot-plugin-spaceapi/debian.control | 8 + .../maubot-plugin-spaceapi/build.sh | 5 + .../maubot-plugin-spaceapi/debian.control | 8 + maubot-plugin-ultimaker/build.sh | 5 + maubot-plugin-ultimaker/debian.control | 8 + maubot/build.sh | 87 + maubot/debian.conffiles | 2 + maubot/debian.control | 8 + maubot/debian.postinst | 25 + maubot/debian.postrm | 9 + maubot/debian.prerm | 9 + maubot/maubot.default | 9 + maubot/maubot.service | 16 + maubot/maubot/build.sh | 87 + maubot/maubot/debian.conffiles | 2 + maubot/maubot/debian.control | 8 + maubot/maubot/debian.postinst | 25 + maubot/maubot/debian.postrm | 9 + maubot/maubot/debian.prerm | 9 + maubot/maubot/maubot.default | 9 + maubot/maubot/maubot.service | 16 + mautrix-signal/build.sh | 66 + mautrix-signal/debian.conffiles | 2 + mautrix-signal/debian.control | 9 + mautrix-signal/debian.postinst | 23 + mautrix-signal/debian.postrm | 9 + mautrix-signal/debian.prerm | 9 + mautrix-signal/mautrix-signal.default | 10 + mautrix-signal/mautrix-signal.service | 15 + mautrix-signal/mautrix-signal/build.sh | 66 + .../mautrix-signal/debian.conffiles | 2 + mautrix-signal/mautrix-signal/debian.control | 9 + mautrix-signal/mautrix-signal/debian.postinst | 23 + mautrix-signal/mautrix-signal/debian.postrm | 9 + mautrix-signal/mautrix-signal/debian.prerm | 9 + .../mautrix-signal/mautrix-signal.default | 10 + .../mautrix-signal/mautrix-signal.service | 15 + mautrix-telegram/build.sh | 74 + mautrix-telegram/debian.conffiles | 2 + mautrix-telegram/debian.control | 9 + mautrix-telegram/debian.postinst | 23 + mautrix-telegram/debian.postrm | 9 + mautrix-telegram/debian.prerm | 9 + mautrix-telegram/mautrix-telegram.default | 10 + mautrix-telegram/mautrix-telegram.service | 15 + .../package.sh | 60 + .../package.sh | 60 + .../package.sh | 60 + .../package.sh | 60 + mediawiki-extension-openidconnect/package.sh | 60 + .../package.sh | 60 + mediawiki-extension-pluggableauth/package.sh | 60 + mqtt2prometheus/build.sh | 60 + mqtt2prometheus/debian.conffiles | 1 + mqtt2prometheus/debian.control | 7 + mqtt2prometheus/debian.postinst | 12 + mqtt2prometheus/debian.postrm | 9 + mqtt2prometheus/debian.prerm | 9 + mqtt2prometheus/mqtt2prometheus.service | 13 + mqtt2prometheus/mqtt2prometheus/build.sh | 60 + .../mqtt2prometheus/debian.conffiles | 1 + .../mqtt2prometheus/debian.control | 7 + .../mqtt2prometheus/debian.postinst | 12 + mqtt2prometheus/mqtt2prometheus/debian.postrm | 9 + mqtt2prometheus/mqtt2prometheus/debian.prerm | 9 + .../mqtt2prometheus/mqtt2prometheus.service | 13 + mumble-web-data/build.sh | 49 + mumble-web-data/debian.conffiles | 2 + mumble-web-data/debian.control | 12 + mumble-web-data/mumble-web.site | 31 + mumble-web-proxy/build.sh | 48 + mumble-web-proxy/debian.conffiles | 1 + mumble-web-proxy/debian.control | 12 + mumble-web-proxy/mumble-web-proxy.conf | 26 + mumble-web-proxy/mumble-web-proxy/build.sh | 48 + .../mumble-web-proxy/debian.conffiles | 1 + .../mumble-web-proxy/debian.control | 12 + .../mumble-web-proxy/mumble-web-proxy.conf | 26 + .../mumble-web-proxy@.service | 13 + mumble-web-proxy/mumble-web-proxy@.service | 13 + mumble-web/build.sh | 36 + mumble-web/debian.conffiles | 1 + mumble-web/debian.control | 12 + mumble-web/mumble-web.defaults | 2 + mumble-web/mumble-web.service | 15 + mumble-web/mumble-web.site | 25 + prometheus-dnsbl-exporter/build.sh | 58 + prometheus-dnsbl-exporter/debian.conffiles | 3 + prometheus-dnsbl-exporter/debian.control | 9 + .../prometheus-dnsbl-exporter.defaults | 13 + .../prometheus-dnsbl-exporter.service | 13 + .../prometheus-dnsbl-exporter/build.sh | 58 + .../debian.conffiles | 3 + .../prometheus-dnsbl-exporter/debian.control | 9 + .../prometheus-dnsbl-exporter.defaults | 13 + .../prometheus-dnsbl-exporter.service | 13 + .../prometheus-dnsbl-exporter/rbls.ini | 98 + .../prometheus-dnsbl-exporter/targets.ini | 4 + prometheus-dnsbl-exporter/rbls.ini | 98 + prometheus-dnsbl-exporter/targets.ini | 4 + prometheus-ipmi-exporter/build.sh | 65 + prometheus-ipmi-exporter/config.yaml | 22 + prometheus-ipmi-exporter/debian.conffiles | 3 + prometheus-ipmi-exporter/debian.control | 10 + prometheus-ipmi-exporter/debian.postinst | 23 + .../prometheus-ipmi-exporter.defaults | 11 + .../prometheus-ipmi-exporter.service | 13 + .../prometheus-ipmi-exporter.sudoers | 7 + prometheus2influxdb/build.sh | 51 + prometheus2influxdb/debian.conffiles | 2 + prometheus2influxdb/debian.control | 9 + prometheus2influxdb/debian.postinst | 22 + prometheus2influxdb/debian.postrm | 9 + prometheus2influxdb/debian.prerm | 9 + .../prometheus2influxdb.defaults | 2 + .../prometheus2influxdb.service | 12 + prometheus2influxdb/prometheus2influxdb.timer | 9 + .../prometheus2influxdb/build.sh | 51 + .../prometheus2influxdb/debian.conffiles | 2 + .../prometheus2influxdb/debian.control | 9 + .../prometheus2influxdb/debian.postinst | 22 + .../prometheus2influxdb/debian.postrm | 9 + .../prometheus2influxdb/debian.prerm | 9 + .../prometheus2influxdb.defaults | 2 + .../prometheus2influxdb.service | 12 + .../prometheus2influxdb.timer | 9 + python3-mautrix/build.sh | 54 + python3-mautrix/debian.control | 8 + python3-mautrix/python3-mautrix/build.sh | 54 + .../python3-mautrix/debian.control | 8 + python3-telethon/build.sh | 60 + python3-telethon/debian.control | 8 + python3-telethon/python3-telethon/build.sh | 60 + .../python3-telethon/debian.control | 8 + repo.s3lph.me-apt-source/debian.changelog | 5 + repo.s3lph.me-apt-source/debian.conffiles | 1 + repo.s3lph.me-apt-source/debian.control | 10 + repo.s3lph.me-apt-source/debian.copyright | 9 + .../gitkabelsalatch-s3lph.asc | 29 + .../gitkabelsalatch-s3lph.sources | 6 + repo.s3lph.me-apt-source/package.sh | 25 + .../repo.s3lph.me-apt-source/debian.changelog | 5 + .../repo.s3lph.me-apt-source/debian.conffiles | 1 + .../repo.s3lph.me-apt-source/debian.control | 10 + .../repo.s3lph.me-apt-source/debian.copyright | 9 + .../gitkabelsalatch-s3lph.asc | 29 + .../gitkabelsalatch-s3lph.sources | 6 + .../repo.s3lph.me-apt-source/package.sh | 25 + republik-feeder/build.sh | 57 + republik-feeder/debian.conffiles | 1 + republik-feeder/debian.control | 10 + republik-feeder/republik-feeder.defaults | 4 + republik-feeder/republik-feeder.service | 14 + republik-feeder/republik-feeder/build.sh | 57 + .../republik-feeder/debian.conffiles | 1 + .../republik-feeder/debian.control | 10 + .../republik-feeder/republik-feeder.defaults | 4 + .../republik-feeder/republik-feeder.service | 14 + woodpecker-agent/agent.conf | 1 + woodpecker-agent/build.sh | 58 + woodpecker-agent/debian.conffiles | 2 + woodpecker-agent/debian.control | 10 + woodpecker-agent/debian.postinst | 21 + woodpecker-agent/debian.postrm | 9 + woodpecker-agent/debian.prerm | 9 + woodpecker-agent/woodpecker-agent.default | 39 + woodpecker-agent/woodpecker-agent.service | 10 + woodpecker-agent/woodpecker-agent/agent.conf | 1 + woodpecker-agent/woodpecker-agent/build.sh | 58 + .../woodpecker-agent/debian.conffiles | 2 + .../woodpecker-agent/debian.control | 10 + .../woodpecker-agent/debian.postinst | 21 + .../woodpecker-agent/debian.postrm | 9 + .../woodpecker-agent/debian.prerm | 9 + .../woodpecker-agent/woodpecker-agent.default | 39 + .../woodpecker-agent/woodpecker-agent.service | 10 + woodpecker-cli/build.sh | 49 + woodpecker-cli/debian.control | 8 + woodpecker-server/build.sh | 56 + woodpecker-server/debian.conffiles | 1 + woodpecker-server/debian.control | 10 + woodpecker-server/debian.postinst | 21 + woodpecker-server/debian.postrm | 9 + woodpecker-server/debian.prerm | 9 + woodpecker-server/woodpecker-server.default | 140 ++ woodpecker-server/woodpecker-server.service | 12 + 312 files changed, 10182 insertions(+) create mode 100644 .forgejo/workflows/package.yml create mode 100644 .gitignore create mode 100644 .skel/helpers.sh create mode 100644 .skel/maubot-plugin.sh create mode 100644 LICENSE create mode 100644 README.md create mode 100755 ansible-semaphore/build.sh create mode 100644 ansible-semaphore/config.json create mode 100644 ansible-semaphore/debian.conffiles create mode 100644 ansible-semaphore/debian.control create mode 100755 ansible-semaphore/debian.postinst create mode 100755 ansible-semaphore/debian.postrm create mode 100755 ansible-semaphore/debian.prerm create mode 100644 ansible-semaphore/semaphore.service create mode 100755 atlasswprobe/atlasswprobe/build.sh create mode 100755 atlasswprobe/build.sh create mode 100755 daliserver/build.sh create mode 100755 daliserver/daliserver/build.sh create mode 100755 forgejo-runner/build.sh create mode 100644 forgejo-runner/debian.conffiles create mode 100644 forgejo-runner/debian.control create mode 100755 forgejo-runner/debian.postinst create mode 100755 forgejo-runner/debian.postrm create mode 100755 forgejo-runner/debian.prerm create mode 100755 forgejo-runner/forgejo-runner-cli create mode 100644 forgejo-runner/forgejo-runner.service create mode 100644 forgejo/app.ini create mode 100755 forgejo/build.sh create mode 100644 forgejo/debian.conffiles create mode 100644 forgejo/debian.control create mode 100755 forgejo/debian.postinst create mode 100755 forgejo/debian.postrm create mode 100755 forgejo/debian.prerm create mode 100644 forgejo/forgejo/app.ini create mode 100755 forgejo/forgejo/build.sh create mode 100644 forgejo/forgejo/debian.conffiles create mode 100644 forgejo/forgejo/debian.control create mode 100755 forgejo/forgejo/debian.postinst create mode 100755 forgejo/forgejo/debian.postrm create mode 100755 forgejo/forgejo/debian.prerm create mode 100644 forgejo/forgejo/gitea.service create mode 100644 forgejo/gitea.service create mode 100755 http-mqtt-bridge/build.sh create mode 100644 http-mqtt-bridge/debian.conffiles create mode 100644 http-mqtt-bridge/debian.control create mode 100644 http-mqtt-bridge/http-mqtt-bridge.defaults create mode 100644 http-mqtt-bridge/http-mqtt-bridge.service create mode 100644 http-mqtt-bridge/http-mqtt-bridge.site create mode 100755 http-mqtt-bridge/http-mqtt-bridge/build.sh create mode 100644 http-mqtt-bridge/http-mqtt-bridge/debian.conffiles create mode 100644 http-mqtt-bridge/http-mqtt-bridge/debian.control create mode 100644 http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.defaults create mode 100644 http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.service create mode 100644 http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.site create mode 100755 keycloak-23/build.sh create mode 100644 keycloak-23/debian.conffiles create mode 100644 keycloak-23/debian.control create mode 100644 keycloak-23/debian.copyright create mode 100755 keycloak-23/debian.postinst create mode 100755 keycloak-23/keycloak-23/build.sh create mode 100644 keycloak-23/keycloak-23/debian.conffiles create mode 100644 keycloak-23/keycloak-23/debian.control create mode 100644 keycloak-23/keycloak-23/debian.copyright create mode 100755 keycloak-23/keycloak-23/debian.postinst create mode 100644 keycloak-23/keycloak-23/keycloak.service create mode 100644 keycloak-23/keycloak-23/keycloak.site.conf create mode 100644 keycloak-23/keycloak.service create mode 100644 keycloak-23/keycloak.site.conf create mode 100644 linux-diversion-ath-regd-optional/ath_regd.patch create mode 100755 linux-diversion-ath-regd-optional/build.sh create mode 100644 linux-diversion-ath-regd-optional/debian.meta/changelog create mode 100644 linux-diversion-ath-regd-optional/debian.meta/control create mode 100644 linux-diversion-ath-regd-optional/debian.meta/copyright create mode 100644 linux-diversion-ath-regd-optional/debian/changelog create mode 100644 linux-diversion-ath-regd-optional/debian/control create mode 100644 linux-diversion-ath-regd-optional/debian/copyright create mode 100755 linux-diversion-ath-regd-optional/debian/postinst create mode 100755 linux-diversion-ath-regd-optional/debian/postrm create mode 100755 linux-diversion-ath-regd-optional/debian/preinst create mode 100755 lottieconverter/build.sh create mode 100644 lottieconverter/debian.control create mode 100755 lottieconverter/lottieconverter/build.sh create mode 100644 lottieconverter/lottieconverter/debian.control create mode 100644 matrix-element-web/debian.conffiles create mode 100644 matrix-element-web/debian.control create mode 100644 matrix-element-web/matrix-element-web.site.conf create mode 100644 matrix-element-web/matrix-element-web/debian.conffiles create mode 100644 matrix-element-web/matrix-element-web/debian.control create mode 100644 matrix-element-web/matrix-element-web/matrix-element-web.site.conf create mode 100755 matrix-element-web/matrix-element-web/package.sh create mode 100755 matrix-element-web/package.sh create mode 100755 matrix-hydrogen/build.sh create mode 100644 matrix-hydrogen/debian.conffiles create mode 100644 matrix-hydrogen/debian.control create mode 100644 matrix-hydrogen/matrix-hydrogen.site.conf create mode 100755 matrix-hydrogen/matrix-hydrogen/build.sh create mode 100644 matrix-hydrogen/matrix-hydrogen/debian.conffiles create mode 100644 matrix-hydrogen/matrix-hydrogen/debian.control create mode 100644 matrix-hydrogen/matrix-hydrogen/matrix-hydrogen.site.conf create mode 100755 matrix.to/build.sh create mode 100644 matrix.to/debian.control create mode 100755 matterbridge/build.sh create mode 100644 matterbridge/debian.conffiles create mode 100644 matterbridge/debian.control create mode 100755 matterbridge/debian.postinst create mode 100755 matterbridge/debian.postrm create mode 100755 matterbridge/debian.prerm create mode 100644 matterbridge/matterbridge-upload-cleanup.service create mode 100644 matterbridge/matterbridge-upload-cleanup.timer create mode 100644 matterbridge/matterbridge.default create mode 100644 matterbridge/matterbridge.service create mode 100644 matterbridge/matterbridge.toml create mode 100644 matterbridge/matterbridge.toml.sample create mode 100755 matterbridge/matterbridge/build.sh create mode 100644 matterbridge/matterbridge/debian.conffiles create mode 100644 matterbridge/matterbridge/debian.control create mode 100755 matterbridge/matterbridge/debian.postinst create mode 100755 matterbridge/matterbridge/debian.postrm create mode 100755 matterbridge/matterbridge/debian.prerm create mode 100644 matterbridge/matterbridge/matterbridge-upload-cleanup.service create mode 100644 matterbridge/matterbridge/matterbridge-upload-cleanup.timer create mode 100644 matterbridge/matterbridge/matterbridge.default create mode 100644 matterbridge/matterbridge/matterbridge.service create mode 100644 matterbridge/matterbridge/matterbridge.toml create mode 100644 matterbridge/matterbridge/matterbridge.toml.sample create mode 100755 maubot-plugin-spaceapi/build.sh create mode 100644 maubot-plugin-spaceapi/debian.control create mode 100755 maubot-plugin-spaceapi/maubot-plugin-spaceapi/build.sh create mode 100644 maubot-plugin-spaceapi/maubot-plugin-spaceapi/debian.control create mode 100755 maubot-plugin-ultimaker/build.sh create mode 100644 maubot-plugin-ultimaker/debian.control create mode 100755 maubot/build.sh create mode 100644 maubot/debian.conffiles create mode 100644 maubot/debian.control create mode 100755 maubot/debian.postinst create mode 100755 maubot/debian.postrm create mode 100755 maubot/debian.prerm create mode 100644 maubot/maubot.default create mode 100644 maubot/maubot.service create mode 100755 maubot/maubot/build.sh create mode 100644 maubot/maubot/debian.conffiles create mode 100644 maubot/maubot/debian.control create mode 100755 maubot/maubot/debian.postinst create mode 100755 maubot/maubot/debian.postrm create mode 100755 maubot/maubot/debian.prerm create mode 100644 maubot/maubot/maubot.default create mode 100644 maubot/maubot/maubot.service create mode 100755 mautrix-signal/build.sh create mode 100644 mautrix-signal/debian.conffiles create mode 100644 mautrix-signal/debian.control create mode 100755 mautrix-signal/debian.postinst create mode 100755 mautrix-signal/debian.postrm create mode 100755 mautrix-signal/debian.prerm create mode 100644 mautrix-signal/mautrix-signal.default create mode 100644 mautrix-signal/mautrix-signal.service create mode 100755 mautrix-signal/mautrix-signal/build.sh create mode 100644 mautrix-signal/mautrix-signal/debian.conffiles create mode 100644 mautrix-signal/mautrix-signal/debian.control create mode 100755 mautrix-signal/mautrix-signal/debian.postinst create mode 100755 mautrix-signal/mautrix-signal/debian.postrm create mode 100755 mautrix-signal/mautrix-signal/debian.prerm create mode 100644 mautrix-signal/mautrix-signal/mautrix-signal.default create mode 100644 mautrix-signal/mautrix-signal/mautrix-signal.service create mode 100755 mautrix-telegram/build.sh create mode 100644 mautrix-telegram/debian.conffiles create mode 100644 mautrix-telegram/debian.control create mode 100755 mautrix-telegram/debian.postinst create mode 100755 mautrix-telegram/debian.postrm create mode 100755 mautrix-telegram/debian.prerm create mode 100644 mautrix-telegram/mautrix-telegram.default create mode 100644 mautrix-telegram/mautrix-telegram.service create mode 100755 mediawiki-extension-auth-remoteuser/package.sh create mode 100755 mediawiki-extension-nativesvghandler/mediawiki-extension-nativesvghandler/package.sh create mode 100755 mediawiki-extension-nativesvghandler/package.sh create mode 100755 mediawiki-extension-openidconnect/mediawiki-extension-openidconnect/package.sh create mode 100755 mediawiki-extension-openidconnect/package.sh create mode 100755 mediawiki-extension-pluggableauth/mediawiki-extension-pluggableauth/package.sh create mode 100755 mediawiki-extension-pluggableauth/package.sh create mode 100755 mqtt2prometheus/build.sh create mode 100644 mqtt2prometheus/debian.conffiles create mode 100644 mqtt2prometheus/debian.control create mode 100755 mqtt2prometheus/debian.postinst create mode 100755 mqtt2prometheus/debian.postrm create mode 100755 mqtt2prometheus/debian.prerm create mode 100644 mqtt2prometheus/mqtt2prometheus.service create mode 100755 mqtt2prometheus/mqtt2prometheus/build.sh create mode 100644 mqtt2prometheus/mqtt2prometheus/debian.conffiles create mode 100644 mqtt2prometheus/mqtt2prometheus/debian.control create mode 100755 mqtt2prometheus/mqtt2prometheus/debian.postinst create mode 100755 mqtt2prometheus/mqtt2prometheus/debian.postrm create mode 100755 mqtt2prometheus/mqtt2prometheus/debian.prerm create mode 100644 mqtt2prometheus/mqtt2prometheus/mqtt2prometheus.service create mode 100755 mumble-web-data/build.sh create mode 100644 mumble-web-data/debian.conffiles create mode 100644 mumble-web-data/debian.control create mode 100644 mumble-web-data/mumble-web.site create mode 100755 mumble-web-proxy/build.sh create mode 100644 mumble-web-proxy/debian.conffiles create mode 100644 mumble-web-proxy/debian.control create mode 100644 mumble-web-proxy/mumble-web-proxy.conf create mode 100755 mumble-web-proxy/mumble-web-proxy/build.sh create mode 100644 mumble-web-proxy/mumble-web-proxy/debian.conffiles create mode 100644 mumble-web-proxy/mumble-web-proxy/debian.control create mode 100644 mumble-web-proxy/mumble-web-proxy/mumble-web-proxy.conf create mode 100644 mumble-web-proxy/mumble-web-proxy/mumble-web-proxy@.service create mode 100644 mumble-web-proxy/mumble-web-proxy@.service create mode 100755 mumble-web/build.sh create mode 100644 mumble-web/debian.conffiles create mode 100644 mumble-web/debian.control create mode 100644 mumble-web/mumble-web.defaults create mode 100644 mumble-web/mumble-web.service create mode 100644 mumble-web/mumble-web.site create mode 100755 prometheus-dnsbl-exporter/build.sh create mode 100644 prometheus-dnsbl-exporter/debian.conffiles create mode 100644 prometheus-dnsbl-exporter/debian.control create mode 100644 prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.defaults create mode 100644 prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.service create mode 100755 prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/build.sh create mode 100644 prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/debian.conffiles create mode 100644 prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/debian.control create mode 100644 prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.defaults create mode 100644 prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.service create mode 100644 prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/rbls.ini create mode 100644 prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/targets.ini create mode 100644 prometheus-dnsbl-exporter/rbls.ini create mode 100644 prometheus-dnsbl-exporter/targets.ini create mode 100755 prometheus-ipmi-exporter/build.sh create mode 100644 prometheus-ipmi-exporter/config.yaml create mode 100644 prometheus-ipmi-exporter/debian.conffiles create mode 100644 prometheus-ipmi-exporter/debian.control create mode 100755 prometheus-ipmi-exporter/debian.postinst create mode 100644 prometheus-ipmi-exporter/prometheus-ipmi-exporter.defaults create mode 100644 prometheus-ipmi-exporter/prometheus-ipmi-exporter.service create mode 100644 prometheus-ipmi-exporter/prometheus-ipmi-exporter.sudoers create mode 100755 prometheus2influxdb/build.sh create mode 100644 prometheus2influxdb/debian.conffiles create mode 100644 prometheus2influxdb/debian.control create mode 100755 prometheus2influxdb/debian.postinst create mode 100755 prometheus2influxdb/debian.postrm create mode 100755 prometheus2influxdb/debian.prerm create mode 100644 prometheus2influxdb/prometheus2influxdb.defaults create mode 100644 prometheus2influxdb/prometheus2influxdb.service create mode 100644 prometheus2influxdb/prometheus2influxdb.timer create mode 100755 prometheus2influxdb/prometheus2influxdb/build.sh create mode 100644 prometheus2influxdb/prometheus2influxdb/debian.conffiles create mode 100644 prometheus2influxdb/prometheus2influxdb/debian.control create mode 100755 prometheus2influxdb/prometheus2influxdb/debian.postinst create mode 100755 prometheus2influxdb/prometheus2influxdb/debian.postrm create mode 100755 prometheus2influxdb/prometheus2influxdb/debian.prerm create mode 100644 prometheus2influxdb/prometheus2influxdb/prometheus2influxdb.defaults create mode 100644 prometheus2influxdb/prometheus2influxdb/prometheus2influxdb.service create mode 100644 prometheus2influxdb/prometheus2influxdb/prometheus2influxdb.timer create mode 100755 python3-mautrix/build.sh create mode 100644 python3-mautrix/debian.control create mode 100755 python3-mautrix/python3-mautrix/build.sh create mode 100644 python3-mautrix/python3-mautrix/debian.control create mode 100755 python3-telethon/build.sh create mode 100644 python3-telethon/debian.control create mode 100755 python3-telethon/python3-telethon/build.sh create mode 100644 python3-telethon/python3-telethon/debian.control create mode 100644 repo.s3lph.me-apt-source/debian.changelog create mode 100644 repo.s3lph.me-apt-source/debian.conffiles create mode 100644 repo.s3lph.me-apt-source/debian.control create mode 100644 repo.s3lph.me-apt-source/debian.copyright create mode 100644 repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.asc create mode 100644 repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.sources create mode 100755 repo.s3lph.me-apt-source/package.sh create mode 100644 repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.changelog create mode 100644 repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.conffiles create mode 100644 repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.control create mode 100644 repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.copyright create mode 100644 repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.asc create mode 100644 repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.sources create mode 100755 repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/package.sh create mode 100755 republik-feeder/build.sh create mode 100644 republik-feeder/debian.conffiles create mode 100644 republik-feeder/debian.control create mode 100644 republik-feeder/republik-feeder.defaults create mode 100644 republik-feeder/republik-feeder.service create mode 100755 republik-feeder/republik-feeder/build.sh create mode 100644 republik-feeder/republik-feeder/debian.conffiles create mode 100644 republik-feeder/republik-feeder/debian.control create mode 100644 republik-feeder/republik-feeder/republik-feeder.defaults create mode 100644 republik-feeder/republik-feeder/republik-feeder.service create mode 100644 woodpecker-agent/agent.conf create mode 100755 woodpecker-agent/build.sh create mode 100644 woodpecker-agent/debian.conffiles create mode 100644 woodpecker-agent/debian.control create mode 100755 woodpecker-agent/debian.postinst create mode 100755 woodpecker-agent/debian.postrm create mode 100755 woodpecker-agent/debian.prerm create mode 100644 woodpecker-agent/woodpecker-agent.default create mode 100644 woodpecker-agent/woodpecker-agent.service create mode 100644 woodpecker-agent/woodpecker-agent/agent.conf create mode 100755 woodpecker-agent/woodpecker-agent/build.sh create mode 100644 woodpecker-agent/woodpecker-agent/debian.conffiles create mode 100644 woodpecker-agent/woodpecker-agent/debian.control create mode 100755 woodpecker-agent/woodpecker-agent/debian.postinst create mode 100755 woodpecker-agent/woodpecker-agent/debian.postrm create mode 100755 woodpecker-agent/woodpecker-agent/debian.prerm create mode 100644 woodpecker-agent/woodpecker-agent/woodpecker-agent.default create mode 100644 woodpecker-agent/woodpecker-agent/woodpecker-agent.service create mode 100755 woodpecker-cli/build.sh create mode 100644 woodpecker-cli/debian.control create mode 100755 woodpecker-server/build.sh create mode 100644 woodpecker-server/debian.conffiles create mode 100644 woodpecker-server/debian.control create mode 100755 woodpecker-server/debian.postinst create mode 100755 woodpecker-server/debian.postrm create mode 100755 woodpecker-server/debian.prerm create mode 100644 woodpecker-server/woodpecker-server.default create mode 100644 woodpecker-server/woodpecker-server.service diff --git a/.forgejo/workflows/package.yml b/.forgejo/workflows/package.yml new file mode 100644 index 0000000..32f7f13 --- /dev/null +++ b/.forgejo/workflows/package.yml @@ -0,0 +1,70 @@ +--- + +on: + push: + branches: + - main + schedule: + - cron: "0 2 * * *" # every night at 1 AM + +jobs: + + # One step per package + + ansible-semaphore: &job + runs-on: docker + container: + image: git.kabelsalat.ch/s3lph/package-pipeline-builder:latest + env: + API_REPOSITORY_DEB: ${{ secrets.API_REPOSITORY_DEB }} + API_USERNAME: ${{ secrets.API_USERNAME }} + API_PASSWORD: ${{ secrets.API_PASSWORD }} + MAINTAINER: ${{ secrets.MAINTAINER }} + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - run: | + cd "${GITHUB_JOB}" + [ -x build.sh ] && ./build.sh + [ -x package.sh ] && fakeroot ./package.sh + cd build + lintian *.deb || true + # Upload to the repo + for file in *deb; do + curl --user "${API_USERNAME}:${API_PASSWORD}" \ + --upload-file "${file}" \ + "${API_REPOSITORY_DEB}" + done + atlasswprobe: *job + daliserver: *job + forgejo: *job + forgejo-runner: *job + http-mqtt-bridge: *job + keycloak-23: *job + linux-diversion-ath-regd-optional: *job + lottieconverter: *job + matterbridge: *job + matrix-element-web: *job + matrix-hydrogen: *job + matrix.to: *job + maubot: *job + maubot-plugin-spaceapi: *job + maubot-plugin-ultimaker: *job + mautrix-signal: *job + mautrix-telegram: *job + mediawiki-extension-auth-remoteuser: *job + mediawiki-extension-nativesvghandler: *job + mediawiki-extension-openidconnect: *job + mediawiki-extension-pluggableauth: *job + mqtt2prometheus: *job + mumble-web: *job + mumble-web-data: *job + mumble-web-proxy: *job + prometheus-ipmi-exporter: *job + prometheus-dnsbl-exporter: *job + prometheus2influxdb: *job + python3-mautrix: *job + python3-telethon: *job + repo.s3lph.me-apt-source: *job + republik-feeder: *job + woodpecker-agent: *job + woodpecker-cli: *job diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bdf319e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +**/build/ diff --git a/.skel/helpers.sh b/.skel/helpers.sh new file mode 100644 index 0000000..e638e37 --- /dev/null +++ b/.skel/helpers.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +function github_changelog() { + curl https://api.github.com/repos/$1/releases | jq -r 'reverse | .[] | select(.draft==false and .prerelease==false) | "'"${PKGNAME}"' (\(.name)); urgency=medium\n \(.body // empty | gsub("\n";"\n "))\n -- '"${MAINTAINER}"' \(.created_at | fromdate | strftime("%a, %d %b %Y %T %z"))\n"' | gzip -9n > "${PKGDIR}/usr/share/doc/${PKGNAME}/changelog.gz" +} + +function gitlab_changelog() { + curl https://gitlab.com/api/v4/$1/releases | jq -r 'reverse | .[] | select(.upcoming_release==false) | "'"${PKGNAME}"' (\(.name)); urgency=medium\n \(.description // empty | gsub("\n";"\n "))\n -- '"${MAINTAINER}"' \(.created_at | fromdate | strftime("%a, %d %b %Y %T %z"))\n"' | gzip -9n > "${PKGDIR}/usr/share/doc/${PKGNAME}/changelog.gz" +} diff --git a/.skel/maubot-plugin.sh b/.skel/maubot-plugin.sh new file mode 100644 index 0000000..6b28d98 --- /dev/null +++ b/.skel/maubot-plugin.sh @@ -0,0 +1,44 @@ + +set -exo pipefail + +ROOT=$(pwd) + +pip3 install --break-system-packages maubot + + +function fetch() { + cd "${SRCDIR}" + git clone "${REPO}" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/lib/maubot/plugins" + PLUGIN_DIR=$(find "${SRCDIR}" -type f -name maubot.yaml | head -1) + PLUGIN_DIR=$(dirname "${PLUGIN_DIR}") + VERSION=$(cat "${PLUGIN_DIR}/maubot.yaml" | yq -r .version | head -1) + PLUGIN_ID=$(cat "${PLUGIN_DIR}/maubot.yaml" | yq -r .id | head -1) + cd "${PLUGIN_DIR}" + mbc build --output "${PKGDIR}/usr/lib/maubot/plugins/${PLUGIN_ID}_${VERSION}.mbp" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + 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 --reference "${PLUGIN_DIR}/maubot.yaml" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build_maubot_plugin() { + export REPO="${1}" + export BUILDDIR=${ROOT}/build + export SRCDIR=${ROOT}/build/srcdir + export PKGDIR=${ROOT}/build/pkgdir + mkdir -p ${SRCDIR} ${PKGDIR} + fetch + prepare + package +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6c25ecc --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +Copyright 2023 s3lph + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5e148fd --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +# Miscellaneous Debian Packages + +This project automatically builds miscellaneous Debian packages for my +personal use (and sometimes adapted to my needs). + +There is a daily Gitlab-CI run which builds the latest stable version +of each package and pushes them to my private repository. For more +information, please see [https://repo.s3lph.me/](https://repo.s3lph.me/). + +## Packages + +- [ansible-semaphore](https://github.com/ansible-semaphore/semaphore) +- [atlasswprobe](https://github.com/RIPE-NCC/ripe-atlas-software-probe) +- [daliserver](https://github.com/onitake/daliserver) +- [forgejo](https://codeberg.org/forgejo/forgejo) +- [forgejo-runner](https://code.forgejo.org/forgejo/runner) +- [http-mqtt-bridge](https://github.com/subzerobo/http-mqtt-bridge) +- [keycloak-23](https://github.com/keycloak/keycloak) +- [linux-diversion-ath-regd-optional](https://github.com/twisteroidambassador/arch-linux-ath-user-regd/issues/1) +- [lottieconverter](https://github.com/sot-tech/LottieConverter) +- [matrix-element-web](https://github.com/vector-im/element-web/) +- [matrix-hydrogen](https://github.com/vector-im/hydrogen-web/) +- [matrix.to](https://github.com/matrix-org/matrix.to) +- [matterbridge](https://github.com/42wim/matterbridge/) +- [maubot](https://github.com/maubot/maubot) +- [maubot-plugin-spaceapi](https://git.kabelsalat.ch/s3lph/maubot-plugin-spaceapi) +- [maubot-plugin-ultimaker](https://git.kabelsalat.ch/s3lph/maubot-plugin-ultimaker) +- [mautrix-signal](https://github.com/tulir/mautrix-signal) +- [mautrix-telegram](https://github.com/tulir/mautrix-telegram) +- [mediawiki-extension-auth-remoteuser](https://www.mediawiki.org/wiki/Extension:Auth_remoteuser) +- [mediawiki-extension-nativesvghandler](https://www.mediawiki.org/wiki/Extension:NativeSvgHandler) +- [mediawiki-extension-openidconnect](https://www.mediawiki.org/wiki/Extension:OpenID_Connect) +- [mediawiki-extension-pluggableauth](https://www.mediawiki.org/wiki/Extension:PluggableAuth) +- [mqtt2prometheus](https://github.com/hikhvar/mqtt2prometheus) +- [mumble-web](https://github.com/Johni0702/mumble-web) +- [mumble-web-data](https://github.com/Johni0702/mumble-web) +- [mumble-web-proxy](https://github.com/Johni0702/mumble-web-proxy) +- [prometheus-ipmi-exporter](https://github.com/prometheus-community/ipmi_exporter) +- [prometheus-dnsbl-exporter](https://github.com/Luzilla/dnsbl_exporter) +- [prometheus2influxdb](https://gitlab.com/s3lph/prometheus2influxdb) +- [python3-mautrix](https://github.com/mautrix/python) +- [python3-telethon](https://github.com/tulir/Telethon) +- [repo.s3lph.me-apt-source](https://repo.s3lph.me) +- [republik-feeder](https://github.com/maetthu/republik-feeder) +- [woodpecker-agent](https://github.com/woodpecker-ci/woodpecker) +- [woodpecker-cli](https://github.com/woodpecker-ci/woodpecker) +- [woodpecker-server](https://github.com/woodpecker-ci/woodpecker) diff --git a/ansible-semaphore/build.sh b/ansible-semaphore/build.sh new file mode 100755 index 0000000..1202c64 --- /dev/null +++ b/ansible-semaphore/build.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +set -exo pipefail + +. ../.skel/helpers.sh + +PKGNAME=ansible-semaphore + +API_URL=https://api.github.com/repos/ansible-semaphore/semaphore/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and (.tag_name|test("^v[0-9.-]+$")) ) | "\(.name[1:]) \(.published_at) \(.assets[] | select(.name|test(".*_linux_amd64.tar.gz$")).browser_download_url )"' + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "semaphore_${VERSION}_linux_amd64.tar.gz" + tar xf "semaphore_${VERSION}_linux_amd64.tar.gz" +} + +function prepare() { + chmod +x "${SRCDIR}/semaphore" + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/semaphore" \ + "${PKGDIR}/var/lib/semaphore/playbooks" \ + "${PKGDIR}/var/lib/semaphore/database" \ + "${PKGDIR}/lib/systemd/system" \ + "${PKGDIR}/usr/share/doc/${PKGNAME}" + cp "${SRCDIR}/semaphore" "${PKGDIR}/usr/bin/semaphore" + cp "${ROOT}/semaphore.service" "${PKGDIR}/lib/systemd/system/semaphore.service" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + cp "${ROOT}/config.json" "${PKGDIR}/etc/semaphore/config.json" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + cp "${SRCDIR}/LICENSE" "${PKGDIR}/usr/share/doc/${PKGNAME}/copyright" + github_changelog ansible-semaphore/semaphore + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + # Replace Forgejo patch level separater - with . to be Debian versioning compatible, and add epoch number 2 + export VERSION="${VERSION/-/.}" + export ISODATE + export URL + 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/ansible-semaphore/config.json b/ansible-semaphore/config.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/ansible-semaphore/config.json @@ -0,0 +1 @@ +{} diff --git a/ansible-semaphore/debian.conffiles b/ansible-semaphore/debian.conffiles new file mode 100644 index 0000000..bd868d5 --- /dev/null +++ b/ansible-semaphore/debian.conffiles @@ -0,0 +1 @@ +/etc/semaphore/config.json diff --git a/ansible-semaphore/debian.control b/ansible-semaphore/debian.control new file mode 100644 index 0000000..0c3ce3d --- /dev/null +++ b/ansible-semaphore/debian.control @@ -0,0 +1,11 @@ +Package: ansible-semaphore +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Depends: ansible, git +Description: Modern UI for Ansible + Ansible Semaphore is a modern UI for Ansible. It lets you easily run + Ansible playbooks, get notifications about fails, control access to + deployment system. diff --git a/ansible-semaphore/debian.postinst b/ansible-semaphore/debian.postinst new file mode 100755 index 0000000..09b820c --- /dev/null +++ b/ansible-semaphore/debian.postinst @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group semaphore >/dev/null; then + groupadd --system semaphore + fi + + if ! getent passwd semaphore >/dev/null; then + useradd --system --gid semaphore --home-dir /var/lib/semaphore --shell /bin/bash semaphore + fi + + chown semaphore:semaphore /var/lib/semaphore + chmod 0750 /var/lib/semaphore + chown root:semaphore /etc/semaphore/config.json + chmod g+rx /etc/semaphore + chmod g+r /etc/semaphore/config.json + + deb-systemd-helper enable semaphore.service + deb-systemd-invoke restart semaphore.service + +fi + diff --git a/ansible-semaphore/debian.postrm b/ansible-semaphore/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/ansible-semaphore/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/ansible-semaphore/debian.prerm b/ansible-semaphore/debian.prerm new file mode 100755 index 0000000..ee82c5e --- /dev/null +++ b/ansible-semaphore/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop semaphore.service + +fi diff --git a/ansible-semaphore/semaphore.service b/ansible-semaphore/semaphore.service new file mode 100644 index 0000000..804ad75 --- /dev/null +++ b/ansible-semaphore/semaphore.service @@ -0,0 +1,19 @@ +[Unit] +Description=Ansible Semaphore +After=network.target +#Requires=mysql.service +#Requires=postgresql.service + +[Service] +# Modify these two values anda +Type=simple +User=semaphore +Group=semaphore +WorkingDirectory=/var/lib/semaphore +ExecStart=/usr/bin/semaphore server --config /etc/semaphore/config.json +Restart=always +CapabilityBoundingSet=CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_BIND_SERVICE + +[Install] +WantedBy=multi-user.target diff --git a/atlasswprobe/atlasswprobe/build.sh b/atlasswprobe/atlasswprobe/build.sh new file mode 100755 index 0000000..6c96d0e --- /dev/null +++ b/atlasswprobe/atlasswprobe/build.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -exo pipefail + +ROOT=$(pwd) + +export BUILDDIR="${ROOT}/build" +export SRCDIR="${ROOT}/build/srcdir" +mkdir -p "${SRCDIR}" + +cd "${SRCDIR}" +apt install --yes git tar fakeroot libssl-dev libcap2-bin autoconf automake libtool build-essential +git clone --recursive https://github.com/RIPE-NCC/ripe-atlas-software-probe + +"${SRCDIR}/ripe-atlas-software-probe/build-config/debian/bin/make-deb" +mv atlasswprobe-*deb "${BUILDDIR}" diff --git a/atlasswprobe/build.sh b/atlasswprobe/build.sh new file mode 100755 index 0000000..6c96d0e --- /dev/null +++ b/atlasswprobe/build.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -exo pipefail + +ROOT=$(pwd) + +export BUILDDIR="${ROOT}/build" +export SRCDIR="${ROOT}/build/srcdir" +mkdir -p "${SRCDIR}" + +cd "${SRCDIR}" +apt install --yes git tar fakeroot libssl-dev libcap2-bin autoconf automake libtool build-essential +git clone --recursive https://github.com/RIPE-NCC/ripe-atlas-software-probe + +"${SRCDIR}/ripe-atlas-software-probe/build-config/debian/bin/make-deb" +mv atlasswprobe-*deb "${BUILDDIR}" diff --git a/daliserver/build.sh b/daliserver/build.sh new file mode 100755 index 0000000..9e64ffb --- /dev/null +++ b/daliserver/build.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +set -exo pipefail + +ROOT=$(pwd) + +function fetch() { + git clone https://github.com/onitake/daliserver "${SRCDIR}/daliserver" +} + +function prepare() { + cd "${SRCDIR}/daliserver" + apt install -y build-essential autoconf + apt build-dep -y "${SRCDIR}/daliserver" + autoreconf -i +} + +function package() { + cd "${SRCDIR}/daliserver" + dpkg-buildpackage + cp ${SRCDIR}/daliserver_*_amd64.deb ${BUILDDIR} +} + +function build() { + export BUILDDIR=${ROOT}/build + export SRCDIR=${BUILDDIR}/srcdir + export PKGDIR=${BUILDDIR}/pkgdir + mkdir -p ${SRCDIR} ${PKGDIR} + fetch + prepare + package +} + + +build diff --git a/daliserver/daliserver/build.sh b/daliserver/daliserver/build.sh new file mode 100755 index 0000000..9e64ffb --- /dev/null +++ b/daliserver/daliserver/build.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +set -exo pipefail + +ROOT=$(pwd) + +function fetch() { + git clone https://github.com/onitake/daliserver "${SRCDIR}/daliserver" +} + +function prepare() { + cd "${SRCDIR}/daliserver" + apt install -y build-essential autoconf + apt build-dep -y "${SRCDIR}/daliserver" + autoreconf -i +} + +function package() { + cd "${SRCDIR}/daliserver" + dpkg-buildpackage + cp ${SRCDIR}/daliserver_*_amd64.deb ${BUILDDIR} +} + +function build() { + export BUILDDIR=${ROOT}/build + export SRCDIR=${BUILDDIR}/srcdir + export PKGDIR=${BUILDDIR}/pkgdir + mkdir -p ${SRCDIR} ${PKGDIR} + fetch + prepare + package +} + + +build diff --git a/forgejo-runner/build.sh b/forgejo-runner/build.sh new file mode 100755 index 0000000..17854b1 --- /dev/null +++ b/forgejo-runner/build.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://code.forgejo.org/api/v1/repos/forgejo/runner/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and (.tag_name|test("^v[0-9.-]+$")) ) | "\(.name[1:]) \(.published_at) \(.assets[] | select(.name|test(".*-linux-amd64.xz$")).browser_download_url )"' + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "forgejo-runner-${VERSION}-linux-amd64.xz" + xz --decompress "forgejo-runner-${VERSION}-linux-amd64.xz" +} + +function prepare() { + chmod +x "${SRCDIR}/forgejo-runner-${VERSION}-linux-amd64" + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/forgejo-runner" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/forgejo-runner-${VERSION}-linux-amd64" "${PKGDIR}/usr/bin/forgejo-runner" + cp "${ROOT}/forgejo-runner-cli" "${PKGDIR}/usr/bin/forgejo-runner-cli" + cp "${ROOT}/forgejo-runner.service" "${PKGDIR}/lib/systemd/system/forgejo-runner.service" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + "${PKGDIR}/usr/bin/forgejo-runner" generate-config > "${PKGDIR}/etc/forgejo-runner/config.yml" + 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() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/forgejo-runner/debian.conffiles b/forgejo-runner/debian.conffiles new file mode 100644 index 0000000..1b26157 --- /dev/null +++ b/forgejo-runner/debian.conffiles @@ -0,0 +1 @@ +/etc/forgejo-runner/config.yml diff --git a/forgejo-runner/debian.control b/forgejo-runner/debian.control new file mode 100644 index 0000000..b57a0f7 --- /dev/null +++ b/forgejo-runner/debian.control @@ -0,0 +1,10 @@ +Package: forgejo-runner +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Depends: git +Description: Runner for Forgejo Actions + A daemon that connects to a Forgejo instance and runs jobs for + continous integration. diff --git a/forgejo-runner/debian.postinst b/forgejo-runner/debian.postinst new file mode 100755 index 0000000..6ad3880 --- /dev/null +++ b/forgejo-runner/debian.postinst @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group forgejo-runner >/dev/null; then + groupadd --system forgejo-runner + fi + + if ! getent passwd forgejo-runner >/dev/null; then + useradd --system --gid forgejo-runner --groups docker --home-dir /var/lib/forgejo-runner --create-home --shell /sbin/nologin forgejo-runner + fi + + chown forgejo-runner:forgejo-runner /var/lib/forgejo-runner + chmod 0750 /var/lib/forgejo-runner + chown root:forgejo-runner /etc/forgejo-runner/config.yml + chmod g+rx /etc/forgejo-runner + chmod g+r /etc/forgejo-runner/config.yml + + deb-systemd-helper enable forgejo-runner.service + deb-systemd-invoke restart forgejo-runner.service + +fi + diff --git a/forgejo-runner/debian.postrm b/forgejo-runner/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/forgejo-runner/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/forgejo-runner/debian.prerm b/forgejo-runner/debian.prerm new file mode 100755 index 0000000..1b47bd8 --- /dev/null +++ b/forgejo-runner/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop forgejo-runner.service + +fi diff --git a/forgejo-runner/forgejo-runner-cli b/forgejo-runner/forgejo-runner-cli new file mode 100755 index 0000000..3ef218f --- /dev/null +++ b/forgejo-runner/forgejo-runner-cli @@ -0,0 +1,4 @@ +#!/bin/bash + +cd /var/lib/forgejo-runner +su -c /usr/bin/forgejo-runner -l forgejo-runner -- $@ diff --git a/forgejo-runner/forgejo-runner.service b/forgejo-runner/forgejo-runner.service new file mode 100644 index 0000000..3821d89 --- /dev/null +++ b/forgejo-runner/forgejo-runner.service @@ -0,0 +1,14 @@ +[Unit] +Description=Forgejo Runner +After=network.target + +[Service] +Type=simple +User=forgejo-runner +Group=forgejo-runner +WorkingDirectory=/var/lib/forgejo-runner +ExecStart=/usr/bin/forgejo-runner daemon -c /etc/forgejo-runner/config.yml +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/forgejo/app.ini b/forgejo/app.ini new file mode 100644 index 0000000..e69de29 diff --git a/forgejo/build.sh b/forgejo/build.sh new file mode 100755 index 0000000..15c2a73 --- /dev/null +++ b/forgejo/build.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://codeberg.org/api/v1/repos/forgejo/forgejo/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and (.tag_name|test("^v[0-9.-]+$")) ) | "\(.name[1:]) \(.published_at) \(.assets[] | select(.name|test(".*-linux-amd64.xz$")).browser_download_url )"' + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "forgejo-${VERSION}-linux-amd64.xz" + xz --decompress "forgejo-${VERSION}-linux-amd64.xz" +} + +function prepare() { + chmod +x "${SRCDIR}/forgejo-${VERSION}-linux-amd64" + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/gitea" \ + "${PKGDIR}/var/lib/gitea/custom" \ + "${PKGDIR}/var/lib/gitea/data" \ + "${PKGDIR}/var/lib/gitea/log" \ + "${PKGDIR}/var/lib/gitea/gitea-repositories" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/forgejo-${VERSION}-linux-amd64" "${PKGDIR}/usr/bin/forgejo" + cp "${ROOT}/gitea.service" "${PKGDIR}/lib/systemd/system/gitea.service" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + cp "${ROOT}/app.ini" "${PKGDIR}/etc/gitea/app.ini" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + ln -s gitea.service "${PKGDIR}/lib/systemd/system/forgejo.service" + ln -s gitea "${PKGDIR}/etc/forgejo" + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + # Replace Forgejo patch level separater - with . to be Debian versioning compatible, and add epoch number 2 + export VERSION="2:${VERSION/-/.}" + export ISODATE + export URL + 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/forgejo/debian.conffiles b/forgejo/debian.conffiles new file mode 100644 index 0000000..cce5639 --- /dev/null +++ b/forgejo/debian.conffiles @@ -0,0 +1 @@ +/etc/gitea/app.ini diff --git a/forgejo/debian.control b/forgejo/debian.control new file mode 100644 index 0000000..e56bfc2 --- /dev/null +++ b/forgejo/debian.control @@ -0,0 +1,13 @@ +Package: forgejo +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Depends: git +Provides: gitea +Conflicts: gitea +Replaces: gitea +Description: Libre code forge - a community-run soft fork of Gitea + Gitea is a community managed lightweight code hosting solution written in Go. + It is published under the MIT license. diff --git a/forgejo/debian.postinst b/forgejo/debian.postinst new file mode 100755 index 0000000..8828864 --- /dev/null +++ b/forgejo/debian.postinst @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group gitea >/dev/null; then + groupadd --system gitea + fi + + if ! getent passwd gitea >/dev/null; then + useradd --system --gid gitea --home-dir /var/lib/gitea --shell /bin/bash gitea + fi + + chown gitea:gitea /var/lib/gitea + chmod 0750 /var/lib/gitea + chown root:gitea /etc/gitea/app.ini + chmod g+rx /etc/gitea + chmod g+rw /etc/gitea/app.ini + + deb-systemd-helper enable gitea.service + deb-systemd-invoke restart gitea.service + +fi + diff --git a/forgejo/debian.postrm b/forgejo/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/forgejo/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/forgejo/debian.prerm b/forgejo/debian.prerm new file mode 100755 index 0000000..b930418 --- /dev/null +++ b/forgejo/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop gitea.service + +fi diff --git a/forgejo/forgejo/app.ini b/forgejo/forgejo/app.ini new file mode 100644 index 0000000..e69de29 diff --git a/forgejo/forgejo/build.sh b/forgejo/forgejo/build.sh new file mode 100755 index 0000000..15c2a73 --- /dev/null +++ b/forgejo/forgejo/build.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://codeberg.org/api/v1/repos/forgejo/forgejo/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and (.tag_name|test("^v[0-9.-]+$")) ) | "\(.name[1:]) \(.published_at) \(.assets[] | select(.name|test(".*-linux-amd64.xz$")).browser_download_url )"' + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "forgejo-${VERSION}-linux-amd64.xz" + xz --decompress "forgejo-${VERSION}-linux-amd64.xz" +} + +function prepare() { + chmod +x "${SRCDIR}/forgejo-${VERSION}-linux-amd64" + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/gitea" \ + "${PKGDIR}/var/lib/gitea/custom" \ + "${PKGDIR}/var/lib/gitea/data" \ + "${PKGDIR}/var/lib/gitea/log" \ + "${PKGDIR}/var/lib/gitea/gitea-repositories" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/forgejo-${VERSION}-linux-amd64" "${PKGDIR}/usr/bin/forgejo" + cp "${ROOT}/gitea.service" "${PKGDIR}/lib/systemd/system/gitea.service" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + cp "${ROOT}/app.ini" "${PKGDIR}/etc/gitea/app.ini" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + ln -s gitea.service "${PKGDIR}/lib/systemd/system/forgejo.service" + ln -s gitea "${PKGDIR}/etc/forgejo" + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + # Replace Forgejo patch level separater - with . to be Debian versioning compatible, and add epoch number 2 + export VERSION="2:${VERSION/-/.}" + export ISODATE + export URL + 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/forgejo/forgejo/debian.conffiles b/forgejo/forgejo/debian.conffiles new file mode 100644 index 0000000..cce5639 --- /dev/null +++ b/forgejo/forgejo/debian.conffiles @@ -0,0 +1 @@ +/etc/gitea/app.ini diff --git a/forgejo/forgejo/debian.control b/forgejo/forgejo/debian.control new file mode 100644 index 0000000..e56bfc2 --- /dev/null +++ b/forgejo/forgejo/debian.control @@ -0,0 +1,13 @@ +Package: forgejo +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Depends: git +Provides: gitea +Conflicts: gitea +Replaces: gitea +Description: Libre code forge - a community-run soft fork of Gitea + Gitea is a community managed lightweight code hosting solution written in Go. + It is published under the MIT license. diff --git a/forgejo/forgejo/debian.postinst b/forgejo/forgejo/debian.postinst new file mode 100755 index 0000000..8828864 --- /dev/null +++ b/forgejo/forgejo/debian.postinst @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group gitea >/dev/null; then + groupadd --system gitea + fi + + if ! getent passwd gitea >/dev/null; then + useradd --system --gid gitea --home-dir /var/lib/gitea --shell /bin/bash gitea + fi + + chown gitea:gitea /var/lib/gitea + chmod 0750 /var/lib/gitea + chown root:gitea /etc/gitea/app.ini + chmod g+rx /etc/gitea + chmod g+rw /etc/gitea/app.ini + + deb-systemd-helper enable gitea.service + deb-systemd-invoke restart gitea.service + +fi + diff --git a/forgejo/forgejo/debian.postrm b/forgejo/forgejo/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/forgejo/forgejo/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/forgejo/forgejo/debian.prerm b/forgejo/forgejo/debian.prerm new file mode 100755 index 0000000..b930418 --- /dev/null +++ b/forgejo/forgejo/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop gitea.service + +fi diff --git a/forgejo/forgejo/gitea.service b/forgejo/forgejo/gitea.service new file mode 100644 index 0000000..f3592ef --- /dev/null +++ b/forgejo/forgejo/gitea.service @@ -0,0 +1,32 @@ +[Unit] +Description=Forgejo +After=network.target +#Requires=mysql.service +Requires=mariadb.service +#Requires=postgresql.service +#Requires=memcached.service +#Requires=redis.service + +[Service] +# Modify these two values and uncomment them if you have +# repos with lots of files and get an HTTP error 500 because +# of that +### +#LimitMEMLOCK=infinity +#LimitNOFILE=65535 +RestartSec=2s +Type=simple +User=gitea +Group=gitea +WorkingDirectory=/var/lib/gitea +ExecStart=/usr/bin/forgejo web -c /etc/gitea/app.ini +Restart=always +Environment=USER=git HOME=/var/lib/gitea GITEA_WORK_DIR=/var/lib/gitea +# If you want to bind Gitea to a port below 1024 uncomment +# the two values below +### +CapabilityBoundingSet=CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_BIND_SERVICE + +[Install] +WantedBy=multi-user.target diff --git a/forgejo/gitea.service b/forgejo/gitea.service new file mode 100644 index 0000000..f3592ef --- /dev/null +++ b/forgejo/gitea.service @@ -0,0 +1,32 @@ +[Unit] +Description=Forgejo +After=network.target +#Requires=mysql.service +Requires=mariadb.service +#Requires=postgresql.service +#Requires=memcached.service +#Requires=redis.service + +[Service] +# Modify these two values and uncomment them if you have +# repos with lots of files and get an HTTP error 500 because +# of that +### +#LimitMEMLOCK=infinity +#LimitNOFILE=65535 +RestartSec=2s +Type=simple +User=gitea +Group=gitea +WorkingDirectory=/var/lib/gitea +ExecStart=/usr/bin/forgejo web -c /etc/gitea/app.ini +Restart=always +Environment=USER=git HOME=/var/lib/gitea GITEA_WORK_DIR=/var/lib/gitea +# If you want to bind Gitea to a port below 1024 uncomment +# the two values below +### +CapabilityBoundingSet=CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_BIND_SERVICE + +[Install] +WantedBy=multi-user.target diff --git a/http-mqtt-bridge/build.sh b/http-mqtt-bridge/build.sh new file mode 100755 index 0000000..2da139c --- /dev/null +++ b/http-mqtt-bridge/build.sh @@ -0,0 +1,52 @@ +#!/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/debian.conffiles b/http-mqtt-bridge/debian.conffiles new file mode 100644 index 0000000..77730e5 --- /dev/null +++ b/http-mqtt-bridge/debian.conffiles @@ -0,0 +1,2 @@ +/etc/default/http-mqtt-bridge +/etc/apache2/sites-available/http-mqtt-bridge.site diff --git a/http-mqtt-bridge/debian.control b/http-mqtt-bridge/debian.control new file mode 100644 index 0000000..c399dbe --- /dev/null +++ b/http-mqtt-bridge/debian.control @@ -0,0 +1,11 @@ +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.defaults b/http-mqtt-bridge/http-mqtt-bridge.defaults new file mode 100644 index 0000000..3ab50a1 --- /dev/null +++ b/http-mqtt-bridge/http-mqtt-bridge.defaults @@ -0,0 +1,5 @@ +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.service b/http-mqtt-bridge/http-mqtt-bridge.service new file mode 100644 index 0000000..ed0a8e1 --- /dev/null +++ b/http-mqtt-bridge/http-mqtt-bridge.service @@ -0,0 +1,14 @@ +[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.site b/http-mqtt-bridge/http-mqtt-bridge.site new file mode 100644 index 0000000..899c383 --- /dev/null +++ b/http-mqtt-bridge/http-mqtt-bridge.site @@ -0,0 +1,32 @@ + + 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 + + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet \ No newline at end of file diff --git a/http-mqtt-bridge/http-mqtt-bridge/build.sh b/http-mqtt-bridge/http-mqtt-bridge/build.sh new file mode 100755 index 0000000..2da139c --- /dev/null +++ b/http-mqtt-bridge/http-mqtt-bridge/build.sh @@ -0,0 +1,52 @@ +#!/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 new file mode 100644 index 0000000..77730e5 --- /dev/null +++ b/http-mqtt-bridge/http-mqtt-bridge/debian.conffiles @@ -0,0 +1,2 @@ +/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 new file mode 100644 index 0000000..c399dbe --- /dev/null +++ b/http-mqtt-bridge/http-mqtt-bridge/debian.control @@ -0,0 +1,11 @@ +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 new file mode 100644 index 0000000..3ab50a1 --- /dev/null +++ b/http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.defaults @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000..ed0a8e1 --- /dev/null +++ b/http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.service @@ -0,0 +1,14 @@ +[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 new file mode 100644 index 0000000..899c383 --- /dev/null +++ b/http-mqtt-bridge/http-mqtt-bridge/http-mqtt-bridge.site @@ -0,0 +1,32 @@ + + 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 + + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet \ No newline at end of file diff --git a/keycloak-23/build.sh b/keycloak-23/build.sh new file mode 100755 index 0000000..31ee5c6 --- /dev/null +++ b/keycloak-23/build.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +set -exo pipefail + +. ../.skel/helpers.sh + +MAJOR_VERSION=23 +export PKGNAME="keycloak-${MAJOR_VERSION}" + +API_URL="https://api.github.com/repos/keycloak/keycloak/releases" +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="main" ) | "\(.name) \(.published_at) \(.assets[] | select( .name|test("keycloak-'${MAJOR_VERSION}'.*.tar.gz$") ).browser_download_url)"' + +ROOT=$(pwd) + +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "keycloak-${VERSION}.tar.gz" + tar -xf "keycloak-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/opt/" \ + "${PKGDIR}/lib/systemd/system" \ + "${PKGDIR}/etc/apache2/sites-available" \ + "${PKGDIR}/usr/share/doc/${PKGNAME}" + cp -r "${SRCDIR}/keycloak-${VERSION}" "${PKGDIR}/opt/keycloak/" + mv "${PKGDIR}/opt/keycloak/conf" "${PKGDIR}/etc/keycloak/" + ln -s /etc/keycloak "${PKGDIR}/opt/keycloak/conf" + mkdir -p \ + "${PKGDIR}/opt/keycloak/data" \ + "${PKGDIR}/opt/keycloak/ObjectStore" + rm "${PKGDIR}/opt/keycloak/bin/kc.bat" \ + "${PKGDIR}/etc/keycloak/README.md" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/keycloak.service" "${PKGDIR}/lib/systemd/system/" + cp "${ROOT}/keycloak.site.conf" "${PKGDIR}/etc/apache2/sites-available/" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.copyright" "${PKGDIR}/usr/share/doc/${PKGNAME}/copyright" + github_changelog keycloak/keycloak + find "${PKGDIR}" -exec touch -m --reference "${SRCDIR}/keycloak-${VERSION}/version.txt" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/keycloak-23/debian.conffiles b/keycloak-23/debian.conffiles new file mode 100644 index 0000000..c4fe3e2 --- /dev/null +++ b/keycloak-23/debian.conffiles @@ -0,0 +1,3 @@ +/etc/apache2/sites-available/keycloak.site.conf +/etc/keycloak/cache-ispn.xml +/etc/keycloak/keycloak.conf diff --git a/keycloak-23/debian.control b/keycloak-23/debian.control new file mode 100644 index 0000000..7318f53 --- /dev/null +++ b/keycloak-23/debian.control @@ -0,0 +1,16 @@ +Package: keycloak-23 +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: default-jdk-headless (>=2:1.17), default-jdk-headless (<<2:1.22) +Suggests: apache2, postgresql +Provides: keycloak +Conflicts: keycloak +Replaces: keycloak +Description: Open Source Identity and Access Management + Add authentication to applications and secure services with minimum + effort. No need to deal with storing users or authenticating users. + Keycloak provides user federation, strong authentication, user + management, fine-grained authorization, and more. diff --git a/keycloak-23/debian.copyright b/keycloak-23/debian.copyright new file mode 100644 index 0000000..12b1dc4 --- /dev/null +++ b/keycloak-23/debian.copyright @@ -0,0 +1,6 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Source: https://github.com/keycloak/keycloak + +Files: * +License: Apache-2.0 + diff --git a/keycloak-23/debian.postinst b/keycloak-23/debian.postinst new file mode 100755 index 0000000..322e0ee --- /dev/null +++ b/keycloak-23/debian.postinst @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group keycloak >/dev/null; then + groupadd --system keycloak + fi + + if ! getent passwd keycloak >/dev/null; then + useradd --system --gid keycloak --home-dir /opt/keycloak --shell /bin/false keycloak + fi + + chown root:keycloak /opt/keycloak /etc/keycloak + chown keycloak:keycloak -R /opt/keycloak/lib/quarkus /opt/keycloak/data /opt/keycloak/ObjectStore + chmod 0750 /etc/keycloak + + deb-systemd-helper enable keycloak.service + deb-systemd-invoke restart keycloak.service + +fi diff --git a/keycloak-23/keycloak-23/build.sh b/keycloak-23/keycloak-23/build.sh new file mode 100755 index 0000000..31ee5c6 --- /dev/null +++ b/keycloak-23/keycloak-23/build.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +set -exo pipefail + +. ../.skel/helpers.sh + +MAJOR_VERSION=23 +export PKGNAME="keycloak-${MAJOR_VERSION}" + +API_URL="https://api.github.com/repos/keycloak/keycloak/releases" +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="main" ) | "\(.name) \(.published_at) \(.assets[] | select( .name|test("keycloak-'${MAJOR_VERSION}'.*.tar.gz$") ).browser_download_url)"' + +ROOT=$(pwd) + +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "keycloak-${VERSION}.tar.gz" + tar -xf "keycloak-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/opt/" \ + "${PKGDIR}/lib/systemd/system" \ + "${PKGDIR}/etc/apache2/sites-available" \ + "${PKGDIR}/usr/share/doc/${PKGNAME}" + cp -r "${SRCDIR}/keycloak-${VERSION}" "${PKGDIR}/opt/keycloak/" + mv "${PKGDIR}/opt/keycloak/conf" "${PKGDIR}/etc/keycloak/" + ln -s /etc/keycloak "${PKGDIR}/opt/keycloak/conf" + mkdir -p \ + "${PKGDIR}/opt/keycloak/data" \ + "${PKGDIR}/opt/keycloak/ObjectStore" + rm "${PKGDIR}/opt/keycloak/bin/kc.bat" \ + "${PKGDIR}/etc/keycloak/README.md" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/keycloak.service" "${PKGDIR}/lib/systemd/system/" + cp "${ROOT}/keycloak.site.conf" "${PKGDIR}/etc/apache2/sites-available/" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.copyright" "${PKGDIR}/usr/share/doc/${PKGNAME}/copyright" + github_changelog keycloak/keycloak + find "${PKGDIR}" -exec touch -m --reference "${SRCDIR}/keycloak-${VERSION}/version.txt" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/keycloak-23/keycloak-23/debian.conffiles b/keycloak-23/keycloak-23/debian.conffiles new file mode 100644 index 0000000..c4fe3e2 --- /dev/null +++ b/keycloak-23/keycloak-23/debian.conffiles @@ -0,0 +1,3 @@ +/etc/apache2/sites-available/keycloak.site.conf +/etc/keycloak/cache-ispn.xml +/etc/keycloak/keycloak.conf diff --git a/keycloak-23/keycloak-23/debian.control b/keycloak-23/keycloak-23/debian.control new file mode 100644 index 0000000..7318f53 --- /dev/null +++ b/keycloak-23/keycloak-23/debian.control @@ -0,0 +1,16 @@ +Package: keycloak-23 +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: default-jdk-headless (>=2:1.17), default-jdk-headless (<<2:1.22) +Suggests: apache2, postgresql +Provides: keycloak +Conflicts: keycloak +Replaces: keycloak +Description: Open Source Identity and Access Management + Add authentication to applications and secure services with minimum + effort. No need to deal with storing users or authenticating users. + Keycloak provides user federation, strong authentication, user + management, fine-grained authorization, and more. diff --git a/keycloak-23/keycloak-23/debian.copyright b/keycloak-23/keycloak-23/debian.copyright new file mode 100644 index 0000000..12b1dc4 --- /dev/null +++ b/keycloak-23/keycloak-23/debian.copyright @@ -0,0 +1,6 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Source: https://github.com/keycloak/keycloak + +Files: * +License: Apache-2.0 + diff --git a/keycloak-23/keycloak-23/debian.postinst b/keycloak-23/keycloak-23/debian.postinst new file mode 100755 index 0000000..322e0ee --- /dev/null +++ b/keycloak-23/keycloak-23/debian.postinst @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group keycloak >/dev/null; then + groupadd --system keycloak + fi + + if ! getent passwd keycloak >/dev/null; then + useradd --system --gid keycloak --home-dir /opt/keycloak --shell /bin/false keycloak + fi + + chown root:keycloak /opt/keycloak /etc/keycloak + chown keycloak:keycloak -R /opt/keycloak/lib/quarkus /opt/keycloak/data /opt/keycloak/ObjectStore + chmod 0750 /etc/keycloak + + deb-systemd-helper enable keycloak.service + deb-systemd-invoke restart keycloak.service + +fi diff --git a/keycloak-23/keycloak-23/keycloak.service b/keycloak-23/keycloak-23/keycloak.service new file mode 100644 index 0000000..c7f50a5 --- /dev/null +++ b/keycloak-23/keycloak-23/keycloak.service @@ -0,0 +1,22 @@ +[Unit] +Description=Keycloak +#Requires=mysql.service +#Requires=mariadb.service +#Requires=postgresql.service + +[Service] +ExecStart=/opt/keycloak/bin/kc.sh start +Restart=always +User=keycloak +Group=keycloak +WorkingDirectory=/opt/keycloak +CapabilityBoundingSet= + +[Install] +WantedBy=multi-user.target + + +## To clear the theme cache (use systemctl edit keycloak.service, then paste this at the top) +#[Service] +#ExecStart= +#ExecStart=/opt/keycloak/bin/kc.sh start --spi-theme-static-max-age=-1 --spi-theme-cache-themes=false --spi-theme-cache-templates=false diff --git a/keycloak-23/keycloak-23/keycloak.site.conf b/keycloak-23/keycloak-23/keycloak.site.conf new file mode 100644 index 0000000..8e922fd --- /dev/null +++ b/keycloak-23/keycloak-23/keycloak.site.conf @@ -0,0 +1,31 @@ + + + ServerName keycloak.example.org + + DocumentRoot /var/www/html + + ProxyPass /js/ http://localhost:8080/js/ + ProxyPassReverse /js/ http://localhost:8080/js/ + ProxyPass /realms/ http://localhost:8080/realms/ + ProxyPassReverse /realms/ http://localhost:8080/realms/ + ProxyPass /resources/ http://localhost:8080/resources/ + ProxyPassReverse /resources/ http://localhost:8080/resources/ + + # Redirect root to user account management + RewriteEngine on + RewriteRule ^/?$ /realms/EXAMPLE/account [L,R] + + ## Test client that dumps the id_token + #OIDCProviderMetadataURL https://keycloak.example.org/realms/EXAMPLE/.well-known/openid-configuration + #OIDCClientID foo + #OIDCClientSecret bar + #OIDCRedirectURI https://keycloak.example.org/test-client/redirect + #OIDCCryptoPassphrase supersecurepassword + #OIDCInfoHook id_token + # + # AuthType openid-connect + # Require valid-user + # RewriteRule .* /test-client/redirect?info=html + # + + \ No newline at end of file diff --git a/keycloak-23/keycloak.service b/keycloak-23/keycloak.service new file mode 100644 index 0000000..c7f50a5 --- /dev/null +++ b/keycloak-23/keycloak.service @@ -0,0 +1,22 @@ +[Unit] +Description=Keycloak +#Requires=mysql.service +#Requires=mariadb.service +#Requires=postgresql.service + +[Service] +ExecStart=/opt/keycloak/bin/kc.sh start +Restart=always +User=keycloak +Group=keycloak +WorkingDirectory=/opt/keycloak +CapabilityBoundingSet= + +[Install] +WantedBy=multi-user.target + + +## To clear the theme cache (use systemctl edit keycloak.service, then paste this at the top) +#[Service] +#ExecStart= +#ExecStart=/opt/keycloak/bin/kc.sh start --spi-theme-static-max-age=-1 --spi-theme-cache-themes=false --spi-theme-cache-templates=false diff --git a/keycloak-23/keycloak.site.conf b/keycloak-23/keycloak.site.conf new file mode 100644 index 0000000..8e922fd --- /dev/null +++ b/keycloak-23/keycloak.site.conf @@ -0,0 +1,31 @@ + + + ServerName keycloak.example.org + + DocumentRoot /var/www/html + + ProxyPass /js/ http://localhost:8080/js/ + ProxyPassReverse /js/ http://localhost:8080/js/ + ProxyPass /realms/ http://localhost:8080/realms/ + ProxyPassReverse /realms/ http://localhost:8080/realms/ + ProxyPass /resources/ http://localhost:8080/resources/ + ProxyPassReverse /resources/ http://localhost:8080/resources/ + + # Redirect root to user account management + RewriteEngine on + RewriteRule ^/?$ /realms/EXAMPLE/account [L,R] + + ## Test client that dumps the id_token + #OIDCProviderMetadataURL https://keycloak.example.org/realms/EXAMPLE/.well-known/openid-configuration + #OIDCClientID foo + #OIDCClientSecret bar + #OIDCRedirectURI https://keycloak.example.org/test-client/redirect + #OIDCCryptoPassphrase supersecurepassword + #OIDCInfoHook id_token + # + # AuthType openid-connect + # Require valid-user + # RewriteRule .* /test-client/redirect?info=html + # + + \ No newline at end of file diff --git a/linux-diversion-ath-regd-optional/ath_regd.patch b/linux-diversion-ath-regd-optional/ath_regd.patch new file mode 100644 index 0000000..7e1d73e --- /dev/null +++ b/linux-diversion-ath-regd-optional/ath_regd.patch @@ -0,0 +1,34 @@ +--- a/drivers/net/wireless/ath/Kconfig ++++ b/drivers/net/wireless/ath/Kconfig +@@ -23,6 +23,10 @@ config WLAN_VENDOR_ATH + + if WLAN_VENDOR_ATH + ++config ATH_USER_REGD ++ bool "Do not enforce EEPROM regulatory restrictions" ++ default n ++ + config ATH_DEBUG + bool "Atheros wireless debugging" + help +--- a/drivers/net/wireless/ath/regd.c ++++ b/drivers/net/wireless/ath/regd.c +@@ -43,12 +43,18 @@ + NL80211_RRF_NO_OFDM) + + /* We allow IBSS on these on a case by case basis by regulatory domain */ ++#ifdef CONFIG_ATH_USER_REGD ++#define ATH_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30, 0) ++#define ATH_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30, 0) ++#define ATH_5GHZ_5725_5850 REG_RULE(5725-10, 5850+10, 80, 0, 30, 0) ++#else + #define ATH_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30,\ + NL80211_RRF_NO_IR) + #define ATH_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30,\ + NL80211_RRF_NO_IR) + #define ATH_5GHZ_5725_5850 REG_RULE(5725-10, 5850+10, 80, 0, 30,\ + NL80211_RRF_NO_IR) ++#endif + + #define ATH_2GHZ_ALL ATH_2GHZ_CH01_11, \ + ATH_2GHZ_CH12_13, \ diff --git a/linux-diversion-ath-regd-optional/build.sh b/linux-diversion-ath-regd-optional/build.sh new file mode 100755 index 0000000..1d1dc71 --- /dev/null +++ b/linux-diversion-ath-regd-optional/build.sh @@ -0,0 +1,116 @@ +#!/bin/bash +# +# Build the current linux kernel with a patch permitting ath10k WiFi +# cards with no burned-in regdom to be used as 5 GHz APs again. +# linux-5.6 "sanitizes the regdom value 0x00 (= unset) to +# 0x64 (= worldwide, most restricted), which works fine in STA mode, but +# does not permit setting a more relaxed regdom in AP mode, breaking +# 5 GHz WiFi. +# +# Build instructions from +# https://github.com/twisteroidambassador/arch-linux-ath-user-regd/issues/1 +# +# Revised kernel patch from +# https://github.com/CodePhase/patch-atheros-regdom + +set -xe + +ROOT="$(pwd)" +export BUILDDIR="${ROOT}/build" +export SRCDIR="${ROOT}/build/srcdir" +export PKGDIR="${ROOT}/build/pkgdir" +export PKGDIR_META="${ROOT}/build/pkgdir_meta" +mkdir -p "${SRCDIR}" "${PKGDIR}" "${PKGDIR_META}" + +# Add deb-src lines missing in the docker:bullseye image +sed 's/^Types: deb$/Types: deb-src/g' /etc/apt/sources.list.d/debian.sources > /etc/apt/sources.list.d/10-deb-src.sources + +apt update +apt build-dep -y linux + +# Get kernel version from orig filename +cd "${SRCDIR}" +apt source linux +export LINUX_VERSION=$(ls -1 linux_*.orig.tar.xz | sed -re 's/^linux_(.*).orig.tar.xz$/\1/g' | head -1) +export LINUX_REVISION=$(ls -1 linux_*.dsc | sed -re 's/^linux_(.*).dsc$/\1/g' | head -1) +# Get debian package version from source's debian/control (contains lots +# of binary packages, pick linux-headers-{version}-common, because it's +# the first one. +export DEB_VERSION=$(grep '^Package: linux-headers-.*-common$' "linux-${LINUX_VERSION}/debian/control" \ + | sed -re 's/^Package: linux-headers-(.*)-common$/\1/g') +# Download the already built binary package and extract the kernel config +mkdir -p "${SRCDIR}/unpack/image" "${SRCDIR}/unpack/headers" +cd "${SRCDIR}/unpack/image" +apt download "linux-image-${DEB_VERSION}-amd64" +ar xf "linux-image-${DEB_VERSION}-amd64_${LINUX_REVISION}_amd64.deb" ./data.tar.xz +tar xf data.tar.xz ./boot/config-${DEB_VERSION}-amd64 +# Download the already built headers package and extract symvers +cd "${SRCDIR}/unpack/headers" +apt download "linux-headers-${DEB_VERSION}-amd64" +ar xf "linux-headers-${DEB_VERSION}-amd64_${LINUX_REVISION}_amd64.deb" ./data.tar.xz +tar xf data.tar.xz "./usr/src/linux-headers-${DEB_VERSION}-amd64/Module.symvers" + +# Apply the patch and copy kernel config and symvers +cd "${SRCDIR}/linux-${LINUX_VERSION}" +make clean mrproper +patch -p1 < "${ROOT}/ath_regd.patch" +cp "${SRCDIR}/unpack/image/boot/config-${DEB_VERSION}-amd64" "${SRCDIR}/linux-${LINUX_VERSION}/.config" +cp "${SRCDIR}/unpack/headers/usr/src/linux-headers-${DEB_VERSION}-amd64/Module.symvers" "${SRCDIR}/linux-${LINUX_VERSION}/Module.symvers" +# Set the new configuration flag +./scripts/config --set-val ATH_USER_REGD y +make oldconfig + +# Build and compress the "ath" kernel module +make prepare modules_prepare scripts +make M=drivers/net/wireless/ath + +# This will be used as timestamp in the "ar" archives +export SOURCE_DATE_EPOCH=$(date +%s -r "${SRCDIR}/unpack/image/boot/config-${DEB_VERSION}-amd64") +# Prepare the diversion package +rsync -a "${ROOT}/debian/" "${PKGDIR}/DEBIAN/" +mkdir -p \ + "${PKGDIR}/lib/modules/${DEB_VERSION}-amd64/kernel/drivers/net/wireless/ath" \ + "${PKGDIR}/usr/share/doc/linux-diversion-${DEB_VERSION}-ath-regd-optional" +cp "${SRCDIR}/linux-${LINUX_VERSION}/drivers/net/wireless/ath/ath.ko" \ + "${PKGDIR}/lib/modules/${DEB_VERSION}-amd64/kernel/drivers/net/wireless/ath/ath.ko" +# Insert version numbers into control files +for FILE in $(echo "${PKGDIR}"/DEBIAN/*); do + sed -re "s/__DEB_VERSION__/${DEB_VERSION}/g" -i "${FILE}" + sed -re "s/__LINUX_VERSION__/${LINUX_VERSION}/g" -i "${FILE}" + sed -re "s/__LINUX_REVISION__/${LINUX_REVISION}/g" -i "${FILE}" +done +mv "${PKGDIR}/DEBIAN/changelog" "${PKGDIR}/usr/share/doc/linux-diversion-${DEB_VERSION}-ath-regd-optional/changelog.Debian" +mv "${PKGDIR}/DEBIAN/copyright" "${PKGDIR}/usr/share/doc/linux-diversion-${DEB_VERSION}-ath-regd-optional/" +gzip -9n "${PKGDIR}/usr/share/doc/linux-diversion-${DEB_VERSION}-ath-regd-optional/changelog.Debian" +chown 0:0 -R "${PKGDIR}" +find "${PKGDIR}" -type f -exec chmod 0644 {} \; +find "${PKGDIR}" -type d -exec chmod 0755 {} \; +chmod 0755 "${PKGDIR}/DEBIAN/preinst" "${PKGDIR}/DEBIAN/postinst" "${PKGDIR}/DEBIAN/postrm" +# change mtime to the original package's config file +find "${PKGDIR}" -exec touch -m -r "${SRCDIR}/unpack/image/boot/config-${DEB_VERSION}-amd64" {} \; +# Build the diversion package +cd "${BUILDDIR}" +dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" + +# Prepare the meta package +rsync -a "${ROOT}/debian.meta/" "${PKGDIR_META}/DEBIAN/" +mkdir -p \ + "${PKGDIR_META}/usr/share/doc/linux-diversion-ath-regd-optional" +# Insert version numbers into control files +for FILE in $(echo "${PKGDIR_META}"/DEBIAN/*); do + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${FILE}" + sed -re "s/__DEB_VERSION__/${DEB_VERSION}/g" -i "${FILE}" + sed -re "s/__LINUX_VERSION__/${LINUX_VERSION}/g" -i "${FILE}" + sed -re "s/__LINUX_REVISION__/${LINUX_REVISION}/g" -i "${FILE}" +done +mv "${PKGDIR_META}/DEBIAN/changelog" "${PKGDIR_META}/usr/share/doc/linux-diversion-ath-regd-optional/changelog.Debian" +mv "${PKGDIR_META}/DEBIAN/copyright" "${PKGDIR_META}/usr/share/doc/linux-diversion-ath-regd-optional/" +gzip -9n "${PKGDIR_META}/usr/share/doc/linux-diversion-ath-regd-optional/changelog.Debian" +chown 0:0 -R "${PKGDIR_META}" +find "${PKGDIR_META}" -type f -exec chmod 0644 {} \; +find "${PKGDIR_META}" -type d -exec chmod 0755 {} \; +# change mtime to the original package's config file +find "${PKGDIR_META}" -exec touch -m -r "${SRCDIR}/unpack/image/boot/config-${DEB_VERSION}-amd64" {} \; +# Build the diversion package +cd "${BUILDDIR}" +dpkg-deb --build "${PKGDIR_META}" "${BUILDDIR}" diff --git a/linux-diversion-ath-regd-optional/debian.meta/changelog b/linux-diversion-ath-regd-optional/debian.meta/changelog new file mode 100644 index 0000000..7e4eaaa --- /dev/null +++ b/linux-diversion-ath-regd-optional/debian.meta/changelog @@ -0,0 +1,5 @@ +linux-diversion-ath-regd-optional (__DEB_VERSION__) s3lphrepo; urgency=high + + * Depend on linux-diversion-__DEB_VERSION__-ath-regd-optional (= __LINUX_REVISION__) + + -- __MAINTAINER__ Fri, 25 Feb 2022 00:44:52 +0100 diff --git a/linux-diversion-ath-regd-optional/debian.meta/control b/linux-diversion-ath-regd-optional/debian.meta/control new file mode 100644 index 0000000..de82efe --- /dev/null +++ b/linux-diversion-ath-regd-optional/debian.meta/control @@ -0,0 +1,14 @@ +Package: linux-diversion-ath-regd-optional +Architecture: amd64 +Version: __DEB_VERSION__ +Maintainer: Sebastian Philipp +Section: kernel +Priority: optional +Depends: linux-diversion-__DEB_VERSION__-ath-regd-optional (= __LINUX_REVISION__) +Description: ath kernel module diversion disabling faulty regdom sanitization (metapackage) + Starting with linux-5.10, the "ath" wireless driver "sanitizes" the + regdom value 0x00 (= unset) to 0x64 (= worldwide, most restricted), + which works fine in STA mode, but does not permit setting a more + relaxed regdom in AP mode, breaking 5 GHz Wi-Fi. This package diverts + ath.ko and replaces it with a patched version that does not perform + this sanitization procedure. diff --git a/linux-diversion-ath-regd-optional/debian.meta/copyright b/linux-diversion-ath-regd-optional/debian.meta/copyright new file mode 100644 index 0000000..ac08566 --- /dev/null +++ b/linux-diversion-ath-regd-optional/debian.meta/copyright @@ -0,0 +1,20 @@ +Copyright 2022 s3lph + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/linux-diversion-ath-regd-optional/debian/changelog b/linux-diversion-ath-regd-optional/debian/changelog new file mode 100644 index 0000000..7f901d0 --- /dev/null +++ b/linux-diversion-ath-regd-optional/debian/changelog @@ -0,0 +1,5 @@ +linux-diversion-__DEB_VERSION__-ath-regd-optional (__LINUX_REVISION__) s3lphrepo; urgency=high + + * Add ath.ko for upstream kernel revision __LINUX_REVISION__ + + -- __MAINTAINER__ Fri, 25 Feb 2022 00:44:52 +0100 diff --git a/linux-diversion-ath-regd-optional/debian/control b/linux-diversion-ath-regd-optional/debian/control new file mode 100644 index 0000000..664afa5 --- /dev/null +++ b/linux-diversion-ath-regd-optional/debian/control @@ -0,0 +1,14 @@ +Package: linux-diversion-__DEB_VERSION__-ath-regd-optional +Architecture: amd64 +Version: __LINUX_REVISION__ +Maintainer: Sebastian Philipp +Section: kernel +Priority: optional +Depends: linux-image-__DEB_VERSION__-amd64 (= __LINUX_REVISION__) +Description: ath kernel module diversion disabling faulty regdom sanitization + Starting with linux-5.10, the "ath" wireless driver "sanitizes" the + regdom value 0x00 (= unset) to 0x64 (= worldwide, most restricted), + which works fine in STA mode, but does not permit setting a more + relaxed regdom in AP mode, breaking 5 GHz Wi-Fi. This package diverts + ath.ko and replaces it with a patched version that does not perform + this sanitization procedure. diff --git a/linux-diversion-ath-regd-optional/debian/copyright b/linux-diversion-ath-regd-optional/debian/copyright new file mode 100644 index 0000000..ac08566 --- /dev/null +++ b/linux-diversion-ath-regd-optional/debian/copyright @@ -0,0 +1,20 @@ +Copyright 2022 s3lph + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/linux-diversion-ath-regd-optional/debian/postinst b/linux-diversion-ath-regd-optional/debian/postinst new file mode 100755 index 0000000..713e709 --- /dev/null +++ b/linux-diversion-ath-regd-optional/debian/postinst @@ -0,0 +1,17 @@ +#!/bin/sh +# Based on linux-image-5.10.0-11-amd64 postinst + +set -e + +if [ "$1" != configure ]; then + exit 0 +fi + +depmod __DEB_VERSION__-amd64 + +if [ -d /var/run ]; then + touch /var/run/reboot-required + if ! grep -q "^linux-diversion-__DEB_VERSION__-ath-regd-optional$" /var/run/reboot-required.pkgs 2> /dev/null ; then + echo "linux-diversion-__DEB_VERSION__-ath-regd-optional" >> /var/run/reboot-required.pkgs + fi +fi diff --git a/linux-diversion-ath-regd-optional/debian/postrm b/linux-diversion-ath-regd-optional/debian/postrm new file mode 100755 index 0000000..b38424a --- /dev/null +++ b/linux-diversion-ath-regd-optional/debian/postrm @@ -0,0 +1,20 @@ +#!/bin/sh + +set -e + +if [ remove != "$1" -a abort-install != "$1" -a disappear != "$1" ]; then + exit 0 +fi + +dpkg-divert --package linux-diversion-__DEB_VERSION__-ath-regd-optional --remove --rename --divert \ + /lib/modules/__DEB_VERSION__-amd64/kernel/drivers/net/wireless/ath/ath.ko.orig \ + /lib/modules/__DEB_VERSION__-amd64/kernel/drivers/net/wireless/ath/ath.ko + +depmod __DEB_VERSION__-amd64 + +if [ -d /var/run ]; then + touch /var/run/reboot-required + if ! grep -q "^linux-diversion-__DEB_VERSION__-ath-regd-optional$" /var/run/reboot-required.pkgs 2> /dev/null ; then + echo "linux-diversion-__DEB_VERSION__-ath-regd-optional" >> /var/run/reboot-required.pkgs + fi +fi diff --git a/linux-diversion-ath-regd-optional/debian/preinst b/linux-diversion-ath-regd-optional/debian/preinst new file mode 100755 index 0000000..1b7e508 --- /dev/null +++ b/linux-diversion-ath-regd-optional/debian/preinst @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +dpkg-divert --package linux-diversion-__DEB_VERSION__-ath-regd-optional --add --rename --divert \ + /lib/modules/__DEB_VERSION__-amd64/kernel/drivers/net/wireless/ath/ath.ko.orig \ + /lib/modules/__DEB_VERSION__-amd64/kernel/drivers/net/wireless/ath/ath.ko diff --git a/lottieconverter/build.sh b/lottieconverter/build.sh new file mode 100755 index 0000000..c7c8465 --- /dev/null +++ b/lottieconverter/build.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/sot-tech/LottieConverter/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false ) | "\(.name[8:]) \(.published_at) \(.assets[] | select( .name|test(".*-linux-bin.tar.gz$") ).browser_download_url)"' + + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "lottieconverter.tar.gz" + tar -xf "lottieconverter.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" + cp "${SRCDIR}/lottieconverter" "${PKGDIR}/usr/bin/lottieconverter" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/lottieconverter/debian.control b/lottieconverter/debian.control new file mode 100644 index 0000000..daca0cd --- /dev/null +++ b/lottieconverter/debian.control @@ -0,0 +1,9 @@ +Package: lottieconverter +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Depends: librlottie0-1, libpng16-16, libz1 +Description: Simple lottie (telegram animated sticker) converter + Animation can be converted to png (with transparency) or to gif. diff --git a/lottieconverter/lottieconverter/build.sh b/lottieconverter/lottieconverter/build.sh new file mode 100755 index 0000000..c7c8465 --- /dev/null +++ b/lottieconverter/lottieconverter/build.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/sot-tech/LottieConverter/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false ) | "\(.name[8:]) \(.published_at) \(.assets[] | select( .name|test(".*-linux-bin.tar.gz$") ).browser_download_url)"' + + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "lottieconverter.tar.gz" + tar -xf "lottieconverter.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" + cp "${SRCDIR}/lottieconverter" "${PKGDIR}/usr/bin/lottieconverter" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/lottieconverter/lottieconverter/debian.control b/lottieconverter/lottieconverter/debian.control new file mode 100644 index 0000000..daca0cd --- /dev/null +++ b/lottieconverter/lottieconverter/debian.control @@ -0,0 +1,9 @@ +Package: lottieconverter +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Depends: librlottie0-1, libpng16-16, libz1 +Description: Simple lottie (telegram animated sticker) converter + Animation can be converted to png (with transparency) or to gif. diff --git a/matrix-element-web/debian.conffiles b/matrix-element-web/debian.conffiles new file mode 100644 index 0000000..5b9df1d --- /dev/null +++ b/matrix-element-web/debian.conffiles @@ -0,0 +1,2 @@ +/etc/matrix-element-web/config.json +/etc/apache2/sites-available/matrix-element-web.site.conf diff --git a/matrix-element-web/debian.control b/matrix-element-web/debian.control new file mode 100644 index 0000000..0447285 --- /dev/null +++ b/matrix-element-web/debian.control @@ -0,0 +1,9 @@ +Package: matrix-element-web +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Description: Glossy Matrix collaboration client for the web + Element (formerly known as Vector and Riot) is a Matrix web client + built using the Matrix React SDK. diff --git a/matrix-element-web/matrix-element-web.site.conf b/matrix-element-web/matrix-element-web.site.conf new file mode 100644 index 0000000..e2a2646 --- /dev/null +++ b/matrix-element-web/matrix-element-web.site.conf @@ -0,0 +1,24 @@ + + + ServerName element.example.com + + DocumentRoot /usr/share/matrix-element-web/html + + + Require all granted + AllowOverride All + Options FollowSymLinks MultiViews + + + + Require all granted + AllowOverride All + Options FollowSymLinks MultiViews + + + Header set X-Frame-Options SAMEORIGIN + Header set X-Content-Type-Options nosniff + Header set X-XSS-Protection "1; mode=block" + Header set Content-Security-Policy "frame-ancestors 'self'" + + diff --git a/matrix-element-web/matrix-element-web/debian.conffiles b/matrix-element-web/matrix-element-web/debian.conffiles new file mode 100644 index 0000000..5b9df1d --- /dev/null +++ b/matrix-element-web/matrix-element-web/debian.conffiles @@ -0,0 +1,2 @@ +/etc/matrix-element-web/config.json +/etc/apache2/sites-available/matrix-element-web.site.conf diff --git a/matrix-element-web/matrix-element-web/debian.control b/matrix-element-web/matrix-element-web/debian.control new file mode 100644 index 0000000..0447285 --- /dev/null +++ b/matrix-element-web/matrix-element-web/debian.control @@ -0,0 +1,9 @@ +Package: matrix-element-web +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Description: Glossy Matrix collaboration client for the web + Element (formerly known as Vector and Riot) is a Matrix web client + built using the Matrix React SDK. diff --git a/matrix-element-web/matrix-element-web/matrix-element-web.site.conf b/matrix-element-web/matrix-element-web/matrix-element-web.site.conf new file mode 100644 index 0000000..e2a2646 --- /dev/null +++ b/matrix-element-web/matrix-element-web/matrix-element-web.site.conf @@ -0,0 +1,24 @@ + + + ServerName element.example.com + + DocumentRoot /usr/share/matrix-element-web/html + + + Require all granted + AllowOverride All + Options FollowSymLinks MultiViews + + + + Require all granted + AllowOverride All + Options FollowSymLinks MultiViews + + + Header set X-Frame-Options SAMEORIGIN + Header set X-Content-Type-Options nosniff + Header set X-XSS-Protection "1; mode=block" + Header set Content-Security-Policy "frame-ancestors 'self'" + + diff --git a/matrix-element-web/matrix-element-web/package.sh b/matrix-element-web/matrix-element-web/package.sh new file mode 100755 index 0000000..6e8867e --- /dev/null +++ b/matrix-element-web/matrix-element-web/package.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/vector-im/element-web/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="develop" ) | "\(.tag_name[1:]) \(.published_at) \(.assets[] | select(.name|test("element-.*.tar.gz$")).browser_download_url )"' + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "element-web-${VERSION}.tar.gz" + tar --strip-components 1 -xf "element-web-${VERSION}.tar.gz" + rm -f "element-web-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/share/matrix-element-web" \ + "${PKGDIR}/etc/matrix-element-web" \ + "${PKGDIR}/etc/apache2/sites-available" + cp -r "${SRCDIR}" "${PKGDIR}/usr/share/matrix-element-web/html" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/matrix-element-web.site.conf" "${PKGDIR}/etc/apache2/sites-available/matrix-element-web.site.conf" + mv "${PKGDIR}/usr/share/matrix-element-web/html/config.sample.json" "${PKGDIR}/etc/matrix-element-web/config.json" + ln -s "/etc/matrix-element-web/config.json" "${PKGDIR}/usr/share/matrix-element-web/html/config.json" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + # root:www-data + chown 0:33 -R "${PKGDIR}/usr/share/matrix-element-web" "${PKGDIR}/etc/matrix-element-web" + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/matrix-element-web/package.sh b/matrix-element-web/package.sh new file mode 100755 index 0000000..6e8867e --- /dev/null +++ b/matrix-element-web/package.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/vector-im/element-web/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="develop" ) | "\(.tag_name[1:]) \(.published_at) \(.assets[] | select(.name|test("element-.*.tar.gz$")).browser_download_url )"' + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "element-web-${VERSION}.tar.gz" + tar --strip-components 1 -xf "element-web-${VERSION}.tar.gz" + rm -f "element-web-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/share/matrix-element-web" \ + "${PKGDIR}/etc/matrix-element-web" \ + "${PKGDIR}/etc/apache2/sites-available" + cp -r "${SRCDIR}" "${PKGDIR}/usr/share/matrix-element-web/html" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/matrix-element-web.site.conf" "${PKGDIR}/etc/apache2/sites-available/matrix-element-web.site.conf" + mv "${PKGDIR}/usr/share/matrix-element-web/html/config.sample.json" "${PKGDIR}/etc/matrix-element-web/config.json" + ln -s "/etc/matrix-element-web/config.json" "${PKGDIR}/usr/share/matrix-element-web/html/config.json" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + # root:www-data + chown 0:33 -R "${PKGDIR}/usr/share/matrix-element-web" "${PKGDIR}/etc/matrix-element-web" + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/matrix-hydrogen/build.sh b/matrix-hydrogen/build.sh new file mode 100755 index 0000000..7d0b4a5 --- /dev/null +++ b/matrix-hydrogen/build.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/vector-im/hydrogen-web/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.tag_name[1:]) \(.published_at) \(.assets[] | select(.name|test("hydrogen-web-.*.tar.gz$")).browser_download_url )"' + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "hydrogen-web-${VERSION}.tar.gz" + tar -xf "hydrogen-web-${VERSION}.tar.gz" + rm -f "hydrogen-web-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/share/matrix-hydrogen" \ + "${PKGDIR}/etc/matrix-hydrogen" \ + "${PKGDIR}/etc/apache2/sites-available" + cp -r "${SRCDIR}" "${PKGDIR}/usr/share/matrix-hydrogen/html" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/matrix-hydrogen.site.conf" "${PKGDIR}/etc/apache2/sites-available/matrix-hydrogen.site.conf" + mv "${PKGDIR}/usr/share/matrix-hydrogen/html/config.sample.json" "${PKGDIR}/etc/matrix-hydrogen/config.json" + ln -s "/etc/matrix-hydrogen/config.json" "${PKGDIR}/usr/share/matrix-hydrogen/html/config.json" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + # root:www-data + chown 0:33 -R "${PKGDIR}/usr/share/matrix-hydrogen" "${PKGDIR}/etc/matrix-hydrogen" + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/matrix-hydrogen/debian.conffiles b/matrix-hydrogen/debian.conffiles new file mode 100644 index 0000000..3c7a90c --- /dev/null +++ b/matrix-hydrogen/debian.conffiles @@ -0,0 +1,2 @@ +/etc/matrix-hydrogen/config.json +/etc/apache2/sites-available/matrix-hydrogen.site.conf diff --git a/matrix-hydrogen/debian.control b/matrix-hydrogen/debian.control new file mode 100644 index 0000000..8b8140a --- /dev/null +++ b/matrix-hydrogen/debian.control @@ -0,0 +1,10 @@ +Package: matrix-hydrogen +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Description: Lightweight matrix client with legacy and mobile browser support + A minimal Matrix chat client, focused on performance, offline + functionality, and broad browser support. This is work in progress + and not yet ready for primetime. diff --git a/matrix-hydrogen/matrix-hydrogen.site.conf b/matrix-hydrogen/matrix-hydrogen.site.conf new file mode 100644 index 0000000..0056e06 --- /dev/null +++ b/matrix-hydrogen/matrix-hydrogen.site.conf @@ -0,0 +1,47 @@ + + + ServerName hydrogen.example.com + + DocumentRoot /usr/share/matrix-hydrogen/html + + + Require all granted + AllowOverride All + Options FollowSymLinks MultiViews + + + + Require all granted + AllowOverride All + Options FollowSymLinks MultiViews + + + + Header unset ETag + Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" + Header set Pragma "no-cache" + Header set Expires "Thu, 01 Jan 1970 00:00:00 GMT" + + + + Header unset ETag + Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" + Header set Pragma "no-cache" + Header set Expires "Thu, 01 Jan 1970 00:00:00 GMT" + + + + Header unset ETag + Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" + Header set Pragma "no-cache" + Header set Expires "Thu, 01 Jan 1970 00:00:00 GMT" + + + + Header unset ETag + Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" + Header set Pragma "no-cache" + Header set Expires "Thu, 01 Jan 1970 00:00:00 GMT" + + + \ No newline at end of file diff --git a/matrix-hydrogen/matrix-hydrogen/build.sh b/matrix-hydrogen/matrix-hydrogen/build.sh new file mode 100755 index 0000000..7d0b4a5 --- /dev/null +++ b/matrix-hydrogen/matrix-hydrogen/build.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/vector-im/hydrogen-web/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.tag_name[1:]) \(.published_at) \(.assets[] | select(.name|test("hydrogen-web-.*.tar.gz$")).browser_download_url )"' + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "hydrogen-web-${VERSION}.tar.gz" + tar -xf "hydrogen-web-${VERSION}.tar.gz" + rm -f "hydrogen-web-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/share/matrix-hydrogen" \ + "${PKGDIR}/etc/matrix-hydrogen" \ + "${PKGDIR}/etc/apache2/sites-available" + cp -r "${SRCDIR}" "${PKGDIR}/usr/share/matrix-hydrogen/html" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/matrix-hydrogen.site.conf" "${PKGDIR}/etc/apache2/sites-available/matrix-hydrogen.site.conf" + mv "${PKGDIR}/usr/share/matrix-hydrogen/html/config.sample.json" "${PKGDIR}/etc/matrix-hydrogen/config.json" + ln -s "/etc/matrix-hydrogen/config.json" "${PKGDIR}/usr/share/matrix-hydrogen/html/config.json" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + # root:www-data + chown 0:33 -R "${PKGDIR}/usr/share/matrix-hydrogen" "${PKGDIR}/etc/matrix-hydrogen" + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/matrix-hydrogen/matrix-hydrogen/debian.conffiles b/matrix-hydrogen/matrix-hydrogen/debian.conffiles new file mode 100644 index 0000000..3c7a90c --- /dev/null +++ b/matrix-hydrogen/matrix-hydrogen/debian.conffiles @@ -0,0 +1,2 @@ +/etc/matrix-hydrogen/config.json +/etc/apache2/sites-available/matrix-hydrogen.site.conf diff --git a/matrix-hydrogen/matrix-hydrogen/debian.control b/matrix-hydrogen/matrix-hydrogen/debian.control new file mode 100644 index 0000000..8b8140a --- /dev/null +++ b/matrix-hydrogen/matrix-hydrogen/debian.control @@ -0,0 +1,10 @@ +Package: matrix-hydrogen +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Description: Lightweight matrix client with legacy and mobile browser support + A minimal Matrix chat client, focused on performance, offline + functionality, and broad browser support. This is work in progress + and not yet ready for primetime. diff --git a/matrix-hydrogen/matrix-hydrogen/matrix-hydrogen.site.conf b/matrix-hydrogen/matrix-hydrogen/matrix-hydrogen.site.conf new file mode 100644 index 0000000..0056e06 --- /dev/null +++ b/matrix-hydrogen/matrix-hydrogen/matrix-hydrogen.site.conf @@ -0,0 +1,47 @@ + + + ServerName hydrogen.example.com + + DocumentRoot /usr/share/matrix-hydrogen/html + + + Require all granted + AllowOverride All + Options FollowSymLinks MultiViews + + + + Require all granted + AllowOverride All + Options FollowSymLinks MultiViews + + + + Header unset ETag + Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" + Header set Pragma "no-cache" + Header set Expires "Thu, 01 Jan 1970 00:00:00 GMT" + + + + Header unset ETag + Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" + Header set Pragma "no-cache" + Header set Expires "Thu, 01 Jan 1970 00:00:00 GMT" + + + + Header unset ETag + Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" + Header set Pragma "no-cache" + Header set Expires "Thu, 01 Jan 1970 00:00:00 GMT" + + + + Header unset ETag + Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" + Header set Pragma "no-cache" + Header set Expires "Thu, 01 Jan 1970 00:00:00 GMT" + + + \ No newline at end of file diff --git a/matrix.to/build.sh b/matrix.to/build.sh new file mode 100755 index 0000000..a9f6786 --- /dev/null +++ b/matrix.to/build.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +set -exo pipefail + +. ../.skel/helpers.sh + +PKGNAME=matrix.to +API_URL=https://api.github.com/repos/matrix-org/matrix.to/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="main" ) | "\(.tag_name) \(.published_at) \(.tarball_url)"' + +apt update +apt install --yes nodejs npm + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + mkdir -p "${PKGNAME}-${VERSION}" + wget "${URL}" --output-document "${PKGNAME}-${VERSION}.tar.gz" + tar -x -C "${PKGNAME}-${VERSION}" --strip-components=1 -f "${PKGNAME}-${VERSION}.tar.gz" + rm "${PKGNAME}-${VERSION}.tar.gz" +} + +function prepare() { + cd "${ROOT}" + npm install yarn + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/share/matrix.to/html/" \ + "${PKGDIR}/usr/share/doc/matrix.to/" + cd "${SRCDIR}/${PKGNAME}-${VERSION}" + "${ROOT}/node_modules/.bin/yarn" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + rsync -a "${SRCDIR}/${PKGNAME}-${VERSION}/index.html" "${PKGDIR}/usr/share/matrix.to/html/index.html" + rsync -a "${SRCDIR}/${PKGNAME}-${VERSION}/src/" "${PKGDIR}/usr/share/matrix.to/html/src/" + rsync -a "${SRCDIR}/${PKGNAME}-${VERSION}/css/" "${PKGDIR}/usr/share/matrix.to/html/css/" + rsync -a "${SRCDIR}/${PKGNAME}-${VERSION}/images/" "${PKGDIR}/usr/share/matrix.to/html/images/" + github_changelog matrix-org/matrix.to + chown root:www-data -R "${PKGDIR}/usr/share/matrix.to" + find "${PKGDIR}/usr/share/matrix.to" -type d -exec chmod 0755 {} \; + find "${PKGDIR}/usr/share/matrix.to" -type f -exec chmod 0644 {} \; + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/matrix.to/debian.control b/matrix.to/debian.control new file mode 100644 index 0000000..a7a1a54 --- /dev/null +++ b/matrix.to/debian.control @@ -0,0 +1,11 @@ +Package: matrix.to +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Description: Simple stateless privacy-protecting URL redirecting service for Matrix. + Matrix.to is a simple url redirection service for the Matrix.org + ecosystem which lets users share links to matrix entities without being + tied to a specific app. Stylistically it serves as a landing page for + rooms and communities. diff --git a/matterbridge/build.sh b/matterbridge/build.sh new file mode 100755 index 0000000..c90b79f --- /dev/null +++ b/matterbridge/build.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +set -exo pipefail + +N_RELEASES=1 +API_URL=https://api.github.com/repos/42wim/matterbridge/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.tag_name[1:]) \(.published_at) \(.assets[] | select( .name|test(".*-linux-64bit$") ).browser_download_url)"' + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "matterbridge-${VERSION}-linux-amd64" +} + +function prepare() { + chmod +x "${SRCDIR}/matterbridge-${VERSION}-linux-amd64" + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/matterbridge" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/var/lib/matterbridge/upload" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/matterbridge-${VERSION}-linux-amd64" "${PKGDIR}/usr/bin/matterbridge" + cp "${ROOT}/matterbridge.service" "${PKGDIR}/lib/systemd/system/matterbridge.service" + cp "${ROOT}/matterbridge-upload-cleanup.service" "${PKGDIR}/lib/systemd/system/matterbridge-upload-cleanup.service" + cp "${ROOT}/matterbridge-upload-cleanup.timer" "${PKGDIR}/lib/systemd/system/matterbridge-upload-cleanup.timer" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + cp "${ROOT}/matterbridge.toml.sample" "${PKGDIR}/etc/matterbridge/matterbridge.toml.sample" + cp "${ROOT}/matterbridge.toml" "${PKGDIR}/etc/matterbridge/matterbridge.toml" + cp "${ROOT}/matterbridge.default" "${PKGDIR}/etc/default/matterbridge" + 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() { + while read VERSION ISODATE URL; do + export VERSION + export ISODATE + export URL + export BUILDDIR=${ROOT}/build + export SRCDIR=${ROOT}/build/${VERSION}/srcdir + export PKGDIR=${ROOT}/build/${VERSION}/pkgdir + mkdir -p ${SRCDIR} ${PKGDIR} + fetch + prepare + package + done <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head "-${N_RELEASES}") +} + + +build diff --git a/matterbridge/debian.conffiles b/matterbridge/debian.conffiles new file mode 100644 index 0000000..03fedea --- /dev/null +++ b/matterbridge/debian.conffiles @@ -0,0 +1,2 @@ +/etc/matterbridge/matterbridge.toml +/etc/default/matterbridge diff --git a/matterbridge/debian.control b/matterbridge/debian.control new file mode 100644 index 0000000..13f3020 --- /dev/null +++ b/matterbridge/debian.control @@ -0,0 +1,9 @@ +Package: matterbridge +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Depends: findutils +Description: A simple chat bridge + Bridges between a growing number of protocols. diff --git a/matterbridge/debian.postinst b/matterbridge/debian.postinst new file mode 100755 index 0000000..ab4631f --- /dev/null +++ b/matterbridge/debian.postinst @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group matterbridge >/dev/null; then + groupadd --system matterbridge + fi + + if ! getent passwd matterbridge >/dev/null; then + useradd --system --gid matterbridge --home-dir /var/lib/matterbridge --shell /bin/bash matterbridge + fi + + chown matterbridge:matterbridge /var/lib/matterbridge + chmod 0750 /var/lib/matterbridge + chown root:matterbridge /etc/matterbridge/ /etc/matterbridge/matterbridge.toml + chmod 0750 /etc/matterbridge/ + chmod 0640 /etc/matterbridge/matterbridge.toml + + systemctl daemon-reload || true + +fi + +systemctl try-restart matterbridge.service || true + diff --git a/matterbridge/debian.postrm b/matterbridge/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/matterbridge/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/matterbridge/debian.prerm b/matterbridge/debian.prerm new file mode 100755 index 0000000..0ffab50 --- /dev/null +++ b/matterbridge/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop matterbridge.service || true + +fi diff --git a/matterbridge/matterbridge-upload-cleanup.service b/matterbridge/matterbridge-upload-cleanup.service new file mode 100644 index 0000000..58aa0dd --- /dev/null +++ b/matterbridge/matterbridge-upload-cleanup.service @@ -0,0 +1,10 @@ +[Unit] +Description=Clean up old files from matterbridge's upload directory + +[Service] +Type=oneshot +EnvironmentFile=-/etc/default/matterbridge +ExecStart=find /var/lib/matterbridge/upload -type f -mtime +${UPLOAD_DIRECTORY_RETENTION_DAYS} -delete +User=matterbridge +Group=matterbridge +WorkingDirectory=/var/lib/matterbridge diff --git a/matterbridge/matterbridge-upload-cleanup.timer b/matterbridge/matterbridge-upload-cleanup.timer new file mode 100644 index 0000000..8433315 --- /dev/null +++ b/matterbridge/matterbridge-upload-cleanup.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Daily cleanup of old files in matterbridge's upload directory + +[Timer] +OnCalendar=daily +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/matterbridge/matterbridge.default b/matterbridge/matterbridge.default new file mode 100644 index 0000000..2515475 --- /dev/null +++ b/matterbridge/matterbridge.default @@ -0,0 +1,20 @@ +# Command line options for matterbridge. Possible options are: +# +# -conf string +# config file (default "matterbridge.toml") +# -debug +# enable debug +# -gops +# enable gops agent +# -version +# show version +# +ARGS=-conf /etc/matterbridge/matterbridge.toml + +# Number of days after which media in the upload directory should be +# removed. +# +# Warning: This variable is passed directly to "find-delete". Don't +# try anything fancy here and just use integers. +# +UPLOAD_DIRECTORY_RETENTION_DAYS=30 \ No newline at end of file diff --git a/matterbridge/matterbridge.service b/matterbridge/matterbridge.service new file mode 100644 index 0000000..0f24b29 --- /dev/null +++ b/matterbridge/matterbridge.service @@ -0,0 +1,14 @@ +[Unit] +Description=Matterbridge chat bridge +After=network.target + +[Service] +EnvironmentFile=-/etc/default/matterbridge +ExecStart=/usr/bin/matterbridge $ARGS +User=matterbridge +Group=matterbridge +WorkingDirectory=/var/lib/matterbridge +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/matterbridge/matterbridge.toml b/matterbridge/matterbridge.toml new file mode 100644 index 0000000..08b1f5e --- /dev/null +++ b/matterbridge/matterbridge.toml @@ -0,0 +1,9 @@ + +[general] +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +# This package contains a cronjob to automatically remove old files from the upload directory +MediaDownloadPath="/var/lib/matterbridge/upload" +MediaServerDownload="https://example.com/upload" + +# See /etc/matterbridge/matterbridge.toml.sample for how to configure \ No newline at end of file diff --git a/matterbridge/matterbridge.toml.sample b/matterbridge/matterbridge.toml.sample new file mode 100644 index 0000000..b1574f3 --- /dev/null +++ b/matterbridge/matterbridge.toml.sample @@ -0,0 +1,1828 @@ +#This is configuration for matterbridge. +#WARNING: as this file contains credentials, be sure to set correct file permissions +#See https://github.com/42wim/matterbridge/wiki/How-to-create-your-config for how to create your config +#See https://github.com/42wim/matterbridge/wiki/Settings for all settings +################################################################### +#IRC section +################################################################### +#REQUIRED to start IRC section +[irc] + +#You can configure multiple servers "[irc.name]" or "[irc.name2]" +#In this example we use [irc.freenode] +#REQUIRED +[irc.freenode] +#irc server to connect to. +#REQUIRED +Server="irc.freenode.net:6667" + +#Password for irc server (if necessary) +#OPTIONAL (default "") +Password="" + +#Enable to use TLS connection to your irc server. +#OPTIONAL (default false) +UseTLS=false + +#Enable SASL (PLAIN) authentication. (freenode requires this from eg AWS hosts) +#It uses NickServNick and NickServPassword as login and password +#OPTIONAL (default false) +UseSASL=false + +#Enable to not verify the certificate on your irc server. +#e.g. when using selfsigned certificates +#OPTIONAL (default false) +SkipTLSVerify=true + +#If you know your charset, you can specify it manually. +#Otherwise it tries to detect this automatically. Select one below +# "iso-8859-2:1987", "iso-8859-9:1989", "866", "latin9", "iso-8859-10:1992", "iso-ir-109", "hebrew", +# "cp932", "iso-8859-15", "cp437", "utf-16be", "iso-8859-3:1988", "windows-1251", "utf16", "latin6", +# "latin3", "iso-8859-1:1987", "iso-8859-9", "utf-16le", "big5", "cp819", "asmo-708", "utf-8", +# "ibm437", "iso-ir-157", "iso-ir-144", "latin4", "850", "iso-8859-5", "iso-8859-5:1988", "l3", +# "windows-31j", "utf8", "iso-8859-3", "437", "greek", "iso-8859-8", "l6", "l9-iso-8859-15", +# "iso-8859-2", "latin2", "iso-ir-100", "iso-8859-6", "arabic", "iso-ir-148", "us-ascii", "x-sjis", +# "utf16be", "iso-8859-8:1988", "utf16le", "l4", "utf-16", "iso-ir-138", "iso-8859-7", "iso-8859-7:1987", +# "windows-1252", "l2", "koi8-r", "iso8859-1", "latin1", "ecma-114", "iso-ir-110", "elot-928", +# "iso-ir-126", "iso-8859-1", "iso-ir-127", "cp850", "cyrillic", "greek8", "windows-1250", "iso-latin-1", +# "l5", "ibm866", "cp866", "ms-kanji", "ibm850", "ecma-118", "iso-ir-101", "ibm819", "l1", "iso-8859-6:1987", +# "latin5", "ascii", "sjis", "iso-8859-10", "iso-8859-4", "iso-8859-4:1988", "shift-jis +# The select charset will be converted to utf-8 when sent to other bridges. +#OPTIONAL (default "") +Charset="" + +#Your nick on irc. +#REQUIRED +Nick="matterbot" + +#If you registered your bot with a service like Nickserv on freenode. +#Also being used when UseSASL=true +# +#Note: if you want do to quakenet auth, set NickServNick="Q@CServe.quakenet.org" +#OPTIONAL +NickServNick="nickserv" +NickServPassword="secret" + +#OPTIONAL only used for quakenet auth +NickServUsername="username" + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Flood control +#Delay in milliseconds between each message send to the IRC server +#OPTIONAL (default 1300) +MessageDelay=1300 + +#Maximum amount of messages to hold in queue. If queue is full +#messages will be dropped. +# will be add to the message that fills the queue. +#OPTIONAL (default 30) +MessageQueue=30 + +#Maximum length of message sent to irc server. If it exceeds +# will be add to the message. +#OPTIONAL (default 400) +MessageLength=400 + +#Split messages on MessageLength instead of showing the +#WARNING: this could lead to flooding +#OPTIONAL (default false) +MessageSplit=false + +#Delay in seconds to rejoin a channel when kicked +#OPTIONAL (default 0) +RejoinDelay=0 + +#ColorNicks will show each nickname in a different color. +#Only works in IRC right now. +ColorNicks=false + +#RunCommands allows you to send RAW irc commands after connection +#Array of strings +#OPTIONAL (default empty) +RunCommands=["PRIVMSG user hello","PRIVMSG chanserv something"] + +#StripMarkdown strips markdown from messages +#OPTIONAL (default false) +StripMarkdown=false + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="ircspammer1 ircspammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +#The string "{NOPINGNICK}" (case sensitive) will be replaced by the actual nick / username, but with a ZWSP inside the nick, so the irc user with the same nick won't get pinged. See https://github.com/42wim/matterbridge/issues/175 for more information +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#Enable to show verbose users joins/parts (ident@host) from other bridges +#Currently works for messages from the following bridges: irc +#OPTIONAL (default false) +VerboseJoinPart=false + +#Do not send joins/parts to other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack +#OPTIONAL (default false) +NoSendJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +#Delay in milliseconds between channel joins +#Only useful when you have a LOT of channels to join +#See https://github.com/42wim/matterbridge/issues/1084 +#OPTIONAL (default 0) +JoinDelay=0 + +################################################################### +#XMPP section +################################################################### +[xmpp] + +#You can configure multiple servers "[xmpp.name]" or "[xmpp.name2]" +#In this example we use [xmpp.jabber] +#REQUIRED +[xmpp.jabber] +#xmpp server to connect to. +#REQUIRED +Server="jabber.example.com:5222" + +#Jid +#REQUIRED +Jid="user@example.com" + +#Password +#REQUIRED +Password="yourpass" + +#MUC +#REQUIRED +Muc="conference.jabber.example.com" + +#Your nick in the rooms +#REQUIRED +Nick="xmppbot" + +#Enable to not verify the certificate on your xmpp server. +#e.g. when using selfsigned certificates +#OPTIONAL (default false) +SkipTLSVerify=true + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="ircspammer1 ircspammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#Messages you want to replace. +#It replaces outgoing messages from the bridge. +#So you need to place it by the sending bridge definition. +#Regular expressions supported +#Some examples: +#This replaces cat => dog and sleep => awake +#ReplaceMessages=[ ["cat","dog"], ["sleep","awake"] ] +#This Replaces every number with number. 123 => numbernumbernumber +#ReplaceMessages=[ ["[0-9]","number"] ] +#OPTIONAL (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#Nicks you want to replace. +#See ReplaceMessages for syntaxA +#OPTIONAL (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +#mattermost section +################################################################### +[mattermost] +#You can configure multiple servers "[mattermost.name]" or "[mattermost.name2]" +#In this example we use [mattermost.work] +#REQUIRED + +[mattermost.work] +#The mattermost hostname. (do not prefix it with http or https) +#REQUIRED (when not using webhooks) +Server="yourmattermostserver.domain" + +#Your team on mattermost. +#REQUIRED (when not using webhooks) +Team="yourteam" + +#login/pass of your bot. +#Use a dedicated user for this and not your own! +#REQUIRED (when not using webhooks) +Login="yourlogin" +Password="yourpass" + +#personal access token of the bot. +#new feature since mattermost 4.1. See https://docs.mattermost.com/developer/personal-access-tokens.html +#OPTIONAL (you can use token instead of login/password) +#Token="abcdefghijklm" + +#Enable this to make a http connection (instead of https) to your mattermost. +#OPTIONAL (default false) +NoTLS=false + +#### Settings for webhook matterbridge. +#NOT RECOMMENDED TO USE INCOMING/OUTGOING WEBHOOK. USE DEDICATED BOT USER WHEN POSSIBLE! +#You don't need to configure this, if you have configured the settings +#above. + +#Url is your incoming webhook url as specified in mattermost. +#See account settings - integrations - incoming webhooks on mattermost. +#If specified, messages will be sent to mattermost using this URL +#OPTIONAL +WebhookURL="https://yourdomain/hooks/yourhookkey" + +#Address to listen on for outgoing webhook requests from mattermost. +#See account settings - integrations - outgoing webhooks on mattermost. +#If specified, messages will be received from mattermost on this ip:port +#(this will only work if WebhookURL above is also configured) +#OPTIONAL +WebhookBindAddress="0.0.0.0:9999" + +#Icon that will be showed in mattermost. +#This only works when WebhookURL is configured +#OPTIONAL +IconURL="http://youricon.png" + +#### End settings for webhook matterbridge. + +#Enable to not verify the certificate on your mattermost server. +#e.g. when using selfsigned certificates +#OPTIONAL (default false) +SkipTLSVerify=true + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#how to format the list of IRC nicks when displayed in mattermost. +#Possible options are "table" and "plain" +#OPTIONAL (default plain) +NickFormatter="plain" +#How many nicks to list per row for formatters that support this. +#OPTIONAL (default 4) +NicksPerRow=4 + +#Skip the Mattermost server version checks that are normally done when connecting. +#The usage scenario for this feature would be when the Mattermost instance is hosted behind a +#reverse proxy that suppresses "non-standard" response headers in flight. +#OPTIONAL (default false) +SkipVersionCheck=false + +#Whether to prefix messages from other bridges to mattermost with the sender's nick. +#Useful if username overrides for incoming webhooks isn't enabled on the +#mattermost server. If you set PrefixMessagesWithNick to true, each message +#from bridge to Mattermost will by default be prefixed by "bridge-" + nick. You can, +#however, modify how the messages appear, by setting (and modifying) RemoteNickFormat +#OPTIONAL (default false) +PrefixMessagesWithNick=false + +#Disable sending of edits to other bridges +#OPTIONAL (default false) +EditDisable=false + +#Message to be appended to every edited message +#OPTIONAL (default empty) +EditSuffix=" (edited)" + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="ircspammer1 ircspammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#Do not send joins/parts to other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack +#OPTIONAL (default false) +NoSendJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +#Gitter section +#Best to make a dedicated gitter account for the bot. +################################################################### + +[gitter] + +#You can configure multiple servers "[gitter.name]" or "[gitter.name2]" +#In this example we use [gitter.myproject] +#REQUIRED +[gitter.myproject] +#Token to connect with Gitter API +#You can get your token by going to https://developer.gitter.im/docs/welcome and SIGN IN +#REQUIRED +Token="Yourtokenhere" + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="ircspammer1 ircspammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +# +# Keybase +# You should have a separate bridge account on Keybase +# (it also needs to be logged in on the system you're running the bridge on) +# +################################################################### + +[keybase.myteam] + +# RemoteNickFormat defines how remote users appear on this bridge +# See [general] config section for default options +RemoteNickFormat="{NICK} ({PROTOCOL}): " + +# extra label that can be used in the RemoteNickFormat +# optional (default empty) +Label="" + +# Your team on Keybase. +# The bot user MUST be a member of this team +# REQUIRED +Team="myteam" + +################################################################### +# Microsoft teams section +# See https://github.com/42wim/matterbridge/wiki/MS-Teams-setup +################################################################### + +[msteams.myteam] + +# TenantID +# See https://github.com/42wim/matterbridge/wiki/MS-Teams-setup#get-necessary-ids-for-matterbridge +TenantID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + +# ClientID +# See https://github.com/42wim/matterbridge/wiki/MS-Teams-setup#get-necessary-ids-for-matterbridge +ClientID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + +# TeamID +# See https://github.com/42wim/matterbridge/wiki/MS-Teams-setup#get-necessary-ids-for-matterbridge +TeamID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="ircspammer1 ircspammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +#Opportunistically preserve threaded replies between bridges +#that support threading +#OPTIONAL (default false) +PreserveThreading=false + +################################################################### +#slack section +################################################################### +[slack] + +#You can configure multiple servers "[slack.name]" or "[slack.name2]" +#In this example we use [slack.hobby] +#REQUIRED +[slack.hobby] +#Token to connect with the Slack API +#You'll have to use a test/api-token using a dedicated user and not a bot token. +#See https://github.com/42wim/matterbridge/issues/75 for more info. +#Use https://api.slack.com/custom-integrations/legacy-tokens +#REQUIRED (when not using webhooks) +Token="yourslacktoken" + +#Extra slack specific debug info, warning this generates a lot of output. +#OPTIONAL (default false) +Debug="false" + +#### Settings for webhook matterbridge. +#NOT RECOMMENDED TO USE INCOMING/OUTGOING WEBHOOK. USE SLACK API +#AND DEDICATED BOT USER WHEN POSSIBLE! +#Url is your incoming webhook url as specified in slack +#See account settings - integrations - incoming webhooks on slack +#OPTIONAL +WebhookURL="https://hooks.slack.com/services/yourhook" + +#NOT RECOMMENDED TO USE INCOMING/OUTGOING WEBHOOK. USE SLACK API +#AND DEDICATED BOT USER WHEN POSSIBLE! +#Address to listen on for outgoing webhook requests from slack +#See account settings - integrations - outgoing webhooks on slack +#webhooks +#OPTIONAL +WebhookBindAddress="0.0.0.0:9999" + +#Icon that will be showed in slack +#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. +#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge +#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge +#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge +#OPTIONAL +IconURL="https://robohash.org/{NICK}.png?size=48x48" + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#how to format the list of IRC nicks when displayed in slack +#Possible options are "table" and "plain" +#OPTIONAL (default plain) +NickFormatter="plain" +#How many nicks to list per row for formatters that support this. +#OPTIONAL (default 4) +NicksPerRow=4 + +#Disable sending of edits to other bridges +#OPTIONAL (default false) +EditDisable=true + +#Message to be appended to every edited message +#OPTIONAL (default empty) +EditSuffix=" (edited)" + +#Whether to prefix messages from other bridges to mattermost with RemoteNickFormat +#Useful if username overrides for incoming webhooks isn't enabled on the +#slack server. If you set PrefixMessagesWithNick to true, each message +#from bridge to Slack will by default be prefixed by "bridge-" + nick. You can, +#however, modify how the messages appear, by setting (and modifying) RemoteNickFormat +#OPTIONAL (default false) +PrefixMessagesWithNick=false + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="ircspammer1 ircspammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#Do not send joins/parts to other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack +#OPTIONAL (default false) +NoSendJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +#Opportunistically preserve threaded replies between Slack channels. +#This only works if the parent message is still in the cache. +#Cache is flushed between restarts. +#Note: Not currently working on gateways with mixed bridges of +# both slack and slack-legacy type. Context in issue #624. +#OPTIONAL (default false) +PreserveThreading=false + +#Enable showing "user_typing" events from across gateway when available. +#Protip: Set your bot/user's "Full Name" to be "Someone (over chat bridge)", +#and so the message will say "Someone (over chat bridge) is typing". +#OPTIONAL (default false) +ShowUserTyping=false + +################################################################### +#discord section +################################################################### +[discord] + +# You can configure multiple servers "[discord.name]" or "[discord.name2]" +# In this example we use [discord.game] +#REQUIRED +[discord.game] +# Token (REQUIRED) is the token to connect with Discord API +# You can get your token by following the instructions on +# https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token +# If you want roles/groups mentions to be shown with names instead of ID, you'll need to give your bot the "Manage Roles" permission. +Token="Yourtokenhere" + +# Server (REQUIRED) is the ID or name of the guild to connect to, selected from the guilds the bot has been invited to +Server="yourservername" + +## RELOADABLE SETTINGS +## All settings below can be reloaded by editing the file. +## They are also all optional. + +# ShowEmbeds shows the title, description and URL of embedded messages (sent by other bots) +ShowEmbeds=false + +# UseLocalAvatar specifies source bridges for which an avatar should be 'guessed' when an incoming message has no avatar. +# This works by comparing the username of the message to an existing Discord user, and using the avatar of the Discord user. +# +# This only works if WebhookURL is set (AND the message has no avatar). +# Example: ["irc"] +UseLocalAvatar=[] + +# UseUserName shows the username instead of the server nickname +UseUserName=false + +# UseDiscriminator appends the `#xxxx` discriminator when used with UseUserName +UseDiscriminator=false + +# WebhookURL sends messages in the style of puppets. +# This only works if you have one discord channel, if you have multiple discord channels you'll have to specify it in the gateway config +# Example: "https://discordapp.com/api/webhooks/1234/abcd_xyzw" +WebhookURL="" + +# EditDisable disables sending of edits to other bridges +EditDisable=false + +# EditSuffix specifies the message to be appended to every edited message +# Example: " (edited)" +EditSuffix="" + +# IgnoreNicks mutes outgoing messages from certain users. +# Messages from these users will not be transmitted to other bridges. +# Regular expressions are also supported. +# Example: "ircspammer1 ircspammer2" +IgnoreNicks="" + +# IgnoreMessages mutes outgoing messages of a certain format. +# Messages matching this regular expression will not be transmitted sent to other bridges +# See https://regex-golang.appspot.com/assets/html/index.html for more regex info +# +# Example that ignores messages starting with ~~ or messages containing badword: +# IgnoreMessages="^~~ badword" +IgnoreMessages="" + +# ReplaceMessages replaces substrings of messages in outgoing messages. +# Regular expressions are supported. +# +# Example that replaces 'cat' => 'dog' and 'sleep' => 'awake': +# ReplaceMessages=[ ["cat","dog"], ["sleep","awake"] ] +# Example that replaces all digits with the letter 'X', so 'hello123' becomes 'helloXXX': +# ReplaceMessages=[ ["[0-9]","X"] ] +ReplaceMessages=[] + +# ReplaceNicks replaces substrings of usernames in outgoing messages. +# See the ReplaceMessages setting for examples. +# Example: [ ["user--","user"] ] +ReplaceNicks=[] + +# ExtractNicks allows for interoperability with other bridge software by rewriting messages and extracting usernames. +# +# Recommended reading: +# - https://github.com/42wim/matterbridge/issues/466 +# - https://github.com/42wim/matterbridge/issues/713 +# +# This example translates the following message +# "Relaybot: something interesting" +# into this message +# "relayeduser: something interesting" +# like so: +# ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +# +# This example translates the following message +# "otherbot: (relayeduser) something else" +# into this message +# "relayeduser: something else" +# like so: +# ExtractNicks=[ [ "otherbot","\\((.*?)\\)\\s+" ] ] +# +# This example combines both of the above examples into one: +# ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +# +ExtractNicks=[] + +# Label is as an extra identifier for use in the RemoteNickFormat setting. +Label="" + +# RemoteNickFormat formats how remote users appear on this bridge. +# See the [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +# ShowJoinPart emits messages that show joins/parts from other bridges +# Supported from the following bridges: irc, mattermost, slack, discord +ShowJoinPart=false + +# StripNick strips non-alphanumeric characters from nicknames. +# Recommended reading: https://github.com/42wim/matterbridge/issues/285 +StripNick=false + +# ShowTopicChange emits messages that show topic/purpose updates from other bridges +# Supported from the following bridges: slack +ShowTopicChange=false + +# SyncTopic synchronises topic/purpose updates from other bridges +# Supported from the following bridges: slack +SyncTopic=false + +################################################################### +#telegram section +################################################################### +[telegram] + +#You can configure multiple servers "[telegram.name]" or "[telegram.name2]" +#In this example we use [telegram.secure] +#REQUIRED +[telegram.secure] +#Token to connect with telegram API +#See https://core.telegram.org/bots#6-botfather and https://www.linkedin.com/pulse/telegram-bots-beginners-marco-frau +#REQUIRED +Token="Yourtokenhere" + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#OPTIONAL (default empty) +#Supported formats are: +#"HTML" https://core.telegram.org/bots/api#html-style +#"Markdown" https://core.telegram.org/bots/api#markdown-style - deprecated, doesn't display links with underscores correctly +#"MarkdownV2" https://core.telegram.org/bots/api#markdownv2-style +#"HTMLNick" - only allows HTML for the nick, the message itself will be html-escaped +MessageFormat="" + +#OPTIONAL (default false) +#Disables link previews for links in messages +DisableWebPagePreview=false + +#If enabled use the "First Name" as username. If this is empty use the Username +#If disabled use the "Username" as username. If this is empty use the First Name +#If all names are empty, username will be "unknown" +#OPTIONAL (default false) +UseFirstName=false + +#WARNING! If enabled this will relay GIF/stickers/documents and other attachments as URLs +#Those URLs will contain your bot-token. This may not be what you want. +#For now there is no secure way to relay GIF/stickers/documents without seeing your token. +#OPTIONAL (default false) +UseInsecureURL=false + +#Disable quoted/reply messages +#OPTIONAL (default false) +QuoteDisable=false + +#Set the max. quoted length if 0 the whole message will be quoted +#OPTIONAL (default 0) +QuoteLengthLimit=0 + +#Format quoted/reply messages +#OPTIONAL (default "{MESSAGE} (re @{QUOTENICK}: {QUOTEMESSAGE})") +QuoteFormat="{MESSAGE} (re @{QUOTENICK}: {QUOTEMESSAGE})" + +#Convert WebP images to PNG before upload. +#https://github.com/42wim/matterbridge/issues/398 +#OPTIONAL (default false) +MediaConvertWebPToPNG=false + +#Disable sending of edits to other bridges +#OPTIONAL (default false) +EditDisable=false + +#Message to be appended to every edited message +#OPTIONAL (default empty) +EditSuffix=" (edited)" + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="spammer1 spammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +# +#WARNING: if you have set MessageFormat="HTML" be sure that this format matches the guidelines +#on https://core.telegram.org/bots/api#html-style otherwise the message will not go through to +#telegram! eg <{NICK}> should be <{NICK}> +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +#rocketchat section +################################################################### +[rocketchat] +#You can configure multiple servers "[rocketchat.name]" or "[rocketchat.name2]" +#In this example we use [rocketchat.work] +#REQUIRED + +[rocketchat.rockme] +#The rocketchat hostname. (prefix it with http or https) +#REQUIRED (when not using webhooks) +Server="https://yourrocketchatserver.domain.com:443" + +#login/pass of your bot. +#login needs to be the login with email address! user@domain.com +#Use a dedicated user for this and not your own! +#REQUIRED (when not using webhooks) +Login="yourlogin@domain.com" +Password="yourpass" +# When using access token set Login to the User ID associated with your token and Token to your token. +# When Token is set Password is ignored. +# Login="yOurUSerID" +# Token="YoUrUsER_toKEN" + + +#### Settings for webhook matterbridge. +#USE DEDICATED BOT USER WHEN POSSIBLE! This allows you to use advanced features like message editing/deleting and uploads +#You don't need to configure this, if you have configured the settings +#above. + +#Url is your incoming webhook url as specified in rocketchat +#Read #https://rocket.chat/docs/administrator-guides/integrations/#how-to-create-a-new-incoming-webhook +#See administration - integrations - new integration - incoming webhook +#REQUIRED +WebhookURL="https://yourdomain/hooks/yourhookkey" + +#Address to listen on for outgoing webhook requests from rocketchat. +#See administration - integrations - new integration - outgoing webhook +#REQUIRED +WebhookBindAddress="0.0.0.0:9999" + +#Your nick/username as specified in your incoming webhook "Post as" setting +#REQUIRED +Nick="matterbot" + +#Enable this to make a http connection (instead of https) to your rocketchat +#OPTIONAL (default false) +NoTLS=false + +#Enable to not verify the certificate on your rocketchat server. +#e.g. when using selfsigned certificates +#OPTIONAL (default false) +SkipTLSVerify=true + +#### End settings for webhook matterbridge. + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Whether to prefix messages from other bridges to rocketchat with the sender's nick. +#Useful if username overrides for incoming webhooks isn't enabled on the +#rocketchat server. If you set PrefixMessagesWithNick to true, each message +#from bridge to rocketchat will by default be prefixed by the RemoteNickFormat setting. i +#if you're using login/pass you can better enable because of this bug: +#https://github.com/RocketChat/Rocket.Chat/issues/7549 +#OPTIONAL (default false) +PrefixMessagesWithNick=false + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="ircspammer1 ircspammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +#matrix section +################################################################### +[matrix] +#You can configure multiple servers "[matrix.name]" or "[matrix.name2]" +#In this example we use [matrix.neo] +#REQUIRED + +[matrix.neo] +#Server is your homeserver (eg https://matrix.org) +#REQUIRED +Server="https://matrix.org" + +#login/pass of your bot. +#Use a dedicated user for this and not your own! +#Messages sent from this user will not be relayed to avoid loops. +#REQUIRED +Login="yourlogin" +Password="yourpass" + +#Whether to send the homeserver suffix. eg ":matrix.org" in @username:matrix.org +#to other bridges, or only send "username".(true only sends username) +#OPTIONAL (default false) +NoHomeServerSuffix=false + +#Whether to disable sending of HTML content to matrix +#See https://github.com/42wim/matterbridge/issues/1022 +#OPTIONAL (default false) +HTMLDisable=false + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Whether to prefix messages from other bridges to matrix with the sender's nick. +#Useful if username overrides for incoming webhooks isn't enabled on the +#matrix server. If you set PrefixMessagesWithNick to true, each message +#from bridge to matrix will by default be prefixed by the RemoteNickFormat setting. i +#OPTIONAL (default false) +PrefixMessagesWithNick=false + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="spammer1 spammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +#steam section +################################################################### +[steam] +#You can configure multiple servers "[steam.name]" or "[steam.name2]" +#In this example we use [steam.gamechat] +#REQUIRED + +[steam.gamechat] +#login/pass of your bot. +#Use a dedicated user for this and not your own account! +#REQUIRED +Login="yourlogin" +Password="yourpass" + +#steamguard mail authcode (not the 2FA code) +#OPTIONAL +Authcode="ABCE12" + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Whether to prefix messages from other bridges to matrix with the sender's nick. +#Useful if username overrides for incoming webhooks isn't enabled on the +#matrix server. If you set PrefixMessagesWithNick to true, each message +#from bridge to matrix will by default be prefixed by the RemoteNickFormat setting. i +#OPTIONAL (default false) +PrefixMessagesWithNick=false + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="spammer1 spammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +# +# NCTalk (Nextcloud Talk) +# +################################################################### + +[nctalk.bridge] + +# Url of your Nextcloud server +Server = "https://cloud.youdomain.me" + +# Enable to not verify the certificate on your Nextcloud server. +# e.g. when using selfsigned certificates +# OPTIONAL (default false) +SkipTLSVerify=true + +# Username of the bot +Login = "talkuser" + +# Password of the bot +Password = "talkuserpass" + +################################################################### +# +# WhatsApp +# +################################################################### + +[whatsapp.bridge] + +# Number you will use as a relay bot. Tip: Get some disposable sim card, don't rely on your own number. +Number="+48111222333" + +# First time that you login you will need to scan QR code, then credentials willl be saved in a session file +# If you won't set SessionFile then you will need to scan QR code on every restart +# optional (by default the session is stored only in memory, till restarting matterbridge) +SessionFile="session-48111222333.gob" + +# If your terminal is white we need to invert QR code in order for it to be scanned properly +# optional (default false) +QrOnWhiteTerminal=true + +# Messages will be seen by other WhatsApp contacts as coming from the bridge. Original nick will be part of the message. +RemoteNickFormat="@{NICK}: " + +# extra label that can be used in the RemoteNickFormat +# optional (default empty) +Label="Organization" + + + +################################################################### +# +# zulip +# +################################################################### + +[zulip] + +#You can configure multiple servers "[zulip.name]" or "[zulip.name2]" +#In this example we use [zulip.streamchat] +#REQUIRED + +[zulip.streamchat] +#Token to connect with zulip API (called bot API key in Settings - Your bots) +#REQUIRED +Token="Yourtokenhere" + +#Username of the bot, normally called yourbot-bot@yourserver.zulipchat.com +#See username in Settings - Your bots +#REQUIRED +Login="yourbot-bot@yourserver.zulipchat.com" + +#Servername of your zulip instance +#REQUIRED +Server="https://yourserver.zulipchat.com" + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="spammer1 spammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +#API +################################################################### +[api] +#You can configure multiple API hooks +#In this example we use [api.local] +#REQUIRED + +[api.local] +#Address to listen on for API +#REQUIRED +BindAddress="127.0.0.1:4242" + +#Amount of messages to keep in memory +#OPTIONAL (library default 10) +Buffer=1000 + +#Bearer token used for authentication +#curl -H "Authorization: Bearer token" http://localhost:4242/api/messages +# https://github.com/vi/websocat +# websocat -H="Authorization: Bearer token" ws://127.0.0.1:4242/api/websocket +#OPTIONAL (no authorization if token is empty) +Token="mytoken" + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="{NICK}" + + + +################################################################### +#General configuration +################################################################### +# Settings here are defaults that each protocol can override +[general] + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#RemoteNickFormat defines how remote users appear on this bridge +#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. +#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge +#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge +#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge +#The string "{GATEWAY}" (case sensitive) will be replaced by the origin gateway name that is replicating the message. +#The string "{CHANNEL}" (case sensitive) will be replaced by the origin channel name used by the bridge +#The string "{TENGO}" (case sensitive) will be replaced by the output of the RemoteNickFormat script under [tengo] +#OPTIONAL (default empty) +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + + +#MediaServerUpload (or MediaDownloadPath) and MediaServerDownload are used for uploading +#images/files/video to a remote "mediaserver" (a webserver like caddy for example). +#When configured images/files uploaded on bridges like mattermost, slack, telegram will be +#downloaded and uploaded again to MediaServerUpload URL +#MediaDownloadPath is the filesystem path where the media file will be placed, instead of uploaded, +#for if Matterbridge has write access to the directory your webserver is serving. +#It is an alternative to MediaServerUpload. +#The MediaServerDownload will be used so that bridges without native uploading support: +#gitter, irc and xmpp will be shown links to the files on MediaServerDownload +# +#More information https://github.com/42wim/matterbridge/wiki/Mediaserver-setup-%5Badvanced%5D +#OPTIONAL (default empty) +MediaServerUpload="https://user:pass@yourserver.com/upload" +#OPTIONAL (default empty) +MediaDownloadPath="/srv/http/yourserver.com/public/download" +#OPTIONAL (default empty) +MediaServerDownload="https://youserver.com/download" + +#MediaDownloadSize is the maximum size of attachments, videos, images +#matterbridge will download and upload this file to bridges that also support uploading files. +#eg downloading from slack to upload it to mattermost +# +#It will only download from bridges that don't have public links available, which are for the moment +#slack, telegram, matrix and mattermost +# +#OPTIONAL (default 1000000 (1 megabyte)) +MediaDownloadSize=1000000 + +#MediaDownloadBlacklist allows you to blacklist specific files from being downloaded. +#Filenames matching these regexp will not be download/uploaded to the mediaserver +#You can use regex for this, see https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (default empty) +MediaDownloadBlacklist=[".html$",".htm$"] + +#IgnoreFailureOnStart allows you to ignore failing bridges on startup. +#Matterbridge will disable the failed bridge and continue with the other ones. +#Context: https://github.com/42wim/matterbridge/issues/455 +#OPTIONAL (default false) +IgnoreFailureOnStart=false + +#LogFile defines the location of a file to write logs into, rather +#than stdout. +#Logging will still happen on stdout if the file cannot be open for +#writing, or if the value is empty. Note that the log won't roll, so +#you might want to use logrotate(8) with this feature. +#OPTIONAL (default empty) +LogFile="/var/log/matterbridge.log" + +################################################################### +#Tengo configuration +################################################################### +#More information about tengo on: https://github.com/d5/tengo/blob/master/docs/tutorial.md and +#https://github.com/d5/tengo/blob/master/docs/stdlib.md + +[tengo] +#InMessage allows you to specify the location of a tengo (https://github.com/d5/tengo/) script. +#This script will receive every incoming message and can be used to modify the Username and the Text of that message. +#The script will have the following global variables: +#to modify: msgUsername and msgText +#to read: msgChannel and msgAccount +# +#The script is reloaded on every message, so you can modify the script on the fly. +# +#Example script can be found in https://github.com/42wim/matterbridge/tree/master/gateway/bench.tengo +#and https://github.com/42wim/matterbridge/tree/master/contrib/example.tengo +# +#The example below will check if the text contains blah and if so, it'll replace the text and the username of that message. +#text := import("text") +#if text.re_match("blah",msgText) { +# msgText="replaced by this" +# msgUsername="fakeuser" +#} +#OPTIONAL (default empty) +InMessage="example.tengo" + +#OutMessage allows you to specify the location of the script that +#will be invoked on each message being sent to a bridge and can be used to modify the Username +#and the Text of that message. +# +#The script will have the following global variables: +#read-only: +#inAccount, inProtocol, inChannel, inGateway, inEvent +#outAccount, outProtocol, outChannel, outGateway, outEvent +# +#read-write: +#msgText, msgUsername +# +#The script is reloaded on every message, so you can modify the script on the fly. +# +#The default script in https://github.com/42wim/matterbridge/tree/master/internal/tengo/outmessage.tengo +#is compiled in and will be executed if no script is specified. +#OPTIONAL (default empty) +OutMessage="example.tengo" + + +#RemoteNickFormat allows you to specify the location of a tengo (https://github.com/d5/tengo/) script. +#The script will have the following global variables: +#to modify: result +#to read: channel, bridge, gateway, protocol, nick +# +#The result will be set in {TENGO} in the RemoteNickFormat key of every bridge where {TENGO} is specified +# +#The script is reloaded on every message, so you can modify the script on the fly. +# +#Example script can be found in https://github.com/42wim/matterbridge/tree/master/contrib/remotenickformat.tengo +# +#OPTIONAL (default empty) +RemoteNickFormat="remotenickformat.tengo" + +################################################################### +#Gateway configuration +################################################################### + +#You can specify multiple gateways using [[gateway]] +#Each gateway has a [[gateway.in]] and a [[gateway.out]] +#[[gateway.in]] specifies the account and channels we will receive messages from. +#[[gateway.out]] specifies the account and channels we will send the messages +#from [[gateway.in]] to. +# +#Most of the time [[gateway.in]] and [[gateway.out]] are the same if you +#want bidirectional bridging. You can then use [[gateway.inout]] +# + +[[gateway]] +#REQUIRED and UNIQUE +name="gateway1" +#Enable enables this gateway +##OPTIONAL (default false) +enable=true + + # [[gateway.in]] specifies the account and channels we will receive messages from. + # The following example bridges between mattermost and irc + [[gateway.in]] + + # account specified above + # REQUIRED + account="irc.freenode" + + # The channel key in each gateway is mapped to a similar group chat ID on the chat platform + # To find the group chat ID for different platforms, refer to the table below + # + # Platform | Identifier name | Example | Description + # ------------------------------------------------------------------------------------------------------------------------------------- + # | channel | general | Do not include the # symbol + # discord | channel id | ID:123456789 | See https://github.com/42wim/matterbridge/issues/57 + # | category/channel | Media/gaming | Without # symbol. If you're using discord categories to group your channels + # ------------------------------------------------------------------------------------------------------------------------------------- + # gitter | username/room | general | As seen in the gitter.im URL + # ------------------------------------------------------------------------------------------------------------------------------------- + # hipchat | id_channel | example needed | See https://www.hipchat.com/account/xmpp for the correct channel + # ------------------------------------------------------------------------------------------------------------------------------------- + # irc | channel | #general | The # symbol is required and should be lowercase! + # ------------------------------------------------------------------------------------------------------------------------------------- + # mattermost | channel | general | This is the channel name as seen in the URL, not the display name + # ------------------------------------------------------------------------------------------------------------------------------------- + # matrix | #channel:server | #yourchannel:matrix.org | Encrypted rooms are not supported in matrix + # ------------------------------------------------------------------------------------------------------------------------------------- + # msteams | threadId | 19:82abcxx@thread.skype | You'll find the threadId in the URL + # ------------------------------------------------------------------------------------------------------------------------------------- + # rocketchat | channel | #channel | # is required for private channels too + # ------------------------------------------------------------------------------------------------------------------------------------- + # slack | channel name | general | Do not include the # symbol + # | channel id | ID:C123456 | The underlying ID of a channel. This doesn't work with + # ------------------------------------------------------------------------------------------------------------------------------------- + # steam | chatid | example needed | The number in the URL when you click "enter chat room" in the browser + # ------------------------------------------------------------------------------------------------------------------------------------- + # nctalk | token | xs25tz5y | The token in the URL when you are in a chat. It will be the last part of the URL. + # ------------------------------------------------------------------------------------------------------------------------------------- + # telegram | chatid | -123456789 | A large negative number. see https://www.linkedin.com/pulse/telegram-bots-beginners-marco-frau + # ------------------------------------------------------------------------------------------------------------------------------------- + # whatsapp | group JID | 48111222333-123455678999@g.us | A unique group JID. If you specify an empty string, bridge will list all the possibilities + # | "Group Name" | "Family Chat" | if you specify a group name, the bridge will find hint the JID to specify. Names can change over time and are not stable. + # ------------------------------------------------------------------------------------------------------------------------------------- + # xmpp | channel | general | The room name + # ------------------------------------------------------------------------------------------------------------------------------------- + # zulip | stream/topic:topic | general/off-topic:food | Do not use the # when specifying a topic + # ------------------------------------------------------------------------------------------------------------------------------------- + + # + # REQUIRED + channel="#testing" + + #OPTIONAL - only used for IRC and XMPP protocols at the moment + [gateway.in.options] + #OPTIONAL - your irc / xmpp channel key + key="yourkey" + + + #[[gateway.out]] specifies the account and channels we will sent messages to. + [[gateway.out]] + account="irc.freenode" + channel="#testing" + + #OPTIONAL - only used for IRC and XMPP protocols at the moment + [gateway.out.options] + #OPTIONAL - your irc / xmpp channel key + key="yourkey" + + #[[gateway.inout]] can be used when then channel will be used to receive from + #and send messages to + [[gateway.inout]] + account="mattermost.work" + channel="off-topic" + + #OPTIONAL - only used for IRC and XMPP protocols at the moment + [gateway.inout.options] + #OPTIONAL - your irc / xmpp channel key + key="yourkey" + + [[gateway.inout]] + account="discord.game" + channel="mygreatgame" + + #OPTIONAL - webhookurl only works for discord (it needs a different URL for each cahnnel) + [gateway.inout.options] + webhookurl="https://discordapp.com/api/webhooks/123456789123456789/C9WPqExYWONPDZabcdef-def1434FGFjstasJX9pYht73y" + + [[gateway.inout]] + account="zulip.streamchat" + channel="general/topic:mytopic" + + #API example + #[[gateway.inout]] + #account="api.local" + #channel="api" + #To send data to the api: + #curl -XPOST -H 'Content-Type: application/json' -d '{"text":"test","username":"randomuser","gateway":"gateway1"}' http://localhost:4242/api/message + #To read from the api: + #curl http://localhost:4242/api/messages + +#If you want to do a 1:1 mapping between protocols where the channelnames are the same +#e.g. slack and mattermost you can use the samechannelgateway configuration +#the example configuration below send messages from channel testing on mattermost to +#channel testing on slack and vice versa. (and for the channel testing2 and testing3) + +[[samechannelgateway]] + name="samechannel1" + enable = false + accounts = [ "mattermost.work","slack.hobby" ] + channels = [ "testing","testing2","testing3"] diff --git a/matterbridge/matterbridge/build.sh b/matterbridge/matterbridge/build.sh new file mode 100755 index 0000000..c90b79f --- /dev/null +++ b/matterbridge/matterbridge/build.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +set -exo pipefail + +N_RELEASES=1 +API_URL=https://api.github.com/repos/42wim/matterbridge/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.tag_name[1:]) \(.published_at) \(.assets[] | select( .name|test(".*-linux-64bit$") ).browser_download_url)"' + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "matterbridge-${VERSION}-linux-amd64" +} + +function prepare() { + chmod +x "${SRCDIR}/matterbridge-${VERSION}-linux-amd64" + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/matterbridge" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/var/lib/matterbridge/upload" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/matterbridge-${VERSION}-linux-amd64" "${PKGDIR}/usr/bin/matterbridge" + cp "${ROOT}/matterbridge.service" "${PKGDIR}/lib/systemd/system/matterbridge.service" + cp "${ROOT}/matterbridge-upload-cleanup.service" "${PKGDIR}/lib/systemd/system/matterbridge-upload-cleanup.service" + cp "${ROOT}/matterbridge-upload-cleanup.timer" "${PKGDIR}/lib/systemd/system/matterbridge-upload-cleanup.timer" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + cp "${ROOT}/matterbridge.toml.sample" "${PKGDIR}/etc/matterbridge/matterbridge.toml.sample" + cp "${ROOT}/matterbridge.toml" "${PKGDIR}/etc/matterbridge/matterbridge.toml" + cp "${ROOT}/matterbridge.default" "${PKGDIR}/etc/default/matterbridge" + 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() { + while read VERSION ISODATE URL; do + export VERSION + export ISODATE + export URL + export BUILDDIR=${ROOT}/build + export SRCDIR=${ROOT}/build/${VERSION}/srcdir + export PKGDIR=${ROOT}/build/${VERSION}/pkgdir + mkdir -p ${SRCDIR} ${PKGDIR} + fetch + prepare + package + done <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head "-${N_RELEASES}") +} + + +build diff --git a/matterbridge/matterbridge/debian.conffiles b/matterbridge/matterbridge/debian.conffiles new file mode 100644 index 0000000..03fedea --- /dev/null +++ b/matterbridge/matterbridge/debian.conffiles @@ -0,0 +1,2 @@ +/etc/matterbridge/matterbridge.toml +/etc/default/matterbridge diff --git a/matterbridge/matterbridge/debian.control b/matterbridge/matterbridge/debian.control new file mode 100644 index 0000000..13f3020 --- /dev/null +++ b/matterbridge/matterbridge/debian.control @@ -0,0 +1,9 @@ +Package: matterbridge +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Depends: findutils +Description: A simple chat bridge + Bridges between a growing number of protocols. diff --git a/matterbridge/matterbridge/debian.postinst b/matterbridge/matterbridge/debian.postinst new file mode 100755 index 0000000..ab4631f --- /dev/null +++ b/matterbridge/matterbridge/debian.postinst @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group matterbridge >/dev/null; then + groupadd --system matterbridge + fi + + if ! getent passwd matterbridge >/dev/null; then + useradd --system --gid matterbridge --home-dir /var/lib/matterbridge --shell /bin/bash matterbridge + fi + + chown matterbridge:matterbridge /var/lib/matterbridge + chmod 0750 /var/lib/matterbridge + chown root:matterbridge /etc/matterbridge/ /etc/matterbridge/matterbridge.toml + chmod 0750 /etc/matterbridge/ + chmod 0640 /etc/matterbridge/matterbridge.toml + + systemctl daemon-reload || true + +fi + +systemctl try-restart matterbridge.service || true + diff --git a/matterbridge/matterbridge/debian.postrm b/matterbridge/matterbridge/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/matterbridge/matterbridge/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/matterbridge/matterbridge/debian.prerm b/matterbridge/matterbridge/debian.prerm new file mode 100755 index 0000000..0ffab50 --- /dev/null +++ b/matterbridge/matterbridge/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop matterbridge.service || true + +fi diff --git a/matterbridge/matterbridge/matterbridge-upload-cleanup.service b/matterbridge/matterbridge/matterbridge-upload-cleanup.service new file mode 100644 index 0000000..58aa0dd --- /dev/null +++ b/matterbridge/matterbridge/matterbridge-upload-cleanup.service @@ -0,0 +1,10 @@ +[Unit] +Description=Clean up old files from matterbridge's upload directory + +[Service] +Type=oneshot +EnvironmentFile=-/etc/default/matterbridge +ExecStart=find /var/lib/matterbridge/upload -type f -mtime +${UPLOAD_DIRECTORY_RETENTION_DAYS} -delete +User=matterbridge +Group=matterbridge +WorkingDirectory=/var/lib/matterbridge diff --git a/matterbridge/matterbridge/matterbridge-upload-cleanup.timer b/matterbridge/matterbridge/matterbridge-upload-cleanup.timer new file mode 100644 index 0000000..8433315 --- /dev/null +++ b/matterbridge/matterbridge/matterbridge-upload-cleanup.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Daily cleanup of old files in matterbridge's upload directory + +[Timer] +OnCalendar=daily +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/matterbridge/matterbridge/matterbridge.default b/matterbridge/matterbridge/matterbridge.default new file mode 100644 index 0000000..2515475 --- /dev/null +++ b/matterbridge/matterbridge/matterbridge.default @@ -0,0 +1,20 @@ +# Command line options for matterbridge. Possible options are: +# +# -conf string +# config file (default "matterbridge.toml") +# -debug +# enable debug +# -gops +# enable gops agent +# -version +# show version +# +ARGS=-conf /etc/matterbridge/matterbridge.toml + +# Number of days after which media in the upload directory should be +# removed. +# +# Warning: This variable is passed directly to "find-delete". Don't +# try anything fancy here and just use integers. +# +UPLOAD_DIRECTORY_RETENTION_DAYS=30 \ No newline at end of file diff --git a/matterbridge/matterbridge/matterbridge.service b/matterbridge/matterbridge/matterbridge.service new file mode 100644 index 0000000..0f24b29 --- /dev/null +++ b/matterbridge/matterbridge/matterbridge.service @@ -0,0 +1,14 @@ +[Unit] +Description=Matterbridge chat bridge +After=network.target + +[Service] +EnvironmentFile=-/etc/default/matterbridge +ExecStart=/usr/bin/matterbridge $ARGS +User=matterbridge +Group=matterbridge +WorkingDirectory=/var/lib/matterbridge +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/matterbridge/matterbridge/matterbridge.toml b/matterbridge/matterbridge/matterbridge.toml new file mode 100644 index 0000000..08b1f5e --- /dev/null +++ b/matterbridge/matterbridge/matterbridge.toml @@ -0,0 +1,9 @@ + +[general] +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +# This package contains a cronjob to automatically remove old files from the upload directory +MediaDownloadPath="/var/lib/matterbridge/upload" +MediaServerDownload="https://example.com/upload" + +# See /etc/matterbridge/matterbridge.toml.sample for how to configure \ No newline at end of file diff --git a/matterbridge/matterbridge/matterbridge.toml.sample b/matterbridge/matterbridge/matterbridge.toml.sample new file mode 100644 index 0000000..b1574f3 --- /dev/null +++ b/matterbridge/matterbridge/matterbridge.toml.sample @@ -0,0 +1,1828 @@ +#This is configuration for matterbridge. +#WARNING: as this file contains credentials, be sure to set correct file permissions +#See https://github.com/42wim/matterbridge/wiki/How-to-create-your-config for how to create your config +#See https://github.com/42wim/matterbridge/wiki/Settings for all settings +################################################################### +#IRC section +################################################################### +#REQUIRED to start IRC section +[irc] + +#You can configure multiple servers "[irc.name]" or "[irc.name2]" +#In this example we use [irc.freenode] +#REQUIRED +[irc.freenode] +#irc server to connect to. +#REQUIRED +Server="irc.freenode.net:6667" + +#Password for irc server (if necessary) +#OPTIONAL (default "") +Password="" + +#Enable to use TLS connection to your irc server. +#OPTIONAL (default false) +UseTLS=false + +#Enable SASL (PLAIN) authentication. (freenode requires this from eg AWS hosts) +#It uses NickServNick and NickServPassword as login and password +#OPTIONAL (default false) +UseSASL=false + +#Enable to not verify the certificate on your irc server. +#e.g. when using selfsigned certificates +#OPTIONAL (default false) +SkipTLSVerify=true + +#If you know your charset, you can specify it manually. +#Otherwise it tries to detect this automatically. Select one below +# "iso-8859-2:1987", "iso-8859-9:1989", "866", "latin9", "iso-8859-10:1992", "iso-ir-109", "hebrew", +# "cp932", "iso-8859-15", "cp437", "utf-16be", "iso-8859-3:1988", "windows-1251", "utf16", "latin6", +# "latin3", "iso-8859-1:1987", "iso-8859-9", "utf-16le", "big5", "cp819", "asmo-708", "utf-8", +# "ibm437", "iso-ir-157", "iso-ir-144", "latin4", "850", "iso-8859-5", "iso-8859-5:1988", "l3", +# "windows-31j", "utf8", "iso-8859-3", "437", "greek", "iso-8859-8", "l6", "l9-iso-8859-15", +# "iso-8859-2", "latin2", "iso-ir-100", "iso-8859-6", "arabic", "iso-ir-148", "us-ascii", "x-sjis", +# "utf16be", "iso-8859-8:1988", "utf16le", "l4", "utf-16", "iso-ir-138", "iso-8859-7", "iso-8859-7:1987", +# "windows-1252", "l2", "koi8-r", "iso8859-1", "latin1", "ecma-114", "iso-ir-110", "elot-928", +# "iso-ir-126", "iso-8859-1", "iso-ir-127", "cp850", "cyrillic", "greek8", "windows-1250", "iso-latin-1", +# "l5", "ibm866", "cp866", "ms-kanji", "ibm850", "ecma-118", "iso-ir-101", "ibm819", "l1", "iso-8859-6:1987", +# "latin5", "ascii", "sjis", "iso-8859-10", "iso-8859-4", "iso-8859-4:1988", "shift-jis +# The select charset will be converted to utf-8 when sent to other bridges. +#OPTIONAL (default "") +Charset="" + +#Your nick on irc. +#REQUIRED +Nick="matterbot" + +#If you registered your bot with a service like Nickserv on freenode. +#Also being used when UseSASL=true +# +#Note: if you want do to quakenet auth, set NickServNick="Q@CServe.quakenet.org" +#OPTIONAL +NickServNick="nickserv" +NickServPassword="secret" + +#OPTIONAL only used for quakenet auth +NickServUsername="username" + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Flood control +#Delay in milliseconds between each message send to the IRC server +#OPTIONAL (default 1300) +MessageDelay=1300 + +#Maximum amount of messages to hold in queue. If queue is full +#messages will be dropped. +# will be add to the message that fills the queue. +#OPTIONAL (default 30) +MessageQueue=30 + +#Maximum length of message sent to irc server. If it exceeds +# will be add to the message. +#OPTIONAL (default 400) +MessageLength=400 + +#Split messages on MessageLength instead of showing the +#WARNING: this could lead to flooding +#OPTIONAL (default false) +MessageSplit=false + +#Delay in seconds to rejoin a channel when kicked +#OPTIONAL (default 0) +RejoinDelay=0 + +#ColorNicks will show each nickname in a different color. +#Only works in IRC right now. +ColorNicks=false + +#RunCommands allows you to send RAW irc commands after connection +#Array of strings +#OPTIONAL (default empty) +RunCommands=["PRIVMSG user hello","PRIVMSG chanserv something"] + +#StripMarkdown strips markdown from messages +#OPTIONAL (default false) +StripMarkdown=false + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="ircspammer1 ircspammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +#The string "{NOPINGNICK}" (case sensitive) will be replaced by the actual nick / username, but with a ZWSP inside the nick, so the irc user with the same nick won't get pinged. See https://github.com/42wim/matterbridge/issues/175 for more information +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#Enable to show verbose users joins/parts (ident@host) from other bridges +#Currently works for messages from the following bridges: irc +#OPTIONAL (default false) +VerboseJoinPart=false + +#Do not send joins/parts to other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack +#OPTIONAL (default false) +NoSendJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +#Delay in milliseconds between channel joins +#Only useful when you have a LOT of channels to join +#See https://github.com/42wim/matterbridge/issues/1084 +#OPTIONAL (default 0) +JoinDelay=0 + +################################################################### +#XMPP section +################################################################### +[xmpp] + +#You can configure multiple servers "[xmpp.name]" or "[xmpp.name2]" +#In this example we use [xmpp.jabber] +#REQUIRED +[xmpp.jabber] +#xmpp server to connect to. +#REQUIRED +Server="jabber.example.com:5222" + +#Jid +#REQUIRED +Jid="user@example.com" + +#Password +#REQUIRED +Password="yourpass" + +#MUC +#REQUIRED +Muc="conference.jabber.example.com" + +#Your nick in the rooms +#REQUIRED +Nick="xmppbot" + +#Enable to not verify the certificate on your xmpp server. +#e.g. when using selfsigned certificates +#OPTIONAL (default false) +SkipTLSVerify=true + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="ircspammer1 ircspammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#Messages you want to replace. +#It replaces outgoing messages from the bridge. +#So you need to place it by the sending bridge definition. +#Regular expressions supported +#Some examples: +#This replaces cat => dog and sleep => awake +#ReplaceMessages=[ ["cat","dog"], ["sleep","awake"] ] +#This Replaces every number with number. 123 => numbernumbernumber +#ReplaceMessages=[ ["[0-9]","number"] ] +#OPTIONAL (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#Nicks you want to replace. +#See ReplaceMessages for syntaxA +#OPTIONAL (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +#mattermost section +################################################################### +[mattermost] +#You can configure multiple servers "[mattermost.name]" or "[mattermost.name2]" +#In this example we use [mattermost.work] +#REQUIRED + +[mattermost.work] +#The mattermost hostname. (do not prefix it with http or https) +#REQUIRED (when not using webhooks) +Server="yourmattermostserver.domain" + +#Your team on mattermost. +#REQUIRED (when not using webhooks) +Team="yourteam" + +#login/pass of your bot. +#Use a dedicated user for this and not your own! +#REQUIRED (when not using webhooks) +Login="yourlogin" +Password="yourpass" + +#personal access token of the bot. +#new feature since mattermost 4.1. See https://docs.mattermost.com/developer/personal-access-tokens.html +#OPTIONAL (you can use token instead of login/password) +#Token="abcdefghijklm" + +#Enable this to make a http connection (instead of https) to your mattermost. +#OPTIONAL (default false) +NoTLS=false + +#### Settings for webhook matterbridge. +#NOT RECOMMENDED TO USE INCOMING/OUTGOING WEBHOOK. USE DEDICATED BOT USER WHEN POSSIBLE! +#You don't need to configure this, if you have configured the settings +#above. + +#Url is your incoming webhook url as specified in mattermost. +#See account settings - integrations - incoming webhooks on mattermost. +#If specified, messages will be sent to mattermost using this URL +#OPTIONAL +WebhookURL="https://yourdomain/hooks/yourhookkey" + +#Address to listen on for outgoing webhook requests from mattermost. +#See account settings - integrations - outgoing webhooks on mattermost. +#If specified, messages will be received from mattermost on this ip:port +#(this will only work if WebhookURL above is also configured) +#OPTIONAL +WebhookBindAddress="0.0.0.0:9999" + +#Icon that will be showed in mattermost. +#This only works when WebhookURL is configured +#OPTIONAL +IconURL="http://youricon.png" + +#### End settings for webhook matterbridge. + +#Enable to not verify the certificate on your mattermost server. +#e.g. when using selfsigned certificates +#OPTIONAL (default false) +SkipTLSVerify=true + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#how to format the list of IRC nicks when displayed in mattermost. +#Possible options are "table" and "plain" +#OPTIONAL (default plain) +NickFormatter="plain" +#How many nicks to list per row for formatters that support this. +#OPTIONAL (default 4) +NicksPerRow=4 + +#Skip the Mattermost server version checks that are normally done when connecting. +#The usage scenario for this feature would be when the Mattermost instance is hosted behind a +#reverse proxy that suppresses "non-standard" response headers in flight. +#OPTIONAL (default false) +SkipVersionCheck=false + +#Whether to prefix messages from other bridges to mattermost with the sender's nick. +#Useful if username overrides for incoming webhooks isn't enabled on the +#mattermost server. If you set PrefixMessagesWithNick to true, each message +#from bridge to Mattermost will by default be prefixed by "bridge-" + nick. You can, +#however, modify how the messages appear, by setting (and modifying) RemoteNickFormat +#OPTIONAL (default false) +PrefixMessagesWithNick=false + +#Disable sending of edits to other bridges +#OPTIONAL (default false) +EditDisable=false + +#Message to be appended to every edited message +#OPTIONAL (default empty) +EditSuffix=" (edited)" + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="ircspammer1 ircspammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#Do not send joins/parts to other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack +#OPTIONAL (default false) +NoSendJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +#Gitter section +#Best to make a dedicated gitter account for the bot. +################################################################### + +[gitter] + +#You can configure multiple servers "[gitter.name]" or "[gitter.name2]" +#In this example we use [gitter.myproject] +#REQUIRED +[gitter.myproject] +#Token to connect with Gitter API +#You can get your token by going to https://developer.gitter.im/docs/welcome and SIGN IN +#REQUIRED +Token="Yourtokenhere" + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="ircspammer1 ircspammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +# +# Keybase +# You should have a separate bridge account on Keybase +# (it also needs to be logged in on the system you're running the bridge on) +# +################################################################### + +[keybase.myteam] + +# RemoteNickFormat defines how remote users appear on this bridge +# See [general] config section for default options +RemoteNickFormat="{NICK} ({PROTOCOL}): " + +# extra label that can be used in the RemoteNickFormat +# optional (default empty) +Label="" + +# Your team on Keybase. +# The bot user MUST be a member of this team +# REQUIRED +Team="myteam" + +################################################################### +# Microsoft teams section +# See https://github.com/42wim/matterbridge/wiki/MS-Teams-setup +################################################################### + +[msteams.myteam] + +# TenantID +# See https://github.com/42wim/matterbridge/wiki/MS-Teams-setup#get-necessary-ids-for-matterbridge +TenantID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + +# ClientID +# See https://github.com/42wim/matterbridge/wiki/MS-Teams-setup#get-necessary-ids-for-matterbridge +ClientID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + +# TeamID +# See https://github.com/42wim/matterbridge/wiki/MS-Teams-setup#get-necessary-ids-for-matterbridge +TeamID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="ircspammer1 ircspammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +#Opportunistically preserve threaded replies between bridges +#that support threading +#OPTIONAL (default false) +PreserveThreading=false + +################################################################### +#slack section +################################################################### +[slack] + +#You can configure multiple servers "[slack.name]" or "[slack.name2]" +#In this example we use [slack.hobby] +#REQUIRED +[slack.hobby] +#Token to connect with the Slack API +#You'll have to use a test/api-token using a dedicated user and not a bot token. +#See https://github.com/42wim/matterbridge/issues/75 for more info. +#Use https://api.slack.com/custom-integrations/legacy-tokens +#REQUIRED (when not using webhooks) +Token="yourslacktoken" + +#Extra slack specific debug info, warning this generates a lot of output. +#OPTIONAL (default false) +Debug="false" + +#### Settings for webhook matterbridge. +#NOT RECOMMENDED TO USE INCOMING/OUTGOING WEBHOOK. USE SLACK API +#AND DEDICATED BOT USER WHEN POSSIBLE! +#Url is your incoming webhook url as specified in slack +#See account settings - integrations - incoming webhooks on slack +#OPTIONAL +WebhookURL="https://hooks.slack.com/services/yourhook" + +#NOT RECOMMENDED TO USE INCOMING/OUTGOING WEBHOOK. USE SLACK API +#AND DEDICATED BOT USER WHEN POSSIBLE! +#Address to listen on for outgoing webhook requests from slack +#See account settings - integrations - outgoing webhooks on slack +#webhooks +#OPTIONAL +WebhookBindAddress="0.0.0.0:9999" + +#Icon that will be showed in slack +#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. +#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge +#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge +#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge +#OPTIONAL +IconURL="https://robohash.org/{NICK}.png?size=48x48" + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#how to format the list of IRC nicks when displayed in slack +#Possible options are "table" and "plain" +#OPTIONAL (default plain) +NickFormatter="plain" +#How many nicks to list per row for formatters that support this. +#OPTIONAL (default 4) +NicksPerRow=4 + +#Disable sending of edits to other bridges +#OPTIONAL (default false) +EditDisable=true + +#Message to be appended to every edited message +#OPTIONAL (default empty) +EditSuffix=" (edited)" + +#Whether to prefix messages from other bridges to mattermost with RemoteNickFormat +#Useful if username overrides for incoming webhooks isn't enabled on the +#slack server. If you set PrefixMessagesWithNick to true, each message +#from bridge to Slack will by default be prefixed by "bridge-" + nick. You can, +#however, modify how the messages appear, by setting (and modifying) RemoteNickFormat +#OPTIONAL (default false) +PrefixMessagesWithNick=false + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="ircspammer1 ircspammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#Do not send joins/parts to other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack +#OPTIONAL (default false) +NoSendJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +#Opportunistically preserve threaded replies between Slack channels. +#This only works if the parent message is still in the cache. +#Cache is flushed between restarts. +#Note: Not currently working on gateways with mixed bridges of +# both slack and slack-legacy type. Context in issue #624. +#OPTIONAL (default false) +PreserveThreading=false + +#Enable showing "user_typing" events from across gateway when available. +#Protip: Set your bot/user's "Full Name" to be "Someone (over chat bridge)", +#and so the message will say "Someone (over chat bridge) is typing". +#OPTIONAL (default false) +ShowUserTyping=false + +################################################################### +#discord section +################################################################### +[discord] + +# You can configure multiple servers "[discord.name]" or "[discord.name2]" +# In this example we use [discord.game] +#REQUIRED +[discord.game] +# Token (REQUIRED) is the token to connect with Discord API +# You can get your token by following the instructions on +# https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token +# If you want roles/groups mentions to be shown with names instead of ID, you'll need to give your bot the "Manage Roles" permission. +Token="Yourtokenhere" + +# Server (REQUIRED) is the ID or name of the guild to connect to, selected from the guilds the bot has been invited to +Server="yourservername" + +## RELOADABLE SETTINGS +## All settings below can be reloaded by editing the file. +## They are also all optional. + +# ShowEmbeds shows the title, description and URL of embedded messages (sent by other bots) +ShowEmbeds=false + +# UseLocalAvatar specifies source bridges for which an avatar should be 'guessed' when an incoming message has no avatar. +# This works by comparing the username of the message to an existing Discord user, and using the avatar of the Discord user. +# +# This only works if WebhookURL is set (AND the message has no avatar). +# Example: ["irc"] +UseLocalAvatar=[] + +# UseUserName shows the username instead of the server nickname +UseUserName=false + +# UseDiscriminator appends the `#xxxx` discriminator when used with UseUserName +UseDiscriminator=false + +# WebhookURL sends messages in the style of puppets. +# This only works if you have one discord channel, if you have multiple discord channels you'll have to specify it in the gateway config +# Example: "https://discordapp.com/api/webhooks/1234/abcd_xyzw" +WebhookURL="" + +# EditDisable disables sending of edits to other bridges +EditDisable=false + +# EditSuffix specifies the message to be appended to every edited message +# Example: " (edited)" +EditSuffix="" + +# IgnoreNicks mutes outgoing messages from certain users. +# Messages from these users will not be transmitted to other bridges. +# Regular expressions are also supported. +# Example: "ircspammer1 ircspammer2" +IgnoreNicks="" + +# IgnoreMessages mutes outgoing messages of a certain format. +# Messages matching this regular expression will not be transmitted sent to other bridges +# See https://regex-golang.appspot.com/assets/html/index.html for more regex info +# +# Example that ignores messages starting with ~~ or messages containing badword: +# IgnoreMessages="^~~ badword" +IgnoreMessages="" + +# ReplaceMessages replaces substrings of messages in outgoing messages. +# Regular expressions are supported. +# +# Example that replaces 'cat' => 'dog' and 'sleep' => 'awake': +# ReplaceMessages=[ ["cat","dog"], ["sleep","awake"] ] +# Example that replaces all digits with the letter 'X', so 'hello123' becomes 'helloXXX': +# ReplaceMessages=[ ["[0-9]","X"] ] +ReplaceMessages=[] + +# ReplaceNicks replaces substrings of usernames in outgoing messages. +# See the ReplaceMessages setting for examples. +# Example: [ ["user--","user"] ] +ReplaceNicks=[] + +# ExtractNicks allows for interoperability with other bridge software by rewriting messages and extracting usernames. +# +# Recommended reading: +# - https://github.com/42wim/matterbridge/issues/466 +# - https://github.com/42wim/matterbridge/issues/713 +# +# This example translates the following message +# "Relaybot: something interesting" +# into this message +# "relayeduser: something interesting" +# like so: +# ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +# +# This example translates the following message +# "otherbot: (relayeduser) something else" +# into this message +# "relayeduser: something else" +# like so: +# ExtractNicks=[ [ "otherbot","\\((.*?)\\)\\s+" ] ] +# +# This example combines both of the above examples into one: +# ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +# +ExtractNicks=[] + +# Label is as an extra identifier for use in the RemoteNickFormat setting. +Label="" + +# RemoteNickFormat formats how remote users appear on this bridge. +# See the [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +# ShowJoinPart emits messages that show joins/parts from other bridges +# Supported from the following bridges: irc, mattermost, slack, discord +ShowJoinPart=false + +# StripNick strips non-alphanumeric characters from nicknames. +# Recommended reading: https://github.com/42wim/matterbridge/issues/285 +StripNick=false + +# ShowTopicChange emits messages that show topic/purpose updates from other bridges +# Supported from the following bridges: slack +ShowTopicChange=false + +# SyncTopic synchronises topic/purpose updates from other bridges +# Supported from the following bridges: slack +SyncTopic=false + +################################################################### +#telegram section +################################################################### +[telegram] + +#You can configure multiple servers "[telegram.name]" or "[telegram.name2]" +#In this example we use [telegram.secure] +#REQUIRED +[telegram.secure] +#Token to connect with telegram API +#See https://core.telegram.org/bots#6-botfather and https://www.linkedin.com/pulse/telegram-bots-beginners-marco-frau +#REQUIRED +Token="Yourtokenhere" + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#OPTIONAL (default empty) +#Supported formats are: +#"HTML" https://core.telegram.org/bots/api#html-style +#"Markdown" https://core.telegram.org/bots/api#markdown-style - deprecated, doesn't display links with underscores correctly +#"MarkdownV2" https://core.telegram.org/bots/api#markdownv2-style +#"HTMLNick" - only allows HTML for the nick, the message itself will be html-escaped +MessageFormat="" + +#OPTIONAL (default false) +#Disables link previews for links in messages +DisableWebPagePreview=false + +#If enabled use the "First Name" as username. If this is empty use the Username +#If disabled use the "Username" as username. If this is empty use the First Name +#If all names are empty, username will be "unknown" +#OPTIONAL (default false) +UseFirstName=false + +#WARNING! If enabled this will relay GIF/stickers/documents and other attachments as URLs +#Those URLs will contain your bot-token. This may not be what you want. +#For now there is no secure way to relay GIF/stickers/documents without seeing your token. +#OPTIONAL (default false) +UseInsecureURL=false + +#Disable quoted/reply messages +#OPTIONAL (default false) +QuoteDisable=false + +#Set the max. quoted length if 0 the whole message will be quoted +#OPTIONAL (default 0) +QuoteLengthLimit=0 + +#Format quoted/reply messages +#OPTIONAL (default "{MESSAGE} (re @{QUOTENICK}: {QUOTEMESSAGE})") +QuoteFormat="{MESSAGE} (re @{QUOTENICK}: {QUOTEMESSAGE})" + +#Convert WebP images to PNG before upload. +#https://github.com/42wim/matterbridge/issues/398 +#OPTIONAL (default false) +MediaConvertWebPToPNG=false + +#Disable sending of edits to other bridges +#OPTIONAL (default false) +EditDisable=false + +#Message to be appended to every edited message +#OPTIONAL (default empty) +EditSuffix=" (edited)" + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="spammer1 spammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +# +#WARNING: if you have set MessageFormat="HTML" be sure that this format matches the guidelines +#on https://core.telegram.org/bots/api#html-style otherwise the message will not go through to +#telegram! eg <{NICK}> should be <{NICK}> +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +#rocketchat section +################################################################### +[rocketchat] +#You can configure multiple servers "[rocketchat.name]" or "[rocketchat.name2]" +#In this example we use [rocketchat.work] +#REQUIRED + +[rocketchat.rockme] +#The rocketchat hostname. (prefix it with http or https) +#REQUIRED (when not using webhooks) +Server="https://yourrocketchatserver.domain.com:443" + +#login/pass of your bot. +#login needs to be the login with email address! user@domain.com +#Use a dedicated user for this and not your own! +#REQUIRED (when not using webhooks) +Login="yourlogin@domain.com" +Password="yourpass" +# When using access token set Login to the User ID associated with your token and Token to your token. +# When Token is set Password is ignored. +# Login="yOurUSerID" +# Token="YoUrUsER_toKEN" + + +#### Settings for webhook matterbridge. +#USE DEDICATED BOT USER WHEN POSSIBLE! This allows you to use advanced features like message editing/deleting and uploads +#You don't need to configure this, if you have configured the settings +#above. + +#Url is your incoming webhook url as specified in rocketchat +#Read #https://rocket.chat/docs/administrator-guides/integrations/#how-to-create-a-new-incoming-webhook +#See administration - integrations - new integration - incoming webhook +#REQUIRED +WebhookURL="https://yourdomain/hooks/yourhookkey" + +#Address to listen on for outgoing webhook requests from rocketchat. +#See administration - integrations - new integration - outgoing webhook +#REQUIRED +WebhookBindAddress="0.0.0.0:9999" + +#Your nick/username as specified in your incoming webhook "Post as" setting +#REQUIRED +Nick="matterbot" + +#Enable this to make a http connection (instead of https) to your rocketchat +#OPTIONAL (default false) +NoTLS=false + +#Enable to not verify the certificate on your rocketchat server. +#e.g. when using selfsigned certificates +#OPTIONAL (default false) +SkipTLSVerify=true + +#### End settings for webhook matterbridge. + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Whether to prefix messages from other bridges to rocketchat with the sender's nick. +#Useful if username overrides for incoming webhooks isn't enabled on the +#rocketchat server. If you set PrefixMessagesWithNick to true, each message +#from bridge to rocketchat will by default be prefixed by the RemoteNickFormat setting. i +#if you're using login/pass you can better enable because of this bug: +#https://github.com/RocketChat/Rocket.Chat/issues/7549 +#OPTIONAL (default false) +PrefixMessagesWithNick=false + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="ircspammer1 ircspammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +#matrix section +################################################################### +[matrix] +#You can configure multiple servers "[matrix.name]" or "[matrix.name2]" +#In this example we use [matrix.neo] +#REQUIRED + +[matrix.neo] +#Server is your homeserver (eg https://matrix.org) +#REQUIRED +Server="https://matrix.org" + +#login/pass of your bot. +#Use a dedicated user for this and not your own! +#Messages sent from this user will not be relayed to avoid loops. +#REQUIRED +Login="yourlogin" +Password="yourpass" + +#Whether to send the homeserver suffix. eg ":matrix.org" in @username:matrix.org +#to other bridges, or only send "username".(true only sends username) +#OPTIONAL (default false) +NoHomeServerSuffix=false + +#Whether to disable sending of HTML content to matrix +#See https://github.com/42wim/matterbridge/issues/1022 +#OPTIONAL (default false) +HTMLDisable=false + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Whether to prefix messages from other bridges to matrix with the sender's nick. +#Useful if username overrides for incoming webhooks isn't enabled on the +#matrix server. If you set PrefixMessagesWithNick to true, each message +#from bridge to matrix will by default be prefixed by the RemoteNickFormat setting. i +#OPTIONAL (default false) +PrefixMessagesWithNick=false + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="spammer1 spammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +#steam section +################################################################### +[steam] +#You can configure multiple servers "[steam.name]" or "[steam.name2]" +#In this example we use [steam.gamechat] +#REQUIRED + +[steam.gamechat] +#login/pass of your bot. +#Use a dedicated user for this and not your own account! +#REQUIRED +Login="yourlogin" +Password="yourpass" + +#steamguard mail authcode (not the 2FA code) +#OPTIONAL +Authcode="ABCE12" + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Whether to prefix messages from other bridges to matrix with the sender's nick. +#Useful if username overrides for incoming webhooks isn't enabled on the +#matrix server. If you set PrefixMessagesWithNick to true, each message +#from bridge to matrix will by default be prefixed by the RemoteNickFormat setting. i +#OPTIONAL (default false) +PrefixMessagesWithNick=false + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="spammer1 spammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +# +# NCTalk (Nextcloud Talk) +# +################################################################### + +[nctalk.bridge] + +# Url of your Nextcloud server +Server = "https://cloud.youdomain.me" + +# Enable to not verify the certificate on your Nextcloud server. +# e.g. when using selfsigned certificates +# OPTIONAL (default false) +SkipTLSVerify=true + +# Username of the bot +Login = "talkuser" + +# Password of the bot +Password = "talkuserpass" + +################################################################### +# +# WhatsApp +# +################################################################### + +[whatsapp.bridge] + +# Number you will use as a relay bot. Tip: Get some disposable sim card, don't rely on your own number. +Number="+48111222333" + +# First time that you login you will need to scan QR code, then credentials willl be saved in a session file +# If you won't set SessionFile then you will need to scan QR code on every restart +# optional (by default the session is stored only in memory, till restarting matterbridge) +SessionFile="session-48111222333.gob" + +# If your terminal is white we need to invert QR code in order for it to be scanned properly +# optional (default false) +QrOnWhiteTerminal=true + +# Messages will be seen by other WhatsApp contacts as coming from the bridge. Original nick will be part of the message. +RemoteNickFormat="@{NICK}: " + +# extra label that can be used in the RemoteNickFormat +# optional (default empty) +Label="Organization" + + + +################################################################### +# +# zulip +# +################################################################### + +[zulip] + +#You can configure multiple servers "[zulip.name]" or "[zulip.name2]" +#In this example we use [zulip.streamchat] +#REQUIRED + +[zulip.streamchat] +#Token to connect with zulip API (called bot API key in Settings - Your bots) +#REQUIRED +Token="Yourtokenhere" + +#Username of the bot, normally called yourbot-bot@yourserver.zulipchat.com +#See username in Settings - Your bots +#REQUIRED +Login="yourbot-bot@yourserver.zulipchat.com" + +#Servername of your zulip instance +#REQUIRED +Server="https://yourserver.zulipchat.com" + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#Nicks you want to ignore. +#Regular expressions supported +#Messages from those users will not be sent to other bridges. +#OPTIONAL +IgnoreNicks="spammer1 spammer2" + +#Messages you want to ignore. +#Messages matching these regexp will be ignored and not sent to other bridges +#See https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword +IgnoreMessages="^~~ badword" + +#messages you want to replace. +#it replaces outgoing messages from the bridge. +#so you need to place it by the sending bridge definition. +#regular expressions supported +#some examples: +#this replaces cat => dog and sleep => awake +#replacemessages=[ ["cat","dog"], ["sleep","awake"] ] +#this replaces every number with number. 123 => numbernumbernumber +#replacemessages=[ ["[0-9]","number"] ] +#optional (default empty) +ReplaceMessages=[ ["cat","dog"] ] + +#nicks you want to replace. +#see replacemessages for syntaxa +#optional (default empty) +ReplaceNicks=[ ["user--","user"] ] + +#Extractnicks is used to for example rewrite messages from other relaybots +#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466 +#some examples: +#this replaces a message like "Relaybot: something interesting" to "relayeduser: something interesting" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ] +#you can use multiple entries for multiplebots +#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else" +#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ] +#OPTIONAL (default empty) +ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ] + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#Enable to show users joins/parts from other bridges +#Currently works for messages from the following bridges: irc, mattermost, slack, discord +#OPTIONAL (default false) +ShowJoinPart=false + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + +#Enable to show topic changes from other bridges +#Only works hiding/show topic changes from slack bridge for now +#OPTIONAL (default false) +ShowTopicChange=false + +################################################################### +#API +################################################################### +[api] +#You can configure multiple API hooks +#In this example we use [api.local] +#REQUIRED + +[api.local] +#Address to listen on for API +#REQUIRED +BindAddress="127.0.0.1:4242" + +#Amount of messages to keep in memory +#OPTIONAL (library default 10) +Buffer=1000 + +#Bearer token used for authentication +#curl -H "Authorization: Bearer token" http://localhost:4242/api/messages +# https://github.com/vi/websocat +# websocat -H="Authorization: Bearer token" ws://127.0.0.1:4242/api/websocket +#OPTIONAL (no authorization if token is empty) +Token="mytoken" + +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +Label="" + +#RemoteNickFormat defines how remote users appear on this bridge +#See [general] config section for default options +RemoteNickFormat="{NICK}" + + + +################################################################### +#General configuration +################################################################### +# Settings here are defaults that each protocol can override +[general] + +## RELOADABLE SETTINGS +## Settings below can be reloaded by editing the file + +#RemoteNickFormat defines how remote users appear on this bridge +#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. +#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge +#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge +#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge +#The string "{GATEWAY}" (case sensitive) will be replaced by the origin gateway name that is replicating the message. +#The string "{CHANNEL}" (case sensitive) will be replaced by the origin channel name used by the bridge +#The string "{TENGO}" (case sensitive) will be replaced by the output of the RemoteNickFormat script under [tengo] +#OPTIONAL (default empty) +RemoteNickFormat="[{PROTOCOL}] <{NICK}> " + +#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285 +#It will strip other characters from the nick +#OPTIONAL (default false) +StripNick=false + + +#MediaServerUpload (or MediaDownloadPath) and MediaServerDownload are used for uploading +#images/files/video to a remote "mediaserver" (a webserver like caddy for example). +#When configured images/files uploaded on bridges like mattermost, slack, telegram will be +#downloaded and uploaded again to MediaServerUpload URL +#MediaDownloadPath is the filesystem path where the media file will be placed, instead of uploaded, +#for if Matterbridge has write access to the directory your webserver is serving. +#It is an alternative to MediaServerUpload. +#The MediaServerDownload will be used so that bridges without native uploading support: +#gitter, irc and xmpp will be shown links to the files on MediaServerDownload +# +#More information https://github.com/42wim/matterbridge/wiki/Mediaserver-setup-%5Badvanced%5D +#OPTIONAL (default empty) +MediaServerUpload="https://user:pass@yourserver.com/upload" +#OPTIONAL (default empty) +MediaDownloadPath="/srv/http/yourserver.com/public/download" +#OPTIONAL (default empty) +MediaServerDownload="https://youserver.com/download" + +#MediaDownloadSize is the maximum size of attachments, videos, images +#matterbridge will download and upload this file to bridges that also support uploading files. +#eg downloading from slack to upload it to mattermost +# +#It will only download from bridges that don't have public links available, which are for the moment +#slack, telegram, matrix and mattermost +# +#OPTIONAL (default 1000000 (1 megabyte)) +MediaDownloadSize=1000000 + +#MediaDownloadBlacklist allows you to blacklist specific files from being downloaded. +#Filenames matching these regexp will not be download/uploaded to the mediaserver +#You can use regex for this, see https://regex-golang.appspot.com/assets/html/index.html for more regex info +#OPTIONAL (default empty) +MediaDownloadBlacklist=[".html$",".htm$"] + +#IgnoreFailureOnStart allows you to ignore failing bridges on startup. +#Matterbridge will disable the failed bridge and continue with the other ones. +#Context: https://github.com/42wim/matterbridge/issues/455 +#OPTIONAL (default false) +IgnoreFailureOnStart=false + +#LogFile defines the location of a file to write logs into, rather +#than stdout. +#Logging will still happen on stdout if the file cannot be open for +#writing, or if the value is empty. Note that the log won't roll, so +#you might want to use logrotate(8) with this feature. +#OPTIONAL (default empty) +LogFile="/var/log/matterbridge.log" + +################################################################### +#Tengo configuration +################################################################### +#More information about tengo on: https://github.com/d5/tengo/blob/master/docs/tutorial.md and +#https://github.com/d5/tengo/blob/master/docs/stdlib.md + +[tengo] +#InMessage allows you to specify the location of a tengo (https://github.com/d5/tengo/) script. +#This script will receive every incoming message and can be used to modify the Username and the Text of that message. +#The script will have the following global variables: +#to modify: msgUsername and msgText +#to read: msgChannel and msgAccount +# +#The script is reloaded on every message, so you can modify the script on the fly. +# +#Example script can be found in https://github.com/42wim/matterbridge/tree/master/gateway/bench.tengo +#and https://github.com/42wim/matterbridge/tree/master/contrib/example.tengo +# +#The example below will check if the text contains blah and if so, it'll replace the text and the username of that message. +#text := import("text") +#if text.re_match("blah",msgText) { +# msgText="replaced by this" +# msgUsername="fakeuser" +#} +#OPTIONAL (default empty) +InMessage="example.tengo" + +#OutMessage allows you to specify the location of the script that +#will be invoked on each message being sent to a bridge and can be used to modify the Username +#and the Text of that message. +# +#The script will have the following global variables: +#read-only: +#inAccount, inProtocol, inChannel, inGateway, inEvent +#outAccount, outProtocol, outChannel, outGateway, outEvent +# +#read-write: +#msgText, msgUsername +# +#The script is reloaded on every message, so you can modify the script on the fly. +# +#The default script in https://github.com/42wim/matterbridge/tree/master/internal/tengo/outmessage.tengo +#is compiled in and will be executed if no script is specified. +#OPTIONAL (default empty) +OutMessage="example.tengo" + + +#RemoteNickFormat allows you to specify the location of a tengo (https://github.com/d5/tengo/) script. +#The script will have the following global variables: +#to modify: result +#to read: channel, bridge, gateway, protocol, nick +# +#The result will be set in {TENGO} in the RemoteNickFormat key of every bridge where {TENGO} is specified +# +#The script is reloaded on every message, so you can modify the script on the fly. +# +#Example script can be found in https://github.com/42wim/matterbridge/tree/master/contrib/remotenickformat.tengo +# +#OPTIONAL (default empty) +RemoteNickFormat="remotenickformat.tengo" + +################################################################### +#Gateway configuration +################################################################### + +#You can specify multiple gateways using [[gateway]] +#Each gateway has a [[gateway.in]] and a [[gateway.out]] +#[[gateway.in]] specifies the account and channels we will receive messages from. +#[[gateway.out]] specifies the account and channels we will send the messages +#from [[gateway.in]] to. +# +#Most of the time [[gateway.in]] and [[gateway.out]] are the same if you +#want bidirectional bridging. You can then use [[gateway.inout]] +# + +[[gateway]] +#REQUIRED and UNIQUE +name="gateway1" +#Enable enables this gateway +##OPTIONAL (default false) +enable=true + + # [[gateway.in]] specifies the account and channels we will receive messages from. + # The following example bridges between mattermost and irc + [[gateway.in]] + + # account specified above + # REQUIRED + account="irc.freenode" + + # The channel key in each gateway is mapped to a similar group chat ID on the chat platform + # To find the group chat ID for different platforms, refer to the table below + # + # Platform | Identifier name | Example | Description + # ------------------------------------------------------------------------------------------------------------------------------------- + # | channel | general | Do not include the # symbol + # discord | channel id | ID:123456789 | See https://github.com/42wim/matterbridge/issues/57 + # | category/channel | Media/gaming | Without # symbol. If you're using discord categories to group your channels + # ------------------------------------------------------------------------------------------------------------------------------------- + # gitter | username/room | general | As seen in the gitter.im URL + # ------------------------------------------------------------------------------------------------------------------------------------- + # hipchat | id_channel | example needed | See https://www.hipchat.com/account/xmpp for the correct channel + # ------------------------------------------------------------------------------------------------------------------------------------- + # irc | channel | #general | The # symbol is required and should be lowercase! + # ------------------------------------------------------------------------------------------------------------------------------------- + # mattermost | channel | general | This is the channel name as seen in the URL, not the display name + # ------------------------------------------------------------------------------------------------------------------------------------- + # matrix | #channel:server | #yourchannel:matrix.org | Encrypted rooms are not supported in matrix + # ------------------------------------------------------------------------------------------------------------------------------------- + # msteams | threadId | 19:82abcxx@thread.skype | You'll find the threadId in the URL + # ------------------------------------------------------------------------------------------------------------------------------------- + # rocketchat | channel | #channel | # is required for private channels too + # ------------------------------------------------------------------------------------------------------------------------------------- + # slack | channel name | general | Do not include the # symbol + # | channel id | ID:C123456 | The underlying ID of a channel. This doesn't work with + # ------------------------------------------------------------------------------------------------------------------------------------- + # steam | chatid | example needed | The number in the URL when you click "enter chat room" in the browser + # ------------------------------------------------------------------------------------------------------------------------------------- + # nctalk | token | xs25tz5y | The token in the URL when you are in a chat. It will be the last part of the URL. + # ------------------------------------------------------------------------------------------------------------------------------------- + # telegram | chatid | -123456789 | A large negative number. see https://www.linkedin.com/pulse/telegram-bots-beginners-marco-frau + # ------------------------------------------------------------------------------------------------------------------------------------- + # whatsapp | group JID | 48111222333-123455678999@g.us | A unique group JID. If you specify an empty string, bridge will list all the possibilities + # | "Group Name" | "Family Chat" | if you specify a group name, the bridge will find hint the JID to specify. Names can change over time and are not stable. + # ------------------------------------------------------------------------------------------------------------------------------------- + # xmpp | channel | general | The room name + # ------------------------------------------------------------------------------------------------------------------------------------- + # zulip | stream/topic:topic | general/off-topic:food | Do not use the # when specifying a topic + # ------------------------------------------------------------------------------------------------------------------------------------- + + # + # REQUIRED + channel="#testing" + + #OPTIONAL - only used for IRC and XMPP protocols at the moment + [gateway.in.options] + #OPTIONAL - your irc / xmpp channel key + key="yourkey" + + + #[[gateway.out]] specifies the account and channels we will sent messages to. + [[gateway.out]] + account="irc.freenode" + channel="#testing" + + #OPTIONAL - only used for IRC and XMPP protocols at the moment + [gateway.out.options] + #OPTIONAL - your irc / xmpp channel key + key="yourkey" + + #[[gateway.inout]] can be used when then channel will be used to receive from + #and send messages to + [[gateway.inout]] + account="mattermost.work" + channel="off-topic" + + #OPTIONAL - only used for IRC and XMPP protocols at the moment + [gateway.inout.options] + #OPTIONAL - your irc / xmpp channel key + key="yourkey" + + [[gateway.inout]] + account="discord.game" + channel="mygreatgame" + + #OPTIONAL - webhookurl only works for discord (it needs a different URL for each cahnnel) + [gateway.inout.options] + webhookurl="https://discordapp.com/api/webhooks/123456789123456789/C9WPqExYWONPDZabcdef-def1434FGFjstasJX9pYht73y" + + [[gateway.inout]] + account="zulip.streamchat" + channel="general/topic:mytopic" + + #API example + #[[gateway.inout]] + #account="api.local" + #channel="api" + #To send data to the api: + #curl -XPOST -H 'Content-Type: application/json' -d '{"text":"test","username":"randomuser","gateway":"gateway1"}' http://localhost:4242/api/message + #To read from the api: + #curl http://localhost:4242/api/messages + +#If you want to do a 1:1 mapping between protocols where the channelnames are the same +#e.g. slack and mattermost you can use the samechannelgateway configuration +#the example configuration below send messages from channel testing on mattermost to +#channel testing on slack and vice versa. (and for the channel testing2 and testing3) + +[[samechannelgateway]] + name="samechannel1" + enable = false + accounts = [ "mattermost.work","slack.hobby" ] + channels = [ "testing","testing2","testing3"] diff --git a/maubot-plugin-spaceapi/build.sh b/maubot-plugin-spaceapi/build.sh new file mode 100755 index 0000000..d9b4617 --- /dev/null +++ b/maubot-plugin-spaceapi/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +. ../.skel/maubot-plugin.sh + +build_maubot_plugin https://git.kabelsalat.ch/s3lph/maubot-plugin-spaceapi diff --git a/maubot-plugin-spaceapi/debian.control b/maubot-plugin-spaceapi/debian.control new file mode 100644 index 0000000..9efa5d1 --- /dev/null +++ b/maubot-plugin-spaceapi/debian.control @@ -0,0 +1,8 @@ +Package: maubot-plugin-spaceapi +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: maubot, python3, python3-aiohttp +Description: SpaceAPI Bot Plugin for Maubot diff --git a/maubot-plugin-spaceapi/maubot-plugin-spaceapi/build.sh b/maubot-plugin-spaceapi/maubot-plugin-spaceapi/build.sh new file mode 100755 index 0000000..d9b4617 --- /dev/null +++ b/maubot-plugin-spaceapi/maubot-plugin-spaceapi/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +. ../.skel/maubot-plugin.sh + +build_maubot_plugin https://git.kabelsalat.ch/s3lph/maubot-plugin-spaceapi diff --git a/maubot-plugin-spaceapi/maubot-plugin-spaceapi/debian.control b/maubot-plugin-spaceapi/maubot-plugin-spaceapi/debian.control new file mode 100644 index 0000000..9efa5d1 --- /dev/null +++ b/maubot-plugin-spaceapi/maubot-plugin-spaceapi/debian.control @@ -0,0 +1,8 @@ +Package: maubot-plugin-spaceapi +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: maubot, python3, python3-aiohttp +Description: SpaceAPI Bot Plugin for Maubot diff --git a/maubot-plugin-ultimaker/build.sh b/maubot-plugin-ultimaker/build.sh new file mode 100755 index 0000000..01e07d8 --- /dev/null +++ b/maubot-plugin-ultimaker/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +. ../.skel/maubot-plugin.sh + +build_maubot_plugin https://git.kabelsalat.ch/s3lph/maubot-plugin-ultimaker diff --git a/maubot-plugin-ultimaker/debian.control b/maubot-plugin-ultimaker/debian.control new file mode 100644 index 0000000..399a6a0 --- /dev/null +++ b/maubot-plugin-ultimaker/debian.control @@ -0,0 +1,8 @@ +Package: maubot-plugin-ultimaker +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: maubot, python3, python3-aiohttp +Description: Ultimaker Status Bot Plugin for Maubot diff --git a/maubot/build.sh b/maubot/build.sh new file mode 100755 index 0000000..8af1917 --- /dev/null +++ b/maubot/build.sh @@ -0,0 +1,87 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/maubot/maubot/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.name[1:]) \(.published_at) \(.tarball_url)"' + +apt update +apt install --yes nodejs npm yarnpkg + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + mkdir -p "maubot-${VERSION}" + wget "${URL}" --output-document "maubot-${VERSION}.tar.gz" + tar -x -C "maubot-${VERSION}" --strip-components=1 -f "maubot-${VERSION}.tar.gz" + rm "maubot-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/usr/lib/python3/dist-packages" \ + "${PKGDIR}/lib/systemd/system" \ + "${PKGDIR}/usr/lib/maubot/plugins" \ + "${PKGDIR}/var/lib/maubot/plugins" \ + "${PKGDIR}/var/lib/maubot/trash" \ + "${PKGDIR}/var/log/maubot" \ + "${PKGDIR}/usr/lib/python3/dist-packages/maubot/management/frontend" + cd "${SRCDIR}/maubot-${VERSION}" + python3 setup.py egg_info install --root="${PKGDIR}/" --prefix=/usr --optimize=1 + rsync -a "${PKGDIR}/usr/local/lib/python3.11/dist-packages/" "${PKGDIR}/usr/lib/python3/dist-packages/" + # Build frontend + cd maubot/management/frontend + yarnpkg --prod + yarnpkg build + rsync -a "${SRCDIR}/maubot-${VERSION}/maubot/management/frontend/build/" "${PKGDIR}/usr/lib/python3/dist-packages/maubot/management/frontend/build/" + cd "${SRCDIR}/maubot-${VERSION}" + # continue package preparation + rm -rf "${PKGDIR}/usr/local/" + find "${PKGDIR}/usr/lib/python3/dist-packages" -name __pycache__ -exec rm -r {} \; 2>/dev/null || true + find "${PKGDIR}/usr/lib/python3/dist-packages" -name '*.pyc' -exec rm {} \; + cp "${ROOT}/maubot.service" "${PKGDIR}/lib/systemd/system/maubot.service" + cp "${ROOT}/maubot.default" "${PKGDIR}/etc/default/maubot" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + cp "${PKGDIR}/usr/lib/python3/dist-packages/maubot/example-config.yaml" "${PKGDIR}/etc/maubot.yml" + find "${PKGDIR}/usr/lib/maubot" "${PKGDIR}/usr/lib/python3/dist-packages" -type d -exec chmod 0755 {} \; + find "${PKGDIR}/usr/lib/maubot" "${PKGDIR}/usr/lib/python3/dist-packages" -type f -exec chmod 0644 {} \; + chmod 0640 "${PKGDIR}/etc/maubot.yml" + # Sensible config defaults + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s# ./maubot.log# /var/log/maubot/maubot.log#g" -i "${PKGDIR}/etc/maubot.yml" + sed -re "s#upload: ./plugins#upload: /var/lib/maubot/plugins#g" -i "${PKGDIR}/etc/maubot.yml" + sed -re "s#db: ./plugins#db: /var/lib/maubot/plugins#g" -i "${PKGDIR}/etc/maubot.yml" + sed -re "s#trash: ./trash#trash: /var/lib/maubot/trash#g" -i "${PKGDIR}/etc/maubot.yml" + sed -re "s#sqlite: ./plugins#sqlite: /var/lib/maubot/trash#g" -i "${PKGDIR}/etc/maubot.yml" + sed -re "s#- ./plugins#- /var/lib/maubot/plugins\n - /usr/lib/maubot/plugins#g" -i "${PKGDIR}/etc/maubot.yml" + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/maubot/debian.conffiles b/maubot/debian.conffiles new file mode 100644 index 0000000..e286ebe --- /dev/null +++ b/maubot/debian.conffiles @@ -0,0 +1,2 @@ +/etc/maubot.yml +/etc/default/maubot diff --git a/maubot/debian.control b/maubot/debian.control new file mode 100644 index 0000000..1f4dd15 --- /dev/null +++ b/maubot/debian.control @@ -0,0 +1,8 @@ +Package: maubot +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: alembic, python3, python3-aiohttp, python3-asyncpg, python3-attr, python3-bcrypt, python3-click, python3-colorama, python3-commonmark, python3-jinja2, python3-mautrix, python3-packaging, python3-psycopg2, python3-ruamel.yaml, python3-yarl, python3-aiosqlite, python3-pycryptodome, python3-olm, python3-unpaddedbase64 +Description: Plugin-based Matrix bot system written in Python. diff --git a/maubot/debian.postinst b/maubot/debian.postinst new file mode 100755 index 0000000..ef7461a --- /dev/null +++ b/maubot/debian.postinst @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group maubot >/dev/null; then + groupadd --system maubot + fi + + if ! getent passwd maubot >/dev/null; then + useradd --system --gid maubot --home-dir /var/lib/maubot --shell /bin/bash maubot + fi + + chown maubot:maubot /var/lib/maubot /var/lib/maubot/plugins /var/lib/maubot/trash /var/log/maubot + chmod 0750 /var/lib/maubot /var/log/maubot + chown root:maubot /usr/lib/maubot /usr/lib/maubot/plugins + chmod 0750 /usr/lib/maubot /usr/lib/maubot/plugins + chown root:maubot /etc/maubot.yml + chmod 0640 /etc/maubot.yml + + deb-systemd-helper enable maubot.service + deb-systemd-invoke restart maubot.service + +fi diff --git a/maubot/debian.postrm b/maubot/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/maubot/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/maubot/debian.prerm b/maubot/debian.prerm new file mode 100755 index 0000000..7161b79 --- /dev/null +++ b/maubot/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop maubot.service + +fi diff --git a/maubot/maubot.default b/maubot/maubot.default new file mode 100644 index 0000000..95b6e62 --- /dev/null +++ b/maubot/maubot.default @@ -0,0 +1,9 @@ + +# The path to your config file +CONFIG=/etc/maubot.yml + + +# Don't save updated config to disk (no write access to /etc) +ARGS=--no-update + +ALEMBIC_ARGS=--config /usr/lib/maubot/alembic.ini -x config=/etc/maubot.yml diff --git a/maubot/maubot.service b/maubot/maubot.service new file mode 100644 index 0000000..c98f38a --- /dev/null +++ b/maubot/maubot.service @@ -0,0 +1,16 @@ +[Unit] +Description=Plugin-based Matrix bot system + +[Service] +WorkingDirectory=/var/lib/maubot +EnvironmentFile=-/etc/default/maubot +ExecStart=/usr/bin/python3 -m maubot --config $CONFIG $ARGS +User=maubot +Group=maubot +CapabilityBoundingSet= +Restart=on-failure +TimeoutStopSec=5 +SendSIGKILL=true + +[Install] +WantedBy=multi-user.target diff --git a/maubot/maubot/build.sh b/maubot/maubot/build.sh new file mode 100755 index 0000000..8af1917 --- /dev/null +++ b/maubot/maubot/build.sh @@ -0,0 +1,87 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/maubot/maubot/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.name[1:]) \(.published_at) \(.tarball_url)"' + +apt update +apt install --yes nodejs npm yarnpkg + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + mkdir -p "maubot-${VERSION}" + wget "${URL}" --output-document "maubot-${VERSION}.tar.gz" + tar -x -C "maubot-${VERSION}" --strip-components=1 -f "maubot-${VERSION}.tar.gz" + rm "maubot-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/usr/lib/python3/dist-packages" \ + "${PKGDIR}/lib/systemd/system" \ + "${PKGDIR}/usr/lib/maubot/plugins" \ + "${PKGDIR}/var/lib/maubot/plugins" \ + "${PKGDIR}/var/lib/maubot/trash" \ + "${PKGDIR}/var/log/maubot" \ + "${PKGDIR}/usr/lib/python3/dist-packages/maubot/management/frontend" + cd "${SRCDIR}/maubot-${VERSION}" + python3 setup.py egg_info install --root="${PKGDIR}/" --prefix=/usr --optimize=1 + rsync -a "${PKGDIR}/usr/local/lib/python3.11/dist-packages/" "${PKGDIR}/usr/lib/python3/dist-packages/" + # Build frontend + cd maubot/management/frontend + yarnpkg --prod + yarnpkg build + rsync -a "${SRCDIR}/maubot-${VERSION}/maubot/management/frontend/build/" "${PKGDIR}/usr/lib/python3/dist-packages/maubot/management/frontend/build/" + cd "${SRCDIR}/maubot-${VERSION}" + # continue package preparation + rm -rf "${PKGDIR}/usr/local/" + find "${PKGDIR}/usr/lib/python3/dist-packages" -name __pycache__ -exec rm -r {} \; 2>/dev/null || true + find "${PKGDIR}/usr/lib/python3/dist-packages" -name '*.pyc' -exec rm {} \; + cp "${ROOT}/maubot.service" "${PKGDIR}/lib/systemd/system/maubot.service" + cp "${ROOT}/maubot.default" "${PKGDIR}/etc/default/maubot" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + cp "${PKGDIR}/usr/lib/python3/dist-packages/maubot/example-config.yaml" "${PKGDIR}/etc/maubot.yml" + find "${PKGDIR}/usr/lib/maubot" "${PKGDIR}/usr/lib/python3/dist-packages" -type d -exec chmod 0755 {} \; + find "${PKGDIR}/usr/lib/maubot" "${PKGDIR}/usr/lib/python3/dist-packages" -type f -exec chmod 0644 {} \; + chmod 0640 "${PKGDIR}/etc/maubot.yml" + # Sensible config defaults + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s# ./maubot.log# /var/log/maubot/maubot.log#g" -i "${PKGDIR}/etc/maubot.yml" + sed -re "s#upload: ./plugins#upload: /var/lib/maubot/plugins#g" -i "${PKGDIR}/etc/maubot.yml" + sed -re "s#db: ./plugins#db: /var/lib/maubot/plugins#g" -i "${PKGDIR}/etc/maubot.yml" + sed -re "s#trash: ./trash#trash: /var/lib/maubot/trash#g" -i "${PKGDIR}/etc/maubot.yml" + sed -re "s#sqlite: ./plugins#sqlite: /var/lib/maubot/trash#g" -i "${PKGDIR}/etc/maubot.yml" + sed -re "s#- ./plugins#- /var/lib/maubot/plugins\n - /usr/lib/maubot/plugins#g" -i "${PKGDIR}/etc/maubot.yml" + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/maubot/maubot/debian.conffiles b/maubot/maubot/debian.conffiles new file mode 100644 index 0000000..e286ebe --- /dev/null +++ b/maubot/maubot/debian.conffiles @@ -0,0 +1,2 @@ +/etc/maubot.yml +/etc/default/maubot diff --git a/maubot/maubot/debian.control b/maubot/maubot/debian.control new file mode 100644 index 0000000..1f4dd15 --- /dev/null +++ b/maubot/maubot/debian.control @@ -0,0 +1,8 @@ +Package: maubot +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: alembic, python3, python3-aiohttp, python3-asyncpg, python3-attr, python3-bcrypt, python3-click, python3-colorama, python3-commonmark, python3-jinja2, python3-mautrix, python3-packaging, python3-psycopg2, python3-ruamel.yaml, python3-yarl, python3-aiosqlite, python3-pycryptodome, python3-olm, python3-unpaddedbase64 +Description: Plugin-based Matrix bot system written in Python. diff --git a/maubot/maubot/debian.postinst b/maubot/maubot/debian.postinst new file mode 100755 index 0000000..ef7461a --- /dev/null +++ b/maubot/maubot/debian.postinst @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group maubot >/dev/null; then + groupadd --system maubot + fi + + if ! getent passwd maubot >/dev/null; then + useradd --system --gid maubot --home-dir /var/lib/maubot --shell /bin/bash maubot + fi + + chown maubot:maubot /var/lib/maubot /var/lib/maubot/plugins /var/lib/maubot/trash /var/log/maubot + chmod 0750 /var/lib/maubot /var/log/maubot + chown root:maubot /usr/lib/maubot /usr/lib/maubot/plugins + chmod 0750 /usr/lib/maubot /usr/lib/maubot/plugins + chown root:maubot /etc/maubot.yml + chmod 0640 /etc/maubot.yml + + deb-systemd-helper enable maubot.service + deb-systemd-invoke restart maubot.service + +fi diff --git a/maubot/maubot/debian.postrm b/maubot/maubot/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/maubot/maubot/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/maubot/maubot/debian.prerm b/maubot/maubot/debian.prerm new file mode 100755 index 0000000..7161b79 --- /dev/null +++ b/maubot/maubot/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop maubot.service + +fi diff --git a/maubot/maubot/maubot.default b/maubot/maubot/maubot.default new file mode 100644 index 0000000..95b6e62 --- /dev/null +++ b/maubot/maubot/maubot.default @@ -0,0 +1,9 @@ + +# The path to your config file +CONFIG=/etc/maubot.yml + + +# Don't save updated config to disk (no write access to /etc) +ARGS=--no-update + +ALEMBIC_ARGS=--config /usr/lib/maubot/alembic.ini -x config=/etc/maubot.yml diff --git a/maubot/maubot/maubot.service b/maubot/maubot/maubot.service new file mode 100644 index 0000000..c98f38a --- /dev/null +++ b/maubot/maubot/maubot.service @@ -0,0 +1,16 @@ +[Unit] +Description=Plugin-based Matrix bot system + +[Service] +WorkingDirectory=/var/lib/maubot +EnvironmentFile=-/etc/default/maubot +ExecStart=/usr/bin/python3 -m maubot --config $CONFIG $ARGS +User=maubot +Group=maubot +CapabilityBoundingSet= +Restart=on-failure +TimeoutStopSec=5 +SendSIGKILL=true + +[Install] +WantedBy=multi-user.target diff --git a/mautrix-signal/build.sh b/mautrix-signal/build.sh new file mode 100755 index 0000000..3b52bd1 --- /dev/null +++ b/mautrix-signal/build.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/mautrix/signal/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.name[1:]) \(.published_at) \(.tarball_url)"' + + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + mkdir -p "mautrix-signal-${VERSION}" + wget "${URL}" --output-document "mautrix-signal-${VERSION}.tar.gz" + tar -x -C "mautrix-signal-${VERSION}" --strip-components=1 -f "mautrix-signal-${VERSION}.tar.gz" + rm "mautrix-signal-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/usr/lib/python3/dist-packages" \ + "${PKGDIR}/lib/systemd/system" \ + "${PKGDIR}/var/lib/mautrix-signal" \ + "${PKGDIR}/var/log/mautrix-signal" + cd "${SRCDIR}/mautrix-signal-${VERSION}" + python3 setup.py egg_info install --root="${PKGDIR}/" --prefix=/usr --optimize=1 + rsync -a "${PKGDIR}/usr/local/lib/python3.11/dist-packages/" "${PKGDIR}/usr/lib/python3/dist-packages/" + rm -rf "${PKGDIR}/usr/lib/python3.11/" + find "${PKGDIR}/usr/lib/python3/dist-packages" -name __pycache__ -exec rm -r {} \; 2>/dev/null || true + find "${PKGDIR}/usr/lib/python3/dist-packages" -name '*.pyc' -exec rm {} \; + cp "${ROOT}/mautrix-signal.service" "${PKGDIR}/lib/systemd/system/mautrix-signal.service" + cp "${ROOT}/mautrix-signal.default" "${PKGDIR}/etc/default/mautrix-signal" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + cp "${SRCDIR}/mautrix-signal-${VERSION}/mautrix_signal/example-config.yaml" "${PKGDIR}/etc/mautrix-signal.yml" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s# ./mautrix-signal.log# /var/log/mautrix-signal.log#g" -i "${PKGDIR}/etc/mautrix-signal.yml" + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/mautrix-signal/debian.conffiles b/mautrix-signal/debian.conffiles new file mode 100644 index 0000000..66312af --- /dev/null +++ b/mautrix-signal/debian.conffiles @@ -0,0 +1,2 @@ +/etc/mautrix-signal.yml +/etc/default/mautrix-signal diff --git a/mautrix-signal/debian.control b/mautrix-signal/debian.control new file mode 100644 index 0000000..105f4f0 --- /dev/null +++ b/mautrix-signal/debian.control @@ -0,0 +1,9 @@ +Package: mautrix-signal +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: signald, python3-aiohttp, python3-mautrix, python3-magic, python3-ruamel.yaml, python3-commonmark, python3-pycryptodome, python3-unpaddedbase64, python3-yarl, python3-attr, python3-asyncpg, python3-olm, python3-phonenumbers, python3-qrcode, python3-pil +Recommends: python3-prometheus-client +Description: A Matrix-Signal puppeting bridge diff --git a/mautrix-signal/debian.postinst b/mautrix-signal/debian.postinst new file mode 100755 index 0000000..c56bdd0 --- /dev/null +++ b/mautrix-signal/debian.postinst @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group mautrix-signal >/dev/null; then + groupadd --system mautrix-signal + fi + + if ! getent passwd mautrix-signal >/dev/null; then + useradd --system --gid mautrix-signal --home-dir /var/lib/mautrix-signal --shell /bin/bash mautrix-signal + fi + + chown mautrix-signal:mautrix-signal /var/lib/mautrix-signal /var/log/mautrix-signal + chmod 0750 /var/lib/mautrix-signal /var/log/mautrix-signal + chown root:mautrix-signal /etc/mautrix-signal.yml + chmod 0640 /etc/mautrix-signal.yml + + deb-systemd-helper enable mautrix-signal.service + deb-systemd-invoke restart mautrix-signal.service + +fi diff --git a/mautrix-signal/debian.postrm b/mautrix-signal/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/mautrix-signal/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/mautrix-signal/debian.prerm b/mautrix-signal/debian.prerm new file mode 100755 index 0000000..f7346af --- /dev/null +++ b/mautrix-signal/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop mautrix-signal.service + +fi diff --git a/mautrix-signal/mautrix-signal.default b/mautrix-signal/mautrix-signal.default new file mode 100644 index 0000000..1fb82d8 --- /dev/null +++ b/mautrix-signal/mautrix-signal.default @@ -0,0 +1,10 @@ + +# The path to your config file +CONFIG=/etc/mautrix-signal.yml + +# The path to save the generated registration to (not needed for +# running the bridge) +REGISTRATION=/var/lib/mautrix-signal/registration.yml + +# Don't save updated config to disk (no write access to /etc) +ARGS=--no-update \ No newline at end of file diff --git a/mautrix-signal/mautrix-signal.service b/mautrix-signal/mautrix-signal.service new file mode 100644 index 0000000..0334cc3 --- /dev/null +++ b/mautrix-signal/mautrix-signal.service @@ -0,0 +1,15 @@ +[Unit] +Description=Matrix-Signal puppeting bridge +Requires=postgresql.service + +[Service] +WorkingDirectory=/var/lib/mautrix-signal +EnvironmentFile=-/etc/default/mautrix-signal +ExecStart=/usr/bin/python3 -m mautrix_signal --config $CONFIG $ARGS +User=mautrix-signal +Group=mautrix-signal +CapabilityBoundingSet= +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/mautrix-signal/mautrix-signal/build.sh b/mautrix-signal/mautrix-signal/build.sh new file mode 100755 index 0000000..3b52bd1 --- /dev/null +++ b/mautrix-signal/mautrix-signal/build.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/mautrix/signal/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.name[1:]) \(.published_at) \(.tarball_url)"' + + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + mkdir -p "mautrix-signal-${VERSION}" + wget "${URL}" --output-document "mautrix-signal-${VERSION}.tar.gz" + tar -x -C "mautrix-signal-${VERSION}" --strip-components=1 -f "mautrix-signal-${VERSION}.tar.gz" + rm "mautrix-signal-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/usr/lib/python3/dist-packages" \ + "${PKGDIR}/lib/systemd/system" \ + "${PKGDIR}/var/lib/mautrix-signal" \ + "${PKGDIR}/var/log/mautrix-signal" + cd "${SRCDIR}/mautrix-signal-${VERSION}" + python3 setup.py egg_info install --root="${PKGDIR}/" --prefix=/usr --optimize=1 + rsync -a "${PKGDIR}/usr/local/lib/python3.11/dist-packages/" "${PKGDIR}/usr/lib/python3/dist-packages/" + rm -rf "${PKGDIR}/usr/lib/python3.11/" + find "${PKGDIR}/usr/lib/python3/dist-packages" -name __pycache__ -exec rm -r {} \; 2>/dev/null || true + find "${PKGDIR}/usr/lib/python3/dist-packages" -name '*.pyc' -exec rm {} \; + cp "${ROOT}/mautrix-signal.service" "${PKGDIR}/lib/systemd/system/mautrix-signal.service" + cp "${ROOT}/mautrix-signal.default" "${PKGDIR}/etc/default/mautrix-signal" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + cp "${SRCDIR}/mautrix-signal-${VERSION}/mautrix_signal/example-config.yaml" "${PKGDIR}/etc/mautrix-signal.yml" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s# ./mautrix-signal.log# /var/log/mautrix-signal.log#g" -i "${PKGDIR}/etc/mautrix-signal.yml" + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/mautrix-signal/mautrix-signal/debian.conffiles b/mautrix-signal/mautrix-signal/debian.conffiles new file mode 100644 index 0000000..66312af --- /dev/null +++ b/mautrix-signal/mautrix-signal/debian.conffiles @@ -0,0 +1,2 @@ +/etc/mautrix-signal.yml +/etc/default/mautrix-signal diff --git a/mautrix-signal/mautrix-signal/debian.control b/mautrix-signal/mautrix-signal/debian.control new file mode 100644 index 0000000..105f4f0 --- /dev/null +++ b/mautrix-signal/mautrix-signal/debian.control @@ -0,0 +1,9 @@ +Package: mautrix-signal +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: signald, python3-aiohttp, python3-mautrix, python3-magic, python3-ruamel.yaml, python3-commonmark, python3-pycryptodome, python3-unpaddedbase64, python3-yarl, python3-attr, python3-asyncpg, python3-olm, python3-phonenumbers, python3-qrcode, python3-pil +Recommends: python3-prometheus-client +Description: A Matrix-Signal puppeting bridge diff --git a/mautrix-signal/mautrix-signal/debian.postinst b/mautrix-signal/mautrix-signal/debian.postinst new file mode 100755 index 0000000..c56bdd0 --- /dev/null +++ b/mautrix-signal/mautrix-signal/debian.postinst @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group mautrix-signal >/dev/null; then + groupadd --system mautrix-signal + fi + + if ! getent passwd mautrix-signal >/dev/null; then + useradd --system --gid mautrix-signal --home-dir /var/lib/mautrix-signal --shell /bin/bash mautrix-signal + fi + + chown mautrix-signal:mautrix-signal /var/lib/mautrix-signal /var/log/mautrix-signal + chmod 0750 /var/lib/mautrix-signal /var/log/mautrix-signal + chown root:mautrix-signal /etc/mautrix-signal.yml + chmod 0640 /etc/mautrix-signal.yml + + deb-systemd-helper enable mautrix-signal.service + deb-systemd-invoke restart mautrix-signal.service + +fi diff --git a/mautrix-signal/mautrix-signal/debian.postrm b/mautrix-signal/mautrix-signal/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/mautrix-signal/mautrix-signal/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/mautrix-signal/mautrix-signal/debian.prerm b/mautrix-signal/mautrix-signal/debian.prerm new file mode 100755 index 0000000..f7346af --- /dev/null +++ b/mautrix-signal/mautrix-signal/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop mautrix-signal.service + +fi diff --git a/mautrix-signal/mautrix-signal/mautrix-signal.default b/mautrix-signal/mautrix-signal/mautrix-signal.default new file mode 100644 index 0000000..1fb82d8 --- /dev/null +++ b/mautrix-signal/mautrix-signal/mautrix-signal.default @@ -0,0 +1,10 @@ + +# The path to your config file +CONFIG=/etc/mautrix-signal.yml + +# The path to save the generated registration to (not needed for +# running the bridge) +REGISTRATION=/var/lib/mautrix-signal/registration.yml + +# Don't save updated config to disk (no write access to /etc) +ARGS=--no-update \ No newline at end of file diff --git a/mautrix-signal/mautrix-signal/mautrix-signal.service b/mautrix-signal/mautrix-signal/mautrix-signal.service new file mode 100644 index 0000000..0334cc3 --- /dev/null +++ b/mautrix-signal/mautrix-signal/mautrix-signal.service @@ -0,0 +1,15 @@ +[Unit] +Description=Matrix-Signal puppeting bridge +Requires=postgresql.service + +[Service] +WorkingDirectory=/var/lib/mautrix-signal +EnvironmentFile=-/etc/default/mautrix-signal +ExecStart=/usr/bin/python3 -m mautrix_signal --config $CONFIG $ARGS +User=mautrix-signal +Group=mautrix-signal +CapabilityBoundingSet= +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/mautrix-telegram/build.sh b/mautrix-telegram/build.sh new file mode 100755 index 0000000..54aae9d --- /dev/null +++ b/mautrix-telegram/build.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +set -exo pipefail + +. ../.skel/helpers.sh + +export PKGNAME=mautrix-telegram +API_URL=https://api.github.com/repos/mautrix/telegram/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.name[1:]) \(.published_at) \(.tarball_url)"' + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + mkdir -p "mautrix-telegram-${VERSION}" + wget "${URL}" --output-document "mautrix-telegram-${VERSION}.tar.gz" + tar -x -C "mautrix-telegram-${VERSION}" --strip-components=1 -f "mautrix-telegram-${VERSION}.tar.gz" + rm "mautrix-telegram-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/usr/lib/python3/dist-packages" \ + "${PKGDIR}/lib/systemd/system" \ + "${PKGDIR}/usr/share/doc/mautrix-telegram" \ + "${PKGDIR}/var/lib/mautrix-telegram" \ + "${PKGDIR}/var/log/mautrix-telegram" + cd "${SRCDIR}/mautrix-telegram-${VERSION}" + python3 setup.py egg_info install --root="${PKGDIR}/" --prefix=/usr --optimize=1 + rsync -a "${PKGDIR}/usr/local/lib/python3.11/dist-packages/" "${PKGDIR}/usr/lib/python3/dist-packages/" + rm -rf "${PKGDIR}/usr/local/lib/python3.11/" + find "${PKGDIR}/usr/lib/python3/dist-packages" -name __pycache__ -exec rm -r {} \; 2>/dev/null || true + find "${PKGDIR}/usr/lib/python3/dist-packages" -name '*.pyc' -exec rm {} \; + find "${PKGDIR}/usr/lib/python3/dist-packages" -type d -exec chmod 0755 {} \; + find "${PKGDIR}/usr/lib/python3/dist-packages" -type f -exec chmod 0644 {} \; + cp "${ROOT}/mautrix-telegram.service" "${PKGDIR}/lib/systemd/system/mautrix-telegram.service" + cp "${ROOT}/mautrix-telegram.default" "${PKGDIR}/etc/default/mautrix-telegram" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + cp "${PKGDIR}/usr/lib/python3/dist-packages/mautrix_telegram/example-config.yaml" "${PKGDIR}/etc/mautrix-telegram.yml" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s# ./mautrix-telegram.log# /var/log/mautrix-telegram/mautrix-telegram.log#g" -i "${PKGDIR}/etc/mautrix-telegram.yml" + chmod 0640 "${PKGDIR}/etc/mautrix-telegram.yml" + install -m 0644 "${SRCDIR}/mautrix-telegram-${VERSION}/LICENSE" "${PKGDIR}/usr/share/doc/${PKGNAME}/copyright" + github_changelog mautrix/telegram + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/mautrix-telegram/debian.conffiles b/mautrix-telegram/debian.conffiles new file mode 100644 index 0000000..e138ae3 --- /dev/null +++ b/mautrix-telegram/debian.conffiles @@ -0,0 +1,2 @@ +/etc/mautrix-telegram.yml +/etc/default/mautrix-telegram diff --git a/mautrix-telegram/debian.control b/mautrix-telegram/debian.control new file mode 100644 index 0000000..4e54848 --- /dev/null +++ b/mautrix-telegram/debian.control @@ -0,0 +1,9 @@ +Package: mautrix-telegram +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: python3, python3-aiohttp, python3-asyncpg, python3-magic, python3-commonmark, python3-mautrix, python3-psycopg2, python3-ruamel.yaml, python3-yarl, python3-pycryptodome, python3-olm, python3-unpaddedbase64, python3-telethon, python3-aiodns, python3-brotli, python3-chardet, python3-pil, python3-qrcode, python3-aiosqlite +Recommends: python3-prometheus-client +Description: A Matrix-Telegram puppeting bridge diff --git a/mautrix-telegram/debian.postinst b/mautrix-telegram/debian.postinst new file mode 100755 index 0000000..512d710 --- /dev/null +++ b/mautrix-telegram/debian.postinst @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group mautrix-telegram >/dev/null; then + groupadd --system mautrix-telegram + fi + + if ! getent passwd mautrix-telegram >/dev/null; then + useradd --system --gid mautrix-telegram --home-dir /var/lib/mautrix-telegram --shell /bin/bash mautrix-telegram + fi + + chown mautrix-telegram:mautrix-telegram /var/lib/mautrix-telegram /var/log/mautrix-telegram + chmod 0750 /var/lib/mautrix-telegram /var/log/mautrix-telegram + chown root:mautrix-telegram /etc/mautrix-telegram.yml + chmod 0640 /etc/mautrix-telegram.yml + + deb-systemd-helper enable mautrix-telegram.service + deb-systemd-invoke restart mautrix-telegram.service + +fi diff --git a/mautrix-telegram/debian.postrm b/mautrix-telegram/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/mautrix-telegram/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/mautrix-telegram/debian.prerm b/mautrix-telegram/debian.prerm new file mode 100755 index 0000000..b337b37 --- /dev/null +++ b/mautrix-telegram/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop mautrix-telegram.service + +fi diff --git a/mautrix-telegram/mautrix-telegram.default b/mautrix-telegram/mautrix-telegram.default new file mode 100644 index 0000000..409bc1a --- /dev/null +++ b/mautrix-telegram/mautrix-telegram.default @@ -0,0 +1,10 @@ + +# The path to your config file +CONFIG=/etc/mautrix-telegram.yml + +# The path to save the generated registration to (not needed for +# running the bridge) +REGISTRATION=/var/lib/mautrix-telegram/registration.yml + +# Don't save updated config to disk (no write access to /etc) +ARGS=--no-update diff --git a/mautrix-telegram/mautrix-telegram.service b/mautrix-telegram/mautrix-telegram.service new file mode 100644 index 0000000..9ea058b --- /dev/null +++ b/mautrix-telegram/mautrix-telegram.service @@ -0,0 +1,15 @@ +[Unit] +Description=Matrix-Telegram puppeting bridge +Requires=postgresql.service + +[Service] +WorkingDirectory=/var/lib/mautrix-telegram +EnvironmentFile=-/etc/default/mautrix-telegram +ExecStart=/usr/bin/python3 -m mautrix_telegram --config $CONFIG $ARGS +User=mautrix-telegram +Group=mautrix-telegram +CapabilityBoundingSet= +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/mediawiki-extension-auth-remoteuser/package.sh b/mediawiki-extension-auth-remoteuser/package.sh new file mode 100755 index 0000000..6f710dc --- /dev/null +++ b/mediawiki-extension-auth-remoteuser/package.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -xeo pipefail + +ROOT=$(pwd) +PKGNAME=mediawiki-extension-auth-remoteuser +ARCH=all + +MW_VERSION=REL1_39 +MW_EXTENSION=Auth_remoteuser + +MWED_URL="https://www.mediawiki.org/wiki/Special:ExtensionDistributor?extdistname=${MW_EXTENSION}&extdistversion=${MW_VERSION}" +PATTERN="https://extdist.wmflabs.org/dist/extensions/${MW_EXTENSION}-${MW_VERSION}-[^.]+.tar.gz" + +function fetch() { + URL="$(curl "${MWED_URL}" | grep -Eo "${PATTERN}" | head -1)" + wget -O "${SRCDIR}/${PKGNAME}.tar.gz" "${URL}" + tar -xf "${SRCDIR}/${PKGNAME}.tar.gz" -C "${SRCDIR}" + export VERSION="$(cat "${SRCDIR}/${MW_EXTENSION}/extension.json" | jq -r .version)" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/var/lib/mediawiki/extensions" \ + "${PKGDIR}/usr/share/mediawiki-extensions" + ln -sf "/usr/share/mediawiki-extensions/${MW_EXTENSION}" "${PKGDIR}/var/lib/mediawiki/extensions/${MW_EXTENSION}" + rsync -a "${SRCDIR}/${MW_EXTENSION}/" "${PKGDIR}/usr/share/mediawiki-extensions/${MW_EXTENSION}/" + cat > "${PKGDIR}/DEBIAN/control" <= 1.39) +Description: Mediawiki Extension ${MW_EXTENSION} + See https://www.mediawiki.org/wiki/Extension:${MW_EXTENSION} + for documentation. +EOF + chown 0:0 -R "${PKGDIR}" + find "${PKGDIR}" -exec touch -m --reference "${SRCDIR}/${MW_EXTENSION}/extension.json" {} \; +} + +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/mediawiki-extension-nativesvghandler/mediawiki-extension-nativesvghandler/package.sh b/mediawiki-extension-nativesvghandler/mediawiki-extension-nativesvghandler/package.sh new file mode 100755 index 0000000..6dc3dca --- /dev/null +++ b/mediawiki-extension-nativesvghandler/mediawiki-extension-nativesvghandler/package.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -xeo pipefail + +ROOT=$(pwd) +PKGNAME=mediawiki-extension-nativesvghandler +ARCH=all + +MW_VERSION=REL1_39 +MW_EXTENSION=NativeSvgHandler + +MWED_URL="https://www.mediawiki.org/wiki/Special:ExtensionDistributor?extdistname=${MW_EXTENSION}&extdistversion=${MW_VERSION}" +PATTERN="https://extdist.wmflabs.org/dist/extensions/${MW_EXTENSION}-${MW_VERSION}-[^.]+.tar.gz" + +function fetch() { + URL="$(curl "${MWED_URL}" | grep -Eo "${PATTERN}" | head -1)" + wget -O "${SRCDIR}/${PKGNAME}.tar.gz" "${URL}" + tar -xf "${SRCDIR}/${PKGNAME}.tar.gz" -C "${SRCDIR}" + export VERSION="$(cat "${SRCDIR}/${MW_EXTENSION}/extension.json" | jq -r .version)" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/var/lib/mediawiki/extensions" \ + "${PKGDIR}/usr/share/mediawiki-extensions" + ln -sf "/usr/share/mediawiki-extensions/${MW_EXTENSION}" "${PKGDIR}/var/lib/mediawiki/extensions/${MW_EXTENSION}" + rsync -a "${SRCDIR}/${MW_EXTENSION}/" "${PKGDIR}/usr/share/mediawiki-extensions/${MW_EXTENSION}/" + cat > "${PKGDIR}/DEBIAN/control" <= 1.39) +Description: Mediawiki Extension ${MW_EXTENSION} + See https://www.mediawiki.org/wiki/Extension:${MW_EXTENSION} + for documentation. +EOF + chown 0:0 -R "${PKGDIR}" + find "${PKGDIR}" -exec touch -m --reference "${SRCDIR}/${MW_EXTENSION}/extension.json" {} \; +} + +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/mediawiki-extension-nativesvghandler/package.sh b/mediawiki-extension-nativesvghandler/package.sh new file mode 100755 index 0000000..6dc3dca --- /dev/null +++ b/mediawiki-extension-nativesvghandler/package.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -xeo pipefail + +ROOT=$(pwd) +PKGNAME=mediawiki-extension-nativesvghandler +ARCH=all + +MW_VERSION=REL1_39 +MW_EXTENSION=NativeSvgHandler + +MWED_URL="https://www.mediawiki.org/wiki/Special:ExtensionDistributor?extdistname=${MW_EXTENSION}&extdistversion=${MW_VERSION}" +PATTERN="https://extdist.wmflabs.org/dist/extensions/${MW_EXTENSION}-${MW_VERSION}-[^.]+.tar.gz" + +function fetch() { + URL="$(curl "${MWED_URL}" | grep -Eo "${PATTERN}" | head -1)" + wget -O "${SRCDIR}/${PKGNAME}.tar.gz" "${URL}" + tar -xf "${SRCDIR}/${PKGNAME}.tar.gz" -C "${SRCDIR}" + export VERSION="$(cat "${SRCDIR}/${MW_EXTENSION}/extension.json" | jq -r .version)" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/var/lib/mediawiki/extensions" \ + "${PKGDIR}/usr/share/mediawiki-extensions" + ln -sf "/usr/share/mediawiki-extensions/${MW_EXTENSION}" "${PKGDIR}/var/lib/mediawiki/extensions/${MW_EXTENSION}" + rsync -a "${SRCDIR}/${MW_EXTENSION}/" "${PKGDIR}/usr/share/mediawiki-extensions/${MW_EXTENSION}/" + cat > "${PKGDIR}/DEBIAN/control" <= 1.39) +Description: Mediawiki Extension ${MW_EXTENSION} + See https://www.mediawiki.org/wiki/Extension:${MW_EXTENSION} + for documentation. +EOF + chown 0:0 -R "${PKGDIR}" + find "${PKGDIR}" -exec touch -m --reference "${SRCDIR}/${MW_EXTENSION}/extension.json" {} \; +} + +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/mediawiki-extension-openidconnect/mediawiki-extension-openidconnect/package.sh b/mediawiki-extension-openidconnect/mediawiki-extension-openidconnect/package.sh new file mode 100755 index 0000000..9ec6d32 --- /dev/null +++ b/mediawiki-extension-openidconnect/mediawiki-extension-openidconnect/package.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -xeo pipefail + +ROOT=$(pwd) +PKGNAME=mediawiki-extension-openidconnect +ARCH=all + +MW_VERSION=REL1_39 +MW_EXTENSION=OpenIDConnect + +MWED_URL="https://www.mediawiki.org/wiki/Special:ExtensionDistributor?extdistname=${MW_EXTENSION}&extdistversion=${MW_VERSION}" +PATTERN="https://extdist.wmflabs.org/dist/extensions/${MW_EXTENSION}-${MW_VERSION}-[^.]+.tar.gz" + +function fetch() { + URL="$(curl "${MWED_URL}" | grep -Eo "${PATTERN}" | head -1)" + wget -O "${SRCDIR}/${PKGNAME}.tar.gz" "${URL}" + tar -xf "${SRCDIR}/${PKGNAME}.tar.gz" -C "${SRCDIR}" + export VERSION="$(cat "${SRCDIR}/${MW_EXTENSION}/extension.json" | jq -r .version)" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/var/lib/mediawiki/extensions" \ + "${PKGDIR}/usr/share/mediawiki-extensions" + ln -sf "/usr/share/mediawiki-extensions/${MW_EXTENSION}" "${PKGDIR}/var/lib/mediawiki/extensions/${MW_EXTENSION}" + rsync -a "${SRCDIR}/${MW_EXTENSION}/" "${PKGDIR}/usr/share/mediawiki-extensions/${MW_EXTENSION}/" + cat > "${PKGDIR}/DEBIAN/control" <= 1.39), mediawiki-extension-pluggableauth +Description: Mediawiki Extension ${MW_EXTENSION} + See https://www.mediawiki.org/wiki/Extension:${MW_EXTENSION} + for documentation. +EOF + chown 0:0 -R "${PKGDIR}" + find "${PKGDIR}" -exec touch -m --reference "${SRCDIR}/${MW_EXTENSION}/extension.json" {} \; +} + +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/mediawiki-extension-openidconnect/package.sh b/mediawiki-extension-openidconnect/package.sh new file mode 100755 index 0000000..9ec6d32 --- /dev/null +++ b/mediawiki-extension-openidconnect/package.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -xeo pipefail + +ROOT=$(pwd) +PKGNAME=mediawiki-extension-openidconnect +ARCH=all + +MW_VERSION=REL1_39 +MW_EXTENSION=OpenIDConnect + +MWED_URL="https://www.mediawiki.org/wiki/Special:ExtensionDistributor?extdistname=${MW_EXTENSION}&extdistversion=${MW_VERSION}" +PATTERN="https://extdist.wmflabs.org/dist/extensions/${MW_EXTENSION}-${MW_VERSION}-[^.]+.tar.gz" + +function fetch() { + URL="$(curl "${MWED_URL}" | grep -Eo "${PATTERN}" | head -1)" + wget -O "${SRCDIR}/${PKGNAME}.tar.gz" "${URL}" + tar -xf "${SRCDIR}/${PKGNAME}.tar.gz" -C "${SRCDIR}" + export VERSION="$(cat "${SRCDIR}/${MW_EXTENSION}/extension.json" | jq -r .version)" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/var/lib/mediawiki/extensions" \ + "${PKGDIR}/usr/share/mediawiki-extensions" + ln -sf "/usr/share/mediawiki-extensions/${MW_EXTENSION}" "${PKGDIR}/var/lib/mediawiki/extensions/${MW_EXTENSION}" + rsync -a "${SRCDIR}/${MW_EXTENSION}/" "${PKGDIR}/usr/share/mediawiki-extensions/${MW_EXTENSION}/" + cat > "${PKGDIR}/DEBIAN/control" <= 1.39), mediawiki-extension-pluggableauth +Description: Mediawiki Extension ${MW_EXTENSION} + See https://www.mediawiki.org/wiki/Extension:${MW_EXTENSION} + for documentation. +EOF + chown 0:0 -R "${PKGDIR}" + find "${PKGDIR}" -exec touch -m --reference "${SRCDIR}/${MW_EXTENSION}/extension.json" {} \; +} + +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/mediawiki-extension-pluggableauth/mediawiki-extension-pluggableauth/package.sh b/mediawiki-extension-pluggableauth/mediawiki-extension-pluggableauth/package.sh new file mode 100755 index 0000000..489d335 --- /dev/null +++ b/mediawiki-extension-pluggableauth/mediawiki-extension-pluggableauth/package.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -xeo pipefail + +ROOT=$(pwd) +PKGNAME=mediawiki-extension-pluggableauth +ARCH=all + +MW_VERSION=REL1_39 +MW_EXTENSION=PluggableAuth + +MWED_URL="https://www.mediawiki.org/wiki/Special:ExtensionDistributor?extdistname=${MW_EXTENSION}&extdistversion=${MW_VERSION}" +PATTERN="https://extdist.wmflabs.org/dist/extensions/${MW_EXTENSION}-${MW_VERSION}-[^.]+.tar.gz" + +function fetch() { + URL="$(curl "${MWED_URL}" | grep -Eo "${PATTERN}" | head -1)" + wget -O "${SRCDIR}/${PKGNAME}.tar.gz" "${URL}" + tar -xf "${SRCDIR}/${PKGNAME}.tar.gz" -C "${SRCDIR}" + export VERSION="$(cat "${SRCDIR}/${MW_EXTENSION}/extension.json" | jq -r .version)" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/var/lib/mediawiki/extensions" \ + "${PKGDIR}/usr/share/mediawiki-extensions" + ln -sf "/usr/share/mediawiki-extensions/${MW_EXTENSION}" "${PKGDIR}/var/lib/mediawiki/extensions/${MW_EXTENSION}" + rsync -a "${SRCDIR}/${MW_EXTENSION}/" "${PKGDIR}/usr/share/mediawiki-extensions/${MW_EXTENSION}/" + cat > "${PKGDIR}/DEBIAN/control" <= 1.39) +Description: Mediawiki Extension ${MW_EXTENSION} + See https://www.mediawiki.org/wiki/Extension:${MW_EXTENSION} + for documentation. +EOF + chown 0:0 -R "${PKGDIR}" + find "${PKGDIR}" -exec touch -m --reference "${SRCDIR}/${MW_EXTENSION}/extension.json" {} \; +} + +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/mediawiki-extension-pluggableauth/package.sh b/mediawiki-extension-pluggableauth/package.sh new file mode 100755 index 0000000..489d335 --- /dev/null +++ b/mediawiki-extension-pluggableauth/package.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -xeo pipefail + +ROOT=$(pwd) +PKGNAME=mediawiki-extension-pluggableauth +ARCH=all + +MW_VERSION=REL1_39 +MW_EXTENSION=PluggableAuth + +MWED_URL="https://www.mediawiki.org/wiki/Special:ExtensionDistributor?extdistname=${MW_EXTENSION}&extdistversion=${MW_VERSION}" +PATTERN="https://extdist.wmflabs.org/dist/extensions/${MW_EXTENSION}-${MW_VERSION}-[^.]+.tar.gz" + +function fetch() { + URL="$(curl "${MWED_URL}" | grep -Eo "${PATTERN}" | head -1)" + wget -O "${SRCDIR}/${PKGNAME}.tar.gz" "${URL}" + tar -xf "${SRCDIR}/${PKGNAME}.tar.gz" -C "${SRCDIR}" + export VERSION="$(cat "${SRCDIR}/${MW_EXTENSION}/extension.json" | jq -r .version)" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/var/lib/mediawiki/extensions" \ + "${PKGDIR}/usr/share/mediawiki-extensions" + ln -sf "/usr/share/mediawiki-extensions/${MW_EXTENSION}" "${PKGDIR}/var/lib/mediawiki/extensions/${MW_EXTENSION}" + rsync -a "${SRCDIR}/${MW_EXTENSION}/" "${PKGDIR}/usr/share/mediawiki-extensions/${MW_EXTENSION}/" + cat > "${PKGDIR}/DEBIAN/control" <= 1.39) +Description: Mediawiki Extension ${MW_EXTENSION} + See https://www.mediawiki.org/wiki/Extension:${MW_EXTENSION} + for documentation. +EOF + chown 0:0 -R "${PKGDIR}" + find "${PKGDIR}" -exec touch -m --reference "${SRCDIR}/${MW_EXTENSION}/extension.json" {} \; +} + +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/mqtt2prometheus/build.sh b/mqtt2prometheus/build.sh new file mode 100755 index 0000000..061f041 --- /dev/null +++ b/mqtt2prometheus/build.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/hikhvar/mqtt2prometheus/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.name[1:]) \(.published_at) \(.tarball_url)"' + + +ROOT=$(pwd) +function fetch() { + apt install --assume-yes --no-install-recommends git golang-go + cd "${SRCDIR}" + mkdir -p "mqtt2prometheus-${VERSION}" + wget "${URL}" --output-document "mqtt2prometheus-${VERSION}.tar.gz" + tar -x -C "mqtt2prometheus-${VERSION}" --strip-components=1 -f "mqtt2prometheus-${VERSION}.tar.gz" + rm "mqtt2prometheus-${VERSION}.tar.gz" + cd "mqtt2prometheus-${VERSION}" + make +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/mqtt2prometheus-${VERSION}/bin/mqtt2prometheus.linux_amd64" "${PKGDIR}/usr/bin/mqtt2prometheus" + cp "${SRCDIR}/mqtt2prometheus-${VERSION}/config.yaml.dist" "${PKGDIR}/etc/mqtt2prometheus.yml" + cp "${ROOT}/mqtt2prometheus.service" "${PKGDIR}/lib/systemd/system/mqtt2prometheus.service" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + 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() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/mqtt2prometheus/debian.conffiles b/mqtt2prometheus/debian.conffiles new file mode 100644 index 0000000..283f453 --- /dev/null +++ b/mqtt2prometheus/debian.conffiles @@ -0,0 +1 @@ +/etc/mqtt2prometheus.yml diff --git a/mqtt2prometheus/debian.control b/mqtt2prometheus/debian.control new file mode 100644 index 0000000..37c099f --- /dev/null +++ b/mqtt2prometheus/debian.control @@ -0,0 +1,7 @@ +Package: mqtt2prometheus +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Description: Translates from MQTT topics to prometheus metrics diff --git a/mqtt2prometheus/debian.postinst b/mqtt2prometheus/debian.postinst new file mode 100755 index 0000000..b82d456 --- /dev/null +++ b/mqtt2prometheus/debian.postinst @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + systemctl daemon-reload || true + +fi + +systemctl try-restart mqtt2prometheus.service || true + diff --git a/mqtt2prometheus/debian.postrm b/mqtt2prometheus/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/mqtt2prometheus/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/mqtt2prometheus/debian.prerm b/mqtt2prometheus/debian.prerm new file mode 100755 index 0000000..fb8099a --- /dev/null +++ b/mqtt2prometheus/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl stop mqtt2prometheus.service || true + +fi diff --git a/mqtt2prometheus/mqtt2prometheus.service b/mqtt2prometheus/mqtt2prometheus.service new file mode 100644 index 0000000..dd5e682 --- /dev/null +++ b/mqtt2prometheus/mqtt2prometheus.service @@ -0,0 +1,13 @@ +[Unit] +Description=Translator from MQTT topics to prometheus metrics +After=network-online.target +Wants=network-online.target + +[Service] +ExecStart=/usr/bin/mqtt2prometheus -config /etc/mqtt2prometheus.yml +DynamicUser=true +CapabilityBoundingSet= +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/mqtt2prometheus/mqtt2prometheus/build.sh b/mqtt2prometheus/mqtt2prometheus/build.sh new file mode 100755 index 0000000..061f041 --- /dev/null +++ b/mqtt2prometheus/mqtt2prometheus/build.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/hikhvar/mqtt2prometheus/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.name[1:]) \(.published_at) \(.tarball_url)"' + + +ROOT=$(pwd) +function fetch() { + apt install --assume-yes --no-install-recommends git golang-go + cd "${SRCDIR}" + mkdir -p "mqtt2prometheus-${VERSION}" + wget "${URL}" --output-document "mqtt2prometheus-${VERSION}.tar.gz" + tar -x -C "mqtt2prometheus-${VERSION}" --strip-components=1 -f "mqtt2prometheus-${VERSION}.tar.gz" + rm "mqtt2prometheus-${VERSION}.tar.gz" + cd "mqtt2prometheus-${VERSION}" + make +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/mqtt2prometheus-${VERSION}/bin/mqtt2prometheus.linux_amd64" "${PKGDIR}/usr/bin/mqtt2prometheus" + cp "${SRCDIR}/mqtt2prometheus-${VERSION}/config.yaml.dist" "${PKGDIR}/etc/mqtt2prometheus.yml" + cp "${ROOT}/mqtt2prometheus.service" "${PKGDIR}/lib/systemd/system/mqtt2prometheus.service" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + 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() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/mqtt2prometheus/mqtt2prometheus/debian.conffiles b/mqtt2prometheus/mqtt2prometheus/debian.conffiles new file mode 100644 index 0000000..283f453 --- /dev/null +++ b/mqtt2prometheus/mqtt2prometheus/debian.conffiles @@ -0,0 +1 @@ +/etc/mqtt2prometheus.yml diff --git a/mqtt2prometheus/mqtt2prometheus/debian.control b/mqtt2prometheus/mqtt2prometheus/debian.control new file mode 100644 index 0000000..37c099f --- /dev/null +++ b/mqtt2prometheus/mqtt2prometheus/debian.control @@ -0,0 +1,7 @@ +Package: mqtt2prometheus +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Description: Translates from MQTT topics to prometheus metrics diff --git a/mqtt2prometheus/mqtt2prometheus/debian.postinst b/mqtt2prometheus/mqtt2prometheus/debian.postinst new file mode 100755 index 0000000..b82d456 --- /dev/null +++ b/mqtt2prometheus/mqtt2prometheus/debian.postinst @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + systemctl daemon-reload || true + +fi + +systemctl try-restart mqtt2prometheus.service || true + diff --git a/mqtt2prometheus/mqtt2prometheus/debian.postrm b/mqtt2prometheus/mqtt2prometheus/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/mqtt2prometheus/mqtt2prometheus/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/mqtt2prometheus/mqtt2prometheus/debian.prerm b/mqtt2prometheus/mqtt2prometheus/debian.prerm new file mode 100755 index 0000000..fb8099a --- /dev/null +++ b/mqtt2prometheus/mqtt2prometheus/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl stop mqtt2prometheus.service || true + +fi diff --git a/mqtt2prometheus/mqtt2prometheus/mqtt2prometheus.service b/mqtt2prometheus/mqtt2prometheus/mqtt2prometheus.service new file mode 100644 index 0000000..dd5e682 --- /dev/null +++ b/mqtt2prometheus/mqtt2prometheus/mqtt2prometheus.service @@ -0,0 +1,13 @@ +[Unit] +Description=Translator from MQTT topics to prometheus metrics +After=network-online.target +Wants=network-online.target + +[Service] +ExecStart=/usr/bin/mqtt2prometheus -config /etc/mqtt2prometheus.yml +DynamicUser=true +CapabilityBoundingSet= +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/mumble-web-data/build.sh b/mumble-web-data/build.sh new file mode 100755 index 0000000..e0e0769 --- /dev/null +++ b/mumble-web-data/build.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -exo pipefail + + +ROOT=$(pwd) +function fetch() { + apt install --assume-yes --no-install-recommends git npm + cd "${SRCDIR}" + git clone https://github.com/johni0702/mumble-web mumble-web + cd mumble-web + export VERSION=0.$(git rev-list --count HEAD) + npm install +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/share/mumble-web/html/" \ + "${PKGDIR}/etc/mumble-web/html/" \ + "${PKGDIR}/etc/apache2/sites-available/" + rsync -a "${SRCDIR}/mumble-web/dist/" "${PKGDIR}/usr/share/mumble-web/html/" + chown root:root -R "${PKGDIR}/usr/share/mumble-web/html" + mv "${PKGDIR}/usr/share/mumble-web/html/config.local.js" "${PKGDIR}/etc/mumble-web/html/config.js" + cp "${ROOT}/mumble-web.site" "${PKGDIR}/etc/apache2/sites-available/mumble-web.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/mumble-web-data/debian.conffiles b/mumble-web-data/debian.conffiles new file mode 100644 index 0000000..5bc435f --- /dev/null +++ b/mumble-web-data/debian.conffiles @@ -0,0 +1,2 @@ +/etc/apache2/sites-available/mumble-web.site +/etc/mumble-web/html/config.js diff --git a/mumble-web-data/debian.control b/mumble-web-data/debian.control new file mode 100644 index 0000000..c205150 --- /dev/null +++ b/mumble-web-data/debian.control @@ -0,0 +1,12 @@ +Package: mumble-web-data +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Recommends: apache2, mumble-web | mumble-web-proxy +Description: HTML5 Mumble client for use in modern browsers - data + The Mumble protocol uses TCP for control and UDP for voice. Running + in a browser, both are unavailable to this client. Instead Websockets + are used for control and WebRTC is used for voice (using Websockets + as fallback if the server does not support WebRTC). diff --git a/mumble-web-data/mumble-web.site b/mumble-web-data/mumble-web.site new file mode 100644 index 0000000..45f50eb --- /dev/null +++ b/mumble-web-data/mumble-web.site @@ -0,0 +1,31 @@ + + ServerName mumble.example.com + ServerAdmin webmaster@localhost + + DocumentRoot /usr/share/mumble-web/html + + Options -Indexes + Require all granted + AllowOverride none + + + Alias /config.local.js /etc/mumble-web/html/config.js + + Options -Indexes + Require all granted + AllowOverride none + + + + RewriteEngine On + RewriteCond %{HTTP:Upgrade} =websocket + RewriteRule ^/(.*) ws://localhost:64737/$1 [P,L] + RewriteRule ^/(.*) http://localhost:64737/$1 [P,L] + + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet \ No newline at end of file diff --git a/mumble-web-proxy/build.sh b/mumble-web-proxy/build.sh new file mode 100755 index 0000000..773082e --- /dev/null +++ b/mumble-web-proxy/build.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +set -exo pipefail + + +ROOT=$(pwd) +function fetch() { + apt install --assume-yes --no-install-recommends git cargo clang pkg-config libssl-dev libglib2.0-dev libnice-dev + cd "${SRCDIR}" + git clone https://github.com/johni0702/mumble-web-proxy mumble-web-proxy + cd mumble-web-proxy + export VERSION=0.$(git rev-list --count HEAD) + cargo build --release +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/mumble-web/proxy" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/mumble-web-proxy/target/release/mumble-web-proxy" "${PKGDIR}/usr/bin/mumble-web-proxy" + cp "${ROOT}/mumble-web-proxy@.service" "${PKGDIR}/lib/systemd/system/mumble-web-proxy@.service" + cp "${ROOT}/mumble-web-proxy.conf" "${PKGDIR}/etc/mumble-web/proxy/mumble.conf" + 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/mumble-web-proxy/debian.conffiles b/mumble-web-proxy/debian.conffiles new file mode 100644 index 0000000..161eaf0 --- /dev/null +++ b/mumble-web-proxy/debian.conffiles @@ -0,0 +1 @@ +/etc/mumble-web/proxy/mumble.conf diff --git a/mumble-web-proxy/debian.control b/mumble-web-proxy/debian.control new file mode 100644 index 0000000..e9fe4f2 --- /dev/null +++ b/mumble-web-proxy/debian.control @@ -0,0 +1,12 @@ +Package: mumble-web-proxy +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Depends: libnice10 +Recommends: apache2, mumble-web-data +Description: Mumble to WebSocket+WebRTC proxy. + mumble-web-proxy is a Mumble to WebSocket+WebRTC proxy. While not + limited to, its primary use-case is allowing mumble-web to connect to + vanilla Mumble 1.2/1.3 servers. diff --git a/mumble-web-proxy/mumble-web-proxy.conf b/mumble-web-proxy/mumble-web-proxy.conf new file mode 100644 index 0000000..d14c7d8 --- /dev/null +++ b/mumble-web-proxy/mumble-web-proxy.conf @@ -0,0 +1,26 @@ +# See https://github.com/johni0702/mumble-web-proxy for details + +# If this file is e.g. named /etc/mumble-web/proxy/mumble.conf +# run the systemd service as mumble-web-proxy@mumble.service + +# Port to listen for WebSocket (non TLS) connections on +listen-ws = 64737 + +# Hostname and (optionally) port of the upstream Mumble server +server = 'mumble.example.org:64738' + +# Connect to upstream server even when its certificate is +# invalid. Only ever use this if know that your server is using a +# self-signed certificate! +#accept-invalid-certificate + +# If your mumble-web-proxy is running behind a firewall or NAT, you +# need to allocate a range of ports to it which it can use for ICE +# connection establishment. +#ice-port-min = 20000 +#ice-port-max = 21000 + +# For NATs, you additionally need to provide it with its publicly +# reachable IP address(es): +#ice-ipv4 = '1.2.3.4' +#ice-ipv6 = '2001:db8::1ce' diff --git a/mumble-web-proxy/mumble-web-proxy/build.sh b/mumble-web-proxy/mumble-web-proxy/build.sh new file mode 100755 index 0000000..773082e --- /dev/null +++ b/mumble-web-proxy/mumble-web-proxy/build.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +set -exo pipefail + + +ROOT=$(pwd) +function fetch() { + apt install --assume-yes --no-install-recommends git cargo clang pkg-config libssl-dev libglib2.0-dev libnice-dev + cd "${SRCDIR}" + git clone https://github.com/johni0702/mumble-web-proxy mumble-web-proxy + cd mumble-web-proxy + export VERSION=0.$(git rev-list --count HEAD) + cargo build --release +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/mumble-web/proxy" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/mumble-web-proxy/target/release/mumble-web-proxy" "${PKGDIR}/usr/bin/mumble-web-proxy" + cp "${ROOT}/mumble-web-proxy@.service" "${PKGDIR}/lib/systemd/system/mumble-web-proxy@.service" + cp "${ROOT}/mumble-web-proxy.conf" "${PKGDIR}/etc/mumble-web/proxy/mumble.conf" + 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/mumble-web-proxy/mumble-web-proxy/debian.conffiles b/mumble-web-proxy/mumble-web-proxy/debian.conffiles new file mode 100644 index 0000000..161eaf0 --- /dev/null +++ b/mumble-web-proxy/mumble-web-proxy/debian.conffiles @@ -0,0 +1 @@ +/etc/mumble-web/proxy/mumble.conf diff --git a/mumble-web-proxy/mumble-web-proxy/debian.control b/mumble-web-proxy/mumble-web-proxy/debian.control new file mode 100644 index 0000000..e9fe4f2 --- /dev/null +++ b/mumble-web-proxy/mumble-web-proxy/debian.control @@ -0,0 +1,12 @@ +Package: mumble-web-proxy +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Depends: libnice10 +Recommends: apache2, mumble-web-data +Description: Mumble to WebSocket+WebRTC proxy. + mumble-web-proxy is a Mumble to WebSocket+WebRTC proxy. While not + limited to, its primary use-case is allowing mumble-web to connect to + vanilla Mumble 1.2/1.3 servers. diff --git a/mumble-web-proxy/mumble-web-proxy/mumble-web-proxy.conf b/mumble-web-proxy/mumble-web-proxy/mumble-web-proxy.conf new file mode 100644 index 0000000..d14c7d8 --- /dev/null +++ b/mumble-web-proxy/mumble-web-proxy/mumble-web-proxy.conf @@ -0,0 +1,26 @@ +# See https://github.com/johni0702/mumble-web-proxy for details + +# If this file is e.g. named /etc/mumble-web/proxy/mumble.conf +# run the systemd service as mumble-web-proxy@mumble.service + +# Port to listen for WebSocket (non TLS) connections on +listen-ws = 64737 + +# Hostname and (optionally) port of the upstream Mumble server +server = 'mumble.example.org:64738' + +# Connect to upstream server even when its certificate is +# invalid. Only ever use this if know that your server is using a +# self-signed certificate! +#accept-invalid-certificate + +# If your mumble-web-proxy is running behind a firewall or NAT, you +# need to allocate a range of ports to it which it can use for ICE +# connection establishment. +#ice-port-min = 20000 +#ice-port-max = 21000 + +# For NATs, you additionally need to provide it with its publicly +# reachable IP address(es): +#ice-ipv4 = '1.2.3.4' +#ice-ipv6 = '2001:db8::1ce' diff --git a/mumble-web-proxy/mumble-web-proxy/mumble-web-proxy@.service b/mumble-web-proxy/mumble-web-proxy/mumble-web-proxy@.service new file mode 100644 index 0000000..9c53d53 --- /dev/null +++ b/mumble-web-proxy/mumble-web-proxy/mumble-web-proxy@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Mumble to WebSocket+WebRTC proxy +After=network-online.target +Wants=network-online.target + +[Service] +ExecStart=/usr/bin/mumble-web-proxy --config /etc/mumble-web/proxy/%I.conf +DynamicUser=true +CapabilityBoundingSet= +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/mumble-web-proxy/mumble-web-proxy@.service b/mumble-web-proxy/mumble-web-proxy@.service new file mode 100644 index 0000000..9c53d53 --- /dev/null +++ b/mumble-web-proxy/mumble-web-proxy@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Mumble to WebSocket+WebRTC proxy +After=network-online.target +Wants=network-online.target + +[Service] +ExecStart=/usr/bin/mumble-web-proxy --config /etc/mumble-web/proxy/%I.conf +DynamicUser=true +CapabilityBoundingSet= +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/mumble-web/build.sh b/mumble-web/build.sh new file mode 100755 index 0000000..9fc443d --- /dev/null +++ b/mumble-web/build.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -exo pipefail + + +ROOT=$(pwd) + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/lib/systemd/system" + cp "${ROOT}/mumble-web.defaults" "${PKGDIR}/etc/default/mumble-web" + cp "${ROOT}/mumble-web.service" "${PKGDIR}/lib/systemd/system/mumble-web.service" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + 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} + prepare + package +} + + +build diff --git a/mumble-web/debian.conffiles b/mumble-web/debian.conffiles new file mode 100644 index 0000000..181e0a2 --- /dev/null +++ b/mumble-web/debian.conffiles @@ -0,0 +1 @@ +/etc/default/mumble-web diff --git a/mumble-web/debian.control b/mumble-web/debian.control new file mode 100644 index 0000000..835aa65 --- /dev/null +++ b/mumble-web/debian.control @@ -0,0 +1,12 @@ +Package: mumble-web +Version: 0.1 +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: websockify, mumble-web-data +Description: HTML5 Mumble client for use in modern browsers + The Mumble protocol uses TCP for control and UDP for voice. Running + in a browser, both are unavailable to this client. Instead Websockets + are used for control and WebRTC is used for voice (using Websockets + as fallback if the server does not support WebRTC). diff --git a/mumble-web/mumble-web.defaults b/mumble-web/mumble-web.defaults new file mode 100644 index 0000000..cd66bb2 --- /dev/null +++ b/mumble-web/mumble-web.defaults @@ -0,0 +1,2 @@ + +ARGS=--ssl-target localhost:64737 localhost:64738 diff --git a/mumble-web/mumble-web.service b/mumble-web/mumble-web.service new file mode 100644 index 0000000..2a23c43 --- /dev/null +++ b/mumble-web/mumble-web.service @@ -0,0 +1,15 @@ +[Unit] +Description=HTML5 Mumble client +Documentation=https://github.com/johni0702/mumble-web +After=network-online.target mumble-server.service +Wants=network-online.target mumble-server.service + +[Service] +EnvironmentFile=-/etc/default/mumble-web +ExecStart=/usr/bin/websockify --web=/usr/share/mumble-web/html $ARGS +DynamicUser=true +CapabilityBoundingSet= +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/mumble-web/mumble-web.site b/mumble-web/mumble-web.site new file mode 100644 index 0000000..80b76e1 --- /dev/null +++ b/mumble-web/mumble-web.site @@ -0,0 +1,25 @@ + + ServerName mumble.example.com + ServerAdmin webmaster@localhost + + DocumentRoot /usr/share/mumble-web/html + + + Options -Indexes + Require all granted + AllowOverride none + + + + RewriteEngine On + RewriteCond %{HTTP:Upgrade} =websocket + RewriteRule ^/(.*) ws://localhost:64737/$1 [P,L] + RewriteRule ^/(.*) http://localhost:64737/$1 [P,L] + + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet \ No newline at end of file diff --git a/prometheus-dnsbl-exporter/build.sh b/prometheus-dnsbl-exporter/build.sh new file mode 100755 index 0000000..a3c4809 --- /dev/null +++ b/prometheus-dnsbl-exporter/build.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +set -exo pipefail + +N_RELEASES=1 +API_URL=https://api.github.com/repos/Luzilla/dnsbl_exporter/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.name) \(.published_at) \(.assets[] | select( .name|test(".*_Linux_x86_64.tar.gz$") ).browser_download_url)"' + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "dnsbl-exporter-${VERSION}-linux-amd64.tar.gz" + tar -xf "dnsbl-exporter-${VERSION}-linux-amd64.tar.gz" +} + +function prepare() { + chmod +x "${SRCDIR}/dnsbl-exporter" + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/lib/systemd/system" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/etc/prometheus/dnsbl-exporter" + cp "${SRCDIR}/dnsbl-exporter" "${PKGDIR}/usr/bin/prometheus-dnsbl-exporter" + cp "${ROOT}/prometheus-dnsbl-exporter.service" "${PKGDIR}/lib/systemd/system/prometheus-dnsbl-exporter.service" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/prometheus-dnsbl-exporter.defaults" "${PKGDIR}/etc/default/prometheus-dnsbl-exporter" + cp "${ROOT}/rbls.ini" "${PKGDIR}/etc/prometheus/dnsbl-exporter/rbls.ini" + cp "${ROOT}/targets.ini" "${PKGDIR}/etc/prometheus/dnsbl-exporter/targets.ini" + V="${VERSION/v/}" + sed -re "s/__VERSION__/${V}/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() { + while read VERSION ISODATE URL; do + export VERSION + export ISODATE + export URL + export BUILDDIR=${ROOT}/build + export SRCDIR=${ROOT}/build/${VERSION}/srcdir + export PKGDIR=${ROOT}/build/${VERSION}/pkgdir + mkdir -p ${SRCDIR} ${PKGDIR} + fetch + prepare + package + done <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head "-${N_RELEASES}") +} + + +build diff --git a/prometheus-dnsbl-exporter/debian.conffiles b/prometheus-dnsbl-exporter/debian.conffiles new file mode 100644 index 0000000..79aa3a9 --- /dev/null +++ b/prometheus-dnsbl-exporter/debian.conffiles @@ -0,0 +1,3 @@ +/etc/default/prometheus-dnsbl-exporter +/etc/prometheus/dnsbl-exporter/rbls.ini +/etc/prometheus/dnsbl-exporter/targets.ini diff --git a/prometheus-dnsbl-exporter/debian.control b/prometheus-dnsbl-exporter/debian.control new file mode 100644 index 0000000..0365852 --- /dev/null +++ b/prometheus-dnsbl-exporter/debian.control @@ -0,0 +1,9 @@ +Package: prometheus-dnsbl-exporter +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Description: Checks the configured hosts against various DNSBL + This is a server which checks the configured hosts against various + DNSBL (sometimes refered to as RBLs). diff --git a/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.defaults b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.defaults new file mode 100644 index 0000000..74b44f7 --- /dev/null +++ b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.defaults @@ -0,0 +1,13 @@ +ARGS="--config.rbls=/etc/prometheus/dnsbl-exporter/rbls.ini --config.targets=/etc/prometheus/dnsbl-exporter/targets.ini" + +# GLOBAL OPTIONS: +# --config.dns-resolver value IP address of the resolver to use. (default: "127.0.0.1") +# --config.rbls value Configuration file which contains RBLs (default: "./rbls.ini") +# --config.targets value Configuration file which contains the targets to check. (default: "./targets.ini") +# --web.listen-address value Address to listen on for web interface and telemetry. (default: ":9211") +# --web.telemetry-path value Path under which to expose metrics. (default: "/metrics") +# --web.include-exporter-metrics Include metrics about the exporter itself (promhttp_*, process_*, go_*). +# --log.debug Enable more output in the logs, otherwise INFO. +# --log.output value Destination of our logs: stdout, stderr (default: "stdout") +# --help, -h show help +# --version, -V Print the version information. diff --git a/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.service b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.service new file mode 100644 index 0000000..925a639 --- /dev/null +++ b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.service @@ -0,0 +1,13 @@ +[Unit] +Description=Prometheus DNSBL Exporter +Documentation=https://github.com/Luzilla/dnsbl_exporter +After=network.target + +[Service] +Restart=always +User=prometheus +EnvironmentFile=/etc/default/prometheus-dnsbl-exporter +ExecStart=/usr/bin/prometheus-dnsbl-exporter $ARGS + +[Install] +WantedBy=multi-user.target diff --git a/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/build.sh b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/build.sh new file mode 100755 index 0000000..a3c4809 --- /dev/null +++ b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/build.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +set -exo pipefail + +N_RELEASES=1 +API_URL=https://api.github.com/repos/Luzilla/dnsbl_exporter/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.name) \(.published_at) \(.assets[] | select( .name|test(".*_Linux_x86_64.tar.gz$") ).browser_download_url)"' + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "dnsbl-exporter-${VERSION}-linux-amd64.tar.gz" + tar -xf "dnsbl-exporter-${VERSION}-linux-amd64.tar.gz" +} + +function prepare() { + chmod +x "${SRCDIR}/dnsbl-exporter" + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/lib/systemd/system" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/etc/prometheus/dnsbl-exporter" + cp "${SRCDIR}/dnsbl-exporter" "${PKGDIR}/usr/bin/prometheus-dnsbl-exporter" + cp "${ROOT}/prometheus-dnsbl-exporter.service" "${PKGDIR}/lib/systemd/system/prometheus-dnsbl-exporter.service" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/prometheus-dnsbl-exporter.defaults" "${PKGDIR}/etc/default/prometheus-dnsbl-exporter" + cp "${ROOT}/rbls.ini" "${PKGDIR}/etc/prometheus/dnsbl-exporter/rbls.ini" + cp "${ROOT}/targets.ini" "${PKGDIR}/etc/prometheus/dnsbl-exporter/targets.ini" + V="${VERSION/v/}" + sed -re "s/__VERSION__/${V}/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() { + while read VERSION ISODATE URL; do + export VERSION + export ISODATE + export URL + export BUILDDIR=${ROOT}/build + export SRCDIR=${ROOT}/build/${VERSION}/srcdir + export PKGDIR=${ROOT}/build/${VERSION}/pkgdir + mkdir -p ${SRCDIR} ${PKGDIR} + fetch + prepare + package + done <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head "-${N_RELEASES}") +} + + +build diff --git a/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/debian.conffiles b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/debian.conffiles new file mode 100644 index 0000000..79aa3a9 --- /dev/null +++ b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/debian.conffiles @@ -0,0 +1,3 @@ +/etc/default/prometheus-dnsbl-exporter +/etc/prometheus/dnsbl-exporter/rbls.ini +/etc/prometheus/dnsbl-exporter/targets.ini diff --git a/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/debian.control b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/debian.control new file mode 100644 index 0000000..0365852 --- /dev/null +++ b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/debian.control @@ -0,0 +1,9 @@ +Package: prometheus-dnsbl-exporter +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Description: Checks the configured hosts against various DNSBL + This is a server which checks the configured hosts against various + DNSBL (sometimes refered to as RBLs). diff --git a/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.defaults b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.defaults new file mode 100644 index 0000000..74b44f7 --- /dev/null +++ b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.defaults @@ -0,0 +1,13 @@ +ARGS="--config.rbls=/etc/prometheus/dnsbl-exporter/rbls.ini --config.targets=/etc/prometheus/dnsbl-exporter/targets.ini" + +# GLOBAL OPTIONS: +# --config.dns-resolver value IP address of the resolver to use. (default: "127.0.0.1") +# --config.rbls value Configuration file which contains RBLs (default: "./rbls.ini") +# --config.targets value Configuration file which contains the targets to check. (default: "./targets.ini") +# --web.listen-address value Address to listen on for web interface and telemetry. (default: ":9211") +# --web.telemetry-path value Path under which to expose metrics. (default: "/metrics") +# --web.include-exporter-metrics Include metrics about the exporter itself (promhttp_*, process_*, go_*). +# --log.debug Enable more output in the logs, otherwise INFO. +# --log.output value Destination of our logs: stdout, stderr (default: "stdout") +# --help, -h show help +# --version, -V Print the version information. diff --git a/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.service b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.service new file mode 100644 index 0000000..925a639 --- /dev/null +++ b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter.service @@ -0,0 +1,13 @@ +[Unit] +Description=Prometheus DNSBL Exporter +Documentation=https://github.com/Luzilla/dnsbl_exporter +After=network.target + +[Service] +Restart=always +User=prometheus +EnvironmentFile=/etc/default/prometheus-dnsbl-exporter +ExecStart=/usr/bin/prometheus-dnsbl-exporter $ARGS + +[Install] +WantedBy=multi-user.target diff --git a/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/rbls.ini b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/rbls.ini new file mode 100644 index 0000000..8854b52 --- /dev/null +++ b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/rbls.ini @@ -0,0 +1,98 @@ +; taken from here: +; https://github.com/matteocorti/check_rbl/blob/master/check_rbl.ini +[rbl] +; server=cbl.abuseat.org +; server=bl.deadbeef.com +; server=spamtrap.drbl.drand.net +; server=spamsources.fabel.dk +; server=0spam.fusionzero.com +; server=mail-abuse.blacklist.jippg.org +; server=korea.services.net +; server=spamguard.leadmon.net +server=ix.dnsbl.manitu.net +; server=relays.nether.net +; server=psbl.surriel.com +; server=dyna.spamrats.com +; server=noptr.spamrats.com +; server=spam.spamrats.com +; server=dnsbl.sorbs.net +; server=spam.dnsbl.sorbs.net +; server=bl.spamcop.net +; server=pbl.spamhaus.org +; server=sbl.spamhaus.org +; server=xbl.spamhaus.org +; server=ubl.unsubscore.com +; server=dnsbl-1.uceprotect.net +; server=dnsbl-2.uceprotect.net +; server=dnsbl-3.uceprotect.net +; server=db.wpbl.info +; server=access.redhawk.org +; server=blacklist.sci.kun.nl +; server=dnsbl.kempt.net +; server=forbidden.icm.edu.pl +; server=hil.habeas.com +; server=rbl.schulte.org +; server=sbl-xbl.spamhaus.org +; server=bl.technovision.dk +; server=b.barracudacentral.org +; server=dnsbl.antispam.or.id +; server=dnsbl.inps.de +; server=drone.abuse.ch +; server=dsn.rfc-ignorant.org +; server=dul.dnsbl.sorbs.net +; server=http.dnsbl.sorbs.net +; server=l1.spews.dnsbl.sorbs.net +; server=l2.spews.dnsbl.sorbs.net +; server=misc.dnsbl.sorbs.net +; server=postmaster.rfc-ignorant.org +; server=rbl.spamlab.com +; server=rbl.suresupport.com +; server=relays.bl.kunden.de +; server=smtp.dnsbl.sorbs.net +; server=socks.dnsbl.sorbs.net +; server=spam.abuse.ch +; server=spamrbl.imp.ch +; server=tr.countries.nerd.dk +; server=unsure.nether.net +; server=virbl.bit.nl +; server=web.dnsbl.sorbs.net +; server=whois.rfc-ignorant.org +; server=wormrbl.imp.ch +server=zen.spamhaus.org +; server=zombie.dnsbl.sorbs.net +; server=blackholes.five-ten-sg.com +; server=blacklist.woody.ch +; server=bl.emailbasura.org +; server=bogons.cymru.com +; server=combined.abuse.ch +; server=duinv.aupads.org +; server=dynip.rothen.com +; server=ohps.dnsbl.net.au +; server=omrs.dnsbl.net.au +; server=orvedb.aupads.org +; server=osps.dnsbl.net.au +; server=osrs.dnsbl.net.au +; server=owfs.dnsbl.net.au +; server=owps.dnsbl.net.au +; server=probes.dnsbl.net.au +; server=proxy.bl.gweep.ca +; server=proxy.block.transip.nl +; server=rbl.inter.net +; server=rbl.megarbl.net +; server=rdts.dnsbl.net.au +; server=relays.bl.gweep.ca +; server=residential.block.transip.nl +; server=ricn.dnsbl.net.au +; server=rmst.dnsbl.net.au +; server=spamlist.or.kr +; server=t3direct.dnsbl.net.au +; server=ubl.lashback.com +; server=all.s5h.net +; server=dnsbl.anticaptcha.net +; server=dnsbl.dronebl.org +; server=dnsbl.spfbl.net +; server=ips.backscatterer.org +; server=singular.ttk.pte.hu +; server=spam.dnsbl.anonmails.de +; server=spambot.bls.digibase.ca +; server=z.mailspike.net diff --git a/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/targets.ini b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/targets.ini new file mode 100644 index 0000000..11b0a32 --- /dev/null +++ b/prometheus-dnsbl-exporter/prometheus-dnsbl-exporter/targets.ini @@ -0,0 +1,4 @@ +; these are examples, customize to your liking +[targets] +server=mailly.debian.org +server=muffat.debian.org diff --git a/prometheus-dnsbl-exporter/rbls.ini b/prometheus-dnsbl-exporter/rbls.ini new file mode 100644 index 0000000..8854b52 --- /dev/null +++ b/prometheus-dnsbl-exporter/rbls.ini @@ -0,0 +1,98 @@ +; taken from here: +; https://github.com/matteocorti/check_rbl/blob/master/check_rbl.ini +[rbl] +; server=cbl.abuseat.org +; server=bl.deadbeef.com +; server=spamtrap.drbl.drand.net +; server=spamsources.fabel.dk +; server=0spam.fusionzero.com +; server=mail-abuse.blacklist.jippg.org +; server=korea.services.net +; server=spamguard.leadmon.net +server=ix.dnsbl.manitu.net +; server=relays.nether.net +; server=psbl.surriel.com +; server=dyna.spamrats.com +; server=noptr.spamrats.com +; server=spam.spamrats.com +; server=dnsbl.sorbs.net +; server=spam.dnsbl.sorbs.net +; server=bl.spamcop.net +; server=pbl.spamhaus.org +; server=sbl.spamhaus.org +; server=xbl.spamhaus.org +; server=ubl.unsubscore.com +; server=dnsbl-1.uceprotect.net +; server=dnsbl-2.uceprotect.net +; server=dnsbl-3.uceprotect.net +; server=db.wpbl.info +; server=access.redhawk.org +; server=blacklist.sci.kun.nl +; server=dnsbl.kempt.net +; server=forbidden.icm.edu.pl +; server=hil.habeas.com +; server=rbl.schulte.org +; server=sbl-xbl.spamhaus.org +; server=bl.technovision.dk +; server=b.barracudacentral.org +; server=dnsbl.antispam.or.id +; server=dnsbl.inps.de +; server=drone.abuse.ch +; server=dsn.rfc-ignorant.org +; server=dul.dnsbl.sorbs.net +; server=http.dnsbl.sorbs.net +; server=l1.spews.dnsbl.sorbs.net +; server=l2.spews.dnsbl.sorbs.net +; server=misc.dnsbl.sorbs.net +; server=postmaster.rfc-ignorant.org +; server=rbl.spamlab.com +; server=rbl.suresupport.com +; server=relays.bl.kunden.de +; server=smtp.dnsbl.sorbs.net +; server=socks.dnsbl.sorbs.net +; server=spam.abuse.ch +; server=spamrbl.imp.ch +; server=tr.countries.nerd.dk +; server=unsure.nether.net +; server=virbl.bit.nl +; server=web.dnsbl.sorbs.net +; server=whois.rfc-ignorant.org +; server=wormrbl.imp.ch +server=zen.spamhaus.org +; server=zombie.dnsbl.sorbs.net +; server=blackholes.five-ten-sg.com +; server=blacklist.woody.ch +; server=bl.emailbasura.org +; server=bogons.cymru.com +; server=combined.abuse.ch +; server=duinv.aupads.org +; server=dynip.rothen.com +; server=ohps.dnsbl.net.au +; server=omrs.dnsbl.net.au +; server=orvedb.aupads.org +; server=osps.dnsbl.net.au +; server=osrs.dnsbl.net.au +; server=owfs.dnsbl.net.au +; server=owps.dnsbl.net.au +; server=probes.dnsbl.net.au +; server=proxy.bl.gweep.ca +; server=proxy.block.transip.nl +; server=rbl.inter.net +; server=rbl.megarbl.net +; server=rdts.dnsbl.net.au +; server=relays.bl.gweep.ca +; server=residential.block.transip.nl +; server=ricn.dnsbl.net.au +; server=rmst.dnsbl.net.au +; server=spamlist.or.kr +; server=t3direct.dnsbl.net.au +; server=ubl.lashback.com +; server=all.s5h.net +; server=dnsbl.anticaptcha.net +; server=dnsbl.dronebl.org +; server=dnsbl.spfbl.net +; server=ips.backscatterer.org +; server=singular.ttk.pte.hu +; server=spam.dnsbl.anonmails.de +; server=spambot.bls.digibase.ca +; server=z.mailspike.net diff --git a/prometheus-dnsbl-exporter/targets.ini b/prometheus-dnsbl-exporter/targets.ini new file mode 100644 index 0000000..11b0a32 --- /dev/null +++ b/prometheus-dnsbl-exporter/targets.ini @@ -0,0 +1,4 @@ +; these are examples, customize to your liking +[targets] +server=mailly.debian.org +server=muffat.debian.org diff --git a/prometheus-ipmi-exporter/build.sh b/prometheus-ipmi-exporter/build.sh new file mode 100755 index 0000000..c18a36d --- /dev/null +++ b/prometheus-ipmi-exporter/build.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +set -exo pipefail + +. ../.skel/helpers.sh + +PKGNAME=prometheus-ipmi-exporter +N_RELEASES=1 +API_URL=https://api.github.com/repos/prometheus-community/ipmi_exporter/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false ) | "\(.tag_name[1:]) \(.published_at) \(.assets[] | select( .name|test(".*.linux-amd64.tar.gz$") ).browser_download_url)"' + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "ipmi-exporter-${VERSION}-linux-amd64.tar.gz" + tar --strip-components=1 -xf "ipmi-exporter-${VERSION}-linux-amd64.tar.gz" +} + +function prepare() { + chmod +x "${SRCDIR}/ipmi_exporter" + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/lib/systemd/system" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/etc/prometheus/ipmi-exporter" \ + "${PKGDIR}/etc/sudoers.d" \ + "${PKGDIR}/usr/share/doc/${PKGNAME}" + cp "${SRCDIR}/ipmi_exporter" "${PKGDIR}/usr/bin/prometheus-ipmi-exporter" + cp "${SRCDIR}/LICENSE" "${PKGDIR}/usr/share/doc/${PKGNAME}/copyright" + cp "${ROOT}/prometheus-ipmi-exporter.service" "${PKGDIR}/lib/systemd/system/prometheus-ipmi-exporter.service" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/prometheus-ipmi-exporter.defaults" "${PKGDIR}/etc/default/prometheus-ipmi-exporter" + cp "${ROOT}/prometheus-ipmi-exporter.sudoers" "${PKGDIR}/etc/sudoers.d/prometheus-ipmi-exporter" + cp "${ROOT}/config.yaml" "${PKGDIR}/etc/prometheus/ipmi-exporter/config.yaml" + chmod 0440 "${PKGDIR}/etc/sudoers.d/prometheus-ipmi-exporter" + sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control" + sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control" + github_changelog prometheus-community/ipmi_exporter + find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + while read VERSION ISODATE URL; do + export VERSION + export ISODATE + export URL + export BUILDDIR=${ROOT}/build + export SRCDIR=${ROOT}/build/${VERSION}/srcdir + export PKGDIR=${ROOT}/build/${VERSION}/pkgdir + mkdir -p ${SRCDIR} ${PKGDIR} + fetch + prepare + package + done <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head "-${N_RELEASES}") +} + + +build diff --git a/prometheus-ipmi-exporter/config.yaml b/prometheus-ipmi-exporter/config.yaml new file mode 100644 index 0000000..7f8052d --- /dev/null +++ b/prometheus-ipmi-exporter/config.yaml @@ -0,0 +1,22 @@ +--- + +modules: + default: + collectors: + - ipmi + - dcmi + - bmc + - chassis + - sel + collector_cmd: + ipmi: sudo + dcmi: sudo + bmc: sudo + chassis: sudo + sel: sudo + custom_args: + ipmi: ["/usr/sbin/ipmimonitoring"] + dcmi: ["/usr/sbin/ipmi-dcmi"] + bmc: ["/usr/sbin/bmc-info"] + chassis: ["/usr/sbin/ipmi-chassis"] + sel: ["/usr/sbin/ipmi-sel"] diff --git a/prometheus-ipmi-exporter/debian.conffiles b/prometheus-ipmi-exporter/debian.conffiles new file mode 100644 index 0000000..5042fcb --- /dev/null +++ b/prometheus-ipmi-exporter/debian.conffiles @@ -0,0 +1,3 @@ +/etc/default/prometheus-ipmi-exporter +/etc/sudoers.d/prometheus-ipmi-exporter +/etc/prometheus/ipmi-exporter/config.yaml diff --git a/prometheus-ipmi-exporter/debian.control b/prometheus-ipmi-exporter/debian.control new file mode 100644 index 0000000..3e71657 --- /dev/null +++ b/prometheus-ipmi-exporter/debian.control @@ -0,0 +1,10 @@ +Package: prometheus-ipmi-exporter +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Depends: sudo, freeipmi +Description: Remote IPMI exporter for Prometheus + This is an IPMI exporter for Prometheus. The exporter relies on tools + from the FreeIPMI suite for the actual IPMI implementation. diff --git a/prometheus-ipmi-exporter/debian.postinst b/prometheus-ipmi-exporter/debian.postinst new file mode 100755 index 0000000..2330c10 --- /dev/null +++ b/prometheus-ipmi-exporter/debian.postinst @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group prometheus >/dev/null; then + groupadd --system prometheus + fi + + if ! getent passwd prometheus >/dev/null; then + useradd --system --gid prometheus --home-dir /var/lib/prometheus --shell /usr/sbin/nologin prometheus + fi + + chown root:prometheus /etc/prometheus/ipmi-exporter /etc/prometheus/ipmi-exporter/config.yaml + chmod g+rx /etc/prometheus/ipmi-exporter + chmod g+r /etc/prometheus/ipmi-exporter + + deb-systemd-helper enable prometheus-ipmi-exporter.service + deb-systemd-invoke restart prometheus-ipmi-exporter.service + +fi + diff --git a/prometheus-ipmi-exporter/prometheus-ipmi-exporter.defaults b/prometheus-ipmi-exporter/prometheus-ipmi-exporter.defaults new file mode 100644 index 0000000..1207642 --- /dev/null +++ b/prometheus-ipmi-exporter/prometheus-ipmi-exporter.defaults @@ -0,0 +1,11 @@ +ARGS="--config.file=/etc/prometheus/ipmi-exporter/config.yaml" + +# GLOBAL OPTIONS: +# --config.file=CONFIG.FILE Path to configuration file. +# --freeipmi.path=FREEIPMI.PATH Path to FreeIPMI executables (default: rely on $PATH). +# --web.listen-address=":9290" Address to listen on for web interface and telemetry. +# --web.config.file="" [EXPERIMENTAL] Path to configuration file that can enable TLS or authentication. +# --log.level=info Only log messages with the given severity or above. One of: [debug, info, warn, error] +# --log.format=logfmt Output format of log messages. One of: [logfmt, json] +# --version Show application version. + diff --git a/prometheus-ipmi-exporter/prometheus-ipmi-exporter.service b/prometheus-ipmi-exporter/prometheus-ipmi-exporter.service new file mode 100644 index 0000000..dc32e6b --- /dev/null +++ b/prometheus-ipmi-exporter/prometheus-ipmi-exporter.service @@ -0,0 +1,13 @@ +[Unit] +Description=Prometheus IPMI Exporter +Documentation=https://github.com/prometheus-community/ipmi_exporter +After=network.target + +[Service] +Restart=always +User=prometheus +EnvironmentFile=/etc/default/prometheus-ipmi-exporter +ExecStart=/usr/bin/prometheus-ipmi-exporter $ARGS + +[Install] +WantedBy=multi-user.target diff --git a/prometheus-ipmi-exporter/prometheus-ipmi-exporter.sudoers b/prometheus-ipmi-exporter/prometheus-ipmi-exporter.sudoers new file mode 100644 index 0000000..88aa2a5 --- /dev/null +++ b/prometheus-ipmi-exporter/prometheus-ipmi-exporter.sudoers @@ -0,0 +1,7 @@ +prometheus ALL = NOPASSWD: /usr/sbin/ipmimonitoring,\ + /usr/sbin/ipmi-sensors,\ + /usr/sbin/ipmi-dcmi,\ + /usr/sbin/ipmi-raw,\ + /usr/sbin/bmc-info,\ + /usr/sbin/ipmi-chassis,\ + /usr/sbin/ipmi-sel diff --git a/prometheus2influxdb/build.sh b/prometheus2influxdb/build.sh new file mode 100755 index 0000000..6fe002b --- /dev/null +++ b/prometheus2influxdb/build.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +set -exo pipefail + + +ROOT=$(pwd) +function fetch() { + git clone https://gitlab.com/s3lph/prometheus2influxdb "${SRCDIR}" + cd "${SRCDIR}" + export VERSION=0.$(git rev-list --count HEAD) +} + +function prepare() { + chmod +x "${SRCDIR}/prometheus2influxdb.py" + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/prometheus2influxdb.py" "${PKGDIR}/usr/bin/prometheus2influxdb.py" + cp "${SRCDIR}/config.yaml" "${PKGDIR}/etc/prometheus2influxdb.yaml" + cp "${ROOT}/prometheus2influxdb.defaults" "${PKGDIR}/etc/default/prometheus2influxdb" + cp "${ROOT}/prometheus2influxdb.service" "${PKGDIR}/lib/systemd/system/prometheus2influxdb.service" + cp "${ROOT}/prometheus2influxdb.timer" "${PKGDIR}/lib/systemd/system/prometheus2influxdb.timer" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + 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/prometheus2influxdb/debian.conffiles b/prometheus2influxdb/debian.conffiles new file mode 100644 index 0000000..ee24d10 --- /dev/null +++ b/prometheus2influxdb/debian.conffiles @@ -0,0 +1,2 @@ +/etc/default/prometheus2influxdb +/etc/prometheus2influxdb.yaml diff --git a/prometheus2influxdb/debian.control b/prometheus2influxdb/debian.control new file mode 100644 index 0000000..829003e --- /dev/null +++ b/prometheus2influxdb/debian.control @@ -0,0 +1,9 @@ +Package: prometheus2influxdb +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: python3 (>= 3.6), python3-yaml +Description: Prometheus to InfluxDB Pushgateway + Prometheus to InfluxDB Pushgateway diff --git a/prometheus2influxdb/debian.postinst b/prometheus2influxdb/debian.postinst new file mode 100755 index 0000000..422b00f --- /dev/null +++ b/prometheus2influxdb/debian.postinst @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group prometheus2influxdb >/dev/null; then + groupadd --system prometheus2influxdb + fi + + if ! getent passwd prometheus2influxdb >/dev/null; then + useradd --system --gid prometheus2influxdb --home-dir /nonexistent --shell /sbin/nologin prometheus2influxdb + fi + + chown root:prometheus2influxdb /etc/prometheus2influxdb.yaml + chmod 0640 /etc/prometheus2influxdb.yaml + + deb-systemd-helper enable prometheus2influxdb.timer + deb-systemd-invoke restart prometheus2influxdb.timer + +fi + diff --git a/prometheus2influxdb/debian.postrm b/prometheus2influxdb/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/prometheus2influxdb/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/prometheus2influxdb/debian.prerm b/prometheus2influxdb/debian.prerm new file mode 100755 index 0000000..7e2c410 --- /dev/null +++ b/prometheus2influxdb/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop prometheus2influxdb.timer + +fi diff --git a/prometheus2influxdb/prometheus2influxdb.defaults b/prometheus2influxdb/prometheus2influxdb.defaults new file mode 100644 index 0000000..54f8222 --- /dev/null +++ b/prometheus2influxdb/prometheus2influxdb.defaults @@ -0,0 +1,2 @@ + +ARGS=/etc/prometheus2influxdb.yaml diff --git a/prometheus2influxdb/prometheus2influxdb.service b/prometheus2influxdb/prometheus2influxdb.service new file mode 100644 index 0000000..b83f6fb --- /dev/null +++ b/prometheus2influxdb/prometheus2influxdb.service @@ -0,0 +1,12 @@ +[Unit] +Description=Prometheus to InfluxDB Pushgateway + +[Service] +Type=oneshot +ExecStart=/usr/bin/prometheus2influxdb.py $ARGS +User=prometheus2influxdb +EnvironmentFile=-/etc/default/prometheus2influxdb + +NoNewPrivileges=true +ProtectSystem=strict +ProtectHome=tmpfs diff --git a/prometheus2influxdb/prometheus2influxdb.timer b/prometheus2influxdb/prometheus2influxdb.timer new file mode 100644 index 0000000..7ff5c1e --- /dev/null +++ b/prometheus2influxdb/prometheus2influxdb.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Prometheus to InfluxDB Pushgateway + +[Timer] +OnBootSec=0 +OnUnitActiveSec=1m + +[Install] +WantedBy=timers.target diff --git a/prometheus2influxdb/prometheus2influxdb/build.sh b/prometheus2influxdb/prometheus2influxdb/build.sh new file mode 100755 index 0000000..6fe002b --- /dev/null +++ b/prometheus2influxdb/prometheus2influxdb/build.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +set -exo pipefail + + +ROOT=$(pwd) +function fetch() { + git clone https://gitlab.com/s3lph/prometheus2influxdb "${SRCDIR}" + cd "${SRCDIR}" + export VERSION=0.$(git rev-list --count HEAD) +} + +function prepare() { + chmod +x "${SRCDIR}/prometheus2influxdb.py" + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/prometheus2influxdb.py" "${PKGDIR}/usr/bin/prometheus2influxdb.py" + cp "${SRCDIR}/config.yaml" "${PKGDIR}/etc/prometheus2influxdb.yaml" + cp "${ROOT}/prometheus2influxdb.defaults" "${PKGDIR}/etc/default/prometheus2influxdb" + cp "${ROOT}/prometheus2influxdb.service" "${PKGDIR}/lib/systemd/system/prometheus2influxdb.service" + cp "${ROOT}/prometheus2influxdb.timer" "${PKGDIR}/lib/systemd/system/prometheus2influxdb.timer" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + 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/prometheus2influxdb/prometheus2influxdb/debian.conffiles b/prometheus2influxdb/prometheus2influxdb/debian.conffiles new file mode 100644 index 0000000..ee24d10 --- /dev/null +++ b/prometheus2influxdb/prometheus2influxdb/debian.conffiles @@ -0,0 +1,2 @@ +/etc/default/prometheus2influxdb +/etc/prometheus2influxdb.yaml diff --git a/prometheus2influxdb/prometheus2influxdb/debian.control b/prometheus2influxdb/prometheus2influxdb/debian.control new file mode 100644 index 0000000..829003e --- /dev/null +++ b/prometheus2influxdb/prometheus2influxdb/debian.control @@ -0,0 +1,9 @@ +Package: prometheus2influxdb +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: python3 (>= 3.6), python3-yaml +Description: Prometheus to InfluxDB Pushgateway + Prometheus to InfluxDB Pushgateway diff --git a/prometheus2influxdb/prometheus2influxdb/debian.postinst b/prometheus2influxdb/prometheus2influxdb/debian.postinst new file mode 100755 index 0000000..422b00f --- /dev/null +++ b/prometheus2influxdb/prometheus2influxdb/debian.postinst @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group prometheus2influxdb >/dev/null; then + groupadd --system prometheus2influxdb + fi + + if ! getent passwd prometheus2influxdb >/dev/null; then + useradd --system --gid prometheus2influxdb --home-dir /nonexistent --shell /sbin/nologin prometheus2influxdb + fi + + chown root:prometheus2influxdb /etc/prometheus2influxdb.yaml + chmod 0640 /etc/prometheus2influxdb.yaml + + deb-systemd-helper enable prometheus2influxdb.timer + deb-systemd-invoke restart prometheus2influxdb.timer + +fi + diff --git a/prometheus2influxdb/prometheus2influxdb/debian.postrm b/prometheus2influxdb/prometheus2influxdb/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/prometheus2influxdb/prometheus2influxdb/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/prometheus2influxdb/prometheus2influxdb/debian.prerm b/prometheus2influxdb/prometheus2influxdb/debian.prerm new file mode 100755 index 0000000..7e2c410 --- /dev/null +++ b/prometheus2influxdb/prometheus2influxdb/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop prometheus2influxdb.timer + +fi diff --git a/prometheus2influxdb/prometheus2influxdb/prometheus2influxdb.defaults b/prometheus2influxdb/prometheus2influxdb/prometheus2influxdb.defaults new file mode 100644 index 0000000..54f8222 --- /dev/null +++ b/prometheus2influxdb/prometheus2influxdb/prometheus2influxdb.defaults @@ -0,0 +1,2 @@ + +ARGS=/etc/prometheus2influxdb.yaml diff --git a/prometheus2influxdb/prometheus2influxdb/prometheus2influxdb.service b/prometheus2influxdb/prometheus2influxdb/prometheus2influxdb.service new file mode 100644 index 0000000..b83f6fb --- /dev/null +++ b/prometheus2influxdb/prometheus2influxdb/prometheus2influxdb.service @@ -0,0 +1,12 @@ +[Unit] +Description=Prometheus to InfluxDB Pushgateway + +[Service] +Type=oneshot +ExecStart=/usr/bin/prometheus2influxdb.py $ARGS +User=prometheus2influxdb +EnvironmentFile=-/etc/default/prometheus2influxdb + +NoNewPrivileges=true +ProtectSystem=strict +ProtectHome=tmpfs diff --git a/prometheus2influxdb/prometheus2influxdb/prometheus2influxdb.timer b/prometheus2influxdb/prometheus2influxdb/prometheus2influxdb.timer new file mode 100644 index 0000000..7ff5c1e --- /dev/null +++ b/prometheus2influxdb/prometheus2influxdb/prometheus2influxdb.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Prometheus to InfluxDB Pushgateway + +[Timer] +OnBootSec=0 +OnUnitActiveSec=1m + +[Install] +WantedBy=timers.target diff --git a/python3-mautrix/build.sh b/python3-mautrix/build.sh new file mode 100755 index 0000000..db55972 --- /dev/null +++ b/python3-mautrix/build.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/mautrix/python/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.name[1:]) \(.published_at) \(.tarball_url)"' + + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + mkdir -p "mautrix-python-${VERSION}" + wget "${URL}" --output-document "mautrix-python-${VERSION}.tar.gz" + tar -x -C "mautrix-python-${VERSION}" --strip-components=1 -f "mautrix-python-${VERSION}.tar.gz" + rm "mautrix-python-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/lib/python3/dist-packages" + cd "${SRCDIR}/mautrix-python-${VERSION}" + python3 setup.py egg_info install --root="${PKGDIR}/" --prefix=/usr --optimize=1 + rsync -a "${PKGDIR}/usr/local/lib/python3.11/dist-packages/" "${PKGDIR}/usr/lib/python3/dist-packages/" + rm -rf "${PKGDIR}/usr/local/lib/python3.11/" + find "${PKGDIR}/usr/lib/python3/dist-packages" -name __pycache__ -exec rm -r {} \; 2>/dev/null || true + find "${PKGDIR}/usr/lib/python3/dist-packages" -name '*.pyc' -exec rm {} \; + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + 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() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/python3-mautrix/debian.control b/python3-mautrix/debian.control new file mode 100644 index 0000000..4966dec --- /dev/null +++ b/python3-mautrix/debian.control @@ -0,0 +1,8 @@ +Package: python3-mautrix +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: python3-aiohttp, python3-attr, python3-yarl +Description: A Python 3.7+ asyncio Matrix framework diff --git a/python3-mautrix/python3-mautrix/build.sh b/python3-mautrix/python3-mautrix/build.sh new file mode 100755 index 0000000..db55972 --- /dev/null +++ b/python3-mautrix/python3-mautrix/build.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/mautrix/python/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.name[1:]) \(.published_at) \(.tarball_url)"' + + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + mkdir -p "mautrix-python-${VERSION}" + wget "${URL}" --output-document "mautrix-python-${VERSION}.tar.gz" + tar -x -C "mautrix-python-${VERSION}" --strip-components=1 -f "mautrix-python-${VERSION}.tar.gz" + rm "mautrix-python-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/lib/python3/dist-packages" + cd "${SRCDIR}/mautrix-python-${VERSION}" + python3 setup.py egg_info install --root="${PKGDIR}/" --prefix=/usr --optimize=1 + rsync -a "${PKGDIR}/usr/local/lib/python3.11/dist-packages/" "${PKGDIR}/usr/lib/python3/dist-packages/" + rm -rf "${PKGDIR}/usr/local/lib/python3.11/" + find "${PKGDIR}/usr/lib/python3/dist-packages" -name __pycache__ -exec rm -r {} \; 2>/dev/null || true + find "${PKGDIR}/usr/lib/python3/dist-packages" -name '*.pyc' -exec rm {} \; + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + 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() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/python3-mautrix/python3-mautrix/debian.control b/python3-mautrix/python3-mautrix/debian.control new file mode 100644 index 0000000..4966dec --- /dev/null +++ b/python3-mautrix/python3-mautrix/debian.control @@ -0,0 +1,8 @@ +Package: python3-mautrix +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: python3-aiohttp, python3-attr, python3-yarl +Description: A Python 3.7+ asyncio Matrix framework diff --git a/python3-telethon/build.sh b/python3-telethon/build.sh new file mode 100755 index 0000000..ce6a2fe --- /dev/null +++ b/python3-telethon/build.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -exo pipefail + +export PKGNAME=python3-telethon +API_URL=https://api.github.com/repos/tulir/Telethon/tags +JQ_EXPR='.[] | "\(.name[1:]) \(.tarball_url)"' + + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + # WORKAROUND + export VERSION=1.25.0a5 + git clone https://github.com/tulir/Telethon "telethon-${VERSION}" + #mkdir -p "telethon-${VERSION}" + #wget "${URL}" --output-document "telethon-${VERSION}.tar.gz" + #tar -x -C "telethon-${VERSION}" --strip-components=1 -f "telethon-${VERSION}.tar.gz" + #rm "telethon-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/share/doc/${PKGNAME}"\ + "${PKGDIR}/usr/lib/python3/dist-packages" + cd "${SRCDIR}/telethon-${VERSION}" + git checkout 23d38d49193f680f03f0545bbfa6ad3da83c29c1 + python3 setup.py egg_info install --root="${PKGDIR}/" --prefix=/usr --optimize=1 + rsync -a "${PKGDIR}/usr/local/lib/python3.11/dist-packages/" "${PKGDIR}/usr/lib/python3/dist-packages/" + rm -rf "${PKGDIR}/usr/local/lib/python3.11/" + find "${PKGDIR}/usr/lib/python3/dist-packages" -name __pycache__ -exec rm -r {} \; 2>/dev/null || true + find "${PKGDIR}/usr/lib/python3/dist-packages" -name '*.pyc' -exec rm {} \; + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + install -m 0644 "${SRCDIR}/telethon-${VERSION}/LICENSE" "${PKGDIR}/usr/share/doc/${PKGNAME}/copyright" + 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 --reference "${SRCDIR}/telethon-${VERSION}/telethon/version.py" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export URL + 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/python3-telethon/debian.control b/python3-telethon/debian.control new file mode 100644 index 0000000..31bca24 --- /dev/null +++ b/python3-telethon/debian.control @@ -0,0 +1,8 @@ +Package: python3-telethon +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: python3, python3-pyaes, python3-rsa +Description: Full-featured Telegram client library for Python 3 diff --git a/python3-telethon/python3-telethon/build.sh b/python3-telethon/python3-telethon/build.sh new file mode 100755 index 0000000..ce6a2fe --- /dev/null +++ b/python3-telethon/python3-telethon/build.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -exo pipefail + +export PKGNAME=python3-telethon +API_URL=https://api.github.com/repos/tulir/Telethon/tags +JQ_EXPR='.[] | "\(.name[1:]) \(.tarball_url)"' + + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + # WORKAROUND + export VERSION=1.25.0a5 + git clone https://github.com/tulir/Telethon "telethon-${VERSION}" + #mkdir -p "telethon-${VERSION}" + #wget "${URL}" --output-document "telethon-${VERSION}.tar.gz" + #tar -x -C "telethon-${VERSION}" --strip-components=1 -f "telethon-${VERSION}.tar.gz" + #rm "telethon-${VERSION}.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/share/doc/${PKGNAME}"\ + "${PKGDIR}/usr/lib/python3/dist-packages" + cd "${SRCDIR}/telethon-${VERSION}" + git checkout 23d38d49193f680f03f0545bbfa6ad3da83c29c1 + python3 setup.py egg_info install --root="${PKGDIR}/" --prefix=/usr --optimize=1 + rsync -a "${PKGDIR}/usr/local/lib/python3.11/dist-packages/" "${PKGDIR}/usr/lib/python3/dist-packages/" + rm -rf "${PKGDIR}/usr/local/lib/python3.11/" + find "${PKGDIR}/usr/lib/python3/dist-packages" -name __pycache__ -exec rm -r {} \; 2>/dev/null || true + find "${PKGDIR}/usr/lib/python3/dist-packages" -name '*.pyc' -exec rm {} \; + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + install -m 0644 "${SRCDIR}/telethon-${VERSION}/LICENSE" "${PKGDIR}/usr/share/doc/${PKGNAME}/copyright" + 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 --reference "${SRCDIR}/telethon-${VERSION}/telethon/version.py" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export URL + 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/python3-telethon/python3-telethon/debian.control b/python3-telethon/python3-telethon/debian.control new file mode 100644 index 0000000..31bca24 --- /dev/null +++ b/python3-telethon/python3-telethon/debian.control @@ -0,0 +1,8 @@ +Package: python3-telethon +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Depends: python3, python3-pyaes, python3-rsa +Description: Full-featured Telegram client library for Python 3 diff --git a/repo.s3lph.me-apt-source/debian.changelog b/repo.s3lph.me-apt-source/debian.changelog new file mode 100644 index 0000000..d124b09 --- /dev/null +++ b/repo.s3lph.me-apt-source/debian.changelog @@ -0,0 +1,5 @@ +__PKGNAME__ (0.2-1) unstable; urgency=medium + + * Move from repo.s3lph.me to git.kabelsalat.ch + + -- __MAINTAINER__ Sun, 03 Sep 2023 01:07:00 +0200 diff --git a/repo.s3lph.me-apt-source/debian.conffiles b/repo.s3lph.me-apt-source/debian.conffiles new file mode 100644 index 0000000..b872022 --- /dev/null +++ b/repo.s3lph.me-apt-source/debian.conffiles @@ -0,0 +1 @@ +/etc/apt/sources.list.d/gitkabelsalatch-s3lph.sources diff --git a/repo.s3lph.me-apt-source/debian.control b/repo.s3lph.me-apt-source/debian.control new file mode 100644 index 0000000..9660426 --- /dev/null +++ b/repo.s3lph.me-apt-source/debian.control @@ -0,0 +1,10 @@ +Package: __PKGNAME__ +Version: 0.2-1 +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Homepage: https://repo.s3lph.me +Description: Repository configuration and key for repo.s3lph.me + Optional, but recommended to keep the sources.list updated in the case + of future changes. diff --git a/repo.s3lph.me-apt-source/debian.copyright b/repo.s3lph.me-apt-source/debian.copyright new file mode 100644 index 0000000..baa1d7a --- /dev/null +++ b/repo.s3lph.me-apt-source/debian.copyright @@ -0,0 +1,9 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Source: https://repo.s3lph.me +Upstream-Name: repo.s3lph.me +Upstream-Contact: __MAINTAINER__ + +Files: + * +Copyright: 2023, s3lph, https://repo.s3lph.me +License: CC0 diff --git a/repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.asc b/repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.asc new file mode 100644 index 0000000..26994b5 --- /dev/null +++ b/repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.asc @@ -0,0 +1,29 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +xsBNBGS/K8ABCAD2a0xssmX92AKZf9U0+tDvctdAe5KfwikMTXhALVZej5PfJMBY +YPfeHes6EPc4h3W2YvElHMrw7kW+zk/yeEbKYIP+Y//uA2gLRhCAzJqp7nCRPPQy +NxWQYP0eSfAslPfnY2NJxs25oHv7TYmOBJ/YLivNh2q/VRFX30m3vRFLVmj5Zdq/ +mQZtmDCAZBfYKJ/geD452Z6O18NjL42FVd1iFJpBCMDdPPlrNuJYTQUlHLtbLlWh +KIJfJm+pWxtdLTIUpGZJELbU7C33QSU81e++BjU12N3G5zVN+rQjP+/7ag4R1wFZ +QRecAZ7MJCxVJCx1wmdepTNrlKzJmuQwbfM5ABEBAAHNH0NDQyBCYXNlbCBHaXQg +KERlYmlhbiBSZWdpc3RyeSnCwGIEEwEIABYFAmS/K8AJECI1/fO2mocZAhsDAhkB +AACBgQgAA0QD2uVDS6UU2FR2ms3QXi5UP/7Nyk2G7lJOzmvyUYYflzyCJMicxJp6 +Eut6gXYAgBSN33XTsDX5wDCd2Y7c0ggVBCIUsWk64EXmNqWVHccDSyOnG9LF16mE +02TZHvj94tPzJqvwLWHjiv83yc0iVsuN9i8FppeNW5aGdcM4Wso0UosJ8L90b0wN +FH7QPgr0WfMf5FStGQa8x3RR1hiSSfNxxo6nWk4VvncMAeSbIH1I71MWq3frWL/j +un3Gl26qyVwcBtiz8WdzeLUYcxKbiW2yVximwYb9f18lzB7MWiLWrtQ7FPxwWHDf +M3NrE6LIkQngcGxH/x410VeMWQTZQc7ATQRkvyvAAQgAqKpDlAEIwol4YvDCwWML +QGYBWyQ3F6fFtUSy/ScStquMdtvSOFVjviVQsssJ1ADyjboQ81ePJo6fNgYiG+dF +grNW6OlQfmSQp7Czf0LyN6xxX/O4/S87CBq0m/eXL/fLIYqysUpOFdkNtmJZZ79j +31UBegeXCw8uft9a7iETxbDZj1zc7moE+0urWql2FdyK/PiDrm+jYIjN325hEAwx +6yqqH4DtMntUPAYaknmtmELfX4kPJNC6mLj3WiWd+1nuTCMZ/Gn+DBHQutlkkvYS +0Pe/Sw/RqEdRs2lQ5C4r/ibWRvFrNdfPUTYu6Lzf3QhaWzJIbJ/UijI4l6TpP0wz +wwARAQABwsBfBBgBCAATBQJkvyvACRAiNf3ztpqHGQIbDAAAmecIACXQ5fGNeMOX ++8xKt5TTpsD4/eIhAWciykM4p9UMrHZyeYAOyEzpKNleqL0UJWbilSpKetf8+XdQ +4vCXv69I+j5WoEMyuqkvo32GHSamWu91qbottsWZvaLjwyXCOl3SflcH9A+rfw4R +gXT7Ic1hBAK/0/xdGBvoAOfl6lzGVbZG6VMycnd+HPWc0SMlCYPe5f5yKrgZB7Be +XyBsdkBLBUmgwyuXJALaswT5h2gHfYFBIAMGuSdf3EgchczX9sadnMHBvAcOKD5X +A29wUrqrBjeM3sMzRQpysx/+PUXfr6pqO2QsLdcc4C1T18GG65YU/bEzBwbDBjRp ++jfGfDU6nfo= +=4gXi +-----END PGP PUBLIC KEY BLOCK----- diff --git a/repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.sources b/repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.sources new file mode 100644 index 0000000..dffb5b2 --- /dev/null +++ b/repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.sources @@ -0,0 +1,6 @@ +X-Repolib-Name: git.kabelsalat.ch-s3lph +Types: deb +URIs: https://git.kabelsalat.ch/api/packages/s3lph/debian +Suites: stable +Components: main +Signed-By: /usr/share/keyrings/gitkabelsalatch-s3lph.asc diff --git a/repo.s3lph.me-apt-source/package.sh b/repo.s3lph.me-apt-source/package.sh new file mode 100755 index 0000000..e0c1a92 --- /dev/null +++ b/repo.s3lph.me-apt-source/package.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +PKGNAME="repo.s3lph.me-apt-source" + +mkdir -p build/pkgdir/DEBIAN +mkdir -p build/pkgdir/etc/apt/sources.list.d +mkdir -p build/pkgdir/usr/share/keyrings +mkdir -p "build/pkgdir/usr/share/doc/${PKGNAME}" + +cp gitkabelsalatch-s3lph.sources build/pkgdir/etc/apt/sources.list.d/gitkabelsalatch-s3lph.sources +cp gitkabelsalatch-s3lph.asc build/pkgdir/usr/share/keyrings/gitkabelsalatch-s3lph.asc +cp debian.control build/pkgdir/DEBIAN/control +cp debian.conffiles build/pkgdir/DEBIAN/conffiles +cp debian.changelog "build/pkgdir/usr/share/doc/${PKGNAME}/changelog" +cp debian.copyright "build/pkgdir/usr/share/doc/${PKGNAME}/copyright" + +sed -re "s/__PKGNAME__/${PKGNAME}/g" -i build/pkgdir/DEBIAN/control +sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i build/pkgdir/DEBIAN/control +sed -re "s/__PKGNAME__/${PKGNAME}/g" -i "build/pkgdir/usr/share/doc/${PKGNAME}/copyright" +sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "build/pkgdir/usr/share/doc/${PKGNAME}/copyright" +sed -re "s/__PKGNAME__/${PKGNAME}/g" -i "build/pkgdir/usr/share/doc/${PKGNAME}/changelog" +sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "build/pkgdir/usr/share/doc/${PKGNAME}/changelog" +gzip -9n "build/pkgdir/usr/share/doc/${PKGNAME}/changelog" + +dpkg-deb --build build/pkgdir build diff --git a/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.changelog b/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.changelog new file mode 100644 index 0000000..d124b09 --- /dev/null +++ b/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.changelog @@ -0,0 +1,5 @@ +__PKGNAME__ (0.2-1) unstable; urgency=medium + + * Move from repo.s3lph.me to git.kabelsalat.ch + + -- __MAINTAINER__ Sun, 03 Sep 2023 01:07:00 +0200 diff --git a/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.conffiles b/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.conffiles new file mode 100644 index 0000000..b872022 --- /dev/null +++ b/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.conffiles @@ -0,0 +1 @@ +/etc/apt/sources.list.d/gitkabelsalatch-s3lph.sources diff --git a/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.control b/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.control new file mode 100644 index 0000000..9660426 --- /dev/null +++ b/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.control @@ -0,0 +1,10 @@ +Package: __PKGNAME__ +Version: 0.2-1 +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: all +Homepage: https://repo.s3lph.me +Description: Repository configuration and key for repo.s3lph.me + Optional, but recommended to keep the sources.list updated in the case + of future changes. diff --git a/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.copyright b/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.copyright new file mode 100644 index 0000000..baa1d7a --- /dev/null +++ b/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/debian.copyright @@ -0,0 +1,9 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Source: https://repo.s3lph.me +Upstream-Name: repo.s3lph.me +Upstream-Contact: __MAINTAINER__ + +Files: + * +Copyright: 2023, s3lph, https://repo.s3lph.me +License: CC0 diff --git a/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.asc b/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.asc new file mode 100644 index 0000000..26994b5 --- /dev/null +++ b/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.asc @@ -0,0 +1,29 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +xsBNBGS/K8ABCAD2a0xssmX92AKZf9U0+tDvctdAe5KfwikMTXhALVZej5PfJMBY +YPfeHes6EPc4h3W2YvElHMrw7kW+zk/yeEbKYIP+Y//uA2gLRhCAzJqp7nCRPPQy +NxWQYP0eSfAslPfnY2NJxs25oHv7TYmOBJ/YLivNh2q/VRFX30m3vRFLVmj5Zdq/ +mQZtmDCAZBfYKJ/geD452Z6O18NjL42FVd1iFJpBCMDdPPlrNuJYTQUlHLtbLlWh +KIJfJm+pWxtdLTIUpGZJELbU7C33QSU81e++BjU12N3G5zVN+rQjP+/7ag4R1wFZ +QRecAZ7MJCxVJCx1wmdepTNrlKzJmuQwbfM5ABEBAAHNH0NDQyBCYXNlbCBHaXQg +KERlYmlhbiBSZWdpc3RyeSnCwGIEEwEIABYFAmS/K8AJECI1/fO2mocZAhsDAhkB +AACBgQgAA0QD2uVDS6UU2FR2ms3QXi5UP/7Nyk2G7lJOzmvyUYYflzyCJMicxJp6 +Eut6gXYAgBSN33XTsDX5wDCd2Y7c0ggVBCIUsWk64EXmNqWVHccDSyOnG9LF16mE +02TZHvj94tPzJqvwLWHjiv83yc0iVsuN9i8FppeNW5aGdcM4Wso0UosJ8L90b0wN +FH7QPgr0WfMf5FStGQa8x3RR1hiSSfNxxo6nWk4VvncMAeSbIH1I71MWq3frWL/j +un3Gl26qyVwcBtiz8WdzeLUYcxKbiW2yVximwYb9f18lzB7MWiLWrtQ7FPxwWHDf +M3NrE6LIkQngcGxH/x410VeMWQTZQc7ATQRkvyvAAQgAqKpDlAEIwol4YvDCwWML +QGYBWyQ3F6fFtUSy/ScStquMdtvSOFVjviVQsssJ1ADyjboQ81ePJo6fNgYiG+dF +grNW6OlQfmSQp7Czf0LyN6xxX/O4/S87CBq0m/eXL/fLIYqysUpOFdkNtmJZZ79j +31UBegeXCw8uft9a7iETxbDZj1zc7moE+0urWql2FdyK/PiDrm+jYIjN325hEAwx +6yqqH4DtMntUPAYaknmtmELfX4kPJNC6mLj3WiWd+1nuTCMZ/Gn+DBHQutlkkvYS +0Pe/Sw/RqEdRs2lQ5C4r/ibWRvFrNdfPUTYu6Lzf3QhaWzJIbJ/UijI4l6TpP0wz +wwARAQABwsBfBBgBCAATBQJkvyvACRAiNf3ztpqHGQIbDAAAmecIACXQ5fGNeMOX ++8xKt5TTpsD4/eIhAWciykM4p9UMrHZyeYAOyEzpKNleqL0UJWbilSpKetf8+XdQ +4vCXv69I+j5WoEMyuqkvo32GHSamWu91qbottsWZvaLjwyXCOl3SflcH9A+rfw4R +gXT7Ic1hBAK/0/xdGBvoAOfl6lzGVbZG6VMycnd+HPWc0SMlCYPe5f5yKrgZB7Be +XyBsdkBLBUmgwyuXJALaswT5h2gHfYFBIAMGuSdf3EgchczX9sadnMHBvAcOKD5X +A29wUrqrBjeM3sMzRQpysx/+PUXfr6pqO2QsLdcc4C1T18GG65YU/bEzBwbDBjRp ++jfGfDU6nfo= +=4gXi +-----END PGP PUBLIC KEY BLOCK----- diff --git a/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.sources b/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.sources new file mode 100644 index 0000000..dffb5b2 --- /dev/null +++ b/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/gitkabelsalatch-s3lph.sources @@ -0,0 +1,6 @@ +X-Repolib-Name: git.kabelsalat.ch-s3lph +Types: deb +URIs: https://git.kabelsalat.ch/api/packages/s3lph/debian +Suites: stable +Components: main +Signed-By: /usr/share/keyrings/gitkabelsalatch-s3lph.asc diff --git a/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/package.sh b/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/package.sh new file mode 100755 index 0000000..e0c1a92 --- /dev/null +++ b/repo.s3lph.me-apt-source/repo.s3lph.me-apt-source/package.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +PKGNAME="repo.s3lph.me-apt-source" + +mkdir -p build/pkgdir/DEBIAN +mkdir -p build/pkgdir/etc/apt/sources.list.d +mkdir -p build/pkgdir/usr/share/keyrings +mkdir -p "build/pkgdir/usr/share/doc/${PKGNAME}" + +cp gitkabelsalatch-s3lph.sources build/pkgdir/etc/apt/sources.list.d/gitkabelsalatch-s3lph.sources +cp gitkabelsalatch-s3lph.asc build/pkgdir/usr/share/keyrings/gitkabelsalatch-s3lph.asc +cp debian.control build/pkgdir/DEBIAN/control +cp debian.conffiles build/pkgdir/DEBIAN/conffiles +cp debian.changelog "build/pkgdir/usr/share/doc/${PKGNAME}/changelog" +cp debian.copyright "build/pkgdir/usr/share/doc/${PKGNAME}/copyright" + +sed -re "s/__PKGNAME__/${PKGNAME}/g" -i build/pkgdir/DEBIAN/control +sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i build/pkgdir/DEBIAN/control +sed -re "s/__PKGNAME__/${PKGNAME}/g" -i "build/pkgdir/usr/share/doc/${PKGNAME}/copyright" +sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "build/pkgdir/usr/share/doc/${PKGNAME}/copyright" +sed -re "s/__PKGNAME__/${PKGNAME}/g" -i "build/pkgdir/usr/share/doc/${PKGNAME}/changelog" +sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "build/pkgdir/usr/share/doc/${PKGNAME}/changelog" +gzip -9n "build/pkgdir/usr/share/doc/${PKGNAME}/changelog" + +dpkg-deb --build build/pkgdir build diff --git a/republik-feeder/build.sh b/republik-feeder/build.sh new file mode 100755 index 0000000..306c9af --- /dev/null +++ b/republik-feeder/build.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +set -exo pipefail + +PKGNAME=republik-feeder +API_URL=https://api.github.com/repos/maetthu/republik-feeder/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.tag_name[1:]) \(.published_at) \(.assets[] | select( .name|test(".*_linux_amd64.tar.gz$") ).browser_download_url)"' + + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + mkdir -p "${PKGNAME}-${VERSION}" + wget "${URL}" --output-document "${PKGNAME}-${VERSION}.tar.gz" + tar -x -C "${PKGNAME}-${VERSION}" -f "${PKGNAME}-${VERSION}.tar.gz" + rm "${PKGNAME}-${VERSION}.tar.gz" + cd "${PKGNAME}-${VERSION}" +} + +function prepare() { + chmod +x "${SRCDIR}/${PKGNAME}-${VERSION}/${PKGNAME}" + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/${PKGNAME}-${VERSION}/republik-feeder" "${PKGDIR}/usr/bin/republik-feeder" + cp "${ROOT}/republik-feeder.defaults" "${PKGDIR}/etc/default/republik-feeder" + cp "${ROOT}/republik-feeder.service" "${PKGDIR}/lib/systemd/system/republik-feeder.service" + 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() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/republik-feeder/debian.conffiles b/republik-feeder/debian.conffiles new file mode 100644 index 0000000..a2f3191 --- /dev/null +++ b/republik-feeder/debian.conffiles @@ -0,0 +1 @@ +/etc/default/republik-feeder diff --git a/republik-feeder/debian.control b/republik-feeder/debian.control new file mode 100644 index 0000000..8f05d39 --- /dev/null +++ b/republik-feeder/debian.control @@ -0,0 +1,10 @@ +Package: republik-feeder +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Description: RSS feed generator service for republik.ch + Quick and simple RSS service for republik.ch content. Listens for + HTTP requests and returns an RSS feed for most recent articles and + narrated articles as a podcast feed. diff --git a/republik-feeder/republik-feeder.defaults b/republik-feeder/republik-feeder.defaults new file mode 100644 index 0000000..4de0bd8 --- /dev/null +++ b/republik-feeder/republik-feeder.defaults @@ -0,0 +1,4 @@ +ARGS=localhost:8080 +REPUBLIK_FEEDER_COOKIE=s%3Asomething... +REPUBLIK_FEEDER_URL=https://example.org/feeds/republik +REPUBLIK_FEEDER_ARTICLE_LIMIT=25 diff --git a/republik-feeder/republik-feeder.service b/republik-feeder/republik-feeder.service new file mode 100644 index 0000000..d3f29d0 --- /dev/null +++ b/republik-feeder/republik-feeder.service @@ -0,0 +1,14 @@ +[Unit] +Description=RSS feed generator service for republik.ch +After=network-online.target +Wants=network-online.target + +[Service] +EnvironmentFile=-/etc/default/republik-feeder +ExecStart=/usr/bin/republik-feeder $ARGS +DynamicUser=true +CapabilityBoundingSet= +Restart=on-failure + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/republik-feeder/republik-feeder/build.sh b/republik-feeder/republik-feeder/build.sh new file mode 100755 index 0000000..306c9af --- /dev/null +++ b/republik-feeder/republik-feeder/build.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +set -exo pipefail + +PKGNAME=republik-feeder +API_URL=https://api.github.com/repos/maetthu/republik-feeder/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="master" ) | "\(.tag_name[1:]) \(.published_at) \(.assets[] | select( .name|test(".*_linux_amd64.tar.gz$") ).browser_download_url)"' + + +ROOT=$(pwd) +function fetch() { + cd "${SRCDIR}" + mkdir -p "${PKGNAME}-${VERSION}" + wget "${URL}" --output-document "${PKGNAME}-${VERSION}.tar.gz" + tar -x -C "${PKGNAME}-${VERSION}" -f "${PKGNAME}-${VERSION}.tar.gz" + rm "${PKGNAME}-${VERSION}.tar.gz" + cd "${PKGNAME}-${VERSION}" +} + +function prepare() { + chmod +x "${SRCDIR}/${PKGNAME}-${VERSION}/${PKGNAME}" + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/${PKGNAME}-${VERSION}/republik-feeder" "${PKGDIR}/usr/bin/republik-feeder" + cp "${ROOT}/republik-feeder.defaults" "${PKGDIR}/etc/default/republik-feeder" + cp "${ROOT}/republik-feeder.service" "${PKGDIR}/lib/systemd/system/republik-feeder.service" + 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() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + 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/republik-feeder/republik-feeder/debian.conffiles b/republik-feeder/republik-feeder/debian.conffiles new file mode 100644 index 0000000..a2f3191 --- /dev/null +++ b/republik-feeder/republik-feeder/debian.conffiles @@ -0,0 +1 @@ +/etc/default/republik-feeder diff --git a/republik-feeder/republik-feeder/debian.control b/republik-feeder/republik-feeder/debian.control new file mode 100644 index 0000000..8f05d39 --- /dev/null +++ b/republik-feeder/republik-feeder/debian.control @@ -0,0 +1,10 @@ +Package: republik-feeder +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Description: RSS feed generator service for republik.ch + Quick and simple RSS service for republik.ch content. Listens for + HTTP requests and returns an RSS feed for most recent articles and + narrated articles as a podcast feed. diff --git a/republik-feeder/republik-feeder/republik-feeder.defaults b/republik-feeder/republik-feeder/republik-feeder.defaults new file mode 100644 index 0000000..4de0bd8 --- /dev/null +++ b/republik-feeder/republik-feeder/republik-feeder.defaults @@ -0,0 +1,4 @@ +ARGS=localhost:8080 +REPUBLIK_FEEDER_COOKIE=s%3Asomething... +REPUBLIK_FEEDER_URL=https://example.org/feeds/republik +REPUBLIK_FEEDER_ARTICLE_LIMIT=25 diff --git a/republik-feeder/republik-feeder/republik-feeder.service b/republik-feeder/republik-feeder/republik-feeder.service new file mode 100644 index 0000000..d3f29d0 --- /dev/null +++ b/republik-feeder/republik-feeder/republik-feeder.service @@ -0,0 +1,14 @@ +[Unit] +Description=RSS feed generator service for republik.ch +After=network-online.target +Wants=network-online.target + +[Service] +EnvironmentFile=-/etc/default/republik-feeder +ExecStart=/usr/bin/republik-feeder $ARGS +DynamicUser=true +CapabilityBoundingSet= +Restart=on-failure + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/woodpecker-agent/agent.conf b/woodpecker-agent/agent.conf new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/woodpecker-agent/agent.conf @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/woodpecker-agent/build.sh b/woodpecker-agent/build.sh new file mode 100755 index 0000000..28d9bb4 --- /dev/null +++ b/woodpecker-agent/build.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/woodpecker-ci/woodpecker/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false ) | "\(.tag_name[1:]) \(.published_at) \(.assets[] | select( .name=="woodpecker-agent_linux_amd64.tar.gz" ).browser_download_url)"' + +ROOT=$(pwd) +BUILDDIR=${ROOT}/build +SRCDIR=${BUILDDIR}/srcdir +PKGDIR=${BUILDDIR}/pkgdir + +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "woodpecker-agent-${VERSION}-linux-amd64.tar.gz" + tar -xf "woodpecker-agent-${VERSION}-linux-amd64.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/etc/woodpecker" \ + "${PKGDIR}/var/lib/woodpecker/data" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/woodpecker-agent" "${PKGDIR}/usr/bin/woodpecker-agent" + cp "${ROOT}/woodpecker-agent.service" "${PKGDIR}/lib/systemd/system/woodpecker-agent.service" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + cp "${ROOT}/woodpecker-agent.default" "${PKGDIR}/etc/default/woodpecker-agent" + cp "${ROOT}/agent.conf" "${PKGDIR}/etc/woodpecker/agent.conf" + 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 -r "${SRCDIR}/woodpecker-agent" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + mkdir -p "${SRCDIR}" "${PKGDIR}" + fetch + prepare + package +} + + +build diff --git a/woodpecker-agent/debian.conffiles b/woodpecker-agent/debian.conffiles new file mode 100644 index 0000000..ca2c688 --- /dev/null +++ b/woodpecker-agent/debian.conffiles @@ -0,0 +1,2 @@ +/etc/default/woodpecker-agent +/etc/woodpecker/agent.conf diff --git a/woodpecker-agent/debian.control b/woodpecker-agent/debian.control new file mode 100644 index 0000000..fe6347e --- /dev/null +++ b/woodpecker-agent/debian.control @@ -0,0 +1,10 @@ +Package: woodpecker-agent +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Depends: docker.io +Description: Woodpecker CI Agent + Woodpecker is a simple CI engine with great extensibility. This is the + agent compoment which runs the individual Docker pipelines. diff --git a/woodpecker-agent/debian.postinst b/woodpecker-agent/debian.postinst new file mode 100755 index 0000000..c962598 --- /dev/null +++ b/woodpecker-agent/debian.postinst @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group woodpecker >/dev/null; then + groupadd --system woodpecker + fi + + if ! getent passwd woodpecker >/dev/null; then + useradd --system --gid woodpecker --groups docker --home-dir /var/lib/woodpecker --shell /bin/sh woodpecker + fi + + chown woodpecker:woodpecker /var/lib/woodpecker /etc/woodpecker /etc/woodpecker/agent.conf + chmod 0750 /var/lib/woodpecker /etc/woodpecker + + deb-systemd-helper enable woodpecker-agent.service + deb-systemd-invoke restart woodpecker-agent.service + +fi diff --git a/woodpecker-agent/debian.postrm b/woodpecker-agent/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/woodpecker-agent/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/woodpecker-agent/debian.prerm b/woodpecker-agent/debian.prerm new file mode 100755 index 0000000..dae4f5f --- /dev/null +++ b/woodpecker-agent/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop woodpecker-agent.service + +fi diff --git a/woodpecker-agent/woodpecker-agent.default b/woodpecker-agent/woodpecker-agent.default new file mode 100644 index 0000000..af76c7b --- /dev/null +++ b/woodpecker-agent/woodpecker-agent.default @@ -0,0 +1,39 @@ + +GODEBUG=netdns=go +#WOODPECKER_LOG_LEVEL= +#WOODPECKER_DEBUG_PRETTY=false +#WOODPECKER_DEBUG_NOCOLOR=true + +#WOODPECKER_SERVER=localhost:9000 +#WOODPECKER_USERNAME=x-oauth-basic +#WOODPECKER_AGENT_SECRET= same as in woodpecker server +#WOODPECKER_AGENT_SECRET_FILE= +#WOODPECKER_HOSTNAME= + +#WOODPECKER_MAX_PROCS=1 +#WOODPECKER_FILTER_LABELS= + +#WOODPECKER_HEALTHCHECK=true +#WOODPECKER_KEEPALIVE_TIME= +#WOODPECKER_KEEPALIVE_TIMEOUT=20s +#WOODPECKER_GRPC_SECURE=false +#WOODPECKER_GRPC_VERIFY=true +#WOODPECKER_BACKEND=auto-detect + +# +# Docker Backend +# + +#WOODPECKER_BACKEND_DOCKER_NETWORK= +#WOODPECKER_BACKEND_DOCKER_ENABLE_IPV6=false +#DOCKER_SOCK=/run/docker.sock + +# +# SSH Backend +# + +#WOODPECKER_BACKEND_SSH_ADDRESS= +#WOODPECKER_BACKEND_SSH_USER= +#WOODPECKER_BACKEND_SSH_KEY= +#WOODPECKER_BACKEND_SSH_KEY_PASSWORD= +#WOODPECKER_BACKEND_SSH_PASSWORD= diff --git a/woodpecker-agent/woodpecker-agent.service b/woodpecker-agent/woodpecker-agent.service new file mode 100644 index 0000000..d691987 --- /dev/null +++ b/woodpecker-agent/woodpecker-agent.service @@ -0,0 +1,10 @@ +[Unit] +Description=Woodpecker CI Agent + +[Service] +ExecStart=/usr/bin/woodpecker-agent +User=woodpecker +EnvironmentFile=-/etc/default/woodpecker-agent + +[Install] +WantedBy=multi-user.target diff --git a/woodpecker-agent/woodpecker-agent/agent.conf b/woodpecker-agent/woodpecker-agent/agent.conf new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/woodpecker-agent/woodpecker-agent/agent.conf @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/woodpecker-agent/woodpecker-agent/build.sh b/woodpecker-agent/woodpecker-agent/build.sh new file mode 100755 index 0000000..28d9bb4 --- /dev/null +++ b/woodpecker-agent/woodpecker-agent/build.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/woodpecker-ci/woodpecker/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false ) | "\(.tag_name[1:]) \(.published_at) \(.assets[] | select( .name=="woodpecker-agent_linux_amd64.tar.gz" ).browser_download_url)"' + +ROOT=$(pwd) +BUILDDIR=${ROOT}/build +SRCDIR=${BUILDDIR}/srcdir +PKGDIR=${BUILDDIR}/pkgdir + +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "woodpecker-agent-${VERSION}-linux-amd64.tar.gz" + tar -xf "woodpecker-agent-${VERSION}-linux-amd64.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/etc/woodpecker" \ + "${PKGDIR}/var/lib/woodpecker/data" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/woodpecker-agent" "${PKGDIR}/usr/bin/woodpecker-agent" + cp "${ROOT}/woodpecker-agent.service" "${PKGDIR}/lib/systemd/system/woodpecker-agent.service" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + cp "${ROOT}/woodpecker-agent.default" "${PKGDIR}/etc/default/woodpecker-agent" + cp "${ROOT}/agent.conf" "${PKGDIR}/etc/woodpecker/agent.conf" + 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 -r "${SRCDIR}/woodpecker-agent" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + mkdir -p "${SRCDIR}" "${PKGDIR}" + fetch + prepare + package +} + + +build diff --git a/woodpecker-agent/woodpecker-agent/debian.conffiles b/woodpecker-agent/woodpecker-agent/debian.conffiles new file mode 100644 index 0000000..ca2c688 --- /dev/null +++ b/woodpecker-agent/woodpecker-agent/debian.conffiles @@ -0,0 +1,2 @@ +/etc/default/woodpecker-agent +/etc/woodpecker/agent.conf diff --git a/woodpecker-agent/woodpecker-agent/debian.control b/woodpecker-agent/woodpecker-agent/debian.control new file mode 100644 index 0000000..fe6347e --- /dev/null +++ b/woodpecker-agent/woodpecker-agent/debian.control @@ -0,0 +1,10 @@ +Package: woodpecker-agent +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Depends: docker.io +Description: Woodpecker CI Agent + Woodpecker is a simple CI engine with great extensibility. This is the + agent compoment which runs the individual Docker pipelines. diff --git a/woodpecker-agent/woodpecker-agent/debian.postinst b/woodpecker-agent/woodpecker-agent/debian.postinst new file mode 100755 index 0000000..c962598 --- /dev/null +++ b/woodpecker-agent/woodpecker-agent/debian.postinst @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group woodpecker >/dev/null; then + groupadd --system woodpecker + fi + + if ! getent passwd woodpecker >/dev/null; then + useradd --system --gid woodpecker --groups docker --home-dir /var/lib/woodpecker --shell /bin/sh woodpecker + fi + + chown woodpecker:woodpecker /var/lib/woodpecker /etc/woodpecker /etc/woodpecker/agent.conf + chmod 0750 /var/lib/woodpecker /etc/woodpecker + + deb-systemd-helper enable woodpecker-agent.service + deb-systemd-invoke restart woodpecker-agent.service + +fi diff --git a/woodpecker-agent/woodpecker-agent/debian.postrm b/woodpecker-agent/woodpecker-agent/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/woodpecker-agent/woodpecker-agent/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/woodpecker-agent/woodpecker-agent/debian.prerm b/woodpecker-agent/woodpecker-agent/debian.prerm new file mode 100755 index 0000000..dae4f5f --- /dev/null +++ b/woodpecker-agent/woodpecker-agent/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop woodpecker-agent.service + +fi diff --git a/woodpecker-agent/woodpecker-agent/woodpecker-agent.default b/woodpecker-agent/woodpecker-agent/woodpecker-agent.default new file mode 100644 index 0000000..af76c7b --- /dev/null +++ b/woodpecker-agent/woodpecker-agent/woodpecker-agent.default @@ -0,0 +1,39 @@ + +GODEBUG=netdns=go +#WOODPECKER_LOG_LEVEL= +#WOODPECKER_DEBUG_PRETTY=false +#WOODPECKER_DEBUG_NOCOLOR=true + +#WOODPECKER_SERVER=localhost:9000 +#WOODPECKER_USERNAME=x-oauth-basic +#WOODPECKER_AGENT_SECRET= same as in woodpecker server +#WOODPECKER_AGENT_SECRET_FILE= +#WOODPECKER_HOSTNAME= + +#WOODPECKER_MAX_PROCS=1 +#WOODPECKER_FILTER_LABELS= + +#WOODPECKER_HEALTHCHECK=true +#WOODPECKER_KEEPALIVE_TIME= +#WOODPECKER_KEEPALIVE_TIMEOUT=20s +#WOODPECKER_GRPC_SECURE=false +#WOODPECKER_GRPC_VERIFY=true +#WOODPECKER_BACKEND=auto-detect + +# +# Docker Backend +# + +#WOODPECKER_BACKEND_DOCKER_NETWORK= +#WOODPECKER_BACKEND_DOCKER_ENABLE_IPV6=false +#DOCKER_SOCK=/run/docker.sock + +# +# SSH Backend +# + +#WOODPECKER_BACKEND_SSH_ADDRESS= +#WOODPECKER_BACKEND_SSH_USER= +#WOODPECKER_BACKEND_SSH_KEY= +#WOODPECKER_BACKEND_SSH_KEY_PASSWORD= +#WOODPECKER_BACKEND_SSH_PASSWORD= diff --git a/woodpecker-agent/woodpecker-agent/woodpecker-agent.service b/woodpecker-agent/woodpecker-agent/woodpecker-agent.service new file mode 100644 index 0000000..d691987 --- /dev/null +++ b/woodpecker-agent/woodpecker-agent/woodpecker-agent.service @@ -0,0 +1,10 @@ +[Unit] +Description=Woodpecker CI Agent + +[Service] +ExecStart=/usr/bin/woodpecker-agent +User=woodpecker +EnvironmentFile=-/etc/default/woodpecker-agent + +[Install] +WantedBy=multi-user.target diff --git a/woodpecker-cli/build.sh b/woodpecker-cli/build.sh new file mode 100755 index 0000000..559acf8 --- /dev/null +++ b/woodpecker-cli/build.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -exo pipefail + +N_RELEASES=1 +API_URL=https://api.github.com/repos/woodpecker-ci/woodpecker/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false ) | "\(.tag_name[1:]) \(.published_at) \(.assets[] | select( .name=="woodpecker-cli_linux_amd64.tar.gz" ).browser_download_url)"' + +ROOT=$(pwd) +BUILDDIR=${ROOT}/build/ +SRCDIR=${ROOT}/build/srcdir +PKGDIR=${ROOT}/build/pkgdir + +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "woodpecker-cli-${VERSION}-linux-amd64.tar.gz" + tar xf "woodpecker-cli-${VERSION}-linux-amd64.tar.gz" +} + +function prepare() { + chmod +x "${SRCDIR}/woodpecker-cli" + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" + cp "${SRCDIR}/woodpecker-cli" "${PKGDIR}/usr/bin/woodpecker" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + 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() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head "-${N_RELEASES}") + export VERSION + export ISODATE + export URL + mkdir -p "${SRCDIR}" "${PKGDIR}" + fetch + prepare + package +} + + +build diff --git a/woodpecker-cli/debian.control b/woodpecker-cli/debian.control new file mode 100644 index 0000000..2ef4caa --- /dev/null +++ b/woodpecker-cli/debian.control @@ -0,0 +1,8 @@ +Package: woodpecker-cli +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Description: CLI for the Woodpecker CI server + Command line client for the Woodpecker continuous integration server. diff --git a/woodpecker-server/build.sh b/woodpecker-server/build.sh new file mode 100755 index 0000000..d6374c7 --- /dev/null +++ b/woodpecker-server/build.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +set -exo pipefail + +API_URL=https://api.github.com/repos/woodpecker-ci/woodpecker/releases +JQ_EXPR='.[] | select( .prerelease==false and .draft==false ) | "\(.tag_name[1:]) \(.published_at) \(.assets[] | select( .name=="woodpecker-server_linux_amd64.tar.gz" ).browser_download_url)"' + +ROOT=$(pwd) +BUILDDIR=${ROOT}/build +SRCDIR=${BUILDDIR}/srcdir +PKGDIR=${BUILDDIR}/pkgdir + +function fetch() { + cd "${SRCDIR}" + wget "${URL}" --output-document "woodpecker-server-${VERSION}-linux-amd64.tar.gz" + tar -xf "woodpecker-server-${VERSION}-linux-amd64.tar.gz" +} + +function prepare() { + mkdir -p \ + "${PKGDIR}/DEBIAN" \ + "${PKGDIR}/usr/bin" \ + "${PKGDIR}/etc/default" \ + "${PKGDIR}/var/lib/woodpecker/data" \ + "${PKGDIR}/lib/systemd/system" + cp "${SRCDIR}/woodpecker-server" "${PKGDIR}/usr/bin/woodpecker-server" + cp "${ROOT}/woodpecker-server.service" "${PKGDIR}/lib/systemd/system/woodpecker-server.service" + cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control" + cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles" + cp "${ROOT}/debian.postinst" "${PKGDIR}/DEBIAN/postinst" + cp "${ROOT}/debian.prerm" "${PKGDIR}/DEBIAN/prerm" + cp "${ROOT}/debian.postrm" "${PKGDIR}/DEBIAN/postrm" + cp "${ROOT}/woodpecker-server.default" "${PKGDIR}/etc/default/woodpecker-server" + 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 -r "${SRCDIR}/woodpecker-server" {} \; +} + +function package() { + cd "${BUILDDIR}" + dpkg-deb --build "${PKGDIR}" "${BUILDDIR}" +} + +function build() { + read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1) + export VERSION + export ISODATE + export URL + mkdir -p "${SRCDIR}" "${PKGDIR}" + fetch + prepare + package +} + + +build diff --git a/woodpecker-server/debian.conffiles b/woodpecker-server/debian.conffiles new file mode 100644 index 0000000..7d554af --- /dev/null +++ b/woodpecker-server/debian.conffiles @@ -0,0 +1 @@ +/etc/default/woodpecker-server diff --git a/woodpecker-server/debian.control b/woodpecker-server/debian.control new file mode 100644 index 0000000..b54a76e --- /dev/null +++ b/woodpecker-server/debian.control @@ -0,0 +1,10 @@ +Package: woodpecker-server +Version: __VERSION__ +Maintainer: __MAINTAINER__ +Section: web +Priority: optional +Architecture: amd64 +Recommends: woodpecker-cli +Description: Woodpecker CI Server + Woodpecker is a simple CI engine with great extensibility. This is the + server component with the web interface and agent controller. diff --git a/woodpecker-server/debian.postinst b/woodpecker-server/debian.postinst new file mode 100755 index 0000000..8a8585e --- /dev/null +++ b/woodpecker-server/debian.postinst @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "configure" ]]; then + + if ! getent group woodpecker >/dev/null; then + groupadd --system woodpecker + fi + + if ! getent passwd woodpecker >/dev/null; then + useradd --system --gid woodpecker --groups docker --home-dir /var/lib/woodpecker --shell /bin/sh woodpecker + fi + + chown woodpecker:woodpecker /var/lib/woodpecker /var/lib/woodpecker/data + chmod 0750 /var/lib/woodpecker /var/lib/woodpecker/data + + deb-systemd-helper enable woodpecker-server.service + deb-systemd-invoke restart woodpecker-server.service + +fi diff --git a/woodpecker-server/debian.postrm b/woodpecker-server/debian.postrm new file mode 100755 index 0000000..305068d --- /dev/null +++ b/woodpecker-server/debian.postrm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + systemctl daemon-reload || true + +fi diff --git a/woodpecker-server/debian.prerm b/woodpecker-server/debian.prerm new file mode 100755 index 0000000..05a785c --- /dev/null +++ b/woodpecker-server/debian.prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$1" == "remove" ]]; then + + deb-systemd-invoke stop woodpecker-server.service + +fi diff --git a/woodpecker-server/woodpecker-server.default b/woodpecker-server/woodpecker-server.default new file mode 100644 index 0000000..7396bad --- /dev/null +++ b/woodpecker-server/woodpecker-server.default @@ -0,0 +1,140 @@ + +XDG_CACHE_HOME=/var/lib/woodpecker/data +GODEBUG=netdns=go +#WOODPECKER_LOG_LEVEL= +#WOODPECKER_DEBUG_PRETTY=false +#WOODPECKER_DEBUG_NOCOLOR=true + +WOODPECKER_HOST=http://localhost:8080 +WOODPECKER_SERVER_ADDR=localhost:8080 +#WOODPECKER_SERVER_CERT= +#WOODPECKER_SERVER_KEY= +#WOODPECKER_LETS_ENCRYPT=false +#WOODPECKER_GRPC_ADDR=localhost:9000 + +#WOODPECKER_ADMIN= +#WOODPECKER_ORGS= +#WOODPECKER_REPO_OWNERS= +#WOODPECKER_OPEN=false +#WOODPECKER_DOCS=https://woodpecker-ci.org/ +#WOODPECKER_AUTHENTICATE_PUBLIC_REPOS=false +#WOODPECKER_DEFAULT_CANCEL_PREVIOUS_PIPELINE_EVENTS=pull_request,push +#WOODPECKER_DEFAULT_CLONE_IMAGE=woodpeckerci/plugin-git:latest +#WOODPECKER_SESSION_EXPIRES=72h + +#WOODPECKER_ESCALATE=plugins/docker,plugins/gcr,plugins/ecr,woodpeckerci/plugin-docker,woodpeckerci/plugin-docker-buildx +#WOODPECKER_DOCKER_CONFIG= +#WOODPECKER_AGENT_SECRET= generate with `openssl rand -hex 32` +#WOODPECKER_AGENT_SECRET_FILE= +#WOODPECKER_KEEPALIVE_MIN_TIME= + +WOODPECKER_DATABASE_DRIVER=sqlite3 +WOODPECKER_DATABASE_DATASOURCE=/var/lib/woodpecker/data/database.sqlite +#WOODPECKER_DATABASE_DATASOURCE_FILE= + +#WOODPECKER_PROMETHEUS_AUTH_TOKEN= +#WOODPECKER_PROMETHEUS_AUTH_TOKEN_FILE= +#WOODPECKER_STATUS_CONTEXT=ci/woodpecker +#WOODPECKER_STATUS_CONTEXT_FORMAT={{ .context }}/{{ .event }}/{{ .pipeline }} + +#WOODPECKER_LIMIT_MEM_SWAP=0 +#WOODPECKER_LIMIT_MEM=0 +#WOODPECKER_LIMIT_SHM_SIZE=0 +#WOODPECKER_LIMIT_CPU_QUOTA=0 +#WOODPECKER_LIMIT_CPU_SHARES=0 +#WOODPECKER_LIMIT_CPU_SET=0 +#WOODPECKER_CONFIG_SERVICE_ENDPOINT= + +# +# GitHub Integration +# + +#WOODPECKER_GITHUB=false +#WOODPECKER_GITHUB_URL=https://github.com +#WOODPECKER_GITHUB_CLIENT= +#WOODPECKER_GITHUB_CLIENT_FILE= +#WOODPECKER_GITHUB_SECRET= +#WOODPECKER_GITHUB_SECRET_FILE= +#WOODPECKER_GITHUB_MERGE_REF=true +#WOODPECKER_GITEA_SKIP_VERIFY=false + +# +# Gogs Integration +# + +#WOODPECKER_GOGS=false +#WOODPECKER_GOGS_URL=https://try.gogs.io +#WOODPECKER_GOGS_GIT_USERNAME= +#WOODPECKER_GOGS_GIT_USERNAME_FILE= +#WOODPECKER_GOGS_GIT_PASSWORD= +#WOODPECKER_GOGS_GIT_PASSWORD_FILE= +#WOODPECKER_GOGS_PRIVATE_MODE=false +#WOODPECKER_GOGS_SKIP_VERIFY=false + +# +# Gitea Integration +# + +#WOODPECKER_GITEA=false +#WOODPECKER_GITEA_URL=https://try.gitea.io +#WOODPECKER_GITEA_CLIENT= +#WOODPECKER_GITEA_CLIENT_FILE= +#WOODPECKER_GITEA_SECRET= +#WOODPECKER_GITEA_SECRET_FILE= +#WOODPECKER_GITEA_SKIP_VERIFY=false + +# +# Atlassian Bitbucket Integration +# + +#WOODPECKER_BITBUCKET=false +#WOODPECKER_BITBUCKET_CLIENT= +#WOODPECKER_BITBUCKET_CLIENT_FILE= +#WOODPECKER_BITBUCKET_SECRET= +#WOODPECKER_BITBUCKET_SECRET_FILE= + +# +# Atlassian Stash Integration +# + +#WOODPECKER_STASH=false +#WOODPECKER_STASH= +#WOODPECKER_STASH_CONSUMER_KEY= +#WOODPECKER_STASH_CONSUMER_KEY_FILE= +#WOODPECKER_STASH_CONSUMER_RSA= +#WOODPECKER_STASH_CONSUMER_RSA_STRING= +#WOODPECKER_STASH_GIT_USERNAME= +#WOODPECKER_STASH_GIT_USERNAME_FILE= +#WOODPECKER_STASH_GIT_PASSWORD= +#WOODPECKER_STASH_GIT_PASSWORD_FILE= +#WOODPECKER_STASH_SKIP_VERIFY= + +# +# Gitlab Integration +# + +#WOODPECKER_GITLAB=false +#WOODPECKER_GITLAB_URL=https://gitlab.com +#WOODPECKER_GITLAB_CLIENT= +#WOODPECKER_GITLAB_CLIENT_FILE= +#WOODPECKER_GITLAB_SECRET= +#WOODPECKER_GITLAB_SECRET_FILE= +#WOODPECKER_GITLAB_SKIP_VERIFY= + +# +# Coding Integration +# + +#WOODPECKER_CODING=false +#WOODPECKER_CODING_URL=https://coding.net +#WOODPECKER_CODING_CLIENT= +#WOODPECKER_CODING_CLIENT_FILE= +#WOODPECKER_CODING_SECRET= +#WOODPECKER_CODING_SECRET_FILE= +#WOODPECKER_CODING_SCOPE= +#WOODPECKER_CODING_GIT_MACHINE= +#WOODPECKER_CODING_GIT_USERNAME= +#WOODPECKER_CODING_GIT_USERNAME_FILE= +#WOODPECKER_CODING_GIT_PASSWORD= +#WOODPECKER_CODING_GIT_PASSWORD_FILE= +#WOODPECKER_CODING_SKIP_VERIFY= diff --git a/woodpecker-server/woodpecker-server.service b/woodpecker-server/woodpecker-server.service new file mode 100644 index 0000000..8ca58ff --- /dev/null +++ b/woodpecker-server/woodpecker-server.service @@ -0,0 +1,12 @@ +[Unit] +Description=Woodpecker CI Server + +[Service] +ExecStart=/usr/bin/woodpecker-server +User=woodpecker +EnvironmentFile=-/etc/default/woodpecker-server +AmbientCapabilities=CAP_NET_BIND_SERVICE +CapabilityBoundingSet=CAP_NET_BIND_SERVICE + +[Install] +WantedBy=multi-user.target