aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-11-22 12:22:27 +0100
committerlonkaars <loek@pipeframe.xyz>2022-11-22 12:22:27 +0100
commitd0051393f3f2b6331a3c1a10b31cee620d9e0abd (patch)
tree36abc1d5f2203e9af88832ea343a74d2a25b1124
parent6e55e01baab0f929bce7aed438b0a8c74188b62d (diff)
add fcgi script for nginx
-rwxr-xr-xfcgi3
-rw-r--r--readme.md2
-rwxr-xr-xtrein.py2
3 files changed, 5 insertions, 2 deletions
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()