author homepage
This commit is contained in:
parent
ce5a20c21c
commit
e1c14af9b7
4 changed files with 61 additions and 5 deletions
|
|
@ -60,7 +60,7 @@ common name is the domain name ex 'localhost'
|
||||||
|
|
||||||
Run server on local:
|
Run server on local:
|
||||||
```shell
|
```shell
|
||||||
$ go run main.go -cert=./keys/cert.crt.pem -key=./keys/localhost_key.pem -host=localhost:8080
|
$ ./dev.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Visit it:
|
Visit it:
|
||||||
|
|
|
||||||
5
dev.sh
Executable file
5
dev.sh
Executable file
|
|
@ -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
|
||||||
9
main.go
9
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), " "))
|
log.Printf("request: %s, user: %v", req.URL.Path, strings.Join(userName(req), " "))
|
||||||
switch req.URL.Path {
|
switch req.URL.Path {
|
||||||
case "/":
|
case "/":
|
||||||
err := w.WriteStatusMsg(gemini.StatusSuccess, "text/gemini")
|
gemini.ServeFileName("pages/home.gmi", "text/gemini")(w, req)
|
||||||
requireNoError(err)
|
// err := w.WriteStatusMsg(gemini.StatusSuccess, "text/gemini")
|
||||||
_, err = w.WriteBody([]byte("Hello, world!"))
|
// requireNoError(err)
|
||||||
requireNoError(err)
|
// _, err = w.WriteBody([]byte("Hello, world!"))
|
||||||
|
// requireNoError(err)
|
||||||
case "/user":
|
case "/user":
|
||||||
if req.Certificate() == nil {
|
if req.Certificate() == nil {
|
||||||
w.WriteStatusMsg(gemini.StatusCertRequired, "Authentication Required")
|
w.WriteStatusMsg(gemini.StatusCertRequired, "Authentication Required")
|
||||||
|
|
|
||||||
50
pages/home.gmi
Normal file
50
pages/home.gmi
Normal file
|
|
@ -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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue