2017-12-26 18:59:21 -06:00
2017-12-26 18:16:15 -06:00
2017-12-26 18:18:26 -06:00
2017-12-26 18:59:21 -06:00
2017-12-20 15:29:54 -06:00
2017-12-24 02:43:56 -06:00
2017-12-22 16:45:48 -06:00
2017-12-26 13:42:04 -06:00
2017-12-26 17:27:48 -06:00

remark42 Build Status

Remark42 ia a comment engine, self-hosted, lightweight, simple (but functional) what doesn't spy on users.

  • Supports social login via google and github
  • Moderation allowing admins to remove comments and block users
  • Voting and pinning system
  • Ability to sort comments
  • Comment retrieval per post, user and comment's id
  • Extractor for recent comments, cross-post
  • Multi-level nested comments with both tree and plain presentations
  • Export all data to json and automatic backups
  • Import from disqus
  • No need of external databases, everything embedded in a single data file
  • Fully dockerized and can be deployed in a single command
  • Nice, lightweight and fully customizable UI
  • Multi-site mode to serve comments for multiple sites from a single remark instance
  • Integration with automatic ssl (Lets Encrypt) via nginx-le

Install

Backend

  • copy provided docker-compose.yml and customize for your needs
  • make sure you don't keep DEV=true for any non-development deployments
  • pull and start docker compose pull && docker compose up

Run modes

  • server activates regular, server mode
  • import performs import from external providers (disqus and internal json, see /api/v1/admin/export)

Register oauth2 providers

TBD

Frontend

TBD

API

Authorization

  • GET /login/{provider}?from=http://url - perform "social" login with one of supported providers and redirect to url
  • GET /logout - logout
  • GET /api/v1/user - get user info, auth required
type User struct {
    Name    string `json:"name"`
    ID      string `json:"id"`
    Picture string `json:"picture"`
    Profile string `json:"profile"`
    Admin   bool   `json:"admin"`
}

currently supported providers are google and github

Commenting

  • POST /api/v1/comment - add a comment. auth required
type Comment struct {
    ID        string          `json:"id"`      // comment ID, read only
    ParentID  string          `json:"pid"`     // parent ID
    Text      string          `json:"text"`    // comment text
    User      User            `json:"user"`    // user info, read only
    Locator   Locator         `json:"locator"` // post locator
    Score     int             `json:"score"`   // comment score, read only
    Votes     map[string]bool `json:"votes"`   // comment votes, read only
    Timestamp time.Time       `json:"time"`    // time stamp, read only
    Pin       bool            `json:"pin"`     // pinned status, read only
}

type Locator struct {
    SiteID string `json:"site"`
    URL    string `json:"url"`
}
  • GET /api/v1/find?url=post-url&sort=fld&format=tree - find all comments for given post

This is the primary call used by UI to show comments for given post. It can return comments in two formats - plain and tree. In plain format result will be sorted list of Comment. In tree format this is going to be tree-like structure with this structure:

type Tree struct {
    Nodes []Node `json:"comments"`
}

type Node struct {
    Comment store.Comment `json:"comment"`
    Replies []Node        `json:"replies,omitempty"`
}

Sort can be time or score. Supported sort order with prefix -/+, i.e. -time. For tree mode sort will be applied to top-level comments only and all replies always sorted by time.

  • GET /api/v1/last/{max} - get up to {max} last comments
  • GET /api/v1/id/{id} - get comment by id
  • GET /api/v1/comments?user=id - get comment by user id
  • GET /api/v1/count?url=post-url - get comment's count for {url}
  • PUT /api/v1/vote/{id}?url=post-url&vote=1 - vote for comment. vote=1 will increase score, -1 decreases. auth required
  • DELETE /api/v1/admin/comment/{id}?url=post-url - delete comment by id. auth and admin required
  • PUT /api/v1/admin/user/{userid}?site=site-id&block=1 - block or unblock user. auth and admin required
  • GET /api/v1/admin/export?site=side-id&block=1 - export all comments. auth and admin required
  • PUT /api/v1/admin/pin/{id}?url=post-url&pin=1 - pin or unpin comment. auth and admin required
S
Description
No description provided
Readme MIT
43 MiB
Languages
Go 69.4%
TypeScript 22.8%
CSS 3.2%
HTML 1.3%
JavaScript 1.3%
Other 2%