From fbfa88439cde77befa90b78f9b64a3a338cb56ad Mon Sep 17 00:00:00 2001 From: Rogier Lommers Date: Wed, 8 Jan 2025 16:54:21 +0100 Subject: [PATCH] Update resume, add KUBUS --- src/assets/index.html | 19 +++++++++++++------ src/main.go | 20 ++++++++++++++++++-- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/assets/index.html b/src/assets/index.html index a9df97f..218b4ea 100644 --- a/src/assets/index.html +++ b/src/assets/index.html @@ -562,7 +562,7 @@

Rogier
Lommers - Solution Architect / Tech Lead @ Alliander + Staff Engineer @ KUBUS

@@ -575,8 +575,8 @@

Profile

-

I am an experienced solution architect / tech lead working for Alliander. I develop and maintain backend systems +

I am an experienced staff engineer working for KUBUS. I develop and maintain backend systems with focus on high availability, performance, reliability and scalability. I have 17+ years of experience in working with multidiciplinairy teams on big projects.

@@ -587,9 +587,16 @@

Experience

-

Alliander: Solution Architect

- 2024 - now -

Working as a solution architect in the technical platform domain.

+

KUBUS: Staff Engineer

+ 2025 - now +

As a Staff Engineer at KUBUS, I drive + cross-team engineering initiatives to elevate the overall + technical excellence of our engineering department. I focus on identifying and leading efforts + that enhance engineering practices, promote scalability and better collaboration across teams. + By working closely with Lead Engineers and the Architect, I ensure that technical solutions and + processes align with long-term strategic goals. Additionally, I provide technical guidance + across teams, mentor Lead Engineers, and serve as a key contributor to the department's + technical roadmap.

diff --git a/src/main.go b/src/main.go index 9e80ce0..b12950a 100644 --- a/src/main.go +++ b/src/main.go @@ -3,6 +3,7 @@ package main import ( "net/http" "os" + "strings" "github.com/gorilla/mux" "github.com/sirupsen/logrus" @@ -11,16 +12,31 @@ import ( func main() { router := mux.NewRouter() router.Use(loggingMiddleware) - router.PathPrefix("/").Handler(http.FileServer(http.Dir("assets"))) + router.PathPrefix("/").Handler(http.StripPrefix("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if !isValidPath(r.URL.Path) { + http.NotFound(w, r) + return + } + http.FileServer(http.Dir("assets")).ServeHTTP(w, r) + }))) cwd, _ := os.Getwd() logrus.Infof("serving on http://localhost:8080, cwd: %s", cwd) if err := http.ListenAndServe(":8080", router); err != nil { - logrus.Fatal(err) + logrus.WithFields(logrus.Fields{ + "address": ":8080", + "router": router, + }).Fatal("Failed to start server: ", err) } } +func isValidPath(path string) bool { + // Add security checks to ensure the path is within the "assets" directory + // For example, you can check for ".." to prevent directory traversal attacks + return !strings.Contains(path, "..") +} + func loggingMiddleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {