GithubHelp home page GithubHelp logo

almost / hubbub Goto Github PK

View Code? Open in Web Editor NEW
16.0 4.0 4.0 60 KB

Comments as GitHub pull requests for Jekyll (and other static site generator) websites.

License: MIT License

JavaScript 100.00%

hubbub's Introduction

Hubbub

Comments as Github pull requests for Jekyll (and other static site generator) websites.

Thanks to Miles Sabin (twitter & github) for the original idea and initial sponsorship.

Initial development by Thomas Parslow. Pull requests very welcome.

Build Status

Quick Deployment

You can deploy (for free) to Heroku with the button below:

Deploy

It will ask you for a Github username and a password. This is for the commenter user which will be the user which actually creates the pull requests for comments. I strongly suggest you create a new user just for this.

Set URL_PREFIX config var to _posts/ and URL_SUFFIX to .markdown for file structure like _posts/2018-12-15-welcome-to-jekyll.markdown.

Manual Deployment

To run the Hubbub server you'll first need to install Node.JS and NPM which you can get nodejs.org.

To install the dependencies required by the Hubbub server run the following command from the project directory:

npm install

You can configure the Hubbub server component by adding a local.json file to the config directory, you can use default.json as a base. You'll need to configure the commenter user (should be a Github user created solely for this purpose) and the target site (you can configure more than one if you want, but you'll usually just want to supply a single default site).

Once you've created the configuration file you can run the server with this command:

PORT=8080 NODE_ENV=local node server.js

Once you've got the server running go to http://127.0.0.1:8080/help to see instructions for integrating Hubbub into your blog (or read the instructions through Github)

Contributing

Pull Requests are very welcome. Check out the Github issues for a list of things that need doing (and please feel free to add your own).

We use Waffle.io to view Github issues, you can too if you want: Stories in Ready

hubbub's People

Contributors

almost avatar milessabin avatar rootkea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

d6y milessabin kyb3r

hubbub's Issues

Remove all TODO: comments

Either they're still relevant and should be fixed or added as issues or they're no longer relevant

Editing/deleteing comments

Users should be able to edit/delete pending comments. Possibly accepted comments as well (in this case it would create a new pull request).

Failed to save comment: Can't find post file

Hello!

Whenever I try to submit the comment the popup with "Failed to send comment" emerges and server log shows "Failed to save comment: Can't find post file".

I re-deployed the Heroku node multiple times to make sure that I had entered the correct credentials and repo details.

Webpage: https://rootkea.me/jekyll/update/2019/02/05/comments-work-here/
Repo: https://github.com/rootkea/rootkea.github.io
Heroku log:

2019-02-26T15:17:41.358962+00:00 heroku[router]: at=info method=GET path="/hubbub.js" host=hubbub-bot.herokuapp.com request_id=bacb4143-ba23-48d6-a9a6-b9f43ab2977c fwd="58.84.15.181" dyno=web.1 connect=1ms service=3ms status=200 bytes=9427 protocol=https

2019-02-26T15:17:53.225282+00:00 heroku[router]: at=info method=OPTIONS path="/api/default/comments" host=hubbub-bot.herokuapp.com request_id=92d0801d-6385-4339-abec-33a326aa0d24 fwd="58.84.15.181" dyno=web.1 connect=0ms service=1ms status=204 bytes=301 protocol=https

2019-02-26T15:17:53.796484+00:00 heroku[router]: at=info method=POST path="/api/default/comments" host=hubbub-bot.herokuapp.com request_id=aa3e7bfb-f6a7-4ebd-b754-cd3c2bcca3e2 fwd="58.84.15.181" dyno=web.1 connect=0ms service=334ms status=500 bytes=362 protocol=https

2019-02-26T15:17:53.793122+00:00 app[web.1]: Failed to save comment: Can't find post file: _posts/2019-02-05-comments-work-here.markdown

Client side code

The client side code needs to allow:

  • Adding comments
  • Seeing pending comments that you have made
  • data- attribute integration option
  • Manual JS integration option

Web based config

It would be nice to be able to configure the system via a web interface instead of via the config.json file

Stop CSRF comments

It shouldn't be possible for javascript running on a random domain to add comments. The endpoint should probably check the referer. Might be an issue if the target site is HTTPS.

Editing comments

We now support deleting pending comments (see #4), editing wouldn't be too much harder

Support for Gitlab

Hello!

I use self hosted Gitlab instance as a version control. Is it possible to use Gitlab instead of Github?

Thanks!

Spam filtering

Akismet? Something like that?

Simpler spam countermeasures?

Make the location of post files in the repository configurable

Right now it assumes the Jekyll defaults (all posts in /_posts with a .markdown extension) but of course this isn't required at all by Jekyll or other static site generators.

See urlPathToSourceFile in server.js: https://github.com/almost/hubbub/blob/master/server.js#L50

Additionally the error message is awful when the paths don't match, gives no information whatsoever. It should produce a useful error message with troubleshooting help.

Add all pending comments to the same PR

From Miles:

I think it might be better to adopt an optimistic strategy and assume
it's more likely than not that a comment will be merged. In that case,
rather than having a separate PR for each comment we just add commits
to a current PR which can be merged in one go without conflicts (much
as I've accidentally done with my PR to almost/hubbub). Obviously this
makes it a little more work to remove undesirable comments which are
mixed in with acceptable ones, but I think I'd like to see if that's
less of a burden ... right now it seems much too easy to generate
conflicts with the one PR per comment model.

Submitting comment redirects to the help page

Hello!

website github repo: https://github.com/rootkea/rootkea.github.io
Comment page: https://rootkea.me/jekyll/update/2018/12/15/welcome-to-jekyll

After, submitting comment on the comment page, it gets redirected to https://hubbub-bot.herokuapp.com/help

Heroku Application log:

2019-02-09T06:29:13.724253+00:00 heroku[router]: at=info method=GET path="/api/default/comments?metadata_name=foo&comment=Hello%21" host=hubbub-bot.herokuapp.com request_id=4c86579e-0793-4592-86ad-2b0cdf664d3c fwd="58.84.15.142" dyno=web.1 connect=0ms service=79ms status=302 bytes=290 protocol=https

2019-02-09T06:29:13.983453+00:00 heroku[router]: at=info method=GET path="/help" host=hubbub-bot.herokuapp.com request_id=8a9d3559-be87-49b4-9b9d-c3b73062ae70 fwd="58.84.15.142" dyno=web.1 connect=0ms service=13ms status=200 bytes=2378 protocol=https

Interestingly, the Hubbub comment system was working perfectly a month ago. May be Github changed their API? Sorry, not good at js so can't seem to find the exact cause.

OAuth for github

Probably as part of #5 it would be nice to be able to OAuth with github. Right now the system can use OAuth tokens but the user is left to generate them on their own.

Deploy to heroku button

It should be as simple as possible to deploy your own instance of the system using something like Heroku. Work work nicely along with #5.

Non-javascript fallback

Should be ok to just post directly to the comments endpoint and have it return an "ok your comment will be reviewed soon" page.

Demo site

Hello!

I am looking for a commenting solution for my static website. Is there any existing site or demo site which uses HubBub?

How does HubBub work? Is it similar to StaticMan? (StaticMan commits the submitted comments to the website source repo)

Thanks!

Automatically reduce merge issues

I have a plan for reducing merge issues when multiple comments come in at the same time. We'll maintain a load of blank lines where the comments are to be inserted. The server will check for existing comment pull requests and will insert each new comment on a different blank line.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.