-
-
Notifications
You must be signed in to change notification settings - Fork 517
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
Improve Parse Server AWS guide #893
base: gh-pages
Are you sure you want to change the base?
Conversation
Hi @parse-community/docs-review , can someone check this PR? |
``` | ||
Scroll down the file and Add `host, all, all, 0.0.0.0/0, md5`, has to be the first line before `local, all, postgres, , peer` | ||
|
||
| TYPE | DATABASE | USER | ADDRESS | METHOD | | ||
| ---- | -------- | ---- | ------- | ------ | | ||
| host | all | all | 0.0.0.0/0 | md5 | | ||
| local | all | postgres | | peer | | ||
{: .docs_table} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{: .docs_table} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. What is the benefit of a table without borders? To me it seems less readable, especially in the example above where the alignment varies.
|
||
Close the file and save the changes with `Control+X` and `Y` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close the file and save the changes with `Control+X` and `Y` | |
Close the file and save the changes with `Control`+`X` and `Y` |
``` | ||
Search for `#listen_addresses='localhost'`, uncomment the line and replace `localhost` for `*` | ||
|
||
Close the file and save the changes with `Control+X` and `Y` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close the file and save the changes with `Control+X` and `Y` | |
Close the file and save the changes with `Control`+`X` and `Y` |
Edit the `package.json` file with your preferences, but do not change the start line inside the scripts. | ||
```jsonc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit the `package.json` file with your preferences, but do not change the start line inside the scripts. | |
```jsonc | |
Edit the `package.json` file with your preferences, but do not change the start line inside the scripts. | |
```jsonc |
Run the bash script and follow the instructions, the script have some visual issues and the keys generation doesn't work. | ||
```bash | ||
sh <(curl -fsSL https://raw.githubusercontent.com/parse-community/parse-server/master/bootstrap.sh) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we abandoning the bash script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It offers little or no functionality and I decided to install parse-server from npm in this guide (don't remember right now if the bootstrap installs the npm version or the node one..), some functionalities didn't work, and had some visuals faults, I was looking to refactor the bootstrap into a more dynamic one with more options, etc (I think using node installer or something like that, the same I saw in other products), but not sure If I have the knowledge to do it...
``` | ||
After that, we need to setup the configuration file, use your own `appId`, `masterKey` and `clientKey`, use random strings or some generator tool to create secured keys. | ||
Close the file and save the changes with `Control+X` and `Y` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close the file and save the changes with `Control+X` and `Y` | |
Close the file and save the changes with `Control+X` and `Y` |
"appName": "MyApp", | ||
"cloud": "./cloud/main", | ||
"serverURL": "http://<IP_OR_DOMAIN>", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we just use "serverURL": "http://localhost",
to simplify this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This guide is for AWS so I think it has to be linked to some real ip/domain, (but this guide should work in local linux distribution too... )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The serverURL
is the local domain for the server to call itself. Localhost should usually work, unless in some special scenarios in which you want to distribute the load over a group of servers.
"appName": "MyApp", | ||
"cloud": "./cloud/main", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we removing the cloud code file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure/don't remember right now, probably because I saw somewhere? or because in this guide I didn't explain how to add the file... ?🤷♂️
Start Parse Server using the script command in the config.json | ||
Check if Parse Server is running typing `http://<IP_OR_DOMAIN>:1337` in your browser's address bar, you should see `{"error":"unauthorized"}`, that means the server is running. | ||
|
||
To daemonized parse-server to keep it running and alive all the time, you can use the package [PM2](https://pm2.keymetrics.io). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To daemonized parse-server to keep it running and alive all the time, you can use the package [PM2](https://pm2.keymetrics.io). | |
To daemonize Parse Server to keep it running and alive all the time, you can use the package [PM2](https://pm2.keymetrics.io). |
Install [yarn](https://yarnpkg.com) | ||
```bash | ||
sudo npm install yarn –g | ||
sudo npm install yarn -g |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is yarn required in this example? I don't see any yarn command being executed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what the purpose of these instructions are and who the target audience is?
It seems to be a contradiction that this aims to be a basic beginner's guide but it deploys Parse Server onto a raw EC2 instance and even runs a DB on the same instance. I'd think that a beginner would rather deploy it in a more abstracted EB environment that is pre-configured for Node, no need for ssh-ing into the instance or PM2. Then use a MongoDB Atlas free plan as DB, MongoDB being Parse Server's "default" and most-supported DB adapter.
Even deploying Postgres on a raw instance is a rather unusual scenario. Managing a DB on such a low level requires a skill set that goes far beyond that of a beginner. One would usually just use the AWS PostgresQL database service.
We do have a deploying-to-heroku-and-mongodb-atlas guide. I think the AWS-alternative would be "deploy on AWS EB and MongoDB Atlas" or even "deploy on AWS EB and AWS PostgresQL".
@MrMartinR before going into the conversations of the review feedback, what do you think about the previous comment? |
Hi, maybe this guide is not beginner or the advisable/normal way to do things, I did choose this way of deployment for my personal situation. I don't remember why I decided or someone told me to include it in the docs, I wanted to make a guide for my future 'me', if you feel that is not appropriate to be included in the docs, we can just remove it, I have no problem with that. I have no idea about AWS EB or Atlas (and to be honest I have no energy right now to play with that just to make a guide 🤔😅), and the option of having the EC2 instance for the app + the RDS for the DB was a bit expensive, thats why I decided to merge all in the same EC2, I am not sure if this guide is valid for linux OS / VM or even macOS. your call... 🤔 |
Got it. It's not a beginner's guide, as it chooses the rather unnecessarily complex way to deploy Parse Server directly on a EC2 instance. This raises more questions, as to how to secure the instance, how to make it accessible publicly in a controlled way (public gateway), how to preserve the logs in CloudWatch when the instance restarts, etc. This all comes out of the box when deploying in EB. It's also not an advanced guide, as deploying Parse Server and a raw PostgresQL instance on a EC2 instance is rather unusual for a professional application, and there is likely no new info in the guide for an advanced user. It provides a fragmented view of how to deploy Parse Server, picking some components and puzzling them together to "just make it work somehow" - a PoC if you will. It seems more an anecdotal account of a challenge you've set for yourself. I would remove the guide, as it doesn't seem to provide value beyond that, specifically for beginners. @parse-community/server your thoughts? |
Improve Parse Server AWS guide, issue #892