— comment processor for static sites —
Commie is a small web application that processes comments (or other user-generated content) for static blogs generated using a tool like Pelican or Jekyll. It assumes the site lives in a git repository and is regenerated automatically on a push hook.
Commie was inspired by Staticman. The main idea is shared with Staticman,
- Helps you make user-generated content appear in your statically generated site.
- Keeps all the published content where it belongs: in your git repository.
- commie doesn't rely on GitHub, but uses plain old git, hosted wherever you want.
- commie doesn't send your or your users' data to any third-party services (no GitHub, no Akismet)
- commie loves email. As an anti-spam measure, commie can require email verification. Commie can also email you about any new comments. Email verification requirements are relaxed for repeat customers with the same name, email, browser and IP address.
- while commie is a service you have to run on an internet-accessible server (losing a benefit of a static site), it is not required to serve your site in and of itself. Commie does not require a database server or anything like that.
- Commie works great with the Pelican Comment System if you add a custom comment form!
Commie powers the comments sections at tjol.eu
- Python 3.7 (or newer)
- Flask and the other dependencies in
- An SMTP server that will accept its mail
- Git, and a target git repository which should have a
post-receivehook to rebuild your site.
- A server that can run WSGI apps with a new enough Python (like uWSGI)
Commie needs a configuration file called
commie.yaml in this directory. The
commie.yaml.example lists all the possible options with short
explanations that should be clear enough.
You can configure multiple sites (called “roots” by commie) in one commie
instance, each with its own block in
commie.yaml. The name of your site goes
right at the top; if you call your site the “People's front of Judea”, then
the first line of
commie.yaml should be
People's front of Judea:.
Comments are submitted by
POST as normal form data to
https://path/to/commie/submit. A comment submission form needs to supply the
root, the name of the site, a field
<form method="POST" action="/commie/submit"> <input type="hidden" name="root" value="People's front of Judea"> <input type="hidden" name="slug" value="an-ode-to-splitters"> <label for="email">Email address:</label> <input id="email" name="email"><br> <!-- ... --> </form>
Commie automatically starts a background process to do things like sending email,
pushing to git and cleaning up old files. To make sure this works, call
http://path/to/commie/ping. You can start this manually if you wish by running
FLASK_APP=commie flask commie-worker.