Compare commits
2
Commits
c4e32064e2
...
9aee5ab2a5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9aee5ab2a5
|
||
|
|
2de48b94d3
|
No files matched your search
@@ -0,0 +1,42 @@
|
|||||||
|
# matrix-lolopener
|
||||||
|
|
||||||
|
A simple matrix bot which posts to a list of matrix rooms everytime the front door is opened or closed.
|
||||||
|
The door state is retrieved by subscribing to an MQTT topic, and a matrix event is sent every time that state changes.
|
||||||
|
|
||||||
|
## building
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo build --release
|
||||||
|
```
|
||||||
|
|
||||||
|
## installing
|
||||||
|
|
||||||
|
```sh
|
||||||
|
useradd -r -M -s /usr/sbin/nologin matrix-lolopener
|
||||||
|
install -o matrix-lolopener -g nogroup target/release/matrix-lolopener /opt/matrix-lolopener/bin/
|
||||||
|
install -o matrix-lolopener -g nogroup -m 600 -T config.yml.example /opt/matrix-lolopener/etc/config.yml
|
||||||
|
cp matrix-lolopener.service /etc/systemd/system/
|
||||||
|
$EDITOR /opt/matrix-lolopener/etc/config.yml
|
||||||
|
systemctl daemon-reload && systemctl enable --now matrix-lolopener.service
|
||||||
|
```
|
||||||
|
|
||||||
|
## usage
|
||||||
|
|
||||||
|
```
|
||||||
|
Matrix bot posting when the front door is opened or closed
|
||||||
|
|
||||||
|
Usage: matrix-lolopener [OPTIONS]
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-c, --config <CONFIG> Configuration file path [default: config.yml]
|
||||||
|
-h, --help Print help
|
||||||
|
-V, --version Print version
|
||||||
|
```
|
||||||
|
|
||||||
|
## contributing
|
||||||
|
|
||||||
|
Send PRs to https://git.labolyon.fr/mirsal/matrix-lolopener
|
||||||
|
|
||||||
|
## license
|
||||||
|
|
||||||
|
GPL v3 or later
|
||||||
@@ -4,8 +4,8 @@ Description=LOL-Opener Matrix Bot
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=matrix-lolopener
|
User=matrix-lolopener
|
||||||
WorkingDirectory=/opt/matrix-lolopener/etc
|
WorkingDirectory=/opt/matrix-lolopener
|
||||||
ExecStart=/opt/matrix-lolopener/bin/matrix-lolopener
|
ExecStart=/opt/matrix-lolopener/bin/matrix-lolopener -c etc/config.yml
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user