Skip to content

Commit

Permalink
Updated docs to clarify install process and fix typos (open-eats#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
KinRyuuu authored Apr 26, 2020
1 parent 9059404 commit 4184f02
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 27 deletions.
8 changes: 4 additions & 4 deletions docs/Creating_a_Release.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Creating a Release

1. Get an Auth token from github. See Github for details on how to do this.
2. Create a secrets folder and add a filer with the below strcuture:
1. Get an Auth token from github. See [Github Help](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) for details on how to do this.
2. Create a secrets folder and add a file with the following content:
```python
#!/usr/bin/env python
# encoding: utf-8
Expand All @@ -10,5 +10,5 @@
password = 'token'
```
3. Create a release doc and place in the releases folder. See the release folder for examples.
4. Once you have a release file created, you can run the release script. This script takes the release file you just created as it's only arg.
- `./release x.x.x.json`
4. Once you have a release file created, you can run the release script. This script takes the release file you just created as its only argument.
- `./release x.x.x.json`
12 changes: 5 additions & 7 deletions docs/Creating_a_proxy_server_for_docker.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Serving with a proxy server and HTTPS
By default the docker application doesn't come with an https server. It is also likely that you want to server other applications.

If you want to server the docker application via https or serve multiple applications via nginx/apache then you will also need a proxy server.
By default the docker application doesn't come with an https server. It is also likely that you want to serve other applications from your server.
If you want to serve the docker application via https or serve multiple applications via nginx/apache then you will also need a proxy server.

To change the port from which OpenEats is served you will need to update the left side of the port configuration in the `docker-prod.override.yml` file.
- Open the docker-prod.override.yml (your docker-compose configuration) file.
Expand All @@ -14,16 +13,15 @@ services:
- "7000:80"
```
- Restart you docker containers
- Restart your docker containers
- `
docker-compose -f docker-prod.yml -f docker-prod.override.yml -f docker-prod.version.yml restart`
- `docker-compose -f docker-prod.yml -f docker-prod.override.yml -f docker-prod.version.yml restart`
- OR
- Just run the `quick-start` script again: `./quick-start`
- Load localhost:7000 to confirm it worked.


It is highly recommended that you server your content over https. [Let's Encrypt](https://letsencrypt.org/getting-started/) provides a super easy, automated, and free process for serving your content over https. If you are using nginx, they will also automatically update your plain http vhost files.
It is highly recommended that you serve your content over https. [Let's Encrypt](https://letsencrypt.org/getting-started/) provides a super easy, automated, and free process for serving your content over https. If you are using nginx, they will also automatically update your plain http vhost files.

For more info on how to use proxies, see:
https://www.nginx.com/resources/admin-guide/reverse-proxy/
34 changes: 25 additions & 9 deletions docs/Running_the_App.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Running the App

The recommended way to run this app is with docker and docker-compose. You can install docker [here](https://hub.docker.com/search/?type=edition&offering=community) and docker-compose [here](https://docs.docker.com/compose/install/#prerequisites). If you are not familiar with docker you can read more about it on [their website](https://www.docker.com/what-docker).
The recommended way to run this app is with [docker](https://hub.docker.com/search/?type=edition&offering=community) and [docker-compose](https://docs.docker.com/compose/install/#prerequisites).
More information on docker can be found [here](https://www.docker.com/what-docker).

### Setup docker configuration for production

Expand All @@ -19,23 +20,37 @@ cp docs/samples/sample_docker_prod_override.yml docker-prod.override.yml
cp docs/samples/sample_env_file.list env_prod.list
```

The `docker-prod.override.yml` specifies the port that OpenEats is served from as well as any override commands you have. The nginx reverse proxy will default to run on port 80. It also allows the containers to reboot them-selfs when your machine restarts of if the containers fail. You can change this to `never` if you want to control when the containers start and stop.
The `docker-prod.override.yml` specifies the port that OpenEats is served from as well as any additional configuration that overrides the defaults.
It also allows the containers to reboot themselves when your machine restarts or if the containers fail. You can change this to `never` if you want to manually control when the containers start and stop.
By default the nginx docker container will serve as a reverse proxy for the other services, and serve its content on port 8000 on the host machine (forwarded from port 80 on the container).

#### Configure the environment file
Most of the settings in your `env_prod.list` can stay the same as `env_stg.list` that is in this repo. There are a few config settings that need to be changed for most configurations. See [Setting_up_env_file.md](Setting_up_env_file.md) for a complete description of the environment variables.
Most of the settings in your `env_prod.list` can stay the same as `env_stg.list` that is in this repo. There are a few config settings that need to be changed for most configurations.
See [Setting_up_env_file.md](Setting_up_env_file.md) for a complete description of the environment variables.

- [DATABASE_PASSWORD](Setting_up_env_file.md#MYSQL_ROOT_PASSWORD)
- [DJANGO_SECRET_KEY](Setting_up_env_file.md#DJANGO_SECRET_KEY)
- [ALLOWED_HOST](Setting_up_env_file.md#ALLOWED_HOST)
- [NODE_API_URL](Setting_up_env_file.md#NODE_API_URL)


##### Note For LAN/Internet or static IP hosting
If you are going to be hosting OpenEats from LAN/intranet or a static IP then you should double check two things within your environment file.
##### Note on the ALLOWED_HOST option
The ALLOWED_HOST option must be set equal to the domain or IP address that users will access the site from.
For example, if you are hosting on "mydomain.com", enter:
``ALLOWED_HOST=mydomain.com``

Given that the IP address for the OpenEats server is `192.168.0.1` and port is `1234`.
1. Confirm that `ALLOWED_HOST=192.168.0.1`
2. Confirm that `NODE_API_URL=http://192.168.0.1:1234`
If you are hosting on `192.168.0.12`, enter:
``ALLOWED_HOST=192.168.0.12``

Note that it is not necessary to specify the port.

##### Note on the NODE_API_URL option

The NODE_API_URL specifies the URL that services use to contact the API.
If you are running OpenEats on a port other than 80 or 443, it is necessary to specify this port in the NODE_API_URL option.
E.g. Given that the IP address for the OpenEats server is `192.168.0.12` and port is `1234`.

``NODE_API_URL=http://192.168.0.1:1234``

#### Connecting to a remote DB
If you are connecting the API to a remote DB (any non-dockerized DB) you need to setup the following configs to your env file.
Expand Down Expand Up @@ -88,4 +103,5 @@ docker-compose -f docker-prod.yml run --rm --entrypoint 'sh' api
```

### Setting up a Proxy Server and HTTPS
The nginx reverse proxy will default to run on port 80. You will most likely want to change the port that nginx runs on. See [Creating a proxy server for docker](Creating_a_proxy_server_for_docker.md) for more information on how to configure an nginx server to serve OpenEats.
The nginx reverse proxy will default to run on port 8000. You will most likely want to change the port that nginx runs on.
See [Creating a proxy server for docker](Creating_a_proxy_server_for_docker.md) for more information on how to configure an nginx server to serve OpenEats.
6 changes: 3 additions & 3 deletions docs/Setting_up_env_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ EX: `MYSQL_PORT=3306`

## Django config
#### API_URL
This URL and port combination is used my gunicorn to server the API.
For docker instances we need to server via `0.0.0.0`.
This URL and port combination is used by gunicorn to serve the API.
For docker instances we need to serve via `0.0.0.0`.
`0.0.0.0` means "all IPv4 addresses on the local machine".
If a host has two IP addresses, 192.168.1.1 and 10.1.2.1,
and a server running on the host listens on 0.0.0.0,
Expand Down Expand Up @@ -64,7 +64,7 @@ The settings file that django will use.
EX: `DJANGO_SETTINGS_MODULE=base.settings`

#### DJANGO_DEBUG
Set environment to the Django app in.
Set the debug environment of the Django app.
This should be set to `False` in production and `True` to debug any issues.

EX: `DJANGO_DEBUG=False`
Expand Down
9 changes: 6 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ Web Status:

OpenEats is a recipe management site that allows users to create, share, and store their personal collection of recipes. This fork uses Django Rest Framework as a backend and React (with flux) as a front end.

The usage for the app is intended for a single user or a small group. For my personal use, I would be an admin user and a few (about 5-6) friends and family would be normal users. Admin users can add other users to the project (no open sign-ups), make changes to the available Cuisines and Courses, and add to the homepage banner. Normal users just have the ability to add recipes. Below are a few of the core features the app provides.
OpenEats is intended for a single user or a small group.
For my personal use, I would be an admin user and a few (about 5-6) friends and family would be normal users.
Admin users can add other users to the project (no open sign-ups), make changes to the available Cuisines and Courses, and add to the homepage banner.
Normal users just have the ability to add recipes. Below are a few of the core features the app provides.

- Creating, viewing, sharing, and editing recipes.
- Update Serving information on the fly.
- Browsing and searching for recipes.
- Creating grocery lists.
- Automatically add recipes to your grocery lists.
- Quickly print recipe.
- Quickly printing recipes.
- Linking recipes and ingredient grouping.

### [Read the docs on getting started here!](https://github.com/open-eats/OpenEats/blob/master/docs/Running_the_App.md)
Expand All @@ -27,4 +30,4 @@ The usage for the app is intended for a single user or a small group. For my per
# Contributing
Please read the [contribution guidelines](https://github.com/open-eats/OpenEats/blob/master/CONTRIBUTING.md) in order to make the contribution process easy and effective for everyone involved.

For a guide on how to setup an environment for development see [this guide](https://github.com/open-eats/OpenEats/blob/master/docs/Running_the_App_in_dev.md).
For a guide on how to setup an environment for development see [this guide](https://github.com/open-eats/OpenEats/blob/master/docs/Running_the_App_in_dev.md).
2 changes: 1 addition & 1 deletion docs/samples/sample_docker_prod_override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ services:
web:
restart: on-failure
db:
restart: always
restart: always

0 comments on commit 4184f02

Please sign in to comment.