Updates for ravensend

This commit is contained in:
DarkFeather 2024-04-08 00:03:30 -05:00
parent 6663651c0b
commit d2fea2be16
Signed by: DarkFeather
GPG Key ID: 1CC1E3F4ED06F296
3 changed files with 8 additions and 10 deletions

View File

@ -19,15 +19,15 @@ install: compile
mkdir -p ${pkgdir}/usr/local/etc/ mkdir -p ${pkgdir}/usr/local/etc/
install -m 0640 -o raven -g raven ./ravensend-daemon.yml ${pkgdir}/usr/local/etc/ install -m 0640 -o raven -g raven ./ravensend-daemon.yml ${pkgdir}/usr/local/etc/
diff:
for i in ${LIST}; do diff /usr/local/bin/$$i $$i; done
diff ${pkgdir}/usr/lib/systemd/system/ravensend-daemon.service ./ravensend-daemon.service
reverse: ${pkgdir}/usr/lib/systemd/system/ravensend-daemon.service reverse: ${pkgdir}/usr/lib/systemd/system/ravensend-daemon.service
cp ${pkgdir}/usr/lib/systemd/system/ravensend-daemon.service . cp ${pkgdir}/usr/lib/systemd/system/ravensend-daemon.service .
for i in ${LIST}; do cp ${pkgdir}/usr/lib/systemd/system/$$i .; done for i in ${LIST}; do cp ${pkgdir}/usr/local/bin/$$i .; done
checkperm: ${pkgdir}/opt/raven.mono checkperm: ${pkgdir}/opt/raven.mono
for i in ${LIST}; do chown -R raven: ${pkgdir}/usr/local/bin/$$i; chmod 0755 ${pkgdir}/usr/local/bin/$$i; done for i in ${LIST}; do chown -R raven: ${pkgdir}/usr/local/bin/$$i; chmod 0755 ${pkgdir}/usr/local/bin/$$i; done
chown raven: ${pkgdir}/usr/lib/systemd/system/ravensend-daemon.service chown raven: ${pkgdir}/usr/lib/systemd/system/ravensend-daemon.service
chmod 0644 ${pkgdir}/usr/lib/systemd/system/ravensend-daemon.service chmod 0644 ${pkgdir}/usr/lib/systemd/system/ravensend-daemon.service
diff:
for i in ${LIST}; do diff ${pkgdir}/usr/lib/systemd/system/$$i $$i; done
diff ${pkgdir}/usr/lib/systemd/system/ravensend-daemon.service ./ravensend-daemon.service

View File

@ -22,15 +22,13 @@ configvars = []
def hello(): def hello():
data = request.json data = request.json
print(data["event"]["message"] + ' at ' + data["event"]["timestamp"]) notification = data["event"]["message"] + ' at ' + data["event"]["timestamp"] + ' -- ' + data["event"]["key"]
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
try: try:
s.connect((configvars["server"],int(configvars["port"]))) s.connect((configvars["server"],int(configvars["port"])))
s.settimeout(1) s.settimeout(1)
mesg = configvars["password"] + ' #' + configvars["channel"] + ' ' + data["event"]["message"] + ' at ' + data["event"]["timestamp"] mesg = configvars["password"] + ' #' + configvars["channel"] + ' ' + notification
print(mesg)
s.send(mesg.encode()) s.send(mesg.encode())
print('Sent to TheRaven')
except: except:
print('Could not send to TheRaven') print('Could not send to TheRaven')
return data return data

View File

@ -1,6 +1,6 @@
[Unit] [Unit]
Description=AniNIX/ravensend Daemon Description=AniNIX/ravensend Daemon
After=network.target After=network.target raven.service
[Service] [Service]
ExecStart=/usr/local/bin/ravensend-daemon ExecStart=/usr/local/bin/ravensend-daemon