Add deployment example using FastCGI server and lighttpd

This commit is contained in:
Jakub Janeczko 2020-09-16 12:37:46 +02:00
parent f349a2686c
commit 7c69a8edd2
3 changed files with 32 additions and 0 deletions

View file

@ -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).

View file

@ -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",
))
)
}

View file

@ -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()