Merge pull request #96 from jumpserver/ip_port_config

jumpserver.conf添加字段,tornado根据需求监听端口
pull/99/head
ibuler 2016-02-27 00:24:15 +08:00
commit 16f5906979
3 changed files with 7 additions and 2 deletions

View File

@ -2,6 +2,8 @@
url = http://192.168.244.129 url = http://192.168.244.129
key = 88aaaf7ffe3c6c04 key = 88aaaf7ffe3c6c04
log = debug log = debug
ip = 127.0.0.1
port = 8080
[db] [db]
host = 127.0.0.1 host = 127.0.0.1

View File

@ -42,6 +42,8 @@ KEY = config.get('base', 'key')
URL = config.get('base', 'url') URL = config.get('base', 'url')
LOG_LEVEL = config.get('base', 'log') LOG_LEVEL = config.get('base', 'log')
WEB_SOCKET_HOST = config.get('websocket', 'web_socket_host') WEB_SOCKET_HOST = config.get('websocket', 'web_socket_host')
IP = config.get('base', 'ip')
PORT = config.get('base', 'port')
# Quick-start development settings - unsuitable for production # Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/

View File

@ -33,8 +33,9 @@ except ImportError:
import json import json
os.environ['DJANGO_SETTINGS_MODULE'] = 'jumpserver.settings' os.environ['DJANGO_SETTINGS_MODULE'] = 'jumpserver.settings'
define("port", default=3000, help="run on the given port", type=int) from jumpserver.settings import IP, PORT
define("host", default='0.0.0.0', help="run port on given host", type=str) define("port", default=PORT, help="run on the given port", type=int)
define("host", default=IP, help="run port on given host", type=str)
def require_auth(role='user'): def require_auth(role='user'):