diff --git a/README.md b/README.md index b4f6f19..6c2e411 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,27 @@ -# Defcon!!! +# OpenFest Timer + +## Deployment + +Clone to `/opt/timer`. +Put `openfest-timer@.service` in `/etc/systemd/system`. +Requires NodeJS and npm. + +```bash +systemctl daemon-reload +npm install +systemctl enable --now openfest-timer@hall-a.service +systemctl enable --now openfest-timer@hall-b.service +``` + +## Based on Defcon + +### Defcon Defcon is a stopwatch running on Node.js, Express.js, and Socket.io. It is intended to be a good starting point if you're just learning to use web sockets. It currently uses xhr-polling so it is compatible with Heroku. -# Who's it for? +### Who's it for? I originally wrote Defcon over four blog posts introducing Socket.io and deploying to Heroku. Please checkout the posts on my site, [robdodson.me](http://robdodson.me) diff --git a/hall-a.env b/hall-a.env new file mode 100644 index 0000000..08e9041 --- /dev/null +++ b/hall-a.env @@ -0,0 +1,4 @@ +HOST=127.0.0.1 +PORT=5050 +TITLE=HALL-A +NODE_ENV=production diff --git a/hall-b.env b/hall-b.env new file mode 100644 index 0000000..9caccc4 --- /dev/null +++ b/hall-b.env @@ -0,0 +1,4 @@ +HOST=127.0.0.1 +PORT=5051 +TITLE=HALL-B +NODE_ENV=production diff --git a/openfest-timer@.service b/openfest-timer@.service new file mode 100644 index 0000000..df054c9 --- /dev/null +++ b/openfest-timer@.service @@ -0,0 +1,13 @@ +[Unit] +Description=OpenFest Timer (%i) +After=network.target + +[Service] +EnvironmentFile=/opt/timer/%i.env +Type=simple +Restart=on-failure +WorkingDirectory=/opt/timer +ExecStart=/usr/bin/env node app.js + +[Install] +WantedBy=multi-user.target diff --git a/start.sh b/start.sh deleted file mode 100755 index b8039ad..0000000 --- a/start.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# Usage: -# HOST=127.0.0.1 PORT=5051 TITLE=HALL-B ./start.sh - -cd "$(dirname "$0")" - -NODE_ENV=production node app.js