Install hugo using your package manager.
This repo uses submodules. To clone them, run git submodule update --init.
To test locally, run hugo server.
- Push the code to the origin at
git@github.com:CodamStudentCouncil/website.git. - SSH to the server
- Run the
website-deploycommand as thehiveminduser:sudo -u hivemind website-deploy
The server can only be accessed from Codam iMacs or from the the "Codam -
Student" wifi network. The IP address is 10.16.1.1.
The website code is cloned at /srv/website and is owned by the hivemind
user. One shouldn't have to touch this directly directly, and should instead
use the website-deploy command to update the website (see "How to publish").
The website-deploy script is located at /usr/local/bin/website-deploy and
simply pulls the git to get the latest version and builds it using hugo. The
output is stored at /var/www/html where it is hosted by nginx (see
/etc/nginx/sites-enabled/default).
TLS (https) is not handled by our server, we are expected to simply host at port 80 and the reverse proxy managed by Codam will all TLS.
- Login as an existing user
- Create a new user (replacing
USERNAMEwith the desired username):The tool will ask for a few questions like Full Name and Room Number, you can leave all those empty.sudo adduser USERNAME
- Add the new user to the
sudogroup so that they are able to run commands as root:sudo adduser USERNAME sudo
- Login as the new user:
sudo su USERNAME
- Add the new user's SSH keys:
mkdir ~/.ssh vim ~/.ssh/auhtorized_keys # Use whatever commands you want to popualte the `authorized_keys` file. chmod 600 ~/.ssh/authorized_keys