diff --git a/README.md b/README.md index 96e64f2..58e3c88 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ common name is the domain name ex 'localhost' Run server on local: ```shell -$ go run main.go -cert=./keys/cert.crt.pem -key=./keys/localhost_key.pem -host=localhost:8080 +$ ./dev.sh ``` Visit it: diff --git a/dev.sh b/dev.sh new file mode 100755 index 0000000..947d997 --- /dev/null +++ b/dev.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +go run main.go -cert=./keys/cert.crt.pem -key=./keys/localhost_key.pem -host=localhost:8080 diff --git a/main.go b/main.go index 857d8e0..e139a6b 100644 --- a/main.go +++ b/main.go @@ -19,10 +19,11 @@ func (h ExampleHandler) ServeGemini(w gemini.ResponseWriter, req *gemini.Request log.Printf("request: %s, user: %v", req.URL.Path, strings.Join(userName(req), " ")) switch req.URL.Path { case "/": - err := w.WriteStatusMsg(gemini.StatusSuccess, "text/gemini") - requireNoError(err) - _, err = w.WriteBody([]byte("Hello, world!")) - requireNoError(err) + gemini.ServeFileName("pages/home.gmi", "text/gemini")(w, req) + // err := w.WriteStatusMsg(gemini.StatusSuccess, "text/gemini") + // requireNoError(err) + // _, err = w.WriteBody([]byte("Hello, world!")) + // requireNoError(err) case "/user": if req.Certificate() == nil { w.WriteStatusMsg(gemini.StatusCertRequired, "Authentication Required") diff --git a/pages/home.gmi b/pages/home.gmi new file mode 100644 index 0000000..6a1a03e --- /dev/null +++ b/pages/home.gmi @@ -0,0 +1,50 @@ +# Travis Shears Personal Gemini Capsule + +```site logo + _____ _ _____ _ +|_ _| (_) / ___| | + | |_ __ __ ___ ___ ___ \ `--.| |__ ___ __ _ _ __ ___ + | | '__/ _` \ \ / / / __| `--. \ '_ \ / _ \/ _` | '__/ __| + | | | | (_| |\ V /| \__ \ /\__/ / | | | __/ (_| | | \__ \ + \_/_| \__,_| \_/ |_|___/ \____/|_| |_|\___|\__,_|_| |___/ +``` + +Hello, World! + +Welcome to my Gemini capsule. This capsule is in very early stages of development. Mostly a proof of concept at this point. I plan to add more features like a gemlog soon. Looking forward to writing and interacting with folks in gemspace. + +My personal website: +=> https://travisshears.com +So far I've joined the following communities here in gemspace: +=> gemini://station.martinrue.com/travisshears + +## Site updates + +== 26.09.2025 == + +Initial deployment +Took quite some tinkering to get everything working, but it's finally up and running! If you are reading this then I got the following architecture working: + +```arch diagram +┌───────┐ +│ User │ +└──┬────┘ + │ + │ +┌──▼───┐ +│ VPC │ +└──┬───┘ + │ + │ +┌──▼──────────────┐ +│ Nomad Homelab │ +└──┬──────────────┘ + │ + │ +┌──▼────────────────┐ +│Dockerized Go App │ +└───────────────────┘ +``` + +You can find the source code for this capsule here: +=> https://git.travisshears.com/travisshears/personal-gemini-capsule