Skip to main content
  1. Posts/

Comment function for static websites with Remark42

·390 words·2 mins· loading · loading · ·
English Docker Tipps Expert
Table of Contents

Static websites are incredibly fast - but the drawback is that you can’t use dynamic content like commenting of articles. But there is a solution for this issue: You could integrate external commenting services. One of them is Remark42 which can be self-hosted. This Article has some Tipps for setting up Remark42.

Introduction

Out there are many different possibilities to add commenting function to a static website. Many of them are some kind of a service hosted by a provider. Beside there great functionality you have to pay a monthly fee starting typically at $10.-/month.

For me this was not an option. Evenmore I wanted to have a self-hosted version. I came across Remark42 - it is a simple solution based on Go and provides the functionality I was looking for.

Installation

This article is not an installation manual; basically the project page has detailed instructions . I’m using the docker based install. I’m also using nginx as reverse proxy: nginx instructions .

Tipps

Even the installation manual has a bunch of information some things are not clear on the first sight.

Get Administrator

One point which was not clear for me was how you get the administrative view for your comments. But it is easy. You have just to do following steps:

  • Register yourself as comment writer (eg. by email)
  • After registration you are “logged in”
  • Click on your Username → a side window will open
  • There you will find the so called user id (<authentication provider>_<hash>)

ExampleAdminId.png
Registrated user ExampleAdmin and his user id when clicking on user name.

This user id you have to supply to your docker image of Remark42 and defines that this specific user is an admin of that instance.

You will supply this user id to the environment variable ADMIN_SHARED_ID. You could supply more than one user id to this environment variable.

Limit who can use your Remark42 instance

Most probably you would not want that everyone could use your instance. You just want to make sure that your websites are able to use your specific instance. For this purpose you have to define the environment variable ALLOWED_HOSTS. Important to know is that after setting only those hosts are able to use Remark42. Others will get an error like:

Allowed_Hosts_forbidden.png
You will get an error in the browser if host is not listed in ALLOWED_HOSTS.