mirror of
https://github.com/EeeeKa/webhook-catcher.git
synced 2025-09-24 03:42:10 +05:00
commit
0e40f2e916
12
systemd/webhook-catcher.service
Normal file
12
systemd/webhook-catcher.service
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Webhook catcher
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=whcd
|
||||||
|
Group=whcd
|
||||||
|
|
||||||
|
ExecStart=/usr/sbin/webhook-catcher -c /etc/webhook-catcher/config.json
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
@ -136,6 +136,8 @@ class WebHookHandler(BaseHTTPRequestHandler):
|
|||||||
self.end_headers()
|
self.end_headers()
|
||||||
self.wfile.write(json.dumps(self.json_response, indent=2, sort_keys=True).encode('UTF-8', 'replace'))
|
self.wfile.write(json.dumps(self.json_response, indent=2, sort_keys=True).encode('UTF-8', 'replace'))
|
||||||
|
|
||||||
|
def log_message(self, format, *args):
|
||||||
|
pm("%s - - [%s] %s \n" % (self.address_string(), self.log_date_time_string(), format%args))
|
||||||
|
|
||||||
def do_POST(self):
|
def do_POST(self):
|
||||||
# GET SIGNATURE
|
# GET SIGNATURE
|
||||||
@ -422,10 +424,12 @@ class MessagePrinter:
|
|||||||
def pm(self, message):
|
def pm(self, message):
|
||||||
if not self.quiet:
|
if not self.quiet:
|
||||||
print(message)
|
print(message)
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
def pdm(self, debug_message):
|
def pdm(self, debug_message):
|
||||||
if self.debug:
|
if self.debug:
|
||||||
pprint(debug_message)
|
pprint(debug_message)
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
def load_config(path):
|
def load_config(path):
|
||||||
if path != '':
|
if path != '':
|
||||||
|
Loading…
Reference in New Issue
Block a user