patsonluk / airline

Apache License 2.0
109 stars 71 forks source link

Google API seemingly not working to display map #561

Open Mereck13579 opened 1 year ago

Mereck13579 commented 1 year ago

I've been trying to run my own "instance" of Airline Club on a personal server and managed to get apparently everything running, except for the Google API. Basically whenever I log into the game I get this: image

In my application.conf file I've set up those:

mysqldb.host="localhost:3306"
airline.akka-actor.host="127.0.0.1:2552"
google.apiKey="API key 1"
google.mapKey="Maps API Key"
play.allowGlobalApplication = true

[API Key 1 and Maps API Key are values that I've obfuscated for obvious reasons]

What I found strange is that the error in the javascript console isn't very telling: image

The problem I see is that it's telling me that the referer is not allowed, but I have tried both unrestricted and restricting with different combination of FQDN/URL with no success (airclub.yangi.re / https://airclub.yangi.re / https://airclub.yangi.re/*) One additional question might be, what's the difference between the "mapKey" and the "apiKey", I can't find any clue about which one does what (does both need to be different at all?) Here is how the "Maps API Key" is set up for instance: image

For additional context, the URL I'm using can access the internet but only some restricted IPs can access it (in case you wonder why it's not accessible).

xrizonx commented 1 year ago

The issue is not with the MAP API Key its with your Other API Key you need to authorize the URL as its in the console exactly https://airclub.yangri.re would be yours.

also to add you need 2 different API keys i tested with both unrestricted and no security set if i share "Maps" API i get your error if not it works if i have 2 different api keys with security or not

Had the same issue with my API

drvntechnologies commented 1 year ago

So what's the fix? I'm having the same issue right now and I'm confused why I need 2 API keys as well and what that process is like. I have 1 API with maps enabled as well but I don't know if I just put that key in both places or if I need another key.

Rustyt23 commented 1 year ago

image in the attached if you see closely you will find API key is used for map is backed somewhere and no getting updated "AIzaSyB5XQhzy2XrM95AyfW8f5BeWJiqr-LGXxU" this is the key if you see closely on console log ... application.conf API key never used

Rustyt23 commented 1 year ago

So what's the fix? I'm having the same issue right now and I'm confused why I need 2 API keys as well and what that process is like. I have 1 API with maps enabled as well but I don't know if I just put that key in both places or if I need another key.

If you can find the API key baked into the repo code or the database , then you can replace it with your API key and see if its working