The only current server-side component of notreda.me is a cron job which scrapes the web to automatically update the Notre Dame schedule when it changes.
Currently, notreda.me does not have its own server and instead piggy-backs off of the existing web server for Six Degrees of Wikipedia.
-
Piggy-back off of the existing web server for Six Degrees of Wikipedia.
-
Set the default region and zone for the
gcloud
CLI:$ gcloud config set compute/region us-central1 $ gcloud config set compute/zone us-central1-c
-
SSH into the machine:
$ gcloud compute ssh sdow-web-server-# --project=sdow-prod
-
Install nvm:
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash $ nvm install node
-
Clone this directory via HTTPS as
jwngr-ops
and navigate into the repo:$ git clone https://[email protected]/jwngr/notreda.me.git $ cd notreda.me/
-
Store the saved password so it does not need to be re-entered every git push:
$ git config credential.helper store
-
Attempt an empty
git push
to store the password.$ git push # Enter password for jwngr-ops
-
Add a
.env
file to the root of the repo to set environment variables:$ cp .env.example .env # Make sure to enable Sentry!
-
Install the required npm dependencies:
$ cd scripts/ $ npm install
-
Run
crontab -e
and add the following cron jobs to that file:# Run the ND schedule update script every 15 minutes. */15 * * * * cd /home/jwngr/notreda.me/scripts/ndSchedules && ./update.sh # Run the future ND schedules audit script every day at 6 AM. 0 6 * * * cd /home/jwngr/notreda.me/scripts/ndSchedules && node auditFutureSchedules.js
-
Install a mail service in order to read logs from cron jobs:
$ sudo apt-get -yq install postfix # Choose "Local only" and use the default email address.
Note: Cron job logs will be written to
/var/mail/jwngr
.