Skip to content

Commit f0d294e

Browse files
committed
change env var keys
1 parent c36d2a3 commit f0d294e

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ it can be provided by **either** of the following methods:
2828
#### Github Personal Access Token
2929
* [FGPAT (recommended) or PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
3030
* Read-Only access to Actions (Workflows, workflow runs and artifacts) required for Private repos.
31-
* You will need to set: `GITHUB_TOKEN="<your_token>"` as the environment variable.
31+
* You will need to set: `GITHUB_TOKEN="<your_github_token>"` as the environment variable.
3232

3333
#### Github APP (Recommened)
3434
* Install [cctray-auth Github APP](https://github.com/apps/cctray-auth) to grant Read-Only access to Github Actions on Personal or Organization repositories.
@@ -60,9 +60,9 @@ docker build -t github-cctray:latest .
6060

6161
```bash
6262
docker run -p 8000:8000 \
63-
-e GITHUB_TOKEN="<your_token>" \
64-
-e BASIC_AUTH_USERNAME="<your_username>" \
65-
-e BASIC_AUTH_PASSWORD="<your_password>" \
63+
-e GITHUB_TOKEN="<your_github_token>" \
64+
-e LOGIN_USER="<set_username>" \
65+
-e LOGIN_PASSWORD="<set_password>" \
6666
github-cctray:latest
6767
```
6868

@@ -72,8 +72,8 @@ docker build -t github-cctray:latest .
7272

7373
```bash
7474
docker run -p 8000:8000 \
75-
-e BASIC_AUTH_USERNAME="<your_username>" \
76-
-e BASIC_AUTH_PASSWORD="<your_password>" \
75+
-e LOGIN_USER="<set_username>" \
76+
-e LOGIN_PASSWORD="<set_password>" \
7777
github-cctray:latest --mode app-auth
7878
```
7979

@@ -86,8 +86,8 @@ docker build -t github-cctray:latest .
8686
```bash
8787
docker run -p 8000:8000 \
8888
-e GITHUB_APP_TOKEN="<github_app_token>" \
89-
-e BASIC_AUTH_USERNAME="<your_username>" \
90-
-e BASIC_AUTH_PASSWORD="<your_password>" \
89+
-e LOGIN_USER="<set_username>" \
90+
-e LOGIN_PASSWORD="<set_password>" \
9191
github-cctray:latest --mode app-auth
9292
```
9393

@@ -117,7 +117,7 @@ curl -X GET http://localhost:8000?owner=<repo_owner>&repo=<repository_name>
117117

118118
* Optional Parameter
119119
```bash
120-
curl -X GET http://localhost:8000?owner=<repo_owner>&repo=<repository_name&token=<your_token>
120+
curl -X GET http://localhost:8000?owner=<repo_owner>&repo=<repository_name&token=<your_github_token>
121121
```
122122

123123
## Response
@@ -202,7 +202,7 @@ curl -X GET http://localhost:8000/limit
202202

203203
* With token in the query parameter
204204
```bash
205-
curl -X GET http://localhost:8000/limit?token=<your_token>
205+
curl -X GET http://localhost:8000/limit?token=<your_github_token>
206206
```
207207

208208
### Response
@@ -233,7 +233,7 @@ pip install -r requirements.txt
233233

234234
```bash
235235
* set necessary env variable to authenticate with Github (see Prerequisites)
236-
* export BASIC_AUTH_USERNAME=<user>
237-
* export BASIC_AUTH_PASSWORD=<pass>
236+
* export LOGIN_USER=<user>
237+
* export LOGIN_PASSWORD=<pass>
238238
* python3 app.py --mode [pat-auth|app-auth] # pat-auth is the default mode if no mode is set
239239
```

src/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
MAX_WORKERS = 10
66
TIMEOUT = 10
77

8-
BASIC_AUTH_USERNAME = os.environ.get("BASIC_AUTH_USERNAME")
9-
BASIC_AUTH_PASSWORD = os.environ.get("BASIC_AUTH_PASSWORD")
8+
LOGIN_USER = os.environ.get("LOGIN_USER")
9+
LOGIN_PASSWORD = os.environ.get("LOGIN_PASSWORD")
1010

1111
GITHUB_TOKEN = os.environ.get("GITHUB_TOKEN")
1212
GITHUB_APP_TOKEN = os.environ.get("GITHUB_APP_TOKEN")

src/routes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
from flask import Flask, request, make_response, jsonify
99
from flask_basicauth import BasicAuth
1010
from helpers import get_token, get_all_workflow_runs, redact_token, authenticate_with_device_flow
11-
from config import BASIC_AUTH_USERNAME, BASIC_AUTH_PASSWORD, TIMEOUT
11+
from config import LOGIN_USER, LOGIN_PASSWORD, TIMEOUT
1212

1313
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
1414
logger = logging.getLogger(__name__)
1515

1616
app = Flask('github-cctray')
17-
app.config['BASIC_AUTH_USERNAME'] = BASIC_AUTH_USERNAME
18-
app.config['BASIC_AUTH_PASSWORD'] = BASIC_AUTH_PASSWORD
17+
app.config['LOGIN_USER'] = LOGIN_USER
18+
app.config['LOGIN_PASSWORD'] = LOGIN_PASSWORD
1919

2020
basic_auth = BasicAuth(app)
2121
access_token = None

tests/test_app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class RoutesTestCase(unittest.TestCase):
77
def setUp(self):
88
"""Set up the test environment."""
99
app.testing = True
10-
app.config['BASIC_AUTH_USERNAME'] = 'user'
11-
app.config['BASIC_AUTH_PASSWORD'] = 'pass'
10+
app.config['LOGIN_USER'] = 'user'
11+
app.config['LOGIN_PASSWORD'] = 'pass'
1212
self.client = app.test_client()
1313
self.headers = {
1414
'Authorization': 'Basic dXNlcjpwYXNz'

0 commit comments

Comments
 (0)