25ed2f06e0
Catching Exception might hide unexpected exceptions, like those that might be raised due to future modification. Therefore, it is recommended to narrow the exceptions. The method send of the class Mailer catches Exception in line 57. MIMEText does not raise exceptions (if not using attachments). See https://docs.python.org/3/library/email.mime.html Most code is handled in an inner exception handling. In order to catch exception from SMTP_SSL I used SMTPException See https://docs.python.org/3/library/smtplib.html |
1 week ago | |
---|---|---|
.github/workflows | 2 months ago | |
dbmigration | 1 year ago | |
docker | 2 years ago | |
src/stacosys | 1 week ago | |
tests | 8 months ago | |
.gitignore | 3 months ago | |
.pylintrc | 1 year ago | |
Dockerfile | 2 years ago | |
LICENSE | 4 years ago | |
Makefile | 1 year ago | |
README.md | 12 months ago | |
config.ini | 2 years ago | |
pyproject.toml | 9 months ago | |
requirements-dev.lock | 3 months ago | |
requirements.lock | 3 months ago | |
stacosys.spec | 2 months ago |
README.md
Stacosys
Stacosys (aka STAtic blog COmment SYStem) is a fork of Pecosys trying to fix Pecosys design drawbacks and to provide a basic alternative to comment hosting services like Disqus. Stacosys works with any static blog or even a simple HTML page.
Features overview
Stacosys main feature is comment management.
Here is the workflow:
- Readers submit comments via a comment form embedded in blog pages
- Blog administrator receives an e-mail notification from Stacosys when a comment is submitted
- Blog administrator can approve or drop the comment through a simple web admin interface
- Stacosys stores approved comment in its database.
Privacy concerns: only surname, gravatar id and comment itself are stored in DB. E-mail is optionally requested in submission form to resolve gravatar id but never sent to Stacosys.
Stacosys is more or less localized (english and french).
Technically speaking, how does it work?
Stacosys offers a REST API to retrieve and post comments. Static blog is HTML-based and a piece of JavaScript code interacts with Stacosys using HTTP requests. Each page has a unique id and a request allows retrieving comments for a given page. Similarly, a form request allows to post a comment which is relayed to the administrator by e-mail. For this purpose an SMTP configuration is needed.
Little FAQ
How do you block spammers?
- Current comment form is basic: no captcha support but protected by a honeypot.
Which database is used?
- SQLite.
Which technologies are used?
Installation
Build and Dependency management relies on Rye but you can also use Docker image.
Build executable with pyinstaller
make build
Update dependencies and sync virtual env
rye lock --update-all
rye sync
Improvements
Stacosys fits my needs, and it manages comments on my blog for a while. I don't have any plan to make big changes, it's more a python playground for me. So I strongly encourage you to fork and enhance the project if you need additional features.