From e9247dd57889f137901ac5746040b1a91f048a24 Mon Sep 17 00:00:00 2001 From: ibuler Date: Sat, 27 Oct 2018 11:34:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[Update]=20default=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=89=80=E6=9C=89=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/api/user.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/users/api/user.py b/apps/users/api/user.py index ba0113a36..6eb51fc53 100644 --- a/apps/users/api/user.py +++ b/apps/users/api/user.py @@ -35,8 +35,9 @@ class UserViewSet(IDInFilterMixin, BulkModelViewSet): def get_queryset(self): queryset = super().get_queryset() - org_users = current_org.get_org_users() - queryset = queryset.filter(id__in=org_users) + if current_org.is_real(): + org_users = current_org.get_org_users() + queryset = queryset.filter(id__in=org_users) return queryset def get_permissions(self): From 384cdfbc198f7347878a52279aaee596f57072bf Mon Sep 17 00:00:00 2001 From: ibuler Date: Sat, 19 Jan 2019 19:29:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[Update]=20=E5=90=AF=E5=8A=A8=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jumpserver/settings.py | 5 ++--- entrypoint.sh | 7 ++++++- jms | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/jumpserver/settings.py b/apps/jumpserver/settings.py index a7aef986e..019bf5748 100644 --- a/apps/jumpserver/settings.py +++ b/apps/jumpserver/settings.py @@ -25,9 +25,8 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) PROJECT_DIR = os.path.dirname(BASE_DIR) CONFIG = load_user_config() LOG_DIR = os.path.join(PROJECT_DIR, 'logs') -HOSTNAME = socket.gethostname() -JUMPSERVER_LOG_FILE = os.path.join(LOG_DIR, 'jumpserver-{}.log'.format(HOSTNAME)) -ANSIBLE_LOG_FILE = os.path.join(LOG_DIR, 'ansible-{}.log'.format(HOSTNAME)) +JUMPSERVER_LOG_FILE = os.path.join(LOG_DIR, 'jumpserver.log') +ANSIBLE_LOG_FILE = os.path.join(LOG_DIR, 'ansible.log') if not os.path.isdir(LOG_DIR): os.makedirs(LOG_DIR) diff --git a/entrypoint.sh b/entrypoint.sh index d48d83cb1..a9beb2ef5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,5 +7,10 @@ function cleanup() fi } +service="all" +if [ "$1" != "" ];then + service=$1 +fi + trap cleanup EXIT -python jms start all +python jms start $service diff --git a/jms b/jms index a5d105c75..a72849124 100755 --- a/jms +++ b/jms @@ -120,6 +120,8 @@ def is_running(s, unlink=True): def parse_service(s): if s == 'all': return all_services + elif "," in s: + return [i.strip() for i in s.split(',')] else: return [s] @@ -316,7 +318,7 @@ if __name__ == '__main__': ) parser.add_argument( "service", type=str, default="all", nargs="?", - choices=("all", "gunicorn", "celery", "beat"), + choices=("all", "gunicorn", "celery", "beat", "celery,beat"), help="The service to start", ) parser.add_argument('-d', '--daemon', nargs="?", const=1)