2023-07-13 03:45:15 +00:00
|
|
|
import logging
|
2021-08-06 11:16:18 +00:00
|
|
|
import os
|
|
|
|
import sys
|
2023-07-13 03:45:15 +00:00
|
|
|
|
2021-08-06 11:16:18 +00:00
|
|
|
from django.conf import settings
|
|
|
|
|
|
|
|
from apps.jumpserver.const import CONFIG
|
|
|
|
|
|
|
|
try:
|
|
|
|
from apps.jumpserver import const
|
2023-07-13 03:45:15 +00:00
|
|
|
|
2021-08-06 11:16:18 +00:00
|
|
|
__version__ = const.VERSION
|
|
|
|
except ImportError as e:
|
|
|
|
print("Not found __version__: {}".format(e))
|
|
|
|
print("Python is: ")
|
|
|
|
logging.info(sys.executable)
|
|
|
|
__version__ = 'Unknown'
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
HTTP_HOST = CONFIG.HTTP_BIND_HOST or '127.0.0.1'
|
|
|
|
HTTP_PORT = CONFIG.HTTP_LISTEN_PORT or 8080
|
|
|
|
WS_PORT = CONFIG.WS_LISTEN_PORT or 8082
|
|
|
|
DEBUG = CONFIG.DEBUG or False
|
|
|
|
BASE_DIR = os.path.dirname(settings.BASE_DIR)
|
2023-07-13 03:45:15 +00:00
|
|
|
LOG_DIR = os.path.join(BASE_DIR, 'data', 'logs')
|
2021-08-06 11:16:18 +00:00
|
|
|
APPS_DIR = os.path.join(BASE_DIR, 'apps')
|
|
|
|
TMP_DIR = os.path.join(BASE_DIR, 'tmp')
|