Hamish Fleming

Vincit qui se vincit
Neovim Arch

This is my personal blog where I write small tutorials and notes worth sharing.


I use Arch btw

Self Hosted Comment Solution

Self Hosted Comment Solution

Commento

Commento

Commento is a fast, bloat-free commenting system written in Go, that you can host on your own server. It embeds directly into your pages, loads fast and is fully-customizable.

Features

  • Fast: Commento is fast. It can handle hundreds of comments per second on a single server.
  • Bloat-free: Commento aims to be feature-filled while keeping the UI clean and fast.
  • No tracking: Commento has no third-party integrations and does not track you or your users.
  • Open-source: Commento is completely open-source and licensed under the permissive MIT license.

Self-hosted

Commento is a fully open-source software that you can host yourself. You can run Commento on your own server and have complete control over your data. Commento is also available as a managed hosting service, with a generous free tier.

Why I choose Commento

I choose Commento because it is simple to use and it is self-hosted. It is also easy to integrate with my static site generator, Hugo. In addition, Commento is open source and free. I can host it on my own server and have complete control over my data.

How to integrate Commento with Hugo

  1. Create a Commento account and get your Commento site ID.
  2. Add the following code to the config.toml file in your Hugo site:
[params.commento]
  site_id = "<your-site-id>"
  1. Add the following code to the layouts/partials/comments.html file in your Hugo site:
{{ if .Site.Params.commento.site_id }}
  <div id="commento"></div>
  <script defer src="https://cdn.commento.io/js/commento.js"></script>
{{ end }}

Docker compose file

version: '3'

services:
  server:
    image: registry.gitlab.com/commento/commento
    environment:
      COMMENTO_ORIGIN: https://commento.hamish-fleming.com
      COMMENTO_PORT: 8080
      COMMENTO_POSTGRES: postgres://postgres:postgres@db:5432/commento?sslmode=disable
    labels:
      - traefik.enable=true
      - traefik.docker.network=traf-external
      - traefik.http.routers.commento.entrypoints=web
      - traefik.http.routers.commento.rule=Host(`commento.hamish-fleming.com`)
      - traefik.http.routers.commento.middlewares=middlewares-https-redirect@file
      - traefik.http.routers.commento-secure.entrypoints=websecure
      - traefik.http.routers.commento-secure.rule=Host(`commento.hamish-fleming.com`)
      - traefik.http.services.commento-secure.loadbalancer.server.port=8080
      - traefik.http.routers.commento-secure.tls.certresolver=myresolver
      - traefik.http.routers.commento-secure.tls=true
    depends_on:
      - db
    networks:
      - frontend
      - db_network
  db:
    image: postgres:13.4
    environment:
      POSTGRES_DB: commento
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    networks:
      - db_network
    volumes:
      - postgres_data_volume:/var/lib/postgresql/data

networks:
  db_network:
  frontend:
    external:
      name: traf-external

volumes:
  postgres_data_volume:

Conclusion

Commento is a fast, bloat-free commenting system written in Go, that you can host on your own server. It embeds directly into your pages, loads fast and is fully-customizable.

Recent Articles

Hashicorp Vault for Bulletproof Security

Just a quick writeup on Hashicorp Vault, what it is, and how it can be used to secure your infrastructure. Hopefully by writing this I can retain some of the information I’ve learned about Vault instead of ending up on their documentation every ……

DockerDocker-ComposeHashicorp Vault Continue Reading
More Like this

Create Your Own Certificate Authority for Traefik SSL using Step CA

Introduction In this post, I will show you how to create your own Certificate Authority (CA) for Traefik SSL. This is a very tool to have, as it will allow you to easily create SSL certificates for your home lab or development environment. This post ……

TraefikHome LabSSLStep CA Read More

Comments....