Install via pip:
pip install -e git+https://github.com/qld-gov-au/ckanext-ytp-comments.git#egg=ckanext-ytp-comments
pip install -r requirements.txt
Initialize database tables:
cd /usr/lib/ckan/default/src/ckanext-ytp-comments
paster initdb -c /etc/ckan/default/development.ini
paster updatedb -c /etc/ckan/default/development.ini
paster init_notifications_db -c /etc/ckan/default/development.ini
Note: May need to run python setup.py develop
first for paster commands.
Enable the plugin:
ckan.plugins = ytp_comments
Configuration options:
Enable follow/mute functionality
ckan.comments.follow_mute_enabled = True
Custom blacklist words file (optional)
ckan.comments.bad_words_file = /path/to/blacklist_words.txt
Custom whitelist words file (optional)
ckan.comments.good_words_file = /path/to/whitelist_words.txt
Display comments on tab page instead of below dataset info
ckan.comments.show_comments_tab_page = True # Default: False
Profanity filtering:
- Uses profanityfilter Python module
- Built-in blacklist plus custom bad_words.txt
- Whitelist via good_words.txt to allow specific terms
- Comments with profanity are blocked
Local development (Docker):
pygmy up
ahoy build
ahoy up
Login: admin/password
Available ahoy commands:
- build, clean, cli, doctor, down, flush-redis
- info, install-site, lint, logs, pull, reset
- restart, start, stop, test-bdd, test-unit, up
Testing:
ahoy test-unit # Run unit tests
ahoy test-bdd # Run BDD tests with Behave
Environment variables:
- ALLOW_LINT_FAIL=1 to allow lint failures
- ALLOW_UNIT_FAIL=1 to allow unit test failures
- ALLOW_BDD_FAIL=1 to allow BDD test failures
Database:
Creates comment_notification_recipient table for user preferences.
Notifications:
- Opt-in system (must follow to receive)
- Authors/org admins always notified
- Email sent on new comments/replies