This project is a simple, modular but extendable webserver to enable your website to join the IndieWeb.
IndieGo currently supports native comments, sending and receiving webmentions, IndieAuth as well as Micropub. All components are built in a modular way, they can be extended for your own needs or disabled by just commenting them out in the main method.
The API can be queried for comments and webmentions of all pages or just of a single page.
You can try out this project on my Blogpost about this project.
The easiest way to run the go-comment-api is via docker compose. There is a sample docker-compose.yml that I use to host the comments for my website. To see how I deploy it on my webserver see deploy.sh.
- TODO: document how to use the default config with env variables.
- TODO: document how to use a custom config file.
You need a recent go version installed. Run the following command to compile:
go mod download
CGO_ENABLED=0 go build -o comment-api -a .
This binary is self contained and only needs a config file to run. Run it with
./comment-api -config config.json
For an example config file see config.json.
go test ./...
# Up
goose -dir model/sqlite-migrations/ sqlite3 db/comments.sqlite up
# Down
goose -dir model/sqlite-migrations/ sqlite3 db/comments.sqlite down
npx ngrok http 8080
For testing IndieAuth:
NGROK_URL=https://<ngok-url> go run . -config config-local.json
- Expose app to web via ngrok
- Register with ngrok url
- Restart app with
APPERTURE_ID=xxx
npx webmention-testpinger --endpoint=http://localhost:8080/wm/webmentions --target https://tiim.ch/target -p 8081
npx webmention-testpinger --endpoint=http://localhost:8080/wm/webmentions --target http://localhost:5173/projects/lenex-split-sheet -p 8081
cd test-data/
python3 -m http.server
curl -i -d source=http://localhost:8000/html/webmention-rocks.html -d target=https://tiim.ch/blog/2022-07-12-first-go-project-commenting-api http://localhost:8080/wm/webmentions