mirror of
https://github.com/QingdaoU/JudgeServer.git
synced 2024-12-28 21:31:43 +00:00
fix token name
This commit is contained in:
parent
3c4f5b3933
commit
65c96739c9
@ -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"
|
||||
|
@ -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:
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user