This commit is contained in:
Albert Stefanov 2023-10-26 07:58:37 +03:00
parent aea34a1d5c
commit 48701890df
5 changed files with 40 additions and 10 deletions

View File

@ -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)

4
hall-a.env Normal file
View File

@ -0,0 +1,4 @@
HOST=127.0.0.1
PORT=5050
TITLE=HALL-A
NODE_ENV=production

4
hall-b.env Normal file
View File

@ -0,0 +1,4 @@
HOST=127.0.0.1
PORT=5051
TITLE=HALL-B
NODE_ENV=production

13
openfest-timer@.service Normal file
View File

@ -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

View File

@ -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