From eb7a76b14a092b765e449379d216563cdbf686c3 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 13 Mar 2022 11:57:09 +0100 Subject: [PATCH] add aliases and fix permalinks --- config.yml | 3 +++ .../index.md | 2 ++ .../2020/color-palettes-on-gbc-and-gba/index.md | 2 ++ .../index.md | 16 ++++++++++------ .../index.md | 2 ++ .../2020/modernize-a-game-boy-advance/index.md | 2 ++ .../index.md | 2 ++ content/posts/2020/welcome/index.md | 6 +++++- content/posts/2021/toolbox-1-direnv/index.md | 2 ++ content/posts/2021/toolbox-2-git-plus/index.md | 2 ++ .../ssl-certificate-monitoring-pitfalls/index.md | 2 ++ 11 files changed, 34 insertions(+), 7 deletions(-) diff --git a/config.yml b/config.yml index 9799118..0a5e979 100644 --- a/config.yml +++ b/config.yml @@ -17,6 +17,9 @@ markup: startLevel: 1 endLevel: 9 +permalinks: + posts: /:year/:month/:title/ + taxonomies: author: authors tag: tags diff --git a/content/posts/2020/ansible-and-the-relations-to-the-inventory/index.md b/content/posts/2020/ansible-and-the-relations-to-the-inventory/index.md index 82748cc..be0f1e2 100644 --- a/content/posts/2020/ansible-and-the-relations-to-the-inventory/index.md +++ b/content/posts/2020/ansible-and-the-relations-to-the-inventory/index.md @@ -1,6 +1,8 @@ --- title: "Ansible and the relations to the inventory" date: 2020-08-03T22:45:00+02:00 +aliases: + - /ansible-and-the-relations-to-the-inventory/ authors: - robert-kaussow tags: diff --git a/content/posts/2020/color-palettes-on-gbc-and-gba/index.md b/content/posts/2020/color-palettes-on-gbc-and-gba/index.md index 0ff4fe7..76fdd13 100644 --- a/content/posts/2020/color-palettes-on-gbc-and-gba/index.md +++ b/content/posts/2020/color-palettes-on-gbc-and-gba/index.md @@ -1,6 +1,8 @@ --- title: "Color palettes on Game Boy Color and Advance" date: 2020-09-15T21:45:00+02:00 +aliases: + - /color-palettes-on-gbc-and-gba/ authors: - robert-kaussow tags: diff --git a/content/posts/2020/create-a-static-site-hosting-platform/index.md b/content/posts/2020/create-a-static-site-hosting-platform/index.md index 9a7103a..5702609 100644 --- a/content/posts/2020/create-a-static-site-hosting-platform/index.md +++ b/content/posts/2020/create-a-static-site-hosting-platform/index.md @@ -1,6 +1,8 @@ --- title: "Create a static site hosting platform" date: 2020-07-30T01:05:00+02:00 +aliases: + - /create-a-static-site-hosting-platform/ authors: - robert-kaussow tags: @@ -8,7 +10,7 @@ tags: - Sysadmin resources: - name: feature - src: 'images/feature.jpg' + src: "images/feature.jpg" params: anchor: Center credits: > @@ -17,7 +19,9 @@ resources: --- There are a lot of static site generators out there and users have a lot of possibilities to automate and continuously deploy static sites these days. Solutions like GitHub pages or Netlify are free to use and easy to set up, even a cheap webspace could work. If one of these services is sufficient for your use case you could stop reading at this point. + + As I wanted to have more control over such a setup and because it might be fun I decided to create my own service. Before we look into the setup details, lets talk about some requirements: - deploy multiple project documentation @@ -90,13 +94,13 @@ server { We will go through this configuration to understand how it works. -__*Lines 1-3*__ defines a backend, in this case it's the Minio server running on `localhost:61000`. +**_Lines 1-3_** defines a backend, in this case it's the Minio server running on `localhost:61000`. -__*Lines 5-10*__ should also be straight forward, this block will redirect HTTP to HTTPS. +**_Lines 5-10_** should also be straight forward, this block will redirect HTTP to HTTPS. -__*Line 14*__ is where the magic starts. We are using a named regular expression to capture the first part of the subdomain and translate it into the bucket sub-directory. For a given URL like `demoproject.mydocs.com` Nginx will try to serve `mydocs/demoproject` from the Minio server. That's what __*Line 23*__ does. Some of you may notice that the used variable `${request_path}` is not defined in the vHost configuration. +**_Line 14_** is where the magic starts. We are using a named regular expression to capture the first part of the subdomain and translate it into the bucket sub-directory. For a given URL like `demoproject.mydocs.com` Nginx will try to serve `mydocs/demoproject` from the Minio server. That's what **_Line 23_** does. Some of you may notice that the used variable `${request_path}` is not defined in the vHost configuration. -Right, we need to add another configuration snippet to the `nginx.conf`. But why do we need this variable at all? For me, that was the hardest part to solve. As the setup is using `proxy_pass` Nginx will *not* try to lookup `index.html` automatically. That's a problem because every folder will at least contain an `index.html`. In general, it's required to tell Nginx to rewrite the request URI to `/index.html` if the origin is a folder and ends with `/`. One way would be an `if` condition in the vHost configuration but such conditions are evil[^if-is-evil] in most cases and should be avoided if possible. Luckily there is a better option: +Right, we need to add another configuration snippet to the `nginx.conf`. But why do we need this variable at all? For me, that was the hardest part to solve. As the setup is using `proxy_pass` Nginx will _not_ try to lookup `index.html` automatically. That's a problem because every folder will at least contain an `index.html`. In general, it's required to tell Nginx to rewrite the request URI to `/index.html` if the origin is a folder and ends with `/`. One way would be an `if` condition in the vHost configuration but such conditions are evil[^if-is-evil] in most cases and should be avoided if possible. Luckily there is a better option: @@ -113,7 +117,7 @@ map $request_uri $request_path { [Nginx maps](https://nginx.org/en/docs/http/ngx_http_map_module.html) are a solid way to create conditionals. In this example set `$request_uri` as input and `$request_path` as output. Each line between the braces is a condition. The first line will simply apply `$request_uri` to the output variable if no other condition match. The second condition applies `${request_uri}index.html` to the output variable if the input variable ends with a slash (and therefor is a directory). -__*Line 38-41*__ of the vHost configuration tries to deliver the custom error page of your site and will fallback to the default Nginx error page. +**_Line 38-41_** of the vHost configuration tries to deliver the custom error page of your site and will fallback to the default Nginx error page. We are done! Nginx should now be able to server your static sites from a sub-directory of the Minio source bucket. I'm using it since a few weeks and I'm really happy with the current setup. diff --git a/content/posts/2020/docker-port-publishing-for-localhost-bindings/index.md b/content/posts/2020/docker-port-publishing-for-localhost-bindings/index.md index 7b15dd5..c129849 100644 --- a/content/posts/2020/docker-port-publishing-for-localhost-bindings/index.md +++ b/content/posts/2020/docker-port-publishing-for-localhost-bindings/index.md @@ -1,6 +1,8 @@ --- title: "Docker port publishing for localhost bindings" date: 2020-09-08T22:15:00+02:00 +aliases: + - /docker-port-publishing-for-localhost-bindings/ authors: - robert-kaussow tags: diff --git a/content/posts/2020/modernize-a-game-boy-advance/index.md b/content/posts/2020/modernize-a-game-boy-advance/index.md index 05d3558..99018c5 100644 --- a/content/posts/2020/modernize-a-game-boy-advance/index.md +++ b/content/posts/2020/modernize-a-game-boy-advance/index.md @@ -1,6 +1,8 @@ --- title: "How to modernize a Game Boy" date: 2020-09-13T23:45:00+02:00 +aliases: + - modernize-a-game-boy-advance authors: - robert-kaussow tags: diff --git a/content/posts/2020/run-arm32-docker-daemon-on-arm64-servers/index.md b/content/posts/2020/run-arm32-docker-daemon-on-arm64-servers/index.md index 5ab9e22..3248676 100644 --- a/content/posts/2020/run-arm32-docker-daemon-on-arm64-servers/index.md +++ b/content/posts/2020/run-arm32-docker-daemon-on-arm64-servers/index.md @@ -1,6 +1,8 @@ --- title: "Run an ARM32 Docker daemon on ARM64 servers" date: 2020-09-24T10:30:00+02:00 +aliases: + - run-arm32-docker-daemon-on-arm64-servers authors: - robert-kaussow tags: diff --git a/content/posts/2020/welcome/index.md b/content/posts/2020/welcome/index.md index 6d9620f..9d3199b 100644 --- a/content/posts/2020/welcome/index.md +++ b/content/posts/2020/welcome/index.md @@ -1,13 +1,15 @@ --- title: "Welcome (back)" date: 2020-07-21T23:00:08+02:00 +aliases: + - welcome authors: - robert-kaussow tags: - General resources: - name: feature - src: 'images/feature.jpg' + src: "images/feature.jpg" params: anchor: Center credits: > @@ -16,7 +18,9 @@ resources: --- As some former readers may have noticed, "geeklabor.de" has been renamed to "thegeeklab.de", welcome back nice to have you here again. If you are a first time visitor, a very warm welcome goes to you as well. This is my private blog, where I write about everything that comes to my mind but mainly about topics from the Linux and Open Source world. + + For those of you who are interested in the backgrounds about the blog migration, here you go: - my old theme had to be reworked, [hugo-geekblog](https://github.com/thegeeklab/hugo-geekblog) was born diff --git a/content/posts/2021/toolbox-1-direnv/index.md b/content/posts/2021/toolbox-1-direnv/index.md index 97f47ba..7655991 100644 --- a/content/posts/2021/toolbox-1-direnv/index.md +++ b/content/posts/2021/toolbox-1-direnv/index.md @@ -1,6 +1,8 @@ --- title: "Toolbox 1: direnv" date: 2021-05-17T21:24:00+01:00 +aliases: + - toolbox-1-direnv authors: - robert-kaussow tags: diff --git a/content/posts/2021/toolbox-2-git-plus/index.md b/content/posts/2021/toolbox-2-git-plus/index.md index 8044395..6aec2d0 100644 --- a/content/posts/2021/toolbox-2-git-plus/index.md +++ b/content/posts/2021/toolbox-2-git-plus/index.md @@ -1,6 +1,8 @@ --- title: "Toolbox 2: git-plus" date: 2021-06-19T09:50:00+01:00 +aliases: + - toolbox-2-git-plus authors: - robert-kaussow tags: diff --git a/content/posts/2022/ssl-certificate-monitoring-pitfalls/index.md b/content/posts/2022/ssl-certificate-monitoring-pitfalls/index.md index fc671b2..e0ebda4 100644 --- a/content/posts/2022/ssl-certificate-monitoring-pitfalls/index.md +++ b/content/posts/2022/ssl-certificate-monitoring-pitfalls/index.md @@ -1,6 +1,8 @@ --- title: "SSL certificate monitoring pitfalls" date: 2022-01-31T23:00:00+01:00 +aliases: + - /ssl-certificate-monitoring-pitfalls/ authors: - robert-kaussow tags: