keygen-sh / keygen-api

Keygen is a fair source software licensing and distribution API built with Ruby on Rails. For developers, by developers.
https://keygen.sh
Other
700 stars 40 forks source link

Always respond Not found error #759

Closed MoonTTMM closed 10 months ago

MoonTTMM commented 10 months ago

I have self hosted a server following the doc. The ping and health api works fine. But other api just respond Not found. There's log on keygen's console like: method=POST path=/v1/accounts/foobar/tokens format=jsonapi controller=ErrorsController action=show status=404

This is my request:

  curl -X POST https://<foodomain>/v1/accounts/foorbar/tokens \
  -H 'Accept: application/vnd.api+json' \
  -u "email:password"
ezekg commented 10 months ago

You most likely didn't configure the KEYGEN_HOST environment variable correctly. It should be set to the domain name you're accessing Keygen under, e.g. licensing.example.com.

Regardless, since most Keygen installations are singleplayer, you should be able to forego the /accounts/<account> prefix. I.e. /v1/accounts/foobar/tokens would become /v1/tokens.

MoonTTMM commented 10 months ago

Thanks, /v1/tokens works. Do not see any doc mentioned that.