From 3fa409f68b364c3efb4b632dd809c96b5661b95f Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sun, 12 Feb 2023 19:02:38 +0100 Subject: [PATCH 01/18] Initial commit --- archetypes/default.md | 6 ++++++ config.toml | 41 +++++++++++++++++++++++++++++++++++++++++ content/about.md | 5 +++++ content/blog/gitea.md | 5 +++++ go.mod | 5 +++++ go.sum | 2 ++ 6 files changed, 64 insertions(+) create mode 100644 archetypes/default.md create mode 100644 config.toml create mode 100644 content/about.md create mode 100644 content/blog/gitea.md create mode 100644 go.mod create mode 100644 go.sum diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..00e77bd --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- + diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..f627343 --- /dev/null +++ b/config.toml @@ -0,0 +1,41 @@ +baseURL = 'https://namesny.com/' +languageCode = 'en-us' + +[module] +[[module.imports]] + path = "github.com/LordMathis/hugo-theme-nightfall" + +[menu] + [[menu.header]] + name = "blog" + weight = 0 + url = "blog" + [[menu.header]] + name = "about" + weight = 1 + url = "about" + +[params] +author = "Matúš Námešný" +user = "hello" +hostname = "namesny.com" + +[[params.social]] +key = 0 +name = "github" +url = "https://github.com/LordMathis" + +[[params.social]] +key = 1 +name = "gitea" +url = "https://git.namesny.com/Mathis" + +[[params.social]] +key = 2 +name = "linkedin" +url = "https://www.linkedin.com/in/matus-namesny/" + +[[params.social]] +key = 3 +name = "email" +url = "mailto:matus@namesny.com" diff --git a/content/about.md b/content/about.md new file mode 100644 index 0000000..d0ca64b --- /dev/null +++ b/content/about.md @@ -0,0 +1,5 @@ +I am a Software Engineer based in Darmstadt, Germany. + +I am interested in broad range of topics including Machine Learning, Cloud, DevOps, Linux and open source. + +This is a place for me to write and to showcase my projects. \ No newline at end of file diff --git a/content/blog/gitea.md b/content/blog/gitea.md new file mode 100644 index 0000000..1627ac1 --- /dev/null +++ b/content/blog/gitea.md @@ -0,0 +1,5 @@ +--- +title: "Replicating Gitea Docker SSH Passthrough on k8s" +date: "2023-02-12" +--- + diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..77480a4 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module git.namesny.com/Mathis/namesny.com + +go 1.20 + +require github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212174009-2c8d4fffb860 // indirect diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..afd3420 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212174009-2c8d4fffb860 h1:LzjrUKFEafD+4VBGyQjWnbYdmv/gb0LV8zBNZ/2IdmM= +github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212174009-2c8d4fffb860/go.mod h1:0tCPxAeg5+tWhv17517Q8Lti/TPh0KNyON/uferEU30= From 24545acb1afddb663e7549ef524f974d22221d40 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sun, 12 Feb 2023 21:28:53 +0100 Subject: [PATCH 02/18] Add favicon --- static/favicon-16x16.png | Bin 0 -> 433 bytes static/favicon-32x32.png | Bin 0 -> 887 bytes static/favicon.ico | Bin 0 -> 15406 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 static/favicon-16x16.png create mode 100644 static/favicon-32x32.png create mode 100644 static/favicon.ico diff --git a/static/favicon-16x16.png b/static/favicon-16x16.png new file mode 100644 index 0000000000000000000000000000000000000000..67e0d01cb1c4ec471cfcbe6437a896576b360736 GIT binary patch literal 433 zcmV;i0Z#sjP)1 zM5h!l^53We{vBD1{IRWl#zsj4VYO0fp9&w~tQ< zwj>B;xR6WO^E`l1hGg~?`@TmI$}qE$fXSY21p4(sxTOM|VjjIyKDf>cI0`+1P=-MK z1)gXT3a!62pfW_TeS8nM^bCz93X?sJ(^wINGDva>)7CgvcIDQttQw~P#K!6@&7KdlTWOLSF;ND b+jsr~&ox}kC88b*00000NkvXXu0mjf%wo7; literal 0 HcmV?d00001 diff --git a/static/favicon-32x32.png b/static/favicon-32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..d7ac5cc08d32c920558d76ee9b93445f57667fd1 GIT binary patch literal 887 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 N3E17q&4JNy;D60P7YYCX literal 0 HcmV?d00001 From 6ae7e75913edadcbae087e795b98b1509a39e1b0 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sun, 12 Feb 2023 21:29:03 +0100 Subject: [PATCH 03/18] Add gitignore --- .gitignore | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7b62a71 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +# Generated files by hugo +/public/ +/resources/_gen/ +/assets/jsconfig.json +hugo_stats.json + +# Executable may be added to repository +hugo.exe +hugo.darwin +hugo.linux + +# Temporary lock file while building +/.hugo_build.lock \ No newline at end of file From e0c56dc6c0e5e68be975120156bca419266c767b Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sun, 12 Feb 2023 21:29:19 +0100 Subject: [PATCH 04/18] Add gitea blog post --- content/blog/_index.md | 3 +++ content/blog/gitea.md | 48 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 content/blog/_index.md diff --git a/content/blog/_index.md b/content/blog/_index.md new file mode 100644 index 0000000..ee163da --- /dev/null +++ b/content/blog/_index.md @@ -0,0 +1,3 @@ +--- +title: "Blog" +--- \ No newline at end of file diff --git a/content/blog/gitea.md b/content/blog/gitea.md index 1627ac1..bd70359 100644 --- a/content/blog/gitea.md +++ b/content/blog/gitea.md @@ -3,3 +3,51 @@ title: "Replicating Gitea Docker SSH Passthrough on k8s" date: "2023-02-12" --- +If you are selfhosting Gitea on a single node Kubernetes cluster and want to enable git through SSH while keeping SSH connection to the cluster, this guide is for you. + + + +## Background + +I am currently in the process of migrating my selfhosted applications from docker-compose to Kubernetes. One of my most used selfhosted app is Gitea. I use it to host my projects, dotfiles and config files where I don't expect any contributions or I simply want to keep it more private. In my docker-compose setup I used SSH Container Passthrough from [Gitea docs](https://docs.gitea.io/en-us/install-with-docker/#SSH-container-passthrough) but when I moved Gitea to k8s I couldn't find any guides on how to achieve the same thing. + +I installed Gitea using the official [Helm Chart](https://gitea.com/gitea/helm-chart/). The documentation says this about enabling SSH: + +> If you're using ingress and want to use SSH, keep in mind, that ingress is not able to forward SSH Ports. You will need a LoadBalancer like metallb and a setting in your SSH service annotations. + +However using this method will route all incoming SSH connections to the Gitea container, essentialy disabling SSH connection to the host. Therefore we need a way to pass SSH connections to user `git` to our Gite container running on Kubernetes and at the same time allow SSH connections to host for some other user(s) + +## Kubernetes Setup + +Create user git on your host and deploy Gitea to Kubernetes (e.g. using Helm). You don't need to expose port 22 using a service. + +First we are going to create a new login shell for user git. Create file `/usr/local/bin/gitea-shell` with content: + +{{< highlight bash >}} +#!/bin/sh +/usr/local/bin/kubectl exec -i -n gitea gitea-0 -c gitea -- env SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" /bin/sh "$@" +{{< / highlight >}} + +Your namespace might be different. + +Then run as root (or sudo): + +{{< highlight bash >}} +chmod +x /usr/local/bin/gitea-shell +usermod -s /usr/local/bin/gitea-shell git +{{< / highlight >}} + +Now everytime the user git logs in (i.e. using git via SSH) `/usr/local/bin/gitea-shell` gets executed which means our original SSH command will be executed in the gitea container. + +Finally we need to make sure that the SSH keys we add through Gitea interface allow us to 'login' as git user. + +Edit `/etc/SSH/SSHd_config` and add the following: + +{{< highlight yaml>}} +Match User git + AuthorizedKeysCommandUser git + AuthorizedKeysCommand /usr/local/bin/kubectl exec -i -n gitea gitea-0 -c gitea -- /usr/local/bin/gitea keys -e git -u %u -t %t -k %k +{{< / highlight >}} + +If you are using AllowUsers directive don't forget to add user git + From b77d343666e976fdafd4150e4c7bf812df5f1114 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sun, 12 Feb 2023 22:11:45 +0100 Subject: [PATCH 05/18] Update theme version --- go.mod | 2 +- go.sum | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 77480a4..5ba836b 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module git.namesny.com/Mathis/namesny.com go 1.20 -require github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212174009-2c8d4fffb860 // indirect +require github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212210243-f116fbf0bdbb // indirect diff --git a/go.sum b/go.sum index afd3420..21fbf8d 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,10 @@ github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212174009-2c8d4fffb860 h1:LzjrUKFEafD+4VBGyQjWnbYdmv/gb0LV8zBNZ/2IdmM= github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212174009-2c8d4fffb860/go.mod h1:0tCPxAeg5+tWhv17517Q8Lti/TPh0KNyON/uferEU30= +github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212203236-33a433d39da2 h1:V0YxXl3C4m+HAq91sIWNM0l0bLue+odmTyGHfS7Pr3o= +github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212203236-33a433d39da2/go.mod h1:0tCPxAeg5+tWhv17517Q8Lti/TPh0KNyON/uferEU30= +github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212204253-1e85425cf392 h1:gd0vKElnhMYEG59orrfvE0lYMmGTFEX1PLffq+HQMPs= +github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212204253-1e85425cf392/go.mod h1:0tCPxAeg5+tWhv17517Q8Lti/TPh0KNyON/uferEU30= +github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212204928-b35551481065 h1:tX2USsiNgLwvaU6xpxtf1T5YJUAPHbl3mqM5gHFdGxg= +github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212204928-b35551481065/go.mod h1:0tCPxAeg5+tWhv17517Q8Lti/TPh0KNyON/uferEU30= +github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212210243-f116fbf0bdbb h1:31cDOpojmeNh9kpnwdPSe+Umzc1UaMc9vFM5N/7e5Yc= +github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212210243-f116fbf0bdbb/go.mod h1:0tCPxAeg5+tWhv17517Q8Lti/TPh0KNyON/uferEU30= From ec42485c6f6be546511af3757517ef580583e6d7 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Mon, 13 Feb 2023 20:05:21 +0100 Subject: [PATCH 06/18] Add Dockerfile --- Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5d409bd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:1.20 as build + +WORKDIR /app + +RUN go install -tags extended github.com/gohugoio/hugo@latest +COPY . /app + +RUN hugo mod get -u && \ + hugo + +FROM nginx:stable-alpine + +COPY --from=build /app/public /usr/share/nginx/html/ \ No newline at end of file From fd32c6e9358369edf47b05569b1942984d69bead Mon Sep 17 00:00:00 2001 From: LordMathis Date: Mon, 13 Feb 2023 22:11:23 +0100 Subject: [PATCH 07/18] Add testing section to gitea --- content/blog/gitea.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/content/blog/gitea.md b/content/blog/gitea.md index bd70359..21246e0 100644 --- a/content/blog/gitea.md +++ b/content/blog/gitea.md @@ -1,5 +1,5 @@ --- -title: "Replicating Gitea Docker SSH Passthrough on k8s" +title: "Replicating Gitea Docker SSH Passthrough on K8s" date: "2023-02-12" --- @@ -49,5 +49,21 @@ Match User git AuthorizedKeysCommand /usr/local/bin/kubectl exec -i -n gitea gitea-0 -c gitea -- /usr/local/bin/gitea keys -e git -u %u -t %t -k %k {{< / highlight >}} -If you are using AllowUsers directive don't forget to add user git +If you are using `AllowUsers` directive don't forget to add user git +## Testing + +Open Gitea in web browser and add you SSH key. Then try to SSH into the Gitea container. + +{{< highlight bash >}} +ssh git@ +{{< / highlight >}} + +You should get a message like this: + +> PTY allocation request failed on channel 0 +> Hi there, test! You've successfully authenticated with the key named , but Gitea does not provide shell access. +> If this is unexpected, please log in with password and setup Gitea under another user. +> Connection to closed. + +Now you can create a repo and you should be able to clone and push via SSH. From b4ca1d0b6a93c53f7b5efd4408a40ba3546883e0 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Mon, 13 Feb 2023 22:11:40 +0100 Subject: [PATCH 08/18] Update about me --- content/about.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/content/about.md b/content/about.md index d0ca64b..5d1e274 100644 --- a/content/about.md +++ b/content/about.md @@ -1,5 +1,13 @@ -I am a Software Engineer based in Darmstadt, Germany. +--- +title: 'About Me' +--- -I am interested in broad range of topics including Machine Learning, Cloud, DevOps, Linux and open source. +Hello there. -This is a place for me to write and to showcase my projects. \ No newline at end of file +I am a Software Engineer based in Darmstadt, Germany. I focus on MLOps bridging the gap between Data Science, DevOps and Software Development. I am interested in broad range of topics including Machine Learning, Cloud, DevOps, Linux and open source. + +After graduating in Artificial Inteligence and Natural Language Processing I joined Konica Minolta in Brno, Czechia, where I worked as an R&D Engineer developing a Python application that provides a unified approach for production ML model deployment. I was also deploying ML applications and MLOps tools to the cloud with Docker and Kubernetes which sparked my interest in DevOps and Cloud. + +Currently I work at Telespazio as Software Engineer. I am developing a Kubeflow based Machine Learning Platform for Spacecraft Operational datasets. The platform is supposed to allow varius universities and researches to use the data to train ML models while keeping the data safe inside the platform which brings an interesting set of challenges. + +In my free time I selfhost a bunch of usefull applications such as Gitea or Nextcloud (and this website). I am currently moving my selfhosted stack from `docker-compose` to `k3s` From 3f97bde5e3a7307585e467a2ed7f5cc3157f75ff Mon Sep 17 00:00:00 2001 From: LordMathis Date: Thu, 27 Jul 2023 22:29:05 +0200 Subject: [PATCH 09/18] Add mastodon link --- config.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config.toml b/config.toml index f627343..7dd9fe1 100644 --- a/config.toml +++ b/config.toml @@ -37,5 +37,11 @@ url = "https://www.linkedin.com/in/matus-namesny/" [[params.social]] key = 3 +name = "mastodon" +url = "https://toot.io/@mathis" +rel = "me" + +[[params.social]] +key = 4 name = "email" url = "mailto:matus@namesny.com" From 81a93304ca6336cf4f365e650733ea54ef289da4 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Thu, 27 Jul 2023 22:29:16 +0200 Subject: [PATCH 10/18] Update about.md --- content/about.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/about.md b/content/about.md index 5d1e274..a2d8d7c 100644 --- a/content/about.md +++ b/content/about.md @@ -1,5 +1,6 @@ --- title: 'About Me' +showMetadata: false --- Hello there. @@ -10,4 +11,4 @@ After graduating in Artificial Inteligence and Natural Language Processing I joi Currently I work at Telespazio as Software Engineer. I am developing a Kubeflow based Machine Learning Platform for Spacecraft Operational datasets. The platform is supposed to allow varius universities and researches to use the data to train ML models while keeping the data safe inside the platform which brings an interesting set of challenges. -In my free time I selfhost a bunch of usefull applications such as Gitea or Nextcloud (and this website). I am currently moving my selfhosted stack from `docker-compose` to `k3s` +In my free time I selfhost a bunch of usefull applications such as Gitea or Nextcloud (and this website). I am learning Go and working on [GitEcho](https://github.com/LordMathis/GitEcho) From d788ddfcb25fb98243a06a566949d7fc4eeaf5e8 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Thu, 27 Jul 2023 22:29:30 +0200 Subject: [PATCH 11/18] Run go mod tidy --- go.sum | 8 -------- 1 file changed, 8 deletions(-) diff --git a/go.sum b/go.sum index 21fbf8d..e4d21ee 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,2 @@ -github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212174009-2c8d4fffb860 h1:LzjrUKFEafD+4VBGyQjWnbYdmv/gb0LV8zBNZ/2IdmM= -github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212174009-2c8d4fffb860/go.mod h1:0tCPxAeg5+tWhv17517Q8Lti/TPh0KNyON/uferEU30= -github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212203236-33a433d39da2 h1:V0YxXl3C4m+HAq91sIWNM0l0bLue+odmTyGHfS7Pr3o= -github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212203236-33a433d39da2/go.mod h1:0tCPxAeg5+tWhv17517Q8Lti/TPh0KNyON/uferEU30= -github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212204253-1e85425cf392 h1:gd0vKElnhMYEG59orrfvE0lYMmGTFEX1PLffq+HQMPs= -github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212204253-1e85425cf392/go.mod h1:0tCPxAeg5+tWhv17517Q8Lti/TPh0KNyON/uferEU30= -github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212204928-b35551481065 h1:tX2USsiNgLwvaU6xpxtf1T5YJUAPHbl3mqM5gHFdGxg= -github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212204928-b35551481065/go.mod h1:0tCPxAeg5+tWhv17517Q8Lti/TPh0KNyON/uferEU30= github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212210243-f116fbf0bdbb h1:31cDOpojmeNh9kpnwdPSe+Umzc1UaMc9vFM5N/7e5Yc= github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212210243-f116fbf0bdbb/go.mod h1:0tCPxAeg5+tWhv17517Q8Lti/TPh0KNyON/uferEU30= From 78fa6b708f3ab43ec08f0b4af781d50bdf51fa58 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sun, 13 Aug 2023 14:06:58 +0200 Subject: [PATCH 12/18] Update theme dependency --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 5ba836b..8045fd3 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module git.namesny.com/Mathis/namesny.com go 1.20 -require github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212210243-f116fbf0bdbb // indirect +require github.com/LordMathis/hugo-theme-nightfall v0.5.1 // indirect diff --git a/go.sum b/go.sum index e4d21ee..cb636c1 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,4 @@ github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212210243-f116fbf0bdbb h1:31cDOpojmeNh9kpnwdPSe+Umzc1UaMc9vFM5N/7e5Yc= github.com/LordMathis/hugo-theme-nightfall v0.0.0-20230212210243-f116fbf0bdbb/go.mod h1:0tCPxAeg5+tWhv17517Q8Lti/TPh0KNyON/uferEU30= +github.com/LordMathis/hugo-theme-nightfall v0.5.1 h1:xeycc74MTnikZ7tv+V8Lhuu9zrqRpVkaNjqw9eQYVNc= +github.com/LordMathis/hugo-theme-nightfall v0.5.1/go.mod h1:0tCPxAeg5+tWhv17517Q8Lti/TPh0KNyON/uferEU30= From a6f9c744bc9686752fddffdd2e014794cb866af1 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sun, 13 Aug 2023 17:20:57 +0200 Subject: [PATCH 13/18] Add back to hugo post --- content/blog/back_to_hugo.md | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 content/blog/back_to_hugo.md diff --git a/content/blog/back_to_hugo.md b/content/blog/back_to_hugo.md new file mode 100644 index 0000000..f19606f --- /dev/null +++ b/content/blog/back_to_hugo.md @@ -0,0 +1,47 @@ +--- +title: "Back to Hugo" +date: "2023-08-13" +tags: + - gatsby + - hugo +--- + +Over the years, this website was running on WordPress, Hugo, a custom React SPA, server-side rendered React, Gatsby, and now I'm back to Hugo. + + + +## First Hugo Website + +I created my first Hugo website in 2016 while still in University studying Computer Science. I started looking for internships and thought that having a personal website would enhance my appeal. I created the [Nix theme](https://github.com/LordMathis/hugo-theme-nix), a minimalistic theme inspired by Unix and the terminal. Looking back at the code, it's actually not that bad considering I had zero experience with web development. But I think it speaks more about the simplicity of Hugo and Bootstrap rather than my skills. + +If I were to rewrite this theme from scratch, I would implement many things differently. However, many people use the theme, so I continue to maintain it. + +## Here Comes React + +Hugo was working perfectly fine for my needs, but for some reason, I wanted something more. Since I was already learning React and Node.js, I decided to build my website using React. Initially, I started building the website as a standard React app. I created all the components that I thought I might need, and the website quickly grew. + +Then I learned about universal (isomorphic) rendering and decided to give it a try. This part of development took me the longest. My challenge with implementing universal rendering was a distinct lack of up-to-date tutorials. They all used outdated versions of Webpack or React Router, or didn't utilize React Router at all. Another issue was that some tutorials were using babel-node in production, which is not recommended. + +After finally implementing universal rendering, the next issue to solve was how to deliver content. A simpler approach would be to create a new React component for each blog post and "hard code" the content. However, that's not very React-like. Instead, I implemented a simple API in Express. + +There are many more aspects that I didn't mention, things I spent hours working on, only to change my mind after implementation. An honorable mention goes to the CSS and the overall style of the website, which underwent several changes. I also reinvented the wheel multiple times, opting to build features from scratch rather than using existing modules. + +So now, I had a new website that was much more complex but had fewer features than my initial Hugo website. + +## The Great Gatsby + +My React-based website wasn't fully server-side rendered. The only server-rendered element was the page layout, while the content was served via an API and rendered on the client side. Thus, I found myself running a Node.js app at all times for a relatively simple website with minimal visitors and content. Instead of embarking on creating my own server-side renderer, I got sidetracked by a captivating newcomer: Gatsby. + +Migrating to Gatsby wasn't overly challenging since I already had all my styles and components ready. I just needed to grasp how to write GraphQL queries to fetch content and assemble a set of Gatsby plugins for website building. The initial implementation of the Gatsby website was enjoyable, but ongoing maintenance proved to be a hassle. + +## Move Fast and Break Things + +The JavaScript landscape evolves at breakneck speed. Libraries that emerged yesterday risk deprecation tomorrow. Not to mention the ceaseless discovery of vulnerabilities every day. To mitigate this, I established dependabot security alerts for my website's GitHub repository. At one point, dependabot became the primary contributor. + +While the detected vulnerabilities didn't directly threaten my server, as the website generated static HTML files and was served by nginx, a chain of vulnerabilities encompassing Gatsby, nginx, and Docker would be necessary for a genuine threat. Nevertheless, uncertainty lingered. + +In the end, I opted to return to Hugo. You can still explore the archived React/Gatsby source code [here](https://git.namesny.com/Mathis/namesny-com-gatsby-archive). + +## Full Circle + +Instead of revisiting my old Nix theme, I chose to create a new theme: [Nightfall](https://github.com/LordMathis/hugo-theme-nightfall), based on the layout of my Gatsby website. Migrating to Hugo was relatively straightforward, thanks to React components. I only needed to replace JSX tags with appropriate HTML tags and integrate Hugo partials. I welcome all contributions to both the Nix and Nightfall themes. From fcfcf6b3882a3ea687fba0fef7acd810d3bb74a4 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sun, 13 Aug 2023 17:39:49 +0200 Subject: [PATCH 14/18] Add resume --- Dockerfile | 3 ++- content/about.md | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5d409bd..6843daa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,4 +10,5 @@ RUN hugo mod get -u && \ FROM nginx:stable-alpine -COPY --from=build /app/public /usr/share/nginx/html/ \ No newline at end of file +COPY --from=build /app/public /usr/share/nginx/html/ +RUN wget https://github.com/LordMathis/resume/releases/download/2023-08-08/resume.pdf -O /usr/share/nginx/html/namesny_matus_resume.pdf \ No newline at end of file diff --git a/content/about.md b/content/about.md index a2d8d7c..cadc5e3 100644 --- a/content/about.md +++ b/content/about.md @@ -11,4 +11,6 @@ After graduating in Artificial Inteligence and Natural Language Processing I joi Currently I work at Telespazio as Software Engineer. I am developing a Kubeflow based Machine Learning Platform for Spacecraft Operational datasets. The platform is supposed to allow varius universities and researches to use the data to train ML models while keeping the data safe inside the platform which brings an interesting set of challenges. -In my free time I selfhost a bunch of usefull applications such as Gitea or Nextcloud (and this website). I am learning Go and working on [GitEcho](https://github.com/LordMathis/GitEcho) +I am usually open to discuss MLOps and ML Engineer opportunities. Here's my [resume](/namesny_matus_resume.pdf). + +In my free time I selfhost a bunch of usefull applications such as Gitea or Nextcloud (and this website). I am learning Go and working on [GitEcho](https://github.com/LordMathis/GitEcho). From b3342d575a9cba7e847d4e306aa8110c1fa8a6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=BA=C5=A1=20N=C3=A1me=C5=A1n=C3=BD?= Date: Fri, 18 Aug 2023 13:40:55 +0000 Subject: [PATCH 15/18] Update content/about.md --- content/about.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/about.md b/content/about.md index cadc5e3..ce6fcd7 100644 --- a/content/about.md +++ b/content/about.md @@ -5,7 +5,7 @@ showMetadata: false Hello there. -I am a Software Engineer based in Darmstadt, Germany. I focus on MLOps bridging the gap between Data Science, DevOps and Software Development. I am interested in broad range of topics including Machine Learning, Cloud, DevOps, Linux and open source. +I am Matúš [ˈmatuːʃ] a Software Engineer based in Darmstadt, Germany. I focus on MLOps bridging the gap between Data Science, DevOps and Software Engineering. I am interested in broad range of topics including Machine Learning, Cloud, DevOps, Linux and open source. After graduating in Artificial Inteligence and Natural Language Processing I joined Konica Minolta in Brno, Czechia, where I worked as an R&D Engineer developing a Python application that provides a unified approach for production ML model deployment. I was also deploying ML applications and MLOps tools to the cloud with Docker and Kubernetes which sparked my interest in DevOps and Cloud. @@ -13,4 +13,4 @@ Currently I work at Telespazio as Software Engineer. I am developing a Kubeflow I am usually open to discuss MLOps and ML Engineer opportunities. Here's my [resume](/namesny_matus_resume.pdf). -In my free time I selfhost a bunch of usefull applications such as Gitea or Nextcloud (and this website). I am learning Go and working on [GitEcho](https://github.com/LordMathis/GitEcho). +In my free time I selfhost a bunch of usefull applications such as Gitea, Nextcloud and this website. I am learning Go and working on [GitEcho](https://github.com/LordMathis/GitEcho). From f3d80f5e988f4e37d72c502dc33116dedc61c3e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=BA=C5=A1=20N=C3=A1me=C5=A1n=C3=BD?= Date: Fri, 18 Aug 2023 19:46:52 +0000 Subject: [PATCH 16/18] Update resujme --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6843daa..435e42c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,4 +11,4 @@ RUN hugo mod get -u && \ FROM nginx:stable-alpine COPY --from=build /app/public /usr/share/nginx/html/ -RUN wget https://github.com/LordMathis/resume/releases/download/2023-08-08/resume.pdf -O /usr/share/nginx/html/namesny_matus_resume.pdf \ No newline at end of file +RUN wget https://github.com/LordMathis/resume/releases/download/2023-08-16/resume.pdf -O /usr/share/nginx/html/namesny_matus_resume.pdf \ No newline at end of file From 79d0e98b13cf9108fa3b2536c397abff5f38aa16 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Thu, 28 Sep 2023 21:48:00 +0200 Subject: [PATCH 17/18] Create resume gh action blog post --- content/blog/resume_github_actions.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 content/blog/resume_github_actions.md diff --git a/content/blog/resume_github_actions.md b/content/blog/resume_github_actions.md new file mode 100644 index 0000000..97c627f --- /dev/null +++ b/content/blog/resume_github_actions.md @@ -0,0 +1,10 @@ +--- +title: "Building my resume with GitHub Actions" +date: "2023-09-29" +draft: true +--- + +I have been using [Overleaf](https://www.overleaf.com/) to edit, update and built my resume. Overleaf is a cloud-based LaTeX editor with countless templates for resumes, theses, presentations, cover letters, scientific papers and more. I have used Overleaf's GitHub integration and GitHub Actions to build pdf from my LaTeX resume and release it on GitHub + + + From eca50e8e00ce7e66a406cfdd09632f90063f183d Mon Sep 17 00:00:00 2001 From: LordMathis Date: Mon, 2 Oct 2023 22:45:29 +0200 Subject: [PATCH 18/18] Finish gh resume article --- content/blog/resume_github_actions.md | 62 ++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/content/blog/resume_github_actions.md b/content/blog/resume_github_actions.md index 97c627f..f09d658 100644 --- a/content/blog/resume_github_actions.md +++ b/content/blog/resume_github_actions.md @@ -1,10 +1,62 @@ --- -title: "Building my resume with GitHub Actions" -date: "2023-09-29" -draft: true +title: "Building My Resume with GitHub Actions" +date: "2023-10-02" --- -I have been using [Overleaf](https://www.overleaf.com/) to edit, update and built my resume. Overleaf is a cloud-based LaTeX editor with countless templates for resumes, theses, presentations, cover letters, scientific papers and more. I have used Overleaf's GitHub integration and GitHub Actions to build pdf from my LaTeX resume and release it on GitHub +Even if you are not actively looking for a new job, it is a good idea to have an up to date resume. I'm using Overleaf's GitHub integration and GitHub Actions to build PDF from my LaTeX resume and release it on GitHub - + + +## LaTeX + +LaTeX is a typesetting system and document preparation tool known for its professional-quality typography and precise formatting capabilities. Widely used in academia, it's popular for creating resumes and academic documents due to its superior handling of complex formatting, mathematical equations, and citations. One of the benefits of using LaTeX is that it separates the content and formatting of a document, which makes it easier to focus on the content without worrying about the layout. + +TeXLive is a comprehensive distribution of the LaTeX typesetting system, providing a wide range of packages, fonts, and utilities for users. It includes everything needed to create LaTeX documents, making it a go-to choice for many LaTeX users. + +## Compiling PDF on Overleaf + +I have been using [Overleaf](https://www.overleaf.com/) to edit, update and build my resume. Overleaf is a cloud-based LaTeX editor with countless templates for resumes, theses, presentations, cover letters, scientific papers and more. Overleaf uses TeXLive distribution, enabling their compile servers to provide a real-time preview of the typeset PDFs. This makes editing LaTeX on Overleaf very convenient since it is not necessary to understand the intricacies of document processing. Overleaf handles the complexities of LaTeX compilation, allowing you to concentrate on creating a standout resume. However, replicating the same results outside of Overleaf's environment requires deeper knowledge of the compilation process. + +Overleaf uses [latexmk](https://ctan.org/pkg/latexmk?lang=en) package to automate the compilation. The package uses a system-wide configuration, which can be customized by a user-level configuration on a document-by-document basis. This customization might include adjusting the sequence of commands, specifying which files to include or exclude, defining custom dependencies, or setting up personalized error-handling procedures. You can access the `latexmk` configuration file used by Overleaf to typeset your document by compiling [this project](https://www.overleaf.com/learn/how-to/How_does_Overleaf_compile_my_project%3F#How_to_access_a_copy_of_Overleaf%E2%80%99s_LatexMk_file). + +Because the template of my resume is quite simple it was not necessary to get the exact `latexmk` config file or to customize it in any way. + +## Compiling and Releasing with GitHub Actions + +Leveraging the power of GitHub Actions has streamlined my document compilation and release process significantly. Within the GitHub Actions Marketplace, there's a wealth of workflows tailored for various tasks, including LaTeX compilation. I've opted for [xu-cheng/latex-action](https://github.com/xu-cheng/latex-action) which utilizes the TeXLive environment and `latexmk` compiler, mirroring the setup used on Overleaf. And indeed without any configuration changes, my resume compiled to PDF correctly. + +But automation doesn't stop there. To simplify the release procedure, I've incorporated [softprops/action-gh-release](https://github.com/softprops/action-gh-release). This action automates the creation of new tags, and releases, and even handles file attachments seamlessly. I've configured it to generate new releases marked with the current date, effortlessly adding the compiled `resume.pdf`. This automated process not only saves valuable time but also streamlines the release workflow, eliminating the need for manual login to Overleaf, recompilation, and downloading. It ensures that each new version of my resume is promptly available to the public. + +You can check the full repository [here](https://github.com/LordMathis/resume). Alternatively here's just the workflow file: + +```yaml +name: Release Compiled PDF +on: + push: + branches: + - master + +jobs: + build_latex: + runs-on: ubuntu-latest + steps: + + - name: Get current date + id: date + run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + + - name: Set up Git repository + uses: actions/checkout@v3 + + - name: Compile + uses: xu-cheng/latex-action@v2 + with: + root_file: resume.tex + + - name: Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ env.NOW }} + files: ./resume.pdf +``` \ No newline at end of file