nilsnolde / wordpress-markdown-git

:loop: WordPress plugin to add file content (Markdown, Jupyter notebooks) from a Git based VCS to a WordPress post; replaces https://github.com/gis-ops/md-github-wordpress
GNU General Public License v3.0
48 stars 14 forks source link

GitLab rate limited #18

Closed andrei1058 closed 4 years ago

andrei1058 commented 4 years ago

Versions Wordpress: 5.5.1 Documents for Git: 1.0.2

Describe the bug

I'm getting a response message like if I were using a markdown from github, but I'm using a gitlab link. Besides that, I'm getting rate limited too easily even if I provided a username and a token.

{"message":"API rate limit exceeded for 54.3*.***.209. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}

Paste the shortcode and the censored contents of config.json

[git-gitlab-markdown url="https://gitlab.com/andrei1058/bedwarsproxy/-/blob/development/README.md"]

{
  "limit": 5,
  "classes": "",
  "Github": {
    "user": "",
    "token": ""
  },
  "Bitbucket": {
    "user": "",
    "token": ""
  },
  "Gitlab": {
    "user": "andrei1058",
    "token": "v5v5*V*V+*V*V**%*%"
  }
}

To Reproduce Steps to reproduce the behavior:

  1. Create an article with a markdown file
  2. Put your credentials in config.json
  3. Refresh the web page evert 10 seconds for about 5 minutes

Expected behavior

Screenshots

Additional context

nilsnolde commented 4 years ago

Jup, see here how to avoid :) https://github.com/gis-ops/wordpress-markdown-git#usage

andrei1058 commented 4 years ago
  1. Why am I getting a github rate limit message if I am using your plugin for gitlab?
  2. I've also tried adding user and token in the [git tag] but the issue is still there.

Please read my entire report.

nilsnolde commented 4 years ago

I did read your report and my answer still stands:

  1. Please read the entire section of the README I pointed you to. It's using Github's /markdown endpoint to generate the markdown, that's why you need it. Irrespective of the provider you're hosting your md file with.
  2. That's not doing anything for github auth when you're using gitlab as a host. Putting the credentials into the shortcode will only be used for the provider the shortcode targets.

So put the Github user/token into the config.json and you'll find it works.