Skip to content

Commit

Permalink
Merge pull request #293 from canonical/add-search-key-config
Browse files Browse the repository at this point in the history
Add google search API key as charm config
  • Loading branch information
jpmartinspt authored May 30, 2024
2 parents c3a7b5d + ee7b19f commit 6204fb5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: pull_request
env:
FLASK_SECRET_KEY: insecure_test_key
SECRET_KEY: insecure_test_key

FLASK_GOOGLE_SEARCH_API_KEY: insecure_test_key
jobs:
run-dotrun:
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions charm/charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ description: This is the charm for the dqlite.io website.
extensions:
- flask-framework

config:
options:
google-search-api-key:
description: Google search API key
type: string
required: true

# Uncomment the integrations used by your application
# requires:
# mysql:
Expand Down
1 change: 1 addition & 0 deletions webapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# TODO: make this a configuration parameter on flask-base
os.environ["SECRET_KEY"] = os.environ["FLASK_SECRET_KEY"]
os.environ["SEARCH_API_KEY"] = os.environ["FLASK_GOOGLE_SEARCH_API_KEY"]

app = FlaskBase(
__name__,
Expand Down

0 comments on commit 6204fb5

Please sign in to comment.