Schnack is a simple Disqus-like drop-in commenting system written in JavaScript.
- Documentation
- Say hello to Schnack.js
- Follow @schnackjs on Twitter
Features:
- Tiny! It takes only ~8 KB!!! to embed Schnack.
- Open source and self-hosted.
- Ad-free and Tracking-free. Schnack will not disturb your users.
- It's simpy to moderate, with a minimal and slick UI to allow/reject comments or trust/block users.
- webpush protocol to notify the site owner about new comments awaiting for moderation.
- Third party providers for authentication like Github, Twitter, Google and Facebook. Users are not required to register a new account on your system and you don't need to manage a user management system.
This is the fastest way to setup schnack.
Requirements:
- Node.js (>= v6)
- npm (>= v5)
Clone or download schnack:
git clone https://github.com/schn4ck/schnackGo to the schnack directory:
cd schnackInstall dependencies:
npm installCopy and edit the config file according to configuration section:
cp config.tpl.json config.json
vim config.json # or open with any editor of your choiceRun the server:
npm startEmbed in your HTML page:
<div class="comments-go-here"></div>
<script src="https://comments.example.com/embed.js"
data-schnack-slug="post-slug"
data-schnack-target=".comments-go-here">
</script>or initialize schnack programmatically:
<div class="comments-go-here"></div>
<script src="http://comments.example.com/client.js"></script>
<script>
new Schnack({
target: '.comments-go-here',
slug: 'post-slug',
host: 'http://comments.example.com'
});
</script>You will find further information on the schnack page.
Notify Providers:
- pushover
- webpush
- slack
- rss
- sendmail
- Jira Cloud
The Jira notifier adds a task to the backlog of your nominated project. This allows your team to assign a workflow to the moderation / approval process.
1: Setup the Application in Jira
- Log into Jira using a privileged account, then visit Atlassian Account API Token Manager
- Click Create API Token and enter a label
- When the Your new API token modal is shown, click the Copy to clipboard button
- Using your favourite Base64 Encoding tool, create the Base64 encoded string
my-email@example.com:my-copied-atlassian-token - Copy the resulting string to the
notify.jira.basic_auth.base64property
2: Assign a board to receive notifications
- Collect a list of the boards available by running
npm run jira-boards - Find the board you'd like to push notifications to, and note the
projectKey - Add the
projectKeyto thenotify.jira.project_key
3: Test
- Send a test task to the board, by running
npm run jira-test
Authentication Providers:
- GitHub
- Google Accounts
- Mastodon
- AWS Cognito
Set up a user pool
- Log in to your Amazon AWS Account, and find the Cognito service
- Sign up for Cognito if you have not already
- Click Manage User Pools
- Click Create a user pool
- Create a pool name (can be anything you like)
- Click Step Through Settings and follow the wizard to set up the new user pool
Set up an authentication app
- From the main screen / control panel for your new user pool, click App Integration=> App client settings
- Check Enabled Identity Providers => Select All (making sure Cognito User Pool is also checked)
- Enter your Sign-in URL (
http://mydomain/auth/cognito/callback) - Check OAuth 2.0 => Authorization code grant
- Check at least Allowed OAuth Scopes => aws.cognito.signin.user.admin (others can be used, if required)
- Note the App client => ID, and copy to the
oauth.cognito.client_idproperty in theconfig.jsonfile
Get / create a domain prefix
- From the main screen / control panel for your new user pool, click App Integration=> Domain name
- If there isn't one already, create a new domain prefix
- Note the domain prefix, and copy to the
oauth.cognito.domain_prefixproperty in theconfig.jsonfile - Note the region (between the
authand theamazoncognitoparts of the domain, egeu-west-1) and copy to theoauth.cognito.regionproperty in theconfig.jsonfile
Get the client secret
- From the main screen / control panel for your new user pool, click General settings => App clients
- Find the app you'd like to integrate (or create a new app client, if needed)
- Click the Show Details button
- Note the App client secret, and copy and copy to the
oauth.cognito.client_secretproperty in theconfig.jsonfile
If you bump into CORS issues when attempting authentication across different ports during development, you may need to use a proxy tunnel to pipe requests from one port to another. Eg:
https://comments.localhost.lcl => https://localhost:8080
https://schnack.localhost.lcl => https://localhost:3000
This can be achieved using third party servers like Apache or Nginx, combined with Proxy Pass to forward traffic from a neutral port (like 443), to the server ports.
If you do this, you will also need to update test/index.html with the address of the proxied Schnack server.
The SSL Certificates included in the /certs directory are for development purposes only. These are used to make it possible to fetch data and perform authentication over SSL, on localhost. DO NOT use them in a production environment.
Schnack is yet another happy collaboration between Webkid and Gregor Aisch, with a few minor additions from Jerram Digital.
Schnack will never track who is using it, so we don't know! If you are a Schnack user, let us know and we'll add your website here. So far Schnack is being used on:
- https://schnack.cool (scroll all the day down)
- https://vis4.net/blog
- https://blog.datawrapper.de
- https://blog.webkid.io
This is not a new idea, so there are a few projects that are doing almost the same thing:
- CoralProject Talk - Node + MongoDB + Redis
- Discourse - Ruby on Rails + PostgreSQL + Redis
- Commento - Go + Node
- Isso - Python + SQLite3
- Mouthful – Go + Preact