vincentbernat / serverspec-example

Advanced use example of serverspec
98 stars 18 forks source link

reports:view not listing reports #6

Open 1tylermitchell opened 8 years ago

1tylermitchell commented 8 years ago

This is great work, thanks for sharing it.

I've had to run my own httpd server without using your builtin reports:view option. With that option it does run everything well except it will not list available reports on the http://localhost:5000/viewer/#/upload page. Maybe it's a recent webrick change or a permissions problem but for some reason below the "choose file" button there is nothing else.
Any tips?

vincentbernat commented 8 years ago

When you go in the "reports" directory (localhost:5000/reports), do you get a listing. A listing is needed to be able to see reports.

1tylermitchell commented 8 years ago

Yes, the /reports shows the file listing. But the http://localhost:5000/viewer/#/upload - shows no files to select.

vincentbernat commented 8 years ago

Could you copy/paste some part of the HTML code produced for the listing? There is a bit of Javascript trying to parse the page. I suppose it doesn't recognize the links.

1tylermitchell commented 8 years ago

I'm not really sure. I don't get any error messages in javascript or in console. I thought I was getting a permissions error but that doesn't make sense. So I guess you're right with the parsing .. I'll look at it more.

1tylermitchell commented 8 years ago

I decided to bypass the index view and just name my report data file the same so I can link directly to the most recent test results. The viewer works fine when the URL points directly to the json file, so not sure what to recommend here. As more of my users start to test it, I may come back to this, but wonder if anyone else can replicate it.

vincentbernat commented 8 years ago

Please, provide the HTML code used by the index.

On March 1, 2016 2:13:55 AM GMT+01:00, Tyler Mitchell notifications@github.com wrote:

I decided to bypass the index view and just name my report data file the same so I can link directly to the most recent test results. The viewer works fine when the URL points directly to the json file, so not sure what to recommend here. As more of my users start to test it, I may come back to this, but wonder if anyone else can replicate it.


Reply to this email directly or view it on GitHub: https://github.com/vincentbernat/serverspec-example/issues/6#issuecomment-190477610

vincentbernat commented 8 years ago

I mean, the HTML code (or an excerpt of) of http://localhost:5000/reports

1tylermitchell commented 8 years ago

Hmm, that page is empty actually. I can see it handle the request on the server, and the /viewer page loads ok (minus the reports listing at bottom).

Maybe the problem might be related to my networking. I'm using an SSH tunnel for port 5000, it doesn't need anything else does it?

My server output: localhost.localdomain - - [01/Mar/2016:02:10:30 CST] "GET /reports/ HTTP/1.1" 304 0

vincentbernat commented 8 years ago

You need to configure your HTTP server to display an index page (HTML page with a list of files in a directory). The JS code will then try to parse it to get a list of available reports. BTW, it's http://localhost:5000/reports/ (with a trailing slash).