My personal website
Clone or download
Latest commit 8b3f950 Dec 11, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dehydrated @ 70d261a Update dehydrated to v0.6.1 Mar 24, 2018
out Make the switch to Python 3 Jul 3, 2017
pelican Add Chromecast article Dec 11, 2018
scripts Update dehydrated Mar 24, 2018
web_config Remove m2t subdomain https renewal Mar 24, 2018
.gitignore Update Pelican to v3.7 Jul 3, 2017
.gitmodules Remove mag2tor Jul 3, 2017
README.md Refactor HTTPS setup Oct 14, 2016
post-receive Fix up some minor shellcheck warnings Jul 3, 2017

README.md

Personal Website

This is the contents of my personal website, found at https://cmetcalfe.ca

Updating

Note that this setup uses Nginx on Debian. The steps will be similar for other setups, but might not be exactly the same.

  1. Initialize a git repo on the server with

    cd [path to site]
    git init
    git config --bool receive.denyCurrentBranch false
    git config --path core.worktree ../
    
  2. Setup an Nginx site configuration file that includes all configuration files in the repositories out/_config/nginx directory. Ex:

    include [path to site]/out/_config/nginx/*.conf;
    
  3. Modify /etc/sudoers (with visudo) to allow the user to restart and get the status of the webserver without a password

    [user] ALL=(root) NOPASSWD: /etc/init.d/nginx restart
    [user] ALL=(root) NOPASSWD: /etc/init.d/nginx status
    
  4. Link the Git post-receive hook (in .git/hooks/post-receive) to the post-receive script in the repo

    # Make something to link to intially - will be replaced on first push
    touch [path to site]/post-receive
    ln -s [path to site]/post-receive [path to site]/.git/hooks/post-receive
    
  5. Set up a cronjob to automatically renew Let's Encrypt certificates on the 1st of every month

    crontab -e
    0 0 1 * * ROOT=[path to site] [path to site]/scripts/renew
    
  6. Locally add the remote repository to your local git remotes with

    git remote add deploy ssh://[user]@[server]:[port]/[path to site]
    
  7. To update the website, commit changes then run git push deploy