Compare commits

..

1 Commits

Author SHA1 Message Date
3e8b817796 Crontab installation support 2018-10-24 14:17:19 -07:00

View File

@ -40,22 +40,23 @@ $ curl -X POST http://localhost:8000/playlist/start
# Screenshots # Screenshots
![screenshot1.png](screenshot1.png) ![screenshot1.png](screenshot1.png)![screenshot2.png](screenshot2.png)
![screenshot2.png](screenshot2.png) # How It Works
The config file specifies the shell commands to run to launch your media player,
volume changing commands, etc.
# Makefile When the playlist starts, the Go app shuffles the files in your media folder
and feeds them one by one to your media player command (`mplayer` by default).
To stop the playlist, it kills the current mplayer task and stops.
* `make setup` to fetch dependencies. When you save a schedule for the alarm clock, it will create and install a
* `make build` to build the binary to `bin/` crontab entry for the user running the app. The cron entry hits the API server
* `make dist` to build a distribution for your current setup to start the playlist at the desired time, and then, an hour later, it stops
* `make run` to run it in debug mode it the same way.
* `make watch` to run it in debug mode, auto-reloading (sometimes flaky control over mplayer tho!)
* `make pi` to build a zipped distribution for Raspberry Pi.
See [Cross Compile for Raspberry Pi](#cross-compile-for-raspberry-pi)
# Crontab ## Crontab
The schedule system installs into the user's local crontab. The cron entries The schedule system installs into the user's local crontab. The cron entries
just post back to the API service, like: just post back to the API service, like:
@ -74,6 +75,24 @@ All custom user crontabs are concatenated together ahead of Sonar's cron entries
The `000-header.cron` is the standard Debian cron header and tends to be installed The `000-header.cron` is the standard Debian cron header and tends to be installed
on top. on top.
# Installation
## Supervisor
There's an example supervisor config in the `etc/` folder.
Add it to supervisor and put nginx in front with Basic Auth.
# Makefile
* `make setup` to fetch dependencies.
* `make build` to build the binary to `bin/`
* `make dist` to build a distribution for your current setup
* `make run` to run it in debug mode
* `make watch` to run it in debug mode, auto-reloading (sometimes flaky control over mplayer tho!)
* `make pi` to build a zipped distribution for Raspberry Pi.
See [Cross Compile for Raspberry Pi](#cross-compile-for-raspberry-pi)
# Configuration # Configuration
The config file will be in your system's native location, which is The config file will be in your system's native location, which is
@ -139,6 +158,7 @@ ARM64, make and chown the folders as a workaround:
sudo mkdir /usr/lib/golang/pkg/linux_arm sudo mkdir /usr/lib/golang/pkg/linux_arm
sudo chown kirsle:kirsle /usr/lib/golang/pkg/linux_arm sudo chown kirsle:kirsle /usr/lib/golang/pkg/linux_arm
make pi make pi
rsync -av sonar.pi 192.168.0.102:
``` ```
It outputs a `sonar-pi.zip` that you can scp over and run. It outputs a `sonar-pi.zip` that you can scp over and run.