/commento

A privacy-focused and bloat-free Disqus alternative

Primary LanguageGoMIT LicenseMIT

An open source, privacy focused discussion platform.

⚠️ ⚠️ ⚠️   Note: All development has moved to GitLab.   ⚠️ ⚠️ ⚠️

You're currently viewing the deprecated v0 branch. Version 0.x will not receive new features any new features (except critical security patches). Version 1.x is the future with lots of new and shiny features (like moderation, voting). Please file new issues over there.

Commento is a discussion platform that you can self-host. You can embed it on your blog, news articles, and any place where you want your readers to add comments. Unlike most alternatives, Commento is lightweight and privacy focused; we'll never sell your data, show ads, embed third-party tracking scripts, or inject affiliate links.

Features

  • Privacy focused
  • Modern interface with a clean design
  • Automatic spam filtering
  • Review and approve or delete comments through the moderation interface
  • Lightweight (under 10 KB total), allowing for faster pageloads
  • Import from existing services
  • Completely free and open source (MIT license)

Editions

There are three editions of Commento:

  • Commento Community Edition (CE) is open source software that's freely available under the MIT Expat license.
  • Commento Enterprise Edition (EE) includes extra features geared towards organizations. If you're interested in this, contact me.
  • Commento Hosted is a service version of Commento if you want to embed Commento without running servers. This is currently in private beta and you can add yourself to the waiting list here.

Getting Started

If you're using version 1.x, you can find documentation here.

Below, you'll find documentation for 0.x.

Hosting the Backend

If you want to self-host Commento, you have three options:

Run Binary

Go makes deployment easy by producing a single binary. This is the recommended way, as it has the least amount of abstraction. Download the latest release for your operating system and architecture, extract, and run. For example, if I'm on linux-amd64, I would do:

$ tar xvf commento_0.2.1_linux_amd64.tar.gz
$ ./commento

This would expose the server on port 8080. Point your Commento frontend configuration to this.

Use Docker

You can also use Docker to host Commento. A minimal Docker image is provided: adtac/commento. You can get a container running by pulling the image and starting it to expose the server on port 8080:

$ docker pull adtac/commento
$ docker run -it -d -p 8080:8080 adtac/commento
Build from Source

Commento is written in Go. Build the binary from source and run the produced executable:

$ go build -i -v -o commento
$ ./commento

If you're building the project for the first time, go build might take a few seconds since Commento's dependencies need to be pulled and compiled as well. However, subsequent builds will be faster.

Frontend Integration

To embed Commento in your website, paste the following HTML snippet wherever you want Commento to load:

<div id="commento"></div>
<script defer
  src="http://server.com/assets/js/commento.min.js"
  data-div="#commento">
</script>

Commento will simply fill the container it is placed in. Remember to change server.com to your server.

Configuration

Configuring the Backend

Parameter Default Value Meaning
COMMENTO_PORT 8080 Default port on which the server will listen.
COMMENTO_DATABASE_FILE commento.sqlite3 Database file that Commento will use to store comments.
AKISMET_KEY Your Akismet key. Read our docs for more details on how to obtain one.

Commento uses environment variables to configure parameters. You can either use a .env file or give parameters through the command line. For example, a particular configuration can be achieved in three different ways:

$ cat .env
COMMENTO_PORT=9000
COMMENTO_DATABASE_FILE=/app/commento.db
AKISMET_KEY=abcdef012345
$ ./commento
$ COMMENTO_PORT=9000 COMMENTO_DATABASE_FILE=/app/commento.db AKISMET_KEY=abcdef012345 ./commento
$ export COMMENTO_PORT=9000
$ export COMMENTO_DATABASE_FILE=/app/commento.db
$ export AKISMET_KEY=abcdef012345
$ ./commento

Note that environment variables have precedence over .env values. If you're using Docker, you can pass environment variables too:

$ docker run adtac/commento -it -d -p 9000:9000 \
    -e COMMENTO_PORT=9000                       \
    -e COMMENTO_DATABASE_FILE=/app/commento.db  \
    -e AKISMET_KEY=abcdef012345

Purpose

If you run a blog, and you want your readers to converse, you'll probably install Disqus. After all, they're the biggest system, with 500 million unique visitors every month[1]. They have a free plan, too! They also have non-optional advertisement, third-party tracking, affiliate marketing, and link hijacking [2] [3] [4] [5]. Your readers will be mercilessly tracked, and you'll have no privacy whatsoever — even if you don't leave any comments. Thanks to the 90+ downloads Disqus will make, your website will be considerably slower.

Commento aims to solve this. Commento is free software that you can self-host for the cost of a cup of coffee. No third-party tracking scripts will be injected, there will be no affiliate marketing, no advertisements. Just comments.

While some open source solutions existed, I didn't find any attractive enough at the time Commento was created -- most were either they were discontinued or development was virtually non-existant. Free software is about, well, freedom, so I figured I'd write my own software.

Contributing

Commento is possible only because of its community. The project is still in beta and I'd be thankful for any contribution. Please go through the development guidelines before you start. If you're a newcomer, you want to go through our newcomer docs first. Pick up any issue and hack away!

If you have any questions, please ask in our #commento IRC channel on freenode.

Sponsors

Commento development is sponsored by Mozilla and DigitalOcean independently.

               

License

Copyright 2018 Adhityaa Chandrasekar

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.