Motivation:

As an initial approach, the Disqus commenting platform was used on this site. Disqus is nicely integrated in Hugo and so getting this service up and running a static site is not a big deal.

(Hugo is a static site generator which allows you to create web sites completely independently of any web service and off-line on your local computer).

Although after a while of usage (and very little comment activity), I felt I need to replace Disqus for various reasons. Ideally a commenting system should be open source, easy to install, self-hosted and I also would like to use sqlite as database back-end.

After searching for quite a while in the web for such a candidate, I stumbled upon HashOver. (Hashover did not even claim to have support for sqlite but in the latest/newest release 2.0 there is!)

Hashover goodies:

  • free and open source PHP comment system, find more information here: http://tildehash.com/?page=hashover
  • self-hosted system which allows completely anonymous comments to be posted, the only required information is the comment itself.

HashOver - installation in brief:

The following is more or less a cheat sheet for me to remember the steps required to get HashOver installed.

  • To install an add-on software, I usually create a sub-domain with a dedicated directory.

    This allows me to organize the directory structure on the server as I want to. No need to create any re-directions on the web server, no need to mess around with apache’s .htaccess file.

To install HashOver on a sub-domain the following step are required so far:

  • create a sub-domain on the provider’s portal e.g. like

    	sub domain-name: cmd.my-domain-name.domain
    	directory:       /my-domain-name.domain/cmd
    
  • download the HashOver software from github and copy it with ftp (filezilla) onto the webserver

    the web server directory might look like:

    	/my-domain-name.domain/cmd/hashover
    
    Note: There is HashOver version 2 available already, so I opted for this new release.
  • once done, the following files need to be edited and configured as described in the documentation

    • /my-domain-name.domain/cmd/hashover/backend/classes/secrets.php
    • /my-domain-name.domain/cmd/hashover/backend/classes/sensitivesettings.php
    Please note:
    In the sensitivesettings.php the hostname of the sub-domain needs to be entered
    otherwise HashOver will throw an error such as: “hashover external use not allowed
  • once done, HashOver’s admin panel should be already fully functional, go to the url to test:

    cmd.my-domain-name.domain/hashover/admin

  • but wait - latest PHP version needs to be enabled on the provider’s site which for the moment is PHP 7.X.X stable.

Hugo site configurations:

To enable commands on each individual blog page is pretty straightforward:

  • head.html:

    Found out that since the latest version 2 this is not required/valid anymore:

    <!-- hashover -->
    <link href="http://cmd.my-domain-name.domain/hashover/comments.css"
    	  rel="stylesheet" type="text/css">
    
  • single.html

    To initialize the comments system, place the following code wherever it’s suitable.

    	<!-- page comments -->
    	{{ if not (in (.Site.BaseURL | string) "localhost") }}
    
    		<div id="hashover"></div>
    
    		<!-- load asynchronous -->
    		<script type="text/javascript">
    			(function() {
    				var s = document.createElement('script'),
    				t = document.getElementsByTagName('script')[0];
    				s.type = 'text/javascript'; s.async = true;
    				s.src = src="http://cmd.my-domain-name.domain/hashover/comments.php";
    				t.parentNode.insertBefore(s, t); })();
    		</script>
    
    	{{ else }}
    		<h2 style="color:Orange;"> Comments will appear here! </h2>
    	{{ end }}
    
    

At this stage the comments should be fully operational. O.k. not locally, while developing and editing the static site, but on the web-server after transfering the site onto the provider’s web-space.

Admin Panel:

The admin panel can be reached via the site’s address e.g. like:

http://cmd.my-domain-name.domain/admin/login

Known Problems:

  • If cookies are disabled, is is not possible any more to login as admin. So, for the moment, cookies must be enabled.

    Settings are managed by the following JSON file: /hashover/config/settings.json

  • Comments are not shown on outdated browsers and javascript must be enabled.

  • Need to figure out, how the gravatar works - I do not have a clue for the moment …

Solved Problems:

  • Problem with notification e-mail: figure out that the sendmail configuration option works fine!

Upgrade to a newer version (modified at: 2020-05-02)

The following cheat sheet is only valid for Hashover V2 for now and as long there is no major change in the hashover source:

  • download the latest/newest source from github

  • backup the actual environment

  • in the new file repository, the following files needs to be replaced/copied over from our actual repository

    • …hashover/backend/classes/secrets.php
    • …hashover/backend/classes/sensitivesettings.php
    • …hashover/config/settings.json
    • …hashover/comments/hashover.sqlite
  • rename / remove the actual repository on the web server’s share

  • copy the repository onto the web server as usual

  • in case, something went wrong, restore backup and try again.