Running at https://mealplan.pikans.org/
data.go
: loads and saves all the state from/to diskserver/signup.go
: has all the logic for displaying the pages & handling user inputserver/signup.html
: a Go HTML template which is used to display the main page (for both authorized and unauthorized users)
Before you deploy, you'll need to clone pika's cdist repo: https://wiki.pikans.org/computers/git#yfncc-cdist. Note down the path you clone this to. Navigate to the directory for the thing you'd like to change (either server or remind, probably), then edit the makefile variables at the top to match the prefixes to the path to yfncc-cdist you noted down earlier (i.e., replace /Users/j/pika/yfncc-dist
with the full path to your copy of yfncc-cdist).
Now you can build the project with make build
, and have cdist put it on the mealplan server with make deploy
.
Now follow the manual steps below from step 5.
You'll also need SSH keys for root on pika-web.mit.edu
-- ask yfncc.
- Make sure you're in the
server
directory - Build for OpenBSD:
env GOOS=openbsd GOARCH=amd64 go build
- Copy the resulting
server
binary to the cdist repo, atcdist/conf/manifest/bin/openbsd/mealplan
, and copyserver.html
andadmin.html
(if changed) intocdist/conf/manifest/html/
- Navigate up to
yfncc-cdist/
in the cdist repo and run./bin/cdist config -v pika-web.mit.edu
- (If the binary changed) SSH into
pika-web.mit.edu
and restart the server: su mealplan
to change into usermealplan
tmux attach
to attach to an existingtmux
session, or justtmux
to start a new one- Kill the existing
mealplanserver
process, either with Ctrl+C if it's in the console, or finding the process and stopping it. - Start it anew, with
./run.sh
or./run-console.sh
, depending on whether you want to get live console output in thetmux
session (only do this if you're running intmux
, or else it will die once your SSH connection dies!)
Make sure when changing anything in this repo to commit, push, and
execute `go get github.com/pikans/mealplan`; otherwise, parts of
this development that refer to other files in the repo by use of a
go remote import from the github repo will not use the updated
bits!