1
0
jcktrue.dk/content/post/architectural-overview/index.md

63 lines
2.5 KiB
Markdown
Raw Permalink Normal View History

2020-02-27 21:42:33 +00:00
---
title: "Architectural Overview"
subtitle: "Overview of the architecture behind this website."
summary: "Overview of the architecture behind this website."
date: 2020-02-27T22:10:31+01:00
lastmod: 2020-02-27T22:10:31+01:00
2021-01-30 09:08:35 +00:00
diagram: true
2020-02-27 21:42:33 +00:00
---
2020-02-29 15:51:43 +00:00
## Introduction
2020-02-27 21:42:33 +00:00
2021-05-01 17:16:57 +00:00
I self host this site. I consider it a learning experience into hosting and managing a full Linux server stack. The purpose of this post is to describe my current setup as notes to myself should I ever need to redo a similar setup.
2020-02-27 21:42:33 +00:00
2020-02-29 15:51:43 +00:00
My setup attempts to achieve the following goals:
2020-02-27 21:42:33 +00:00
- Require no or little maintenance
- I do not wish to daily check the status of the server
- High data integrity
2021-05-01 17:16:57 +00:00
- Losing data is not acceptable. Downtime, while data is being recovered, is however okay.
2020-02-27 21:42:33 +00:00
- Employ best practices
2021-05-01 17:16:57 +00:00
- TLS, Git, and containers are all considered best practices in modern software development.
2020-02-27 21:42:33 +00:00
2020-02-29 15:51:43 +00:00
Out of scope:
- Uptime and reliability
2021-05-01 17:16:57 +00:00
- I self-host and do not host any critical services.
2020-02-29 15:51:43 +00:00
- Performance and scaling
- The server is purely for personal use and hardware is cheap.
## Hardware
2020-02-27 21:42:33 +00:00
2021-05-01 17:16:57 +00:00
The webserver is hosted on an HP MicroServer Gen8. The OS runs off a 120GB SSD drive and 2x3TB HDD running RAID1 using the Btrfs filesystem. This provides a suitable balance between storage capacity, and performance. Offsite backup is done weekly through https://wasabi.com/ and their S3 compatible service.
2020-02-27 21:42:33 +00:00
2020-02-29 15:51:43 +00:00
## Network
2020-02-27 21:42:33 +00:00
2020-02-29 18:54:31 +00:00
The server is connected via Gigabit Ethernet to an ASUS router. The router supports both IPv4 and IPv6 and does port forwarding for port 80 and port 443 to the statically configured IP address.
2020-02-27 21:42:33 +00:00
2021-05-01 17:16:57 +00:00
On the WAN side, a 150/150Mb/sec fiber line from Altibox provides the internet connection, and while the IP address is not static it changes rarely enough for this not to be an issue.
2020-02-27 21:42:33 +00:00
2020-02-29 18:54:31 +00:00
The domain is registered via gandi.net providing both registration and name servers.
2020-02-27 21:42:33 +00:00
2020-02-29 15:51:43 +00:00
## Software
2020-02-27 21:42:33 +00:00
2021-05-01 17:16:57 +00:00
The software stack is built on containers. A reverse proxy is employed to provide SSL certificates through LetsEncrypt. The webserver itself is Nginx running on an internal virtual network.
2020-02-27 21:42:33 +00:00
All containers are automatically updated as is the host system.
2021-01-30 09:08:35 +00:00
```mermaid
graph LR;
WAN-->Router-->Server;
2021-01-30 14:25:47 +00:00
subgraph Docker
FP-->NGINX;
2021-01-30 09:08:35 +00:00
FP-->OC["Other Containers"];
2021-01-30 14:25:47 +00:00
end
Server-->FP["Traefik"];
2021-01-30 09:08:35 +00:00
```
2020-02-29 15:51:43 +00:00
## Build
2020-02-27 21:42:33 +00:00
2021-05-01 17:16:57 +00:00
The site uses the Hugo static site generator. The content of the site is maintained in a git repository. On each update to the repository, a dedicated build server generates the HTML and pushes it to the webserver. This allows the site to be updated from any machine with access to git.