rename config, fix pyproject.toml, add rpm stuff

This commit is contained in:
Louis Abel 2024-12-18 13:42:59 -07:00
parent 63a1cb3377
commit ff26bd87f2
Signed by: label
GPG Key ID: 2A6975660E424560
6 changed files with 62 additions and 5 deletions

View File

@ -15,7 +15,7 @@ requires-python = ">=3.9"
dependencies = [
"fastapi >= 0.115.5",
"paho-mqtt >= 1.6.1",
"pydantic >= 2.9.2"
"pydantic >= 2.9.2",
"uvicorn >= 0.29.0"
]

View File

@ -1,4 +0,0 @@
fastapi>=0.115.5
paho-mqtt>=1.6.1
pydantic>=2.9.2
uvicorn>=0.29.0

14
rpm/buzon.service Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=Buzon - MQTT Webhook Delivery Service
After=network-online.target
Wants=network-online.target
[Service]
Environment="BUZON_CONFIG=/etc/buzon/buzon.yaml"
EnvironmentFile=/etc/sysconfig/noggin
EnvironmentFile=/etc/buzon/buzon.yaml
ExecStart=/usr/bin/uvicorn --host ${BUZON_HOST} --port ${BUZON_PORT} buzon.app:app
[Install]
WantedBy=multi-user.target

45
rpm/buzon.spec Normal file
View File

@ -0,0 +1,45 @@
Name: buzon
Version: 0.1.0
Release: 1%{?dist}
Summary: MQTT Webhook Delivery Service
License: GPLv3
URL: https://git.resf.org/infrastructure/buzon
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: pyproject-rpm-macros
BuildRequires: systemd-rpm-macros
Requires: (python3dist(uvicorn) with /usr/bin/uvicorn)
%description
Buzon is a webhook system designed to receive messages from a forgejo instance
and then send it to an MQTT-aware endpoint.
%prep
%autosetup -n %{name}-%{version} -p1
%generate_buildrequires
%pyproject_buildrequires
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files buzon
# install buzon.yaml to /etc/buzon
%files -f %{pyproject_files}
%license LICENSE
%ghost %{_sysconfdir}/%{name}/%{name}.cfg
%changelog
* Wed Dec 18 2024 Louis Abel <label@resf.org> - 0.1.0-1
- Initial buzon spec file

2
rpm/buzon.sysconfig Normal file
View File

@ -0,0 +1,2 @@
BUZON_HOST="0.0.0.0"
BUZON_PORT="9898"