wttech / aet

AET - a system that detects visual changes on web sites and performs basic page health checks
https://wttech.blog/open-source/
Apache License 2.0
146 stars 49 forks source link

No way to define endpoint URL for AET reports #88

Closed zietas closed 6 years ago

zietas commented 7 years ago

Instance setup:

  1. Windows PC with 2 VM's installed using cookbook for windows https://github.com/Cognifide/aet-cookbook/pull/9 created by @karoldrazek
  2. network for VM's using NAT - all relevant ports are forwarded
  3. we have no proxy setup so all requests have to have port defined

Steps to reproduce

  1. Run AET in given setup
  2. open up report.html and wait for redirect

Expected I should be able to see report

Actual Report app is displaying connection error alerts

Reason In JS Console we can see that reports app is trying to contact "http://192.168.37.12/api/metadata?company=cognifide&project=pioneer&correlationId=cognifide-pioneer-pioneer-ci-1493362630699", but due to fact that we have no proxy, nothing is dispatching request to Apache Karaf. If we execute the same request with port "http://192.168.37.12:8181/api/metadata?company=cognifide&project=pioneer&correlationId=cognifide-pioneer-pioneer-ci-1493362630699" we can see that report is there.

In order to fix this issue we need to have an ability to define endpoint for reports app as well. At the moment in "endpointConfiguration" module we can se that it's simply using current domain as endpoint.

zietas commented 7 years ago

Simply changing endpoint configuration will not fix anything as it causing CORS issues.

I've manage to fix it by altering rule on apache vhosts configuration. <Location "/api"> Header set Access-Control-Allow-Origin "*" ProxyPass http://192.168.123.111:81/api </Location>

I have raised an issue with aet-coockbook pull request for windows-automation

zietas commented 7 years ago

Seems like the solution is in place. The only thing that should also be provide is a guide on how and why we have to do it this way. There is no mention about this in manual.

wiiitek commented 7 years ago

When doing this task please update also documentation at:

https://github.com/Cognifide/aet/blob/master/documentation/src/main/wiki/LinuxAndWindowsSetup.md