Skip to content

Commit

Permalink
Add deployment example using FastCGI server and lighttpd
Browse files Browse the repository at this point in the history
  • Loading branch information
yay6 committed Jan 22, 2021
1 parent f349a26 commit 7c69a8e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
11 changes: 11 additions & 0 deletions examples/lighttpd.conf.example
Original file line number Diff line number Diff line change
@@ -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",
))
)
}
17 changes: 17 additions & 0 deletions examples/ycast.fcgi.example
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 7c69a8e

Please sign in to comment.