Skip to content

Commit 5cd84ed

Browse files
committed
use config for trigger rebuild token
1 parent 358b314 commit 5cd84ed

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

.github/workflows/deploy.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ jobs:
3434
- name: Deploy
3535
uses: DefangLabs/[email protected]
3636
with:
37-
config-env-vars: ASK_TOKEN OPENAI_API_KEY SECRET_KEY SEGMENT_WRITE_KEY DISCORD_APP_ID DISCORD_TOKEN DISCORD_PUBLIC_KEY
37+
config-env-vars: ASK_TOKEN OPENAI_API_KEY REBUILD_TOKEN SECRET_KEY SEGMENT_WRITE_KEY DISCORD_APP_ID DISCORD_TOKEN DISCORD_PUBLIC_KEY
3838
mode: production
3939
provider: aws
4040

4141
env:
4242
ASK_TOKEN: ${{ secrets.ASK_TOKEN }}
4343
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
44+
REBUILD_TOKEN: ${{ secrets.REBUILD_TOKEN }}
4445
SECRET_KEY: ${{ secrets.SECRET_KEY }}
4546
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
4647
DISCORD_APP_ID: ${{ secrets.DISCORD_APP_ID }}

app/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def v1_ask():
9191
@csrf.exempt
9292
def trigger_rebuild():
9393
token = request.args.get('token')
94-
if token != 'b75c82e0-2f47-4fcb-8b02-d66932803885':
94+
if token != os.getenv('REBUILD_TOKEN'):
9595
return jsonify({"error": "Unauthorized"}), 401
9696
try:
9797
print("Running get_knowledge_base.py script...")

compose.dev.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ services:
88
environment:
99
ASK_TOKEN: asktoken
1010
FLASK_APP: app.py
11+
REBUILD_TOKEN: rebuildtoken
1112
SECRET_KEY: supersecret
1213
SEGMENT_WRITE_KEY: ${SEGMENT_WRITE_KEY} # Set your Segment write key here or in the .env file
1314
SESSION_COOKIE_SECURE: 0

compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ services:
1515
ASK_TOKEN:
1616
FLASK_APP: app.py
1717
DEBUG: 0
18+
REBUILD_TOKEN:
1819
SECRET_KEY:
1920
SEGMENT_WRITE_KEY:
2021
SESSION_COOKIE_SECURE: 1

0 commit comments

Comments
 (0)