onweru / hugo-swift-theme

A simple open source theme for publishing with hugo
https://neuralvibes.com/
Other
120 stars 64 forks source link

remove all references to staticman endpoints that are affected by quotas #47

Closed onweru closed 5 years ago

onweru commented 5 years ago

It is now obvious that the public instance of staticman is broken, and will probably stay that way indefinitely.

It would then make sense to remove any reference to that endpoint. Why? It's misleading as an option, since it doesn't work anyway. This is also true for all links that point to the dated staticman docs. It doesn't matter if some sections of those docs work if as a whole, they don't get the job done.

As a courtesy to users, it would be immensely helpful to only document options that actually work. Is it possible to document a concise guide so that one doesn't have to get lost in the weeds (issue threads and fractured documentation pages)? .

What we have at the moment reads like this is the default option but it doesn't work, but you can try it.

In hind sight, this πŸ‘‡ too needs to be removed. Why? At this point, these information is another turn deeper into the annoying rabbit πŸ‡ hole.

:information_source: This Binary Mist article could also be quite helpful :) :information_source: By default, this theme uses the official production instance at v3 instead of v2 due to a requests' quota issue reported in issue eduardoboucas/staticman#222. :warning: Since Staticman is an evolving project, things might work differently than they do at the moment of this writing.

We need to rethink the staticman section because as it is, it utterly frustrating to anyone looking to get up and running quickly.

Maybe we could even extract it to a dedicated documentation page(s), with procedures that work. All other references could then be linked as footnotes.

VincentTam commented 5 years ago

Move detailed instructions like the following to the Wiki page, and keep the essential parts.


:construction_worker_man: Staticman Configurations for Beautiful Jekyll

:email: Please don't hesitate to ping me on GitHub/GitLab/leave a comment on my blog/send me an email to ask for help.

  1. :checkered_flag: Invite @staticmanlab as a collaborator to your repository (by going to your repository Settings page, navigate to the Collaborators tab).
    send invitation to Staticman Lab
    Image short link: https://git.io/fjZPx

  2. :ballot_box_with_check: Help @staticmanlab accept the invitation by going to

    https://staticman3.herokuapp.com/v3/connect/github/<username>/<repo-name>

    In your case, that's

    https://staticman3.herokuapp.com/v3/connect/github/<username>/<repo-name>

    Staticman Lab invitation accepted
    Figure: image showing setup for my fork of this theme
    Image short link: https://git.io/fjZXG

    Staticman Lab shown as collaborator
    Figure: @staticmanlab invited to GitHub repo
    Image short link: https://git.io/fjZXZ

  3. :writing_hand: Fill in your repository and branch in the Staticman section of _config.yml.

     # Staticman support 
     staticman: 
       repository : "<username>/<repo-name>" # GitHub username/repository eg. "daattali/beautiful-jekyll" 
       branch     : "master" # eg. "master" If you're not using `master` branch, then you also need to update the `branch` parameter in `staticman.yml` 
       endpoint   : # URL of your own deployment (with trailing slash) (will fallback to a public GitLab instance) 
       reCaptcha: 
         # reCaptcha for Staticman (OPTIONAL) 
         # If you use reCaptcha, you must also set these parameters in staticman.yml 
         siteKey  : # Use your own site key, you need to apply for one on Google 
    secret   : # ENCRYPT your password by going to https://staticman3.herokuapp.com/v3/encrypt/<your-site-secret> 
  4. :memo: Start commenting.

onweru commented 5 years ago

@VincentTam, yeah, something like πŸ‘†. staticmanlab doesn't have quotas, correct?

VincentTam commented 5 years ago

@VincentTam, yeah, something like . staticmanlab doesn't have quotas, correct?

It's running on a free Heroku instance, so there is quota, just like the official development instance. I won't regret my choice since it's supposed to be a test for Staticman's native GitLab integration. One might setup his/her own API endpoint or find other existing ones like @staticmanaima, @Bloggerbust-bot, etc.

onweru commented 5 years ago

I think setting up their own instance is the safer option. It's not that straight forward though, is it? It's not to me πŸ˜„ . I think one concise guide on how to setup a heroku / docker instance would be more great.

This way, we don't even have to advise people to signup to specific bots. After all, those bots are bound to reach their respective quotas at some point πŸ€” ... at which point they will find themselves where they began.

VincentTam commented 5 years ago

Staticman config in this project's Wiki page was published several minutes ago. It's copied from https://github.com/victoriadrake/hugo-theme-introduction/pull/119/files#diff-04c6e90faac2675aa89e2176d2eec7d8 with minor updated.

I think setting up their own instance is the safer option. It's not that straight forward though, is it? It's not to me . I think one concise guide on how to setup a heroku / docker instance would be more great.

This way, we don't even have to advise people to signup to specific bots. After all, those bots are bound to reach their respective quotas at some point ... at which point they will find themselves where they began.

I have another view of point. It would be hard to grab the message from a large chuck of text/code. Having some screenshots illustrating a concrete textbook examples helps interested users to understand what Staticman is actually. By using this example, I would be suggesting new comers to try my bot, but I think experienced users are wise enough to judge.

onweru commented 5 years ago
  • A anti-spam fight will never end, so it's too soon to say which one is safer.

I meant, safer in terms of one's comment form being rendered useless after a quota has been reached. If one has an instance of their own πŸ‘‡

If the only app that you are running is Staticman, however, it is unlikely that you will use up you free dyno hours because this would mean that you are receiving comments for more than 18 hours per day, which would be quite a lot.

I have read it and I like it. I will try it and see how it goes. Thank you.

VincentTam commented 5 years ago

If the only app that you are running is Staticman, however, it is unlikely that you will use up you free dyno hours because this would mean that you are receiving comments for more than 18 hours per day, which would be quite a lot.

Not related to the title, just for responding to your comments about frequence of comments received.

You may see @zinefer's GitHub Page repo: https://github.com/zinefer/zinefer.github.com/pulls?utf8=%E2%9C%93&q=is%3Apr+label%3ASpam to see how the GitHub App Staticman spammed his repo. I believe (s)he isn't the only victim.

onweru commented 5 years ago

Looks pretty awful. Do you think it would be cool to add a disqus fallback which users can choose to activate?

VincentTam commented 5 years ago

Looks pretty awful.

Me2

Do you think it would be cool to add a disqus fallback which users can choose to activate?

I'm not keen on that, due to reasons found in the linked articles in Pelican-Elegant/elegant#288.

It's the user's choice to grant permission to a Staticman bot. What we, as a maintainer of a static theme, can do is to offer suggestions/guides for best practices, say, those mentioned in https://github.com/onweru/hugo-swift-theme/commit/cc386c77ba4f884c882d04360968253e9d77ba46#r34762244.

What I, as the maintainer of a Staticman instance, can do, is to fight spams.

onweru commented 5 years ago

What we, as a maintainer of a static theme, can do is to offer suggestions/guides for best practices, say, those mentioned in

Fair enough, let's keep things simple, as they're, and keep improving the docs wherever possible.

zinefer commented 5 years ago

Staticman did not necessarily spam my repository. I made a choice not to use recaptcha because I wanted my users to be able to add a comment with absolutely minimal effort. I am only using a BotPot field right now. It worked quite well for a while but it seems a few bots have figured it out. I have been considering changing up the field to try to trip them up again.

In the past I have written my own commenting system in PHP and that system had an order of magnitude more spam.