summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDidierRLopes <dro.lopes@campus.fct.unl.pt>2021-09-19 21:47:00 +0100
committerGitHub <noreply@github.com>2021-09-19 21:47:00 +0100
commit4a50ac101975402c46b1ead791257c04abc91806 (patch)
treec42fa92640ef4ba580d342332b5afa770606ac8f
parentcfa83a168096d0a94e64601de63706d22f26eb79 (diff)
Improve docker docs (#753)
* Update setenv with more API keys and fix FRED key * Improve docker documentation w.r.t. keys * Improving display for docker search in case display is not in en1 * Update DOCKER_ADVANCED.md * Highlight the :0 when writing own DISPLAY var * Update _index.md
-rw-r--r--DOCKER_ADVANCED.md44
-rw-r--r--docker/setenv37
-rwxr-xr-xwebsite/content/stocks/news/_index.md2
3 files changed, 50 insertions, 33 deletions
diff --git a/DOCKER_ADVANCED.md b/DOCKER_ADVANCED.md
index b3bad4b319e..edec910ea06 100644
--- a/DOCKER_ADVANCED.md
+++ b/DOCKER_ADVANCED.md
@@ -2,19 +2,16 @@
## Environment Variables
-In order to pass your API keys to the docker container, they must first be set in a local file. In the main repository, there is a file with predefined keys and terminal settings [setenv](gamestonk_terminal/docker/setenv). This can be downloaded or created on your own
+In order to pass your API keys to the docker container, they must first be set in a local file. In the main repository, there is a file with predefined keys and terminal settings [setenv](/docker/setenv). This can be downloaded or created on your own
The file should contain something such as:
```
-GT_API_KEY_FINANCIALMODELINGPREP="YOUR_KEY"
-GT_API_REDDIT_CLIENT_ID="YOUR_KEY"
-GT_API_REDDIT_CLIENT_SECRET="YOUR_KEY"
-GT_API_REDDIT_USERNAME="YOUR_KEY"
-GT_API_REDDIT_USER_AGENT=Python
-GT_API_REDDIT_PASSWORD="YOUR_KEY"
-GT_API_TWITTER_KEY="YOUR_KEY"
-GT_API_TWITTER_SECRET_KEY="YOUR_KEY"
-GT_FRED_API_KEY="YOUR_KEY"
+DISPLAY=
+
+GT_API_KEY_FINANCIALMODELINGPREP=qwerty123456
+...
+GT_API_POLYGON_KEY=qwerty123456
+GT_API_FRED_KEY=qwerty123456
HDF5_DISABLE_VERSION_CHECK=2
@@ -23,36 +20,45 @@ GTFF_ENABLE_THOUGHTS_DAY=False
GTFF_USE_PROMPT_TOOLKIT=True
GTFF_USE_ION=True
```
+where 'qwerty123456' corresponds to each individual API key. Note:
+
+1. Unlike API keys in [config_terminal](/gamestonk_terminal/config_terminal.py), these keys **DO NOT** use " ".
+2. This file is sensible to white spaces. Therefore, make sure there isn't an additional white space at the end of the key, otherwise it won't work.
-In order to run the docker container with the environment variables, make sure to edit with whatever keys you have and then run the container (`path/to/file`) should be replaced with wherever this file was created). If you have downloaded the entire repository and your current directory is `GamestonkTerminal`, then the path would be `docker/setenv`
+
+In order to run the docker container with the environment variables, make sure to edit with whatever keys you have and then run the container (`path/to/setenv`) should be replaced with wherever this file was created). If you have downloaded the entire repository and your current directory is `GamestonkTerminal`, then the path would be `docker/setenv`
```
-docker run -it --rm --env-file=path/to/file ghcr.io/gamestonkterminal/gst-poetry:latest
+docker run -it --rm --env-file=path/to/setenv ghcr.io/gamestonkterminal/gst-poetry:latest
```
-## X-Server
+## Display
+
+In order to display plots in the docker container, we can configure our XServer.
-In order to display plots in the docker container, we need to configure our XServer. Users familiar with Docker can just set the DISPLAY variable in their file described above.
+Users familiar with Docker and X-Server can set the `DISPLAY` variable in the file [setenv](/docker/setenv) described above. If you use this approach remember to add `:0` at the end of your inet address. E.g. `DISPLAY=192.168.1.155:0`.
+
+### X-Server
For help setting up the X-Server, I will go through this now:
-### Setting up X Quartz/X11
+#### Setting up X Quartz/X11
0. Install X Quartz from https://www.xquartz.org/
1. With X Quartz open: go to Preferences -> Security and make sure both options are enabled.
![Screen Shot 2021-09-08 at 12 21 48 PM](https://user-images.githubusercontent.com/18151143/132548605-235d774b-9aa6-4a45-afcf-58fb775d376a.png)
-
-### Adding the display for Docker
+#### Adding the display for Docker
From the command prompt or terminal, run the following to add your local configuration to the list of allowed access control:
```bash
-IP=$(ifconfig en1 | grep inet | awk '$1=="inet" {print $2}')
+IP=$(ifconfig | grep inet | grep -v -e "127.0.0.1" | awk '$1=="inet" {print $2}')
xhost + $IP
```
Now we can run the docker container, adding the display to the environment:
```bach
-docker run -it --rm --env-file=path/to/file -e DISPLAY=$IP:0 ghcr.io/gamestonkterminal/gst-poetry:latest
+docker run -it --rm --env-file=path/to/setenv -e DISPLAY=$IP:0 ghcr.io/gamestonkterminal/gst-poetry:latest
```
+
This container will be able to display all the same plots as the terminal interface.
diff --git a/docker/setenv b/docker/setenv
index 0ed4809bc98..954cfb7d682 100644
--- a/docker/setenv
+++ b/docker/setenv
@@ -1,17 +1,30 @@
-DISPLAY="ADDRESS-OF-YOUR-XSERVER"
+DISPLAY=
-GT_API_KEY_FINANCIALMODELINGPREP="YOUR_KEY"
-
-GT_API_REDDIT_CLIENT_ID="YOUR_KEY"
-GT_API_REDDIT_CLIENT_SECRET="YOUR_KEY"
-GT_API_REDDIT_USERNAME="YOUR_KEY"
+GT_API_KEY_FINANCIALMODELINGPREP=
+GT_API_KEY_ALPHAVANTAGE=
+GT_API_KEY_QUANDL=
+GT_API_REDDIT_CLIENT_ID=
+GT_API_REDDIT_CLIENT_SECRET=
+GT_API_REDDIT_USERNAME=
GT_API_REDDIT_USER_AGENT=Python
-GT_API_REDDIT_PASSWORD="YOUR_KEY"
-
-GT_API_TWITTER_KEY="YOUR_KEY"
-GT_API_TWITTER_SECRET_KEY="YOUR_KEY"
-
-GT_FRED_API_KEY="YOUR_KEY"
+GT_API_REDDIT_PASSWORD=
+GT_API_TWITTER_KEY=
+GT_API_TWITTER_SECRET_KEY=
+GT_API_TWITTER_BEARER_TOKEN=
+GT_API_POLYGON_KEY=
+GT_API_FRED_KEY=
+GT_API_NEWS_TOKEN=
+GT_API_TRADIER_TOKEN=
+GT_API_CMC_KEY=
+GT_API_BINANCE_KEY=
+GT_API_BINANCE_SECRET=
+GT_API_FINNHUB_KEY=
+GT_API_IEX_KEY=
+GT_API_SENTIMENTINVESTOR_KEY=
+GT_API_SENTIMENTINVESTOR_TOKEN=
+GT_API_COINBASE_KEY=
+GT_API_COINBASE_SECRET=
+GT_API_COINBASE_PASS_PHRASE=
HDF5_DISABLE_VERSION_CHECK=2
diff --git a/website/content/stocks/news/_index.md b/website/content/stocks/news/_index.md
index 8b53f3bc440..0b6bba77315 100755
--- a/website/content/stocks/news/_index.md
+++ b/website/content/stocks/news/_index.md
@@ -10,5 +10,3 @@ optional arguments:
Number of latest news being printed.
-h, --help show this help message
```
-
-<img width="896" alt="Captura de ecrã 2021-08-06, às 21 31 12" src="https://user-images.githubusercontent.com/25267873/128567977-7185427e-1511-460e-954d-047b53ea5c7d.png">