Giter Club home page Giter Club logo

docker-parse-dashboard's Introduction

Parse Dashboard

Docker Pulls Docker Stars Docker Size Docker Layers Docker Tag Travis CI npm version Gitter Chat

Deploy Deploy to Docker Cloud Deploy to Tutum

Parse Dashboard is a standalone dashboard for managing your Parse apps. You can use it to manage your Parse Server apps and your apps that are running on Parse.com.

Getting Started With Docker

docker run -d -e APP_ID={appId} -e MASTER_KEY={masterKey} -e SERVER_URL={http://localhost:1337/parse} -p 4040:4040 yongjhih/parse-dashboard

or

wget https://github.com/yongjhih/docker-parse-dashboard/raw/master/docker-compose.yml
APP_ID={appId} MASTER_KEY={masterKey} SERVER_URL={http://localhost:1337/parse} docker-compose up -d

or specific version 1.0.10:

docker run -d -e APP_ID={appId} -e MASTER_KEY={masterKey} -e SERVER_URL={http://localhost:1337/parse} -p 4040:4040 yongjhih/parse-dashboard:1.0.10

or specific dev image for latest commit:

docker run -d -e APP_ID={appId} -e MASTER_KEY={masterKey} -e SERVER_URL={http://localhost:1337/parse} -p 4040:4040 yongjhih/parse-dashboard:dev

Usage of letsencrypt for parse-dashboard with https certificated domain

$ git clone https://github.com/yongjhih/docker-parse-server
$ cd docker-parse-server

$ USER1=yongjhih \
  USER1_PASSWORD=yongjhih \
  [email protected] \
  LETSENCRYPT_HOST=yongjhih.example.com \
  VIRTUAL_HOST=yongjhih.example.com \
  APP_ID=myAppId MASTER_KEY=myMasterKey docker-compose -f docker-compose-le.yml up

Open your https://yongjhih.example.com/ url and unblock browser protected scripts, that's it.

BTW, you can remove unused 80 port after volumes/proxy/certs generated:

sed -i -- '/- "80:80"/d' docker-compose-le.yml

Getting Started

Node.js version >= 4.3 is required to run the dashboard. You also need to be using Parse Server version 2.1.4 or higher.

Local Installation

Install the dashboard from npm.

npm install -g parse-dashboard

You can launch the dashboard for an app with a single command by supplying an app ID, master key, URL, and name like this:

parse-dashboard --appId yourAppId --masterKey yourMasterKey --serverURL "https://example.com/parse" --appName optionalName

You may set the host, port and mount path by supplying the --host, --port and --mountPath options to parse-dashboard. You can use anything you want as the app name, or leave it out in which case the app ID will be used.

After starting the dashboard, you can visit http://localhost:4040 in your browser:

Parse Dashboard

Configuring Parse Dashboard

You can also start the dashboard from the command line with a config file. To do this, create a new file called parse-dashboard-config.json inside your local Parse Dashboard directory hierarchy. The file should match the following format:

{
  "apps": [
    {
      "serverURL": "http://localhost:1337/parse",
      "appId": "myAppId",
      "masterKey": "myMasterKey",
      "appName": "MyApp"
    }
  ]
}

You can then start the dashboard using parse-dashboard --config parse-dashboard-config.json.

Managing Multiple Apps

Managing multiple apps from the same dashboard is also possible. Simply add additional entries into the parse-dashboard-config.json file's "apps" array.

You can manage self-hosted Parse Server apps, and apps that are hosted on Parse.com from the same dashboard. In your config file, you will need to add the restKey and javascriptKey as well as the other paramaters, which you can find on dashboard.parse.com. Set the serverURL to http://api.parse.com/1:

{
  "apps": [
    {
      "serverURL": "https://api.parse.com/1", // Hosted on Parse.com
      "appId": "myAppId",
      "masterKey": "myMasterKey",
      "javascriptKey": "myJavascriptKey",
      "restKey": "myRestKey",
      "appName": "My Parse.Com App",
      "production": true
    },
    {
      "serverURL": "http://localhost:1337/parse", // Self-hosted Parse Server
      "appId": "myAppId",
      "masterKey": "myMasterKey",
      "appName": "My Parse Server App"
    }
  ]
}

App Icon Configuration

Parse Dashboard supports adding an optional icon for each app, so you can identify them easier in the list. To do so, you must use the configuration file, define an iconsFolder in it, and define the iconName parameter for each app (including the extension). The path of the iconsFolder is relative to the configuration file. If you have installed ParseDashboard globally you need to use the full path as value for the iconsFolder. To visualize what it means, in the following example icons is a directory located under the same directory as the configuration file:

{
  "apps": [
    {
      "serverURL": "http://localhost:1337/parse",
      "appId": "myAppId",
      "masterKey": "myMasterKey",
      "appName": "My Parse Server App",
      "iconName": "MyAppIcon.png",
    }
  ],
  "iconsFolder": "icons"
}

Other Configuration Options

You can set appNameForURL in the config file for each app to control the url of your app within the dashboard. This can make it easier to use bookmarks or share links on your dashboard.

To change the app to production, simply set production to true in your config file. The default value is false if not specified.

Running as Express Middleware

Instead of starting Parse Dashboard with the CLI, you can also run it as an express middleware.

var express = require('express');
var ParseDashboard = require('parse-dashboard');

var dashboard = new ParseDashboard({
  "apps": [
    {
      "serverURL": "http://localhost:1337/parse",
      "appId": "myAppId",
      "masterKey": "myMasterKey",
      "appName": "MyApp"
    }
  ]
});

var app = express();

// make the Parse Dashboard available at /dashboard
app.use('/dashboard', dashboard);

var httpServer = require('http').createServer(app);
httpServer.listen(4040);

If you want to run both Parse Server and Parse Dashboard on the same server/port, you can run them both as express middleware:

var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var ParseDashboard = require('parse-dashboard');

var api = new ParseServer({
	// Parse Server settings
});

var dashboard = new ParseDashboard({
	// Parse Dashboard settings
});

var app = express();

// make the Parse Server available at /parse
app.use('/parse', api);

// make the Parse Dashboard available at /dashboard
app.use('/dashboard', dashboard);

var httpServer = require('http').createServer(app);
httpServer.listen(4040);

Deploying Parse Dashboard

Preparing for Deployment

Make sure the server URLs for your apps can be accessed by your browser. If you are deploying the dashboard, then localhost urls will not work.

Security Considerations

In order to securely deploy the dashboard without leaking your apps master key, you will need to use HTTPS and Basic Authentication.

The deployed dashboard detects if you are using a secure connection. If you are deploying the dashboard behind a load balancer or proxy that does early SSL termination, then the app won't be able to detect that the connection is secure. In this case, you can start the dashboard with the --allowInsecureHTTP=1 option. You will then be responsible for ensureing that your proxy or load balancer only allows HTTPS.

Configuring Basic Authentication

You can configure your dashboard for Basic Authentication by adding usernames and passwords your parse-dashboard-config.json configuration file:

{
  "apps": [{"...": "..."}],
  "users": [
    {
      "user":"user1",
      "pass":"pass"
    },
    {
      "user":"user2",
      "pass":"pass"
    }
  ]
}

Separating App Access Based on User Identity

If you have configured your dashboard to manage multiple applications, you can restrict the management of apps based on user identity.

To do so, update your parse-dashboard-config.json configuration file to match the following format:

{
  "apps": [{"...": "..."}],
  "users": [
     {
       "user":"user1",
       "pass":"pass1",
       "apps": [{"appId1": "myAppId1"}, {"appId2": "myAppId2"}]
     },
     {
       "user":"user2",
       "pass":"pass2",
       "apps": [{"appId1": "myAppId1"}]
     }  ]
}

The effect of such a configuration is as follows:

When user1 logs in, he/she will be able to manage appId1 and appId2 from the dashboard.

When user2 logs in, he/she will only be able to manage appId1 from the dashboard.

Deploy Docker

Getting npm versions of parse-dashboard:

docker run -it node npm view parse-dashboard

If you are not familiar with Docker, --port 8080 will be passed in as argument to the entrypoint to form the full command npm start -- --port 8080. The application will start at port 8080 inside the container and port 8080 will be mounted to port 80 on your host machine.

Contributing

We really want Parse to be yours, to see it grow and thrive in the open source community. Please see the Contributing to Parse Dashboard guide.

docker-parse-dashboard's People

Contributors

bgw avatar dcdspace avatar derekvanvliet avatar drew-gross avatar ericraio avatar felipeandradebezerra avatar flovilmart avatar funkenstrahlen avatar gateway avatar gavrix avatar gfosco avatar gimdongwoo avatar hallucinogen avatar hpello avatar hramos avatar jeremyplease avatar johnjelinek avatar kevinold avatar kilabyte avatar mihai-iorga avatar mnoble avatar mtrezza avatar natanrolnik avatar peterdotjs avatar poltib avatar r2doesinc avatar sideffect0 avatar timchunght avatar tylerbrock avatar yongjhih avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-parse-dashboard's Issues

Parse Dashboard can only be remotely accessed via HTTPS

I want to test docker parse dashboard on localhost. And when I navigate to http://<docker-ip>:4040, I get this error: Parse Dashboard can only be remotely accessed via HTTPS

Edit:
I successfully omit that error message by adding env PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 and SERVER_URL=http://<docker-ip>:1337/parse. But now I get new error message: Configure a user to access Parse Dashboard remotely. So my question is: how to add users via env on Docker?

Configure a user to access Parse Dashboard remotely

After passing a ENV with User1 and User1_password, this still cannot work

docker run -d \
             -e APP_ID=$(APP_ID)\
             -e MASTER_KEY=$(MASTER_KEY)\
             -e SERVER_URL=http://localhost:1337/parse \
             -e PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1  \
             -e USER1=yourUsername  \
             -e USER1_PASSWORD=yourUsernamesPassword \
             -p 4040:4040                      \
             --link parse-server               \
             --name parse-dashboard            \
             yongjhih/parse-dashboard

Parse Dashboard unable to connect to server

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. :)

webpack not found

I using One-click Deploy to heroku
and found that there is a problem showing that
webpack: not found

Below are the full logs from heroku app.

2016-07-30T08:12:07.836066+00:00 heroku[slug-compiler]: Slug compilation started
2016-07-30T08:12:07.836071+00:00 heroku[slug-compiler]: Slug compilation finished
2016-07-30T08:12:08.860189+00:00 heroku[web.1]: Starting process with command `npm start`
2016-07-30T08:12:11.094739+00:00 app[web.1]:
2016-07-30T08:12:11.094754+00:00 app[web.1]: > [email protected] start /app
2016-07-30T08:12:11.094755+00:00 app[web.1]: > node ./Parse-Dashboard/index.js & webpack --config webpack/build.config.js --progress --watch
2016-07-30T08:12:11.094756+00:00 app[web.1]:
2016-07-30T08:12:11.110299+00:00 app[web.1]: npm ERR! Linux 3.13.0-91-generic
2016-07-30T08:12:11.099355+00:00 app[web.1]: sh: 1: webpack: not found
2016-07-30T08:12:11.103601+00:00 app[web.1]:
2016-07-30T08:12:11.110594+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-07-30T08:12:11.110762+00:00 app[web.1]: npm ERR! node v5.11.1
2016-07-30T08:12:11.111533+00:00 app[web.1]: npm ERR! npm  v3.8.6
2016-07-30T08:12:11.111765+00:00 app[web.1]: npm ERR! file sh
2016-07-30T08:12:11.111905+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-07-30T08:12:11.112043+00:00 app[web.1]: npm ERR! errno ENOENT
2016-07-30T08:12:11.112215+00:00 app[web.1]: npm ERR! syscall spawn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.