
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/cmddownload 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/hashoverNote: 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/adminbut 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…
Problem with notification e-mail: figure out toget the sendmail configuration up and running…
2020-05-02, Upgrade to a newer version
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.
2026-05-30, PHP 8-4-FCGI Upgrade notes:
As my provider does not support aged PHP varsions any more, I was forced to update to PHP version 8-4-FCGI.
On GitHub HashOver does not seem to get a lot of support I was a bit in doubt if the upgrade will still work. Nevertheless, after downloading and merging the actual source together with existing configuration files (described above), it worked out well.
No problems detected and no PHP related “depricated” warning messages (or similar). So the only thing left for me is to figure out why send mail notification is not working…
I also tweaked the file …hashover/backend/classes/formui.php and removed some links down below the comment entry textbox.
// 26-05-30, hans: -disabled-
// // Create link back to HashOver homepage
// $homepage_link = new HTMLTag ('a', array (
// 'rel' => 'nofollow',
// 'href' => 'https://www.barkdull.org/software/hashover',
// 'class' => 'hashover-home-link',
// 'target' => '_blank',
// 'title' => $homepage_link_text,
// 'innerHTML' => $homepage_link_text
// ), false);
//
// // Add link back to HashOver homepage to end links wrapper element
// $end_links_wrapper->innerHTML ($homepage_link->asHTML () . ' ‒');
// 26-05-30, hans: -disabled-
// // Source Code hyperlink text
// $source_link_text = $this->locale->text['source-code'];
//
// // Create link to HashOver source code
// $source_link = new HTMLTag ('a', array (
// 'rel' => 'nofollow',
// 'href' => $this->setup->getBackendPath ('source-viewer.php'),
// 'class' => 'hashover-source-link',
// 'target' => '_blank',
// 'title' => $source_link_text,
// 'innerHTML' => $source_link_text
// ), false);
//
// // Add source code hyperlink to end links array
// $end_links[] = $source_link->asHTML ();
// if ($this->mode !== 'php') {
// // Create link to HashOver JavaScript source code
// $javascript_link = new HTMLTag ('a', array (
// 'rel' => 'nofollow',
// 'href' => $this->setup->getHttpPath ('comments.php'),
// 'class' => 'hashover-javascript-link',
// 'target' => '_blank',
// 'title' => 'JavaScript'
// ), false);
//
// // Add JavaScript code hyperlink text
// $javascript_link->innerHTML ('JavaScript');
//
// // Add JavaScript hyperlink to end links array
// $end_links[] = $javascript_link->asHTML ();
// }
Summary
Looks like, HashOver still get’s enough attention from the community so that the the software keeps alive and works well with the lates PHP release. Thats’s great!
Credits:
- Jacob Barkdull: barkdull.org
- GitHub: hashover-next
