DIVERSIFY-project / amiunique

Learn how identifiable you are on the Internet
https://amiunique.org/
MIT License
688 stars 92 forks source link

Issue when trying to compile code #40

Open ishagadekar opened 7 years ago

ishagadekar commented 7 years ago

Hi,

I am trying to run the code on my local machine and I am getting the below error:

[error] C:\amiunique\website\app\controllers\FPController.java:346: non-static method generateToken() cannot be referenced from a static context [error] Crypto.generateToken [error] C:\amiunique\website\app\controllers\FPController.java:347: non-static method encryptAES(java.lang.String) cannot be referenced from a static context [error] Crypto.encryptAES [error] C:\amiunique\website\app\controllers\StatsController.java:28: non-static method decryptAES(java.lang.String) cannot be referenced from a static context [error] Crypto.decryptAES

Please let me know what could be the issue.

Thanks in Advance!

plaperdr commented 7 years ago

Hi! Thanks for your interest in AmIUnique! Can you give me the version of Java and Play you are using? It could help me sort this out.

ishagadekar commented 7 years ago

I am using Java 8 and Play 2.4.6.

SyBen commented 7 years ago

Starting with Play 2.4.x, Crypto methods stopped being static. Try with play 2.3.x

ishagadekar commented 7 years ago

I tried with Play 2.3. It worked. Thanks!

ishagadekar commented 7 years ago

Also, in the table "fpdata", for the "id" column, I get value "Not Supported". Can you tell me what does that mean? Thanks.

plaperdr commented 7 years ago

Thanks a lot @SyBen for finding out the cause of the problem! The site will probably go through a small refresh this year so we may upgrade to a more recent version of Play and this will change.

@ishagadekar The id value comes from the cookie we setup in the browser. If you get "Not Supported", it is either because cookies are blocked or the path may not be correct (i.e. if you run the site locally on your machine, it may not work).

ishagadekar commented 7 years ago

@plaperdr Cookies are not blocked on my system and even if other person hits the website from their system, it gives "Not Supported" value. Can you tell me where are the paths configured? Also, what is the purpose of "id" vs "addressHttp" fields? Thanks.

plaperdr commented 7 years ago

The main path for cookies is defined on this line HERE. You can see that "amiunique.org" is directly in the code. The last two boolean values are to only allow the cookie to be used in the context of a secure connection (HTTPS) and to be delivered only through HTTP (no possibility to access it through JavaScript). If you want to use it on your own, I recommend setting at least the second-to-last boolean value (HTTPS one) to "false". The difference between "id" and "addressHttp" is simple. The "id" column is for the cookie value, the "addressHttp" is an hashed version of the IP address.

ishagadekar commented 7 years ago

Okay. I will try doing that. Thank You!