Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deployment example using FastCGI server and lighttpd #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()