From d0051393f3f2b6331a3c1a10b31cee620d9e0abd Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 22 Nov 2022 12:22:27 +0100 Subject: add fcgi script for nginx --- fcgi | 3 +++ readme.md | 2 +- trein.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100755 fcgi diff --git a/fcgi b/fcgi new file mode 100755 index 0000000..2fa6778 --- /dev/null +++ b/fcgi @@ -0,0 +1,3 @@ +#!/bin/sh +echo "HTTP/1.1 200 OK\n" +exec ./trein.py diff --git a/readme.md b/readme.md index 17405f7..d558b62 100644 --- a/readme.md +++ b/readme.md @@ -16,7 +16,7 @@ location /ical/trein.ics { autoindex on; fastcgi_pass unix:/var/run/fcgiwrap.socket; include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME /var/trein/trein.py; + fastcgi_param SCRIPT_FILENAME /var/trein/fcgi; } ``` diff --git a/trein.py b/trein.py index 9afad6d..4ee5273 100755 --- a/trein.py +++ b/trein.py @@ -61,7 +61,7 @@ def main(): relevant = True # only relevant if consequence contains current and next station if relevant: disruption2ical(disruption) - print(cal.to_ical()) + print(str(cal.to_ical(), 'utf-8')) if __name__ == "__main__": main() -- cgit v1.2.3