mirror of https://github.com/jumpserver/jumpserver
feat: 增加 es 忽略 https 证书验证
parent
85d226eb07
commit
07bd44990b
|
@ -25,6 +25,10 @@ class CommandStore():
|
||||||
kwargs = config.get("OTHER", {})
|
kwargs = config.get("OTHER", {})
|
||||||
self.index = config.get("INDEX") or 'jumpserver'
|
self.index = config.get("INDEX") or 'jumpserver'
|
||||||
self.doc_type = config.get("DOC_TYPE") or 'command_store'
|
self.doc_type = config.get("DOC_TYPE") or 'command_store'
|
||||||
|
|
||||||
|
ignore_verify_certs = kwargs.pop('ignore_verify_certs', False)
|
||||||
|
if ignore_verify_certs:
|
||||||
|
kwargs['verify_certs'] = None
|
||||||
self.es = Elasticsearch(hosts=hosts, max_retries=0, **kwargs)
|
self.es = Elasticsearch(hosts=hosts, max_retries=0, **kwargs)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
@ -181,7 +181,10 @@ class CommandStorageTypeESSerializer(serializers.Serializer):
|
||||||
max_length=1024, default='jumpserver', label=_('Index'), allow_null=True
|
max_length=1024, default='jumpserver', label=_('Index'), allow_null=True
|
||||||
)
|
)
|
||||||
DOC_TYPE = ReadableHiddenField(default='command', label=_('Doc type'), allow_null=True)
|
DOC_TYPE = ReadableHiddenField(default='command', label=_('Doc type'), allow_null=True)
|
||||||
|
ignore_verify_certs = serializers.BooleanField(
|
||||||
|
default=False, label=_('Ignore Certificate Verification'),
|
||||||
|
source='OTHER.ignore_verify_certs', allow_null=True,
|
||||||
|
)
|
||||||
|
|
||||||
# mapping
|
# mapping
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue