Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow localhost files behind a flag #22

Open
tduval-unifylogic opened this issue Apr 13, 2022 · 10 comments
Open

Allow localhost files behind a flag #22

tduval-unifylogic opened this issue Apr 13, 2022 · 10 comments

Comments

@tduval-unifylogic
Copy link

Hola!

I am sure it is something really simple I am missing. I want to use the api but cannot get it to work as designed with local web server files (port 80). Here are some images that depict what I am experiencing. I'm on an M1 Mac Mini (Monterey) if that makes any difference.

First, I try the sample post provided on the github repo home page in postman (which works!):
image

Then I create a local web server (on port 80), files are accessible by a browser without specifying port:
image
image

Then I try the same post, except this time I point to the files on the local web server:
image

Then I tried the same post in a Notebook in Visual Studio with Python requests object:
image

Lastly, (what did work!!!) I gave the eye CLI the same arguments (local web server addresses) to the files and it worked!!

image

Any guidance on how to get this working as intended would be greatly appreciated!

Thanks!

@RubenVerborgh
Copy link
Collaborator

Maybe the server does not work with more recent EYE versions, that would be an easy explanation.

@josd
Copy link
Contributor

josd commented Apr 14, 2022

Here on my laptop plus WSL 2 (Windows Subsystem for Linux) EyeServer still runs fine with the latest EYE v22.0409.1317

$ eyeserver 8000
EYE server running on http://localhost:8000
$ curl "http://localhost:8000/?data=http://eulersharp.sourceforge.net/2003/03swap/socrates.n3&query=http://eulersharp.sourceforge.net/2003/03swap/socratesF.n3"
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix : <http://www.agfa.com/w3c/euler/socrates#>.
@prefix q: <http://www.w3.org/2004/ql#>.

:Socrates a :Man.
:Socrates a :Mortal.
$ curl "http://localhost:8000/?data=https://n3.restdesc.org/n3/friends.n3&data=https://n3.restdesc.org/n3/knows-rule.n3&query=https://n3.restdesc.org
/n3/query-all.n3"
@prefix ppl: <http://example.org/people#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.

ppl:Cindy foaf:knows ppl:John.
ppl:Cindy foaf:knows ppl:Eliza.
ppl:Cindy foaf:knows ppl:Kate.
ppl:Eliza foaf:knows ppl:John.
ppl:Peter foaf:knows ppl:John.
ppl:John foaf:knows ppl:Cindy.
ppl:Eliza foaf:knows ppl:Cindy.
ppl:Kate foaf:knows ppl:Cindy.
ppl:John foaf:knows ppl:Eliza.
ppl:John foaf:knows ppl:Peter.

@tduval-unifylogic
Copy link
Author

tduval-unifylogic commented Apr 14, 2022 via email

@bdevloed
Copy link
Contributor

bdevloed commented Apr 14, 2022

@MartyStache are you using Docker or some kind of virtualization to run EyeServer?
This would explain why localhost for node (i.e. EyeServer) doesn't map to the same localhost as your cli.

@tduval-unifylogic
Copy link
Author

tduval-unifylogic commented Apr 14, 2022 via email

@josd
Copy link
Contributor

josd commented Apr 14, 2022

Tried the same here and there is indeed an issue:
Via command line it works all fine

$ eye --nope http://localhost/eye/reasoning/socrates/socrates.n3 --query http://localhost/eye/reasoning/socrates/socrates-query.n3
eye --nope http://localhost/eye/reasoning/socrates/socrates.n3 --query http://localhost/eye/reasoning/socrates/socrates-query.n3
EYE v22.0409.1317 josd
SWI-Prolog version 8.5.10-15-g673a8f640
starting 32 [msec cputime] 29 [msec walltime]
#Processed by EYE v22.0409.1317 josd
#eye --nope http://localhost/eye/reasoning/socrates/socrates.n3 --query http://localhost/eye/reasoning/socrates/socrates-query.n3

GET http://localhost/eye/reasoning/socrates/socrates.n3 SC=3
GET http://localhost/eye/reasoning/socrates/socrates-query.n3 SC=1
networking 5 [msec cputime] 24 [msec walltime]
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix : <http://example.org/socrates#>.

:Socrates a :Human.
:Socrates a :Mortal.

reasoning 0 [msec cputime] 0 [msec walltime]
#2022-04-14T16:53:38.202Z in=4 out=2 ent=3 step=6 brake=2 inf=23148 sec=0.037 inf/sec=625622
#ENDS

2022-04-14T16:53:38.202Z in=4 out=2 ent=3 step=6 brake=2 inf=23148 sec=0.037 inf/sec=625622

but via eyeserver nothing comes back

$ curl "http://localhost:8000/?data=http://localhost/eye/reasoning/socrates/socrates.n3&query=http://localhost/eye/reasoning/socrates/socrates-query.n3"

@RubenVerborgh any idea?

@RubenVerborgh
Copy link
Collaborator

Oh yes, we are very likely deliberately blocking localhost access for security reasons 🙂

@RubenVerborgh
Copy link
Collaborator

@josd
Copy link
Contributor

josd commented Apr 14, 2022

That would be a nice option indeed!

@tduval-unifylogic
Copy link
Author

tduval-unifylogic commented Apr 14, 2022

awesome! thanks! great for debugging!

@RubenVerborgh RubenVerborgh changed the title Issues with eye server seeing local web server files (when CLI does??) Allow localhost files behind a flag Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants