-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
- Loading branch information
Showing
3 changed files
with
20 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,34 @@ | ||
tldr-bot | ||
======== | ||
# tldr-bot | ||
|
||
A simple [bot](https://github.com/tldr-bot) that performs automation tasks on the main [tldr repo](https://github.com/tldr-pages/tldr). | ||
A simple [bot](https://github.com/tldr-bot) that performs automation tasks on the main [tldr repository](https://github.com/tldr-pages/tldr). | ||
|
||
Quick start | ||
----------- | ||
## Quick start | ||
|
||
First of all, set the needed environment variables: | ||
- Generate a GitHub personal access token with the `repo` scope and then set the needed environment variables: | ||
|
||
FLASK_APP=/path/to/app/tldr_bot.py | ||
BOT_TOKEN=<token> | ||
BOT_USERNAME=<username> | ||
REPO_SLUG=tldr-pages/tldr | ||
PORT=<port> | ||
```sh | ||
FLASK_APP=/path/to/app/tldr_bot.py | ||
BOT_TOKEN=<token> | ||
BOT_USERNAME=<username> | ||
REPO_SLUG=tldr-pages/tldr | ||
PORT=<port> | ||
``` | ||
|
||
Then run using Flask: | ||
Then run the app using Flask: | ||
|
||
flask run --port=$PORT | ||
```sh | ||
flask run --port=$PORT | ||
``` | ||
|
||
Run as a service | ||
---------------- | ||
## Run as a service | ||
|
||
See the [`tldr-bot.service`](/tldr-bot.service) file for an example systemd unit configuration. | ||
|
||
Typically, the service is running under uWSGI and fronted by nginx. So you need to set the proper nginx config too. | ||
|
||
```sh | ||
location / { | ||
include uwsgi_params; | ||
uwsgi_pass 127.0.0.1:6129; | ||
} | ||
``` |