Commento++ is a free, open source, fast & lightweight comments box that you can embed in your static website instead of Disqus.
- Markdown support
- Import from Disqus
- Voting
- Automated spam detection (Askimet integration)
- Moderation tools
- Sticky comments
- Thread locking
- OAuth login (Google, Github, Twitter) and single sign-on
- Hot-reloading of comments
- Email notifications.
Please (donate) if you find my work helpful (this will always remain free and open source)!
- ๐ฑโ๐ค Respects your privacy and no adverts
- ๐ Prettier comments box compared to other FOSS alternatives
- โก Orders of magnitude lighter and faster than alternatives
- ๐ One click to deploy your own instance to a free Heroku account in seconds
- ๐ You can self-host too for maximum control!
To start you just need to launch an instance. The button below will work for a free Heroku account:
Otherwise, most of the below is the same as documented at https://docs.commento.io
If you want to self-host, you will need a PostgreSQL server handy and then:
- Use this repo's Dockerfile if you're into that kind of thing
- Download the plug and play pre-compiled version from the releases
- To build yourself, you can clone this repo (you will require
nodejs
,yarn
,golang
installed) and runmake prod
and you will generate./build/prod/commento
To launch, you should configure the following environment variables below:
$ export COMMENTO_ORIGIN=http://commento.example.com:8080
$ export COMMENTO_PORT=8080
$ export COMMENTO_POSTGRES=postgres://username:[email protected]:5432/commento?sslmode=disable
$ export COMMENTO_CDN_PREFIX=$COMMENTO_ORIGIN
And then you can run the commento
binary.
Alternatively you can use the pre-build images from:
Instructions for configuring the docker image can be found here. Are you missing a version? Please contact @caroga here.
Once you have created an account in your commento instance, it should give you instructions on how to embed this into your site! It should be as simple as:
<script defer src="https://(server url)/js/commento.js"></script>
<div id="commento"></div>
Remember to either forward the websockets through to commento in your nginx config, e.g.:
location / {
proxy_pass http://commento;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
Or if you'd rather not do that, disable websockets in favour of HTTP polling by adding data-no-websockets="true"
to the commento <script> tag (or `data-no-livereload="true"`` to only load comments on page load, see below!)
You can add the following to commento's script tag:
data-css-override="http://server/styles.css"
- A URL to a CSS file with overriding styles. Defaults to no override and uses Commento's default theme.data-auto-init="false"
- Commento automatically initialises itself when the page is loaded. If you prefer to load Commento dynamically (for example, after the user clicks a button), you can disable this. You will be required to callwindow.commento.main()
when you want to load Commento. By default, this is true.data-id-root="notcommento"
- By default, Commento looks for a<div>
withid="commento"
. If you want to load Commento in a different element, you can set this attribute to the ID of that element.data-no-fonts="true"
- By default, Commento uses the Source Sans Pro font to present a good design out-of-the-box. If you'd like to disable this so that Commento never loads the font files, you can set this to true. By default, this is true.data-hide-deleted
- By default, deleted comments with undeleted replies are shown with a "[deleted]" tag. If you'd like to disable this, setting this to true will hide deleted comments even if there are legitimate replies underneath. Deleted comments without any undeleted comments underneath are hidden irrespective of the value of this function. By default, this is false.data-no-websockets="true"
- Disables websocket functionality in favour of HTTP polling to have the same live reload functionality in a situation where websockets aren't allowed (e.g. a reverse proxy)data-no-livereload="true"
- Disabled all hot reload functionality (this supercedes the above flag) - all comments are loaded once and only once on page load.
e.g. Usage example:
<script defer src="https://chat.mookerj.ee/js/commento.js" data-no-websockets="true"></script>
Original source is from @adtac at https://gitlab.com/commento/commento/ - this fork is largely a result of me getting carried away fixing a lot of bugs but the original maintainer seemingly disappearing!
(Inconclusive) list of changes from upstream:
- NEW FEATURE: Auto refreshing comments with WebSockets for push updates
- NEW FEATURE: Window title updates when there's new activity
- NEW FEATURE: Permalinks, and a subtle yellow highlight animation for new comments when they come in live
- NEW FEATURE: Smooth scrolling
- NEW FEATURE: Hide +/- if no children
- NEW FEATURE: Errors now slide down from the top rather than the ugly error system before
- NEW FEATURE: Guests can leave their name
- FIXED: Twitter profile photo bug
- FIXED: Duplicate comment bug on login
- FIXED: Add target="_blank" to all external links, while also adding "noopener" to prevent XSS
- FIXED: Allow anchor links onto same page
- NEW FEATURE: Comment moderation dashboard, to approve/delete comments across your entire domain from one place
- NEW FEATURE: MathJax support hook, will plug in to any MathJax library included on the same page commento is on
- NEW FEATURE: Press enter to log in after entering your password
- FIXED: Deleted comments not returned in array
I've sent in merge requests for a lot of the above but I don't know when they'll be accepted, so here's a ready to use version with all batteries included to help out fellow bloggers!