From f983d2500dcfb9b810a09a6470e57a3432b3a1ff Mon Sep 17 00:00:00 2001 From: milaq Date: Tue, 6 Nov 2018 01:00:53 +0100 Subject: [PATCH] polish readme and add nginx and systemd examples also move examples into separate subdir to keep it tidy --- README.md | 12 ++++++++---- examples/nginx-ycast.conf.example | 18 ++++++++++++++++++ .../stations.yml.example | 0 examples/ycast.service.example | 12 ++++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 examples/nginx-ycast.conf.example rename stations.yml.example => examples/stations.yml.example (100%) create mode 100644 examples/ycast.service.example diff --git a/README.md b/README.md index c2ea2e0..40c03ba 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ + + # YCast YCast is a self hosted replacement for the vTuner internet radio service which some Yamaha AVRs use. @@ -46,7 +48,7 @@ Category two name: Fourth awesome station name: fourth.awesome/station/URL ``` -You can also have a look at the provided [example](stations.yml.example) to better understand the configuration. +You can also have a look at the provided [example](examples/stations.yml.example) to better understand the configuration. ## Web server configuration @@ -65,6 +67,9 @@ You need to redirect the following URLs from your webserver to YCast (listening __Attention__: Do not rewrite the request transparently. YCast expects the complete URL (i.e. including `/ycast/`). +In case you are using (or plan on using) Nginx to proxy requests, have a look at [this example](examples/nginx-ycast.conf.example). +This can be used together with [this systemd service example](examples/ycast.service.example) for a fully functional deployment. + ## Firewall rules * The server running YCast does __not__ need internet access @@ -76,6 +81,5 @@ __Attention__: Do not rewrite the request transparently. YCast expects the compl YCast was a quick and dirty project to lay the foundation for having a self hosted vTuner emulation. It is a barebone service at the moment. It provides your AVR with the basic info it needs to play internet radio stations. -Maybe this will change in the future. -But for now just station names and URLs. No web-based management interface, no coverart, no fancy stuff. - +Maybe this will change in the future, maybe not. +For now just station names and URLs; no web-based management interface, no coverart, no cute kittens, no fancy stuff. diff --git a/examples/nginx-ycast.conf.example b/examples/nginx-ycast.conf.example new file mode 100644 index 0000000..7a8182d --- /dev/null +++ b/examples/nginx-ycast.conf.example @@ -0,0 +1,18 @@ +server { + listen 80; + server_name radioyamaha.vtuner.com; + + access_log /var/log/nginx/ycast_access.log; + error_log /var/log/nginx/ycast_error.log; + + location / { + proxy_redirect off; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_pass http://localhost:8010; + } +} diff --git a/stations.yml.example b/examples/stations.yml.example similarity index 100% rename from stations.yml.example rename to examples/stations.yml.example diff --git a/examples/ycast.service.example b/examples/ycast.service.example new file mode 100644 index 0000000..5379e8c --- /dev/null +++ b/examples/ycast.service.example @@ -0,0 +1,12 @@ +[Unit] +Description=YCast internet radio service +After=network.target + +[Service] +Type=simple +User=ycast +Group=ycast +ExecStart=/opt/ycast/ycast.py -l 127.0.0.1 -p 8010 + +[Install] +WantedBy=multi-user.target