tasseo authentication fails - cross-browser

I was wondering if anyone uses Tasseo for their Graphite dashboards. I'm having some problems I dont quite get. Basically, Tasseo polls Graphite server for stats - if you have authentication enabled (http base auth) on your Graphite server then you must export GRAPHITE_URL and GRAPHITE_AUTH environment variables to the environment in which tasseo is running ie. if you run tasseo as runit service then your run script should look like this:
#!/bin/sh
exec 2>&1
export GRAPHITE_URL="https://graphite-url"
export GRAPHITE_AUTH="user:password"
cd /app
exec chpst -u tasseo bundle exec rackup -o 127.0.0.1 -p 5000 -s thin
What I noticed though is that IF I DONT authenticate to the Graphite in the SAME browser in which I'm running Tasseo in another tab (by running I literally mean running as Tasseo is just a sinatra app fully built in javascript ie it's running in your browser), then I'm NOT able to display ANY graphs. As soon as I authenticate against Graphite in the same browser all works fine.
Tasseo is using CORS ie. it's polling Graphite from within JavaScript so it might do something with it.
The most annoying thing is that I have to do this every time I restart tasseo app server :-( So when I restart tasseo I have to reload Graphite page - I assume so that is re-authenticates ?
Also I noticed that even though when I reload the Graphite tab, Tasseo works for a while and then after some time (dont have exact measures) it stops working - in Chrome's development console I can see that the OPTIONS requests to Graphite are failing - so the GET requests must too.
Anyone ideas ?

Just If anyone comes across this problem when setting up Tasseo then make sure if you're using Self Signed Certificate on Graphite server, then they MUST BE trusted by the browser which is running Tasseo's CORS java script. Otherwise you'll be noticing what is described above - once you set those self signed certificates as TRUSTED, everything wil work like a charm!

Related

Disable internet access for testing ionic app but still serve files from localhost

I have an app that I'm testing on localhost via ng serve, and want to test the app offline.
I know in dev tools I can disable network access, however, this also prevents the files being served from localhost.
Currently, the only way I have found to test the app offline whilst still serving the files from localhost is simply to enable flight mode on my own computer, however, is there another way to achieve this?
Example screenshot, running ng serve whilst network is disabled
I think you are on the right path, but definitely there are alternatives to achieve the same results. The other possible ways I can think of:
Changing Internet Proxy Settings to point to a non-existent server, will block all your outgoing traffic but localhost.
Block outgoing traffic with Firewall.

Proxy server for Gatling

Recently I installed Gatling for performance testing on Ubuntu 14.04. And to run the recorder I needed to configure a proxy server in my browser. I tried to change proxy settings in Google chrome, but I don`t have rights. So I tried to do it using network settings in Ubuntu (Network -> Network proxy). But when I open a website which I need to test, nothing happens in the recorder.
So I do not really know is there a problem with the proxy server or Gatling itself? And how to check if the proxy server is configured correctly?
I would appreciate any help!
It's a bit too late, but I had a similar problem today. Was able to solve only by setting global IP address like xxx.xxx.xxx.xxx. Nor localhost nor 127.0.0.1 worked for me Chrome. After that I was able to notice http requests in Recorder inside Executed Events
Hopefully it could help somebody else
Edit : this is how setting looks like in Chrome, taking into account you have specified in Recorder Listening port to be 8000 also:

Using getUserMedia() on insecure origins in Chrome

I am developing a webpage that uses camera. When I test in Chrome in my local network, camera doesn't work and I get warning in the console:
getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See link for more details.
In the link provided there is an instruction to set some flags in Chrome. So I tried. My command looks like this:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --unsafely-treat-insecure-origin-as-secure="192.168.0.15" --user-data-dir=c:\chrome-dev-profile
But when I run Chrome I get this message:
You are using an unsupported command-line flag: --unsafely-treat-insecure-origin-as-secure. Stability and security will suffer.
What am I doing wrong?
Is there another way I can test in local network without setting up https server? I need this just for development.
Luka,
I've run into this bug just yesterday. I have not found out how to get Chrome to honor that flag on the command line yet. But I did find a workaround that works for my case.
I'm running my web services on a Linux machine that is running an ssh server. I'm testing on windows with chrome, and used putty to connect to the linux box from windows and then created a "local port forward" to make my remote linux box's ipaddress:port appear on localhost:port on windows. Depending on your platform this workaround may work for you. This approach isn't too cumbersome if you only have a few ports to forward.
In my particular case my setting for putty looked like
L8080 localhost:8080
To see more about port forwarding and ssh see: https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding

wso2 esb not running on linux server

I have some problem with my wso2-esb, it is on a remote linux server and seems to be succesfully started:
But when I try to access it, does not work:
I am not any expert in servers, it is the first time I do such thing, so I probably missed some basic step or something you might know.
Please suggest
Thanks a lot
SOLVED the server was firewalled, I had to add an exception to access it
Two things might be happening.
IE is masking an HTTP error response with its friendly errors.
Since this is a remote server, iptables could be running on the server, or there is another firewall in the way blocking that port.
To diagnose, I would start by disabling friendly error messages in IE, or using a different browser that doesn't do this. Instructions on how to disable it here: http://technet.microsoft.com/en-us/library/cc778248(v=ws.10).aspx
Next, if that doesn't resolve it, I would try running curl/wget on the server, and requesting the displayed URL. curl can be run with curl example.com and wget wget -qO- example.com, both will displayed the returned data (if any) on the terminal. If one returns a command not found, try the other. If that doesn't work, something is going on with your server. If it's returning something that looks like an error (e.g. a sever generated error page), I'd look into that too at this step.
If you appear to have connectivity issues, you can see if there's any iptables rules in place by running iptables -L on the server. A DROP all under Chain INPUT would cause this. You can read more about iptables here, and how to set it up for your needs here: https://help.ubuntu.com/community/IptablesHowTo (Even if you're not using ubuntu, this will still work for you, look in the "Allowing Incoming Traffic on Specific Ports" section, there's an example there you would need to adopt slightly for the non-standard port the server is running on). If there's an external firewall preventing access, you would need to talk with whoever is managing the sever.
Its seems some network issue. Can you try to ping the IP. If you cannt ping that means the machine is not reachable.
Regards,
/nuwan

How do I debug 503 errors in Openshift?

I have a scalable EAP 6.0 web app hosted on Openshift, and I get HTTP 503 error messages whenever I attempt to access the app. How do I fix this.
In my case this was an issue with the HAProxy cartridge, and not my web cartridge. I found this out by attempting to view the HAProxy status page at http://app-domain.rhcloud.com/haproxy-status/ (obviously you'll have to replace app and domain in that URL to match your own Openshift settings). That page was displaying a 503 error.
To fix it, ssh into the HAProxy session using
ssh 1234567890abcdef1234567890abcdef#app-domain.rhcloud.com
You'll get your actual username and hostname from your OpenShift web admin console. Then run
ctl_app restart
This will restart the HAProxy. And for me, that fixed the issue.
Another handy tip I found while debugging this was that you can browse to a specific instance of your web cartridge, bypassing the HAProxy.
In the HAProxy status page, you can see that the web cartridge instance is called gear-1234567890ab-domain. Drop the "gear-" prefix, and then use the remaining hex characters and domain name to form a URL like:
1234567890ab-domain.rhcloud.com
This will take you straight to the specific web cartridge, bypassing any HAProxy issues.
Thanks Phyxx,
Its working for me let elaborate your suggestion so that others can also benefit.
Step 1: cd /var/lib/openshift/your server/haproxy/conf
Step 2: vi haproxy.cfg
step 3: remove " option httpchk GET /"
step 4: save
step 5: ctl_app restart