Compare commits

..

1 Commits

Author SHA1 Message Date
Noah 3e8b817796 Crontab installation support 2018-10-24 14:17:19 -07:00
1 changed files with 31 additions and 11 deletions

View File

@ -40,22 +40,23 @@ $ curl -X POST http://localhost:8000/playlist/start
# 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.
* `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)
When you save a schedule for the alarm clock, it will create and install a
crontab entry for the user running the app. The cron entry hits the API server
to start the playlist at the desired time, and then, an hour later, it stops
it the same way.
# Crontab
## Crontab
The schedule system installs into the user's local crontab. The cron entries
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
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
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 chown kirsle:kirsle /usr/lib/golang/pkg/linux_arm
make pi
rsync -av sonar.pi 192.168.0.102:
```
It outputs a `sonar-pi.zip` that you can scp over and run.