Skip to content

Commit

Permalink
Merge pull request #169 from hotosm/fix/build
Browse files Browse the repository at this point in the history
Fix Build
  • Loading branch information
kshitijrajsharma authored Nov 16, 2023
2 parents e1a4bd3 + 6e73c43 commit ca9e4a9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/Unit-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,14 @@ jobs:
- name: Launch Worker
run: |
export OSM_CLIENT_ID=thisisfakeosmcliendid
export OSM_CLIENT_SECRET=thisisclientosm
export APP_SECRET_KEY=thisissecretkey
celery --app API.api_worker worker --loglevel=INFO --queues='raw_default' &
- name: Run Tests
run: |
export OSM_CLIENT_ID=thisisfakeosmcliendid
export OSM_CLIENT_SECRET=thisisclientosm
export APP_SECRET_KEY=thisissecretkey
py.test -v -s
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,20 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
- name: Run uvicorn server
run: |
export OSM_CLIENT_ID=thisisfakeosmcliendid
export OSM_CLIENT_SECRET=thisisclientosm
export APP_SECRET_KEY=thisissecretkey
uvicorn API.main:app &> uvicorn.log &
env:
PORT: 8000
- name: Run celery server
run: |
export OSM_CLIENT_ID=thisisfakeosmcliendid
export OSM_CLIENT_SECRET=thisisclientosm
export APP_SECRET_KEY=thisissecretkey
celery --app API.api_worker worker --loglevel=DEBUG &> worker.log &
- name: Run flower dashboard
run: |
Expand Down
4 changes: 2 additions & 2 deletions config.txt.sample
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ PGDATABASE=rawdata
# for scope. Callback / Redirect URI should be set when the OAuth2 app
# is created on OSM portal. App secret key is a high-entropy string.
[OAUTH]
OSM_CLIENT_ID=0yhbzr7-e0F-DGgyxXOyq2Y4d_sYLflMzVvLIfRtxHg
OSM_CLIENT_SECRET= KI59u4PLCQFAd8Vo2oewaHNmlf2EfTcfGgwWd2VCtk8
OSM_CLIENT_ID=0yhbzr7-e0F-DGgyxXOyq2Y4d_sYLfdflMzVvLIfRtxHg
OSM_CLIENT_SECRET= KI59u4PLCQFAd8Vo2oewaHNmlf2EfTcfGgwWd2VCsdtk8
;OSM_URL=https://www.openstreetmap.org
;OSM_PERMISSION_SCOPE=read_prefs
LOGIN_REDIRECT_URI=http://raw-data-test.example.net:8000/v1/auth/callback/
Expand Down
2 changes: 1 addition & 1 deletion src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def get_oauth_credentials() -> tuple:
"OAUTH", "APP_SECRET_KEY"
)
login_redirect_uri = os.environ.get("LOGIN_REDIRECT_URI") or config.get(
"OAUTH", "LOGIN_REDIRECT_URI"
"OAUTH", "LOGIN_REDIRECT_URI", fallback="http://127.0.0.1:8000/v1/auth/callback"
)
scope = os.environ.get("OSM_PERMISSION_SCOPE") or config.get(
"OAUTH", "OSM_PERMISSION_SCOPE", fallback="read_prefs"
Expand Down

0 comments on commit ca9e4a9

Please sign in to comment.