These are chat archives for ushahidi/Community

1st
Apr 2016
Ushbot
@ushbot
Apr 01 2016 08:17
[Kwesi Banson Jnr, Ushahidi] Hello Guys
[Kwesi Banson Jnr, Ushahidi] i am back again with another issue
Ushbot
@ushbot
Apr 01 2016 08:32
[Kwesi Banson Jnr, Ushahidi] i am done installing ushahidi platform and client but my client only says "It Works" when i open it in the browser
[Kwesi Banson Jnr, Ushahidi] in the documentation there is supposed to be a login page
Ushbot
@ushbot
Apr 01 2016 09:05
[Angela Oduor Lungati, Ushahidi] @Jason, kwesi is back with more questions..
[Jason Mule, Ushahidi] Hi Kwesi, it doesn't look like you have hosted you client properly. If you managed to run gulp build successfully, your docroot should point to server/www in platform-client. The page you are seeing is most likely the default page on you Apache webserver.
Ushbot
@ushbot
Apr 01 2016 09:33
[Kwesi Banson Jnr, Ushahidi] Hello Jason
[Kwesi Banson Jnr, Ushahidi] Please I need your help again
[Kwesi Banson Jnr, Ushahidi] when i run the client in the browser all i get is "It Works"
[Jason Mule, Ushahidi] Hi Kwesi, Did you go through the steps listed under Building the client?
[Kwesi Banson Jnr, Ushahidi] yes please i went through it word for word
Ushbot
@ushbot
Apr 01 2016 09:50
[Jason Mule, Ushahidi] You are installing on Apache right?
[Kwesi Banson Jnr, Ushahidi] yes Apache
[Kwesi Banson Jnr, Ushahidi] i have a created virtual host as per the documentation
[Kwesi Banson Jnr, Ushahidi] I have created a virtual host as per the documentation
Ushbot
@ushbot
Apr 01 2016 09:55
[Jason Mule, Ushahidi] where's your DocumentRoot pointing to?
[Kwesi Banson Jnr, Ushahidi] it points to client/server/www
Ushbot
@ushbot
Apr 01 2016 10:03
[Jason Mule, Ushahidi] And are you using the correct address to that virtual host? because you seem to be visiting the default Apache install page
[Kwesi Banson Jnr, Ushahidi] that is the correct address. My client platform is in the folder client that is why the path is
client/server/www
Ushbot
@ushbot
Apr 01 2016 10:09
[Jason Mule, Ushahidi] could you check the apache has permissions to read server/www?
[Kwesi Banson Jnr, Ushahidi] ok
[Kwesi Banson Jnr, Ushahidi] i will check and get back to you
Ushbot
@ushbot
Apr 01 2016 10:54
[Jason Mule, Ushahidi] @Kwesi any luck checking permissions. The goal here is to find out why apache is serving the default page instead of server/www
Ushbot
@ushbot
Apr 01 2016 11:02
[Kwesi Banson Jnr, Ushahidi] @Jason I checked the permissions as you said and fixed it but now I am getting Cross-Origin issues
[Kwesi Banson Jnr, Ushahidi] specifically this
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1' is therefore not allowed access.
Ushbot
@ushbot
Apr 01 2016 11:13
[Jason Mule, Ushahidi] What else are you seeing when you try to load the page?
[Kwesi Banson Jnr, Ushahidi] I also see this "Sorry, something went wrong. Try reloading the page"
Ushbot
@ushbot
Apr 01 2016 11:21
[Jason Mule, Ushahidi] any other console errors you are seeing?
[Kwesi Banson Jnr, Ushahidi] no please
Ushbot
@ushbot
Apr 01 2016 11:28
[Jason Mule, Ushahidi] What do you see when you navigate to the API url?
[Kwesi Banson Jnr, Ushahidi] i get a json output
Ushbot
@ushbot
Apr 01 2016 11:39
[Jason Mule, Ushahidi] sorry, I am having a hard time trying to reproduce this. What happens when you visit one of the endpoints e.g. /api/v3/config
[Jason Mule, Ushahidi] use the API url for this
Ushbot
@ushbot
Apr 01 2016 11:45
[Kwesi Banson Jnr, Ushahidi] ok
[Kwesi Banson Jnr, Ushahidi] let me try and see
Ushbot
@ushbot
Apr 01 2016 11:51
[Kwesi Banson Jnr, Ushahidi] I got another json output
[Kwesi Banson Jnr, Ushahidi] like this
{
"count": 3,
"results": [
{
"id": "features",
"url": "http://localhost/ushai_platform/httpdocs/index.php/api/v3/config/features",
"views": {
"map": true,
"list": true,
"chart": true,
"timeline": true,
"activity": true,
"plan": false
},
"data-providers": {
"smssync": true,
"twitter": true,
"frontlinesms": true,
"email": true,
"twilio": true,
"nexmo": true
[Jason Mule, Ushahidi] Ok, thanks. Was confirming that the API routes are ok.
[Kwesi Banson Jnr, Ushahidi] alright
[Kwesi Banson Jnr, Ushahidi] so what now
Ushbot
@ushbot
Apr 01 2016 12:04
[Jason Mule, Ushahidi] I don't know why this is failing on your client setup...
[Kwesi Banson Jnr, Ushahidi] hmmm
[Kwesi Banson Jnr, Ushahidi] i have a colleague here working on the same project but using a linux OS and he is also facing the same issues
Ushbot
@ushbot
Apr 01 2016 12:13
[Jason Mule, Ushahidi] btw, what's the HTTP status code in your error?
Ushbot
@ushbot
Apr 01 2016 12:19
[Jason Mule, Ushahidi] before you run gulp build did you create a .env file with BACKEND_URL set to your api url?
[Kwesi Banson Jnr, Ushahidi] yes i created the .env with the backend_url value set to the platform url
[Jason Mule, Ushahidi] The file is called .env?
[Jason Mule, Ushahidi] also please share your the HTTP status code you are getting with the error.
[Kwesi Banson Jnr, Ushahidi] yes the file is called .env and the status code is 200
Ushbot
@ushbot
Apr 01 2016 12:27
[Jason Mule, Ushahidi] So you are geting No 'Access-Control-Allow-Origin' header is present on the requested resource. and this comes with a 200?
[Jason Mule, Ushahidi] Could you check?
Metractive
@metractive
Apr 01 2016 12:34
Robbie, there is anything I could help the project with?
Ushbot
@ushbot
Apr 01 2016 12:43
[Kwesi Banson Jnr, Ushahidi] i am close to giving up
[Jason Mule, Ushahidi] @Kwesi Is it possible that the No 'Access-Control-Allow-Origin' header is being stripped by a firewall?
[Kwesi Banson Jnr, Ushahidi] i don't think my firewall is doing that
Metractive
@metractive
Apr 01 2016 12:43
Kwesi, I don't know about the project, but are you accessing the system through browser?
Ushbot
@ushbot
Apr 01 2016 12:44
[Kwesi Banson Jnr, Ushahidi] @ushbot yes through a browser
Metractive
@metractive
Apr 01 2016 12:44
What browser is it?
Ushbot
@ushbot
Apr 01 2016 12:45

[Kwesi Banson Jnr, Ushahidi] i have installed both the platform and the client

I am using firefox and chrome interchangeably

Metractive
@metractive
Apr 01 2016 12:45
When I had a problem similar, it was not a firewall problem
Ushbot
@ushbot
Apr 01 2016 12:45
[Kwesi Banson Jnr, Ushahidi] now the client is displaying "it works" again
Metractive
@metractive
Apr 01 2016 12:45
it was a access problem
You are accessing the URL that gives you this error, through JS?
Ushbot
@ushbot
Apr 01 2016 12:47
[Jason Mule, Ushahidi] @ushbot yeah the client is built using AngularJS
Metractive
@metractive
Apr 01 2016 12:48
I don't know if it can help you, but, on the endpoint, there was a kind of Whitelist that accepted my access.
Maybe is missing some Authorization key, just trying to help
I am giving an example of what I did on my project when I had this problem
Ushbot
@ushbot
Apr 01 2016 12:49
[Kwesi Banson Jnr, Ushahidi] which endpoint is that @ushbot
Metractive
@metractive
Apr 01 2016 12:50
It was my API, that accepted access from that URL. But I think that the ushahidi URL that you are accessing have some whitelisting, right?
Ushbot
@ushbot
Apr 01 2016 12:50
[Kwesi Banson Jnr, Ushahidi] i am yet to see any whitelist, where should i look ..?? @ushbot
Metractive
@metractive
Apr 01 2016 12:52
An example of my API:
header("Access-Control-Allow-Origin: http://url.com");
There was a header that allowed me to access through a URL
but if you want to have everyone to access
You change it to:
header("Access-Control-Allow-Origin: *");
But on JS, there is no configuration needed
you just access it directly
Ushbot
@ushbot
Apr 01 2016 12:53
[Kwesi Banson Jnr, Ushahidi] assess it directly in what way @ushbot
[Jason Mule, Ushahidi] @Kwesi do you want get on a call to try and troubleshoot your setup?
Metractive
@metractive
Apr 01 2016 12:55
Through Angular, but really can't help you further. Maybe taking the Jason it's the best way to troubleshoot this
Ushbot
@ushbot
Apr 01 2016 13:00
[Kwesi Banson Jnr, Ushahidi] i accessed it directly as you @ushbot said and i am not getting that access issue again
Metractive
@metractive
Apr 01 2016 13:00
No?
But it's appearing that message? "it works?
Ushbot
@ushbot
Apr 01 2016 13:01
[Kwesi Banson Jnr, Ushahidi] but when i try to log in i get a lot of errors in the console
Metractive
@metractive
Apr 01 2016 13:02
Now it's showing the login page?
Ushbot
@ushbot
Apr 01 2016 13:03

[Kwesi Banson Jnr, Ushahidi] yes i have the login page now

but when i try to login i get errors in the console like this ....... SyntaxError: Unexpected token <

Metractive
@metractive
Apr 01 2016 13:03
Debug the response of JS
maybe there is an intern error
Ushbot
@ushbot
Apr 01 2016 13:04
[Jason Mule, Ushahidi] @Kwesi for simplicity, go to server/www/js
[Jason Mule, Ushahidi] remove the js files in there and re-run gulp build
[Kwesi Banson Jnr, Ushahidi] yes i am sure its an internal error in the application ...but i am not familiar with angular js
Metractive
@metractive
Apr 01 2016 13:05
I am glad it helped in someway
Try to do what Jason said
Ushbot
@ushbot
Apr 01 2016 13:07
[Kwesi Banson Jnr, Ushahidi] @Jason which specific js files should i take out
[Jason Mule, Ushahidi] remove bundle.js and bundle.js.map
[Jason Mule, Ushahidi] and re-run gulp build
[Kwesi Banson Jnr, Ushahidi] ok
[Kwesi Banson Jnr, Ushahidi] i am get back to you
Metractive
@metractive
Apr 01 2016 13:09
Jason, I would like to help the project, can you guide me through this?
Ushbot
@ushbot
Apr 01 2016 13:11
[Jason Mule, Ushahidi] cool, did you go through this: https://www.ushahidi.com/support/add-code-to-ushahidi?
Metractive
@metractive
Apr 01 2016 13:12
I didn't forked the project yet, after that I can contact you?
Ushbot
@ushbot
Apr 01 2016 13:13
[Jason Mule, Ushahidi] sure. Take a look at https://github.com/ushahidi/platform/labels/Community%20Task for a list of community tasks that you could start tackling

[Link, Ushahidi]

ushahidi/platform

platform - Ushahidi Platform v3 API

Metractive
@metractive
Apr 01 2016 13:15
Thank you very much for that
And sorry if I have a bad english, good day for you guys
Ushbot
@ushbot
Apr 01 2016 13:15
[Kwesi Banson Jnr, Ushahidi] i would like to ask a question from you two
[Jason Mule, Ushahidi] np. Ping us if you need clarify anything
[Kwesi Banson Jnr, Ushahidi] what is specific request the main platform if i want to interact with it using a custom code
[Kwesi Banson Jnr, Ushahidi] what is specific request the main platform accept if i want to interact with it using a custom code
[Jason Mule, Ushahidi] the platform exposes an API. It's undocumented at the moment but you can see how it's used by looking at the platform-client code.
Ushbot
@ushbot
Apr 01 2016 13:20
[Kwesi Banson Jnr, Ushahidi] ok
Metractive
@metractive
Apr 01 2016 13:23
Jason, we have access to this API? Maybe people can help you to document it.
Ushbot
@ushbot
Apr 01 2016 13:25
[Jason Mule, Ushahidi] That would be great!
Metractive
@metractive
Apr 01 2016 13:28
Nice!
Ushbot
@ushbot
Apr 01 2016 13:28
[Jason Mule, Ushahidi] You can download the API by going to https://github.com/ushahidi/platform

[Link, Ushahidi]

ushahidi/platform

platform - Ushahidi Platform v3 API

Metractive
@metractive
Apr 01 2016 13:33
Thank you again Jason