|
1 year ago | |
---|---|---|
archetypes | 1 year ago | |
archive | 1 year ago | |
content | 1 year ago | |
data | 1 year ago | |
hooks | 1 year ago | |
nginx | 1 year ago | |
static | 1 year ago | |
themes/hugo-future-imperfect | 1 year ago | |
.gitignore | 1 year ago | |
.gitmodules | 1 year ago | |
Dockerfile | 1 year ago | |
README.md | 1 year ago | |
config.toml | 1 year ago | |
install_server.sh | 1 year ago | |
license.md | 1 year ago | |
save.sh | 1 year ago |
README.md
(Deprecated) Documentation for noahsbwilliams.com
Note: This repository exists for reference purposes and is no longer actively maintained. Current website stack consists of a Ghost instance running on another VPS.
Stack
Hugo static site served by Nginx on Ubuntu Server 18.04 LTS
Functions
-
Function as git SCM server to supplement GitHub repo
-
Analytics on site traffic
-
Serve Hugo static content
-
Feature SEO-indexable main domain website for personal blog and list of projects
-
Be separate from personal cloud
-
Auto-build website from a git branch
-
Be easily editable from any
git
client -
Feature convenient installer script
-
Feature Docker container for easy deployment on any server
Nginx Configuration
In /etc/nginx/sites-availible
, an nginx
server block is present. This is a copy of the one located in the nginx
folder of this repository. This is symlinked into /etc/sites-enabled
. In a future docker image or deploy script, this server block will be included; for now, including it is too complicated for deployment.
While port 80 is left open, SSL
is enabled through certbot
, and automatic HTTPS
redirects to port 443 are enabled globally.
Deployment/DevOps
The unprivileged git
user in the group devops
is used on the server for SCM & DevOps purposes. In its home folder is a git repository called personalWebsite.git
, which is configured as one of two remotes for this site (the other being this GitHub page). The post-receive script checks out the site to /home/personalWebsite
, also set to ownership by the git
user, then copies the contents of the docs
folder within that to /var/www/noahsbwilliams.com
to sanitize them.
The deploy directory for noahsbwilliams.com is /var/www/noahsbwilliams.com
. It is owned by www-data:devops
and its permissions are set to 775
so the git
user can both read & write.
On the server, the post-receive
file included in this repo is symlinked into /home/git/personalwebsite.git/hooks
for easy updates.
On the local machine, the script in the pre-commit git hook is used, symlinked into ./.git/hooks
for easy updates. It conducts automatic rebuilds in the development environment for every commit.
To do (also see to-do.md
)
- Symlink git hooks included in SCM to git hooks directory (server side)
- Needs testing & potential editing of script
Fix weird issue with older version ofhugo
not recognizing the necessary elements to render a page properly- Call the snap version of
hugo
directly from build script. - This is useful because the version of
hugo
distributed throughapt
is not new enough to get the required features working.
- Call the snap version of
Documentnginx
server blocks configuration betterFix inconsistent loading of images- This was mitigated by changing
featuredpath
from=date
to the actual hardcoded path of the featured images in each post.
- This was mitigated by changing
Notable quirks
- When deploying, setup
ssl
pronto on server - both Safari and Brave web browsers refuse to load JavaScript onhttp
pages! - Don't include
nginx
listers on port443
! This breaks Certbot! Listeners on port80
are fine though. Runninghugo server
while running an independent hugo build might result in glitches for that build.- Determined to be an issue with the implementation of
js
loading featured images using the "path by date" function.
- Determined to be an issue with the implementation of