diff --git a/README.md b/README.md index c3c30d1..a8a4232 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,10 @@ This can be used together with [this systemd service example](examples/ycast.ser You can also setup a proper WSGI server. See the [official Flask documentation](https://flask.palletsprojects.com/en/1.1.x/deploying/). +For example deployment on embedded device have a look at: + * [ycast.fcgi](examples/ycast.fcgi.example) - FastCGI server file using [flup](https://www.saddi.com/software/flup/). + * [lighttpd configuration stub](examples/lighttpd.conf.example) for YCast FastCGI server. + ### Custom stations If you want to use the 'My Stations' feature, create a `stations.yml` and run YCast with the `-c` switch to specify the path to it. The config follows a basic YAML structure (see below). diff --git a/examples/lighttpd.conf.example b/examples/lighttpd.conf.example new file mode 100644 index 0000000..542b8d3 --- /dev/null +++ b/examples/lighttpd.conf.example @@ -0,0 +1,11 @@ +$HTTP["host"] =~ ".(radiosetup|vtuner).com" { +fastcgi.server = ( + "/" => + (( "socket" => "/tmp/ycast-fcgi.sock", + "bin-path" => "/jffs/srv/ycast.fcgi", + "check-local" => "disable", + "max-procs" => 1, + "fix-root-scriptname" => "enable", + )) +) +} diff --git a/examples/ycast.fcgi.example b/examples/ycast.fcgi.example new file mode 100644 index 0000000..866d77e --- /dev/null +++ b/examples/ycast.fcgi.example @@ -0,0 +1,17 @@ +#!/opt/bin/python + +# Path to cloned YCast repository +PATH_YCAST = '/jffs/srv/YCast' + +# Path to my stations file +PATH_MY_STATIONS = '/jffs/www/stations.yml' + +import sys +sys.path.insert(0, PATH_YCAST) + +from flup.server.fcgi import WSGIServer +from ycast import server + +if __name__ == '__main__': + server.check_my_stations_feature(PATH_MY_STATIONS) + WSGIServer(server.app).run()