From 2f9c232540bfef3152fbbfe421c834909a355db2 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 23 Dec 2023 20:04:40 +0200 Subject: [PATCH 1/2] add IPv6 support --- pymaster.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pymaster.py b/pymaster.py index 949823c..cca0402 100755 --- a/pymaster.py +++ b/pymaster.py @@ -67,7 +67,10 @@ class PyMaster: self.serverRL = IPRateLimit('server', 60, 30) self.clientRL = IPRateLimit('client', 60, 120) self.ipfilterRL = IPRateLimit('filterlog', 60, 10) - self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + if ':' in ip: + self.sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) + else: + self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.sock.bind((ip, port)) log("Welcome to PyMaster!") From de1562907903be9fe84c0c4cd577ca474760ed6d Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 24 Dec 2023 07:01:17 +0200 Subject: [PATCH 2/2] debug pymaster output to file --- etc/systemd/system/pymaster.service | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etc/systemd/system/pymaster.service b/etc/systemd/system/pymaster.service index fb4030f..db56c1e 100644 --- a/etc/systemd/system/pymaster.service +++ b/etc/systemd/system/pymaster.service @@ -9,8 +9,9 @@ User=master Group=master WorkingDirectory=/home/master/pymaster/ ExecStart=/home/master/pymaster/pymaster.py -i $PYMASTER_IP -p $PYMASTER_PORT +StandardOutput=file:/home/master/pymaster-debug.log +StandardError=file:/home/master/pymaster-error.log Restart=on-failure [Install] WantedBy=multi-user.target -