fix token name

This commit is contained in:
virusdefender 2017-12-06 11:50:15 +08:00
parent 3c4f5b3933
commit 65c96739c9
3 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
version: "2"
version: "3"
services:
judge_server:
image: registry.cn-hangzhou.aliyuncs.com/onlinejudge/judge_server
@ -16,11 +16,11 @@ services:
- /spj:exec,mode=777
volumes:
- $PWD/tests/test_case:/test_case:ro
- /data/log:/log
- $PWD/log:/log
- $PWD/server:/code:ro
environment:
- backend_url=http://backend:8000/api/judge_server_heartbeat
- service_url=http://judge-server:12358
- BACKEND_URL=http://backend:8000/api/judge_server_heartbeat
- SERVICE_URL=http://judge-server:12358
- TOKEN=YOUR_TOKEN_HERE
ports:
- "0.0.0.0:12358:8080"

View File

@ -11,8 +11,8 @@ from utils import server_info, logger, token
class JudgeService(object):
def __init__(self):
self.service_url = os.environ["service_url"]
self.backend_url = os.environ["backend_url"]
self.service_url = os.environ["SERVICE_URL"]
self.backend_url = os.environ["BACKEND_URL"]
def _request(self, data):
try:

View File

@ -32,7 +32,7 @@ def get_token():
if token:
return token
else:
raise JudgeClientError("ENV TOKEN not found")
raise JudgeClientError("env 'token' not found")
token = hashlib.sha256(get_token()).hexdigest()