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

Dashboard unable to connect to server #62

Open
2 tasks done
TAProgramming opened this issue Aug 29, 2016 · 5 comments
Open
2 tasks done

Dashboard unable to connect to server #62

TAProgramming opened this issue Aug 29, 2016 · 5 comments

Comments

@TAProgramming
Copy link

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Dashboard!

  • You're running version >=2.1.4 of Parse Server.
  • You've searched through existing issues. Chances are that your issue has been reported or resolved before.

Environment Setup

I'm running Ubuntu 14.04 with Docker 1.11.2 on a Digital Ocean server.

docker run -d
-e DATABASE_URI=${DATABASE_URI:-xxxx}
-e APP_ID=${APP_ID:-xxxx}
-e MASTER_KEY=${MASTER_KEY:-xxxx}
-e FILE_KEY=${FILE_KEY:-xxxx}
-p 127.0.0.1:1337:1337
--name parse-server
yongjhih/parse-server

docker run -d
-p 127.0.0.1:2022:22
--volumes-from parse-server
--name parse-cloud-code-git
yongjhih/parse-server:git

docker run -d -e PARSE_DASHBOARD_CONFIG='{ "apps": [ { "serverURL": "https://localhost:1337/parse/", "appId": "xxxx, "masterKey": "xxxx", "appName": "xxxx" } ], "users": [ { "user":"Admin", "pass":"Qwerty" } ] }' -p 4040:4040 --link parse-server --name parse-dashboard yongjhih/parse-dashboard

I have parse server, cloud code and dashboard running on localhost as per configuration. I have SSL set up with Lets-Encrypt and my domain is connecting to localhost via an Nginx wrapper.

My Nginx config:

# HTTPS - serve HTML from /usr/share/nginx/html, proxy requests to /parse/
# through to Parse Server
server {
        listen 443;
        server_name xxxx.com;

        root /usr/share/nginx/html;
        index index.html index.htm;

        ssl on;
        # Use certificate and key provided by Let's Encrypt:
        ssl_certificate /etc/letsencrypt/live/xxxx.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/xxxx.com/privkey.pem;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_ciphers 'xxxx';

        # Pass requests for /parse/ to Parse Server instance at localhost:1337
        location /parse/ {
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-NginX-Proxy true;
                proxy_pass http://localhost:1337/parse/;
                proxy_ssl_session_reuse off;
                proxy_set_header Host $http_host;
                proxy_redirect off;
        }

    location / {
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-NginX-Proxy true;
                proxy_pass http://localhost:4040/;
                proxy_ssl_session_reuse off;
                proxy_set_header Host $http_host;
                proxy_redirect off;
        }
}

Steps to reproduce

My Javascript Parse Web App connects to Parse Server and my MongoDB perfectly. Dashboard is the problem.
Localhost won't even connect, even if I try via HTTP. If I stop securing the ports by removing "127.0.0.1", use the serverURL in the dashboard config as my server's IP "http://xx.xxx.xxx.xx:1337/parse" and add -e PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1. Then I can connect via HTTP.
However I need to connect via HTTPS. My domain name set up via Nginx won't work either as the server URL option, even though I'm using my domain URL to connect my javascript web app to my parse server.

Please help. Thanks. :)

@yongjhih
Copy link
Owner

Ok, you wrapped a https proxy (https://your-parse-sever/parse) for parse-server (:1337). I think you must make https proxy work correctly first.

Try to run parse-server and parse-dashboard with
-e SERVER_URL=https://your-parse-sever/parse

@TAProgramming
Copy link
Author

TAProgramming commented Aug 31, 2016

Thanks for replying. I have tried your suggestion, however it now comes up with "unauthorized" on Parse Dashboard. If I remove -e PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 from the config then it comes up with this error even though it definitely is going through https: "Parse Dashboard can only be remotely accessed via HTTPS". My Master Keys are identical on both configurations for Parse server and dashboard.
Parse Server still functions correctly with my javascript web app though. Dashboard still not playing nice.

@TAProgramming
Copy link
Author

SOLVED.
Problem was incompatibility with parse server version - BUG.
Solution:
used yongjhih/parse-server:dev
(v. 2.2.18)
Also used yongjhih/parse-dashboard:1.0.15

This combination works.
No need for SERVER_URL on parse server config.
Used https://xxx.com/parse/ on parse dashboard config. This is the domain with SSL configured with letsencrypt and is a wrapper through Nginx proxy to http://localhost:1337/parse/

@TAProgramming
Copy link
Author

Update on bug.
If I call yongjhih/parse-server:2.2.18 directly when starting docker container for parse server, then parse dashboard comes up with unauthorized again and no longer connects to server.

However if I call yongjhih/parse-server:dev when starting docker container then dashboard connects through HTTPS to the server and it all works correctly.
This is despite yongjhih/parse-server:dev using version 2.2.18 anyway.

@agordeev
Copy link

I'm having the same issue. parse-server:dev and parse-dashboard:1.0.18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants