Skip to content

Commit

Permalink
Moved the cert and key files into src (#193)
Browse files Browse the repository at this point in the history
* Changed path to .cert and .key files to use env vars

* Changed SSL_CERT_FILE and SSL_KEY_FILE to require names of files instead of paths

* Fixes issues caused when running in docker

Changed the directory of the ssl certificates as ../ did not work as intended when running in docker.
  • Loading branch information
Fluxticks authored Sep 15, 2021
1 parent dbad99f commit bd8f51d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ $ openssl req -new -out reqout.txt -key server.key
```
$ openssl x509 -req -in reqout.txt -days 3650 -sha1 -CAcreateserial -CA root.crt -CAkey servercakey.pem -out server.crt
```

6. Move your `server.crt` and `server.key` files into the root of the project. (Level above src)
6. Move your `server.crt` and `server.key` files into the `src` folder.

7. Set the environment variable `SSL_CERT_FILE` to the name of your `server.crt` file and the variable `SSL_KEY_FILE` to the name of your `server.key` file.

Expand Down
4 changes: 2 additions & 2 deletions src/esportsbot/cogs/TwitchCog.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,8 @@ def setup_http_listener():
# Setup the TwitchListener to listen for /webhook requests.
app = TwitchApp([(r"/webhook", TwitchListener)])
http_server = HTTPServer(app,
ssl_options={"certfile": f"../{os.getenv('SSL_CERT_FILE')}",
"keyfile": f"../{os.getenv('SSL_KEY_FILE')}"}
ssl_options={"certfile": f"{os.getenv('SSL_CERT_FILE')}",
"keyfile": f"{os.getenv('SSL_KEY_FILE')}"}
)
http_server.listen(443)
return http_server, app
Expand Down

0 comments on commit bd8f51d

Please sign in to comment.