Alteiria / pterodactylAutoStart

Pterodactyl bash script to auto start servers (at boot for example)
2 stars 2 forks source link

Script doesn't work #5

Closed realkarmakun closed 5 years ago

realkarmakun commented 5 years ago

Logs:

Jul 06 15:55:50  systemd[1]: Starting Pterodactyl Auto Start...
Jul 06 15:56:50  systemd[1]: Started Pterodactyl Auto Start.

After doing some research I found that output from this curl command might be useful:

curl -s https://your.pterodactyl.panel/api/client \
-H "Authorization: Bearer YourToken" \
-H "Content-Type: application/json" \
-H "Accept: Application/vnd.pterodactyl.v1+json" | jq
{
  "errors": [
    {
      "code": "HttpException",
      "status": "401",
      "detail": "An error was encountered while processing this request."
    }
  ]
}

jq --version output:

root@testvm:~# jq --version
jq-1.6
realkarmakun commented 5 years ago

Ok, I'm stupid and replaced in Authorization 'Bearer' along Your Token with my token. After proper replacing it gives me this now: UPD: script still doesn't work

{
  "object": "list",
  "data": [],
  "meta": {
    "pagination": {
      "total": 0,
      "count": 0,
      "per_page": 15,
      "current_page": 1,
      "total_pages": 1,
      "links": []
    }
  }
}
unixfox commented 5 years ago

Hello, your issue is probably the same as the one on #1. I still plan to improve the script so that it reports better the errors.

realkarmakun commented 5 years ago

I guess you right, but if we look in server response can it be just incorrect response form panel? Maybe API changed recently or something like that? I mean it should return list of servers right? But it returns just an empty list

unixfox commented 5 years ago

I don't think that the API changed because I'm using the latest version of pterodactyl and my script is still working on it.

realkarmakun commented 5 years ago

That was just my stupid mistake. I used wrong account to get Account API key

unixfox commented 5 years ago

Oh nice, did you get it working then?