sammcoe / samuelcoe.com

My V3 Personal Website
https://samuelcoe.com/
2 stars 0 forks source link

[Bug] Can't post comment #29

Open VincentTam opened 5 years ago

VincentTam commented 5 years ago

Tried posting a comment. Received a 403 error from the offical Staticman instance. It has been reported that @staticmanapp no longer works in https://github.com/eduardoboucas/staticman/issues/296#issuecomment-509571795.

{
  "JSON": {
    "success": false,
    "rawError": {
      "name": "HttpError",
      "status": 403,
      "headers": {
        "access-control-allow-origin": "*",
        "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
        "connection": "close",
        "content-encoding": "gzip",
        "content-security-policy": "default-src 'none'",
        "content-type": "application/json; charset=utf-8",
        "date": "Fri, 12 Jul 2019 20:25:28 GMT",
        "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
        "server": "GitHub.com",
        "status": "403 Forbidden",
        "strict-transport-security": "max-age=31536000; includeSubdomains; preload",
        "transfer-encoding": "chunked",
        "x-accepted-oauth-scopes": "repo",
        "x-content-type-options": "nosniff",
        "x-frame-options": "deny",
        "x-github-media-type": "github.v3; format=json",
        "x-github-request-id": "D3FC:402B9:35030C2:4175B2B:5D28ECB7",
        "x-oauth-scopes": "repo",
        "x-ratelimit-limit": "60",
        "x-ratelimit-remaining": "0",
        "x-ratelimit-reset": "1562966728",
        "x-xss-protection": "1; mode=block"
      },
      "request": {
        "method": "GET",
        "url": "https://api.github.com/repos/sammcoe/samuelcoe.com/contents/staticman.yml?ref=master",
        "headers": {
          "accept": "application/vnd.github.v3+json",
          "user-agent": "Staticman agent octokit.js/16.8.0 Node.js/11.12.0 (Linux 4.4; x64)",
          "authorization": "token fbb9e50e161f8f0286d01714050f45416e6f9c1c"
        },
        "request": {
          "timeout": 5000,
          "validate": {
            "owner": {
              "required": true,
              "type": "string"
            },
            "path": {
              "required": true,
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "repo": {
              "required": true,
              "type": "string"
            }
          }
        }
      },
      "documentation_url": "https://developer.github.com/v3/#rate-limiting",
      "_smErrorCode": "GITHUB_READING_FILE"
    },
    "errorCode": "GITHUB_READING_FILE"
  },
  "Response payload": {
    "EDITOR_CONFIG": {
      "text": "{\"success\":false,\"rawError\":{\"name\":\"HttpError\",\"status\":403,\"headers\":{\"access-control-allow-origin\":\"*\",\"access-control-expose-headers\":\"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type\",\"connection\":\"close\",\"content-encoding\":\"gzip\",\"content-security-policy\":\"default-src 'none'\",\"content-type\":\"application/json; charset=utf-8\",\"date\":\"Fri, 12 Jul 2019 20:25:28 GMT\",\"referrer-policy\":\"origin-when-cross-origin, strict-origin-when-cross-origin\",\"server\":\"GitHub.com\",\"status\":\"403 Forbidden\",\"strict-transport-security\":\"max-age=31536000; includeSubdomains; preload\",\"transfer-encoding\":\"chunked\",\"x-accepted-oauth-scopes\":\"repo\",\"x-content-type-options\":\"nosniff\",\"x-frame-options\":\"deny\",\"x-github-media-type\":\"github.v3; format=json\",\"x-github-request-id\":\"D3FC:402B9:35030C2:4175B2B:5D28ECB7\",\"x-oauth-scopes\":\"repo\",\"x-ratelimit-limit\":\"60\",\"x-ratelimit-remaining\":\"0\",\"x-ratelimit-reset\":\"1562966728\",\"x-xss-protection\":\"1; mode=block\"},\"request\":{\"method\":\"GET\",\"url\":\"https://api.github.com/repos/sammcoe/samuelcoe.com/contents/staticman.yml?ref=master\",\"headers\":{\"accept\":\"application/vnd.github.v3+json\",\"user-agent\":\"Staticman agent octokit.js/16.8.0 Node.js/11.12.0 (Linux 4.4; x64)\",\"authorization\":\"token fbb9e50e161f8f0286d01714050f45416e6f9c1c\"},\"request\":{\"timeout\":5000,\"validate\":{\"owner\":{\"required\":true,\"type\":\"string\"},\"path\":{\"required\":true,\"type\":\"string\"},\"ref\":{\"type\":\"string\"},\"repo\":{\"required\":true,\"type\":\"string\"}}}},\"documentation_url\":\"https://developer.github.com/v3/#rate-limiting\",\"_smErrorCode\":\"GITHUB_READING_FILE\"},\"errorCode\":\"GITHUB_READING_FILE\"}",
      "mode": "application/json"
    }
  }
}

Screenshot from 2019-07-12 22-28-47

sammcoe commented 5 years ago

Wow, that's unfortunate, but I guess that's the risk I was running. I really appreciate you pointing this out to me @VincentTam !

VincentTam commented 5 years ago

Nonetheless, you've the right choice of technology: static comments. I can't agree more with what you've written about the upside of Staticman in this article. The current official Staticman instance doesn't work for v2. You may either

  1. choose official Staticman instance v3, or
  2. choose alternative API instance

P.S. I've chosen the 2nd option and I've built @staticmanlab, a public Staticman instance for GitLab, due to the possibility to tweak the API instance, like support from multilined message in https://github.com/eduardoboucas/staticman/pull/301.