Sphinx Comments Deployment
August 3, 2018
I have setup Shinx documentation system for work. We used Read the Docs Sphinx Theme.
I decided to add publically available comments to the system. My major restriction is to limit amount of used technologies on the server to reduce chance of breaking the server with installation of new dependencies. It is largely a self-imposed restriction influenced by a set of particular circumstances at work.
We currently use IIS Server to run .NET Core micro services. So, a standalone web comments application in PHP or Python falls into an increased risk category even if those technologies might provide a superior self-hosted comments application. Thus, options are limitted to existing .NET Core technology or to any standalone executable type of application. GO language belongs to the later category and it is wide used than most people expect it to be.
I found mouthful to be a simple GO language based self-hosted alternative to Disqus.
Installation was simple:
- Download release executable from Github releases.
- Place executable on the server.
- Create configuration file.
- Run the application without command line arguments.
There is a small complication on windows that\’s typical for many GO language based web applications and services. GO application is not aware of Windows Services and thus on reboot the application will not be started as a daemon.
There are solutions that intergrate into IIS, but that required installation of specific IIS handler. In this particular case, our company decided to run application per IIS website. Each IIS website is running on its own port number (I am not promoting this method). Thus, GО language application running on its own port would not be an exception in this case.
From what I remember, there are a number of windows execuables that target wrapping a console application into a windows service. This time I have decided to try winsw project. It turns out this project is C# based and is written for .NET 2 and 4.
So, the final solution consisted of:
- winsw executable renamed to svc-mouthful.exe
- svc-mouthful.xml configuration file that points to mouthful executable
- mouthful data directory and configuration file
- mouthful files.
Renaming of the winsw allows us to wrap more than one execugtable into windows service.