mirror of
https://github.com/QingdaoU/JudgeServer.git
synced 2025-01-01 15:26:01 +00:00
fix token name
This commit is contained in:
parent
3c4f5b3933
commit
65c96739c9
@ -1,4 +1,4 @@
|
|||||||
version: "2"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
judge_server:
|
judge_server:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/onlinejudge/judge_server
|
image: registry.cn-hangzhou.aliyuncs.com/onlinejudge/judge_server
|
||||||
@ -16,11 +16,11 @@ services:
|
|||||||
- /spj:exec,mode=777
|
- /spj:exec,mode=777
|
||||||
volumes:
|
volumes:
|
||||||
- $PWD/tests/test_case:/test_case:ro
|
- $PWD/tests/test_case:/test_case:ro
|
||||||
- /data/log:/log
|
- $PWD/log:/log
|
||||||
- $PWD/server:/code:ro
|
- $PWD/server:/code:ro
|
||||||
environment:
|
environment:
|
||||||
- backend_url=http://backend:8000/api/judge_server_heartbeat
|
- BACKEND_URL=http://backend:8000/api/judge_server_heartbeat
|
||||||
- service_url=http://judge-server:12358
|
- SERVICE_URL=http://judge-server:12358
|
||||||
- TOKEN=YOUR_TOKEN_HERE
|
- TOKEN=YOUR_TOKEN_HERE
|
||||||
ports:
|
ports:
|
||||||
- "0.0.0.0:12358:8080"
|
- "0.0.0.0:12358:8080"
|
||||||
|
@ -11,8 +11,8 @@ from utils import server_info, logger, token
|
|||||||
|
|
||||||
class JudgeService(object):
|
class JudgeService(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.service_url = os.environ["service_url"]
|
self.service_url = os.environ["SERVICE_URL"]
|
||||||
self.backend_url = os.environ["backend_url"]
|
self.backend_url = os.environ["BACKEND_URL"]
|
||||||
|
|
||||||
def _request(self, data):
|
def _request(self, data):
|
||||||
try:
|
try:
|
||||||
|
@ -32,7 +32,7 @@ def get_token():
|
|||||||
if token:
|
if token:
|
||||||
return token
|
return token
|
||||||
else:
|
else:
|
||||||
raise JudgeClientError("ENV TOKEN not found")
|
raise JudgeClientError("env 'token' not found")
|
||||||
|
|
||||||
|
|
||||||
token = hashlib.sha256(get_token()).hexdigest()
|
token = hashlib.sha256(get_token()).hexdigest()
|
||||||
|
Loading…
Reference in New Issue
Block a user