Skip to content

Can we Install the dashboard on Heroku,? #159

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

Closed
wallydsyh opened this issue Mar 17, 2016 · 29 comments
Closed

Can we Install the dashboard on Heroku,? #159

wallydsyh opened this issue Mar 17, 2016 · 29 comments

Comments

@wallydsyh
Copy link

Hello,

I was wondering if we can install the Dashboard on heroku.

I just tried and got this error
image
if you have any idea. please

Thanks you.

@yguy08
Copy link

yguy08 commented Mar 17, 2016

Hey @wallydsyh,

Take a look here: https://github.com/ParsePlatform/parse-dashboard#deploying-the-dashboard

The section says, "If you are deploying the dashboard, then localhost urls will not work."

Are you still using localhost urls?

@wallydsyh
Copy link
Author

Thanks you for the link . but it seems like its not available anymore.
yes, my dashboard is running on localhost perfectly, but i wanted to know i could deploy iton heroku as well as did with the Parse Server.

@yguy08
Copy link

yguy08 commented Mar 17, 2016

@wallydsyh my fault, fixed it. Go ahead and try it again. That section should point you in the right direction.

If it works on localhost perfectly, that's great!

If you want to deploy the dashboard anywhere you will have to make some changes to your URLs.

Did you make changes to your URLs or are you still using localhost URLs in the code you deployed to Heroku when you got the Application Error?

@wallydsyh
Copy link
Author

Actually when i deployed the app on heroku i changed the URL

here is how it looks like
"apps": [
{
"serverURL": "http://something.herokuapp.com/parse",
"appId": "AppId",
"masterKey": "masterKey",
"appName": "Appname"
}
]

the Url is the Url in which i install the Parse Server.

i don't really know which URL i should pass in the "serverUrl"
do you have any idea please ?

@benaneesh
Copy link

@wallydsyh are you still getting the heroku application error?

I just tried this with these config:

{
  "apps": [
    {
      "serverURL": "https://your-app.herokuapp.com/parse",
      "appId": "your_app_id",
      "masterKey": "your_master_key",
      "javascriptKey": "your_javascript_key",
      "restKey": "yor_rest_key",
      "appName": "cover-migration"
    }
  ],
  "users": [
    {
      "user":"[email protected]",
      "pass":"password"
    }
  ]
}

but there seems to be another error now, an empty page with this error:

screen shot 2016-03-17 at 12 51 47 pm

@wallydsyh
Copy link
Author

Excatly, i have the same thing , a blank page too.

you know what is causing it ?

@drew-gross
Copy link
Contributor

We've pushed a new version to npm and recommend using that instead of the old installation method. The npm package shouldn't have that issue, so I recommend you try that one.

@Dima564
Copy link

Dima564 commented Mar 23, 2016

@drew-gross I'm still getting "Unexpected token <" when I deploy to Heroku

@drew-gross
Copy link
Contributor

Could you open a new issue describing how you are installing and deploying?

@flyingmate
Copy link

I had the same problem, and found bundle.js was empty (ignored by .gitignore).
So I deleted /bundles line in .gitignore file, there was some progress.
Then got 'Parse Dashboard can only be remotely accessed via HTTPS' error page (better than blank page), so set PARSE_DASHBOARD_ALLOW_INSECURE_HTTP to 1 on heroku env setting.
It's now working finally

@LaChrome
Copy link

LaChrome commented Apr 7, 2016

@flyingmate I tried deleting /bundles line in .gitignore file, but this didn't solve the problem for me. I still get the same blank page with "Unexpected token <" error in the source.

Did you change anything else to possibly fix this issue?

@drew-gross would you like me to open up a issue for this? I will include all the steps to reproduce. Thanks

@flyingmate
Copy link

@Apptation you need to check if the asset files under pubilc/bundles folder are deploying to heroku correctly. [Unexpected token <] issue must be caused by the absence of asset files

@LaChrome
Copy link

LaChrome commented Apr 7, 2016

@flyingmate there is no public/bundles folder in the repo. Do I misunderstand or am I missing something?
Thx

@flyingmate
Copy link

@Apptation you should 'npm install', then you will have bundles folder under Parse-Dashboard/public. And you need to set your apps on parse-dashboard-config.json file before deploying

@LaChrome
Copy link

LaChrome commented Apr 7, 2016

@flyingmate That fixed the obvious problem. Running npm install locally, and then pushing to Heroku

Thanks! Running Parse Dashboard smoothly on Heroku now.

@flyingmate
Copy link

@Apptation :)

@andrewcbancroft
Copy link
Contributor

I really appreciate this thread, but it took me far too long to come across it before I finally got my Parse Dashboard deployed and working. To keep track of it for myself, I created a walkthrough at https://www.andrewcbancroft.com/2016/04/17/deploying-parse-dashboard/ .

I would be interested in contributing this walkthrough or something like it to the docs of this project to help others out if that'd be well-received. I just created it on my blog so that I, myself could remember the steps. In any case, I'm hoping the post sheds a little more light on how to fix the "Unexpected token <" error.

@drew-gross
Copy link
Contributor

Looks good to me. A PR adding the link to the README would definitely be accepted! You might be interested to know that we also have a npm package now that might simplify your deployment flow.

@andrewcbancroft
Copy link
Contributor

Thanks Drew - I'll work something up! I don't mind extracting the content from my blog and embedding it directly into the README somehow if that's more appropriate.

The npm package approach sounds great! I'm assuming it'd be a simple npm install for the package, and then the deployment would be the output of that, plus the needed config updates?

@drew-gross
Copy link
Contributor

The npm package include command line tool to serve the app or mount on an existing express app. Setting up Heroku to run the command line tool is probably the way to go, with a command line flag pointing to the config file. Heroku isn't really set up to be used that way, so you may have to come up with something that deals with that.

@rizdem
Copy link

rizdem commented May 10, 2016

Hi Does anybody know how to help with my issue, so i got my dashboard loaded to heroic where i was displayed with the 'Parse Dashboard can only be remotely accessed via HTTPS' i then went in to my config variables on heroku and added the PARSE_DASHBOARD_ALLOW_INSECURE_HTTP now all i get is my app saying 'unable to connect to server' when i open the web inspector it says that its being blocked. 'was not allowed to display insecure content from' then my parse server url can anybody help me. its my last hurdle.

Thanks in advance

@johnantoni
Copy link

johnantoni commented Jun 1, 2016

managed to get it up on heroku, this is the best working tutorial i've found:

https://www.codementor.io/nodejs/tutorial/deploy-parse-dashboard-on-heroku

for heroku, you will need to set the config variable even if you use heroku's https path

PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1

also --allowInsecureHTTP in the Procfile has no effect on heroku, you can drop that. guessing it's different with an actual docker setup.

i'm guessing heroku's free https uses a pass-thru so the parse-dashboard see's it as not real https, if you buy a certificate that's a different story.

@joevo2
Copy link

joevo2 commented Jul 11, 2016

I'm using the parse dashboard as a middleware with my parse server on heroku. adding the PARSE_DASHBOARD_ALLOW_INSECURE_HTTP doesn't seems to work. Any idea on how to make it work? i tried to run the parse dashboard locally to connect to it doesn't work as well. but of course running the entire parse server + parse dashboard middleware works locally

Update: got it working by following @warrenca #46

var config = {
"allowInsecureHTTP": true,
"apps": [
{
"serverURL": "http://localhost:1337/parse",
"appId": "xxx",
"masterKey": "yyy",
"appName": "appName"
}
],"users": [
{
"user":"user",
"pass":"pass"
}
]
};
var dashboard = new ParseDashboard(config, config.allowInsecureHTTP);

@markmssd
Copy link

markmssd commented Jul 22, 2016

Instead of pushing the Parse-Dashboard/parse-dashboard-config.json file to Github, I'm trying to deploy with npm run build && npm start, and setting environment variables in Heroku's settings. I've also set PARSE_DASHBOARD_ALLOW_INSECURE_HTTP to 1... but no luck. I'm expecting the npm run build to generate the required files in /production/bundles directly, rather than generating them on my local and pushing them to Github.

Variables set in Heroku's settings:
PARSE_DASHBOARD_APP_ID
PARSE_DASHBOARD_APP_NAME
PARSE_DASHBOARD_MASTER_KEY
PARSE_DASHBOARD_SERVER_URL
PARSE_DASHBOARD_USER_ID
PARSE_DASHBOARD_USER_PASSWORD
PARSE_DASHBOARD_ALLOW_INSECURE_HTTP

Any pointers? I'm sure many people would prefer this method, rather than pushing secret masterKey/passwords to Github. Even in a private repo, it's a bad practice.

Thanks in advance!

@krzkz94
Copy link

krzkz94 commented Jul 29, 2016

@markmssd
So, i have found a solution for heroku's bundle generation, the problem is this variable (env) NPM_CONFIG_PRODUCTION, if you set it to false, it will then install the devDependencies and subsequently run webpack, which will generate the bundle files.

I would like to add that removing the Procfile helps honor the environment variables as well.

@markmssd
Copy link

markmssd commented Jul 31, 2016

@krzykz
Hey thanks for your suggestion! I will give it a try when I have time... I wasn't even aware of the NPM_CONFIG_PRODUCTION env variable.

For now, I used a workaround. I used heroku run bash to access my Heroku repo, and I modified the parse-dashboard-config.json file directly through here. As for the bundle files problem, I installed Parse-Dashboard through as an npm (through package.json).

P.S: instead of removing the procfile, you can modify the commands to use inside it. Instead of the default command telling it to use the config file, you can change it to npm start. npm install is already triggered automatically by Heroku, so no need to put it before npm start.

@harryworld
Copy link

Is it still secure on Heroku after using PARSE_DASHBOARD_ALLOW_INSECURE_HTTP? I checked the network audit on Chrome, seems all the requests are still https, with POST handling the login

douglasmuraoka pushed a commit that referenced this issue Nov 29, 2019
@Tapaniya25
Copy link

I have set my value in Parse-Dashboard/parse-dashboard-config.json then i push git on my account. After try to deploy on herocku, But got below error, So, i change value to "scripts": {"start": "node ./Parse-Dashboard/index.js --config ./Parse-Dashboard/parse-dashboard-config.json --allowInsecureHTTP=1"}. Then also getting same error.
I have attached logs
Herocku Logs.txt

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

No branches or pull requests