Skip to content

Commit

Permalink
add CORS (hail-is#99)
Browse files Browse the repository at this point in the history
- fix the Makefile
 - add CORS package dependency
 - add CORS to all endpoints

The CI does not serve secret information so accessing it from
arbitrary domains is not a problem.
  • Loading branch information
danking authored and cseed committed Sep 18, 2018
1 parent 70b47a1 commit c3f3993
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ restart-batch-proxy:
| head -n 1))
kubectl port-forward ${BATCH_POD} 8888:5000 > batch-proxy.log 2>batch-proxy.err & echo $$! > batch-proxy.pid

run-local: HAIL_CI_REMOTE_PORT = 3000 restart-all-proxies
run-local: HAIL_CI_REMOTE_PORT = 3000
run-local: restart-all-proxies
SELF_HOSTNAME=http://35.232.159.176:${HAIL_CI_REMOTE_PORT} \
BATCH_SERVER_URL=http://127.0.0.1:${HAIL_CI_LOCAL_BATCH_PORT} \
source activate hail-ci && python ci/ci.py
Expand Down
2 changes: 2 additions & 0 deletions ci/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
WATCHED_TARGETS, \
REFRESH_INTERVAL_IN_SECONDS
from flask import Flask, request, jsonify
from flask_cors import CORS
from git_state import Repo, FQRef, FQSHA
from github import open_pulls, overall_review_state, latest_sha_for_ref
from google_storage import \
Expand All @@ -27,6 +28,7 @@
prs = PRS({k: v for [k, v] in WATCHED_TARGETS})

app = Flask(__name__)
CORS(app)


@app.errorhandler(BadStatus)
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ dependencies:
- pip
- pip:
- google-cloud-storage
- flask-cors

0 comments on commit c3f3993

Please sign in to comment.