leave me a message!
ssh guestbook.phthallo.com -p 2222
Guestbook1 is exactly what the name suggests - a guestbook for anyone who happens to stumble upon it. There are two parts to this: the SSH app where you can write a small message for me, and an API with a GET endpoint (/entries?limit=10) that returns the messages sent.
You can also customise the name attributed to your message by specifying a username when you SSH.
-
Make sure you have Go installed and configured.
-
Clone the repository
https://github.com/phthallo/guestbook && cd guestbook -
Generate a SSH key in the
guestbookdirectory. Skip the passphrase.ssh-keygen -t ed25519 -f id_ed25519 -
Install dependencies
go get -
Start development:
go main.go -
Build it into a handy little
guestbookexecutable and run it with./guestbook! The API will be accessible atlocalhost:{API_PORT}and the SSH server will listen on the specifiedSSH_PORT.go build
Generate the ed25519 key outside of the container to avoid it being recreated every time you rebuild it, which will cause scary looking REMOTE HOST IDENTIFICATION CHANGED errors for people who might be revisiting.
Then, use the provided docker-compose.yml.
docker compose up -d
| Variable | Explanation |
|---|---|
API_PORT |
Port to run the API on. |
SSH_PORT |
Port to listen on for SSH. |
GIN_MODE |
Set it to release in production. Set it to anything else for debug mode in development. |
DATABASE_URL |
URL of a Postgres database used for storing messages. |
TERM |
Set it to xterm-256color. For colours. |
Footnotes
-
i somehow made all of this without knowing that charmbracelet/wish was a thing. lol, lmao even. ↩