diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-11-22 12:22:27 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-11-22 12:22:27 +0100 |
commit | d0051393f3f2b6331a3c1a10b31cee620d9e0abd (patch) | |
tree | 36abc1d5f2203e9af88832ea343a74d2a25b1124 | |
parent | 6e55e01baab0f929bce7aed438b0a8c74188b62d (diff) |
add fcgi script for nginx
-rwxr-xr-x | fcgi | 3 | ||||
-rw-r--r-- | readme.md | 2 | ||||
-rwxr-xr-x | trein.py | 2 |
3 files changed, 5 insertions, 2 deletions
@@ -0,0 +1,3 @@ +#!/bin/sh +echo "HTTP/1.1 200 OK\n" +exec ./trein.py @@ -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; } ``` @@ -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() |