mirror of https://github.com/jumpserver/jumpserver
Merge remote-tracking branch 'origin/dev' into dev
commit
01afcf701c
|
@ -16,7 +16,7 @@ class AssetCreateForm(forms.ModelForm):
|
|||
fields = [
|
||||
'hostname', 'ip', 'public_ip', 'port', 'comment',
|
||||
'nodes', 'is_active', 'admin_user', 'labels', 'platform',
|
||||
'domain',
|
||||
'domain', 'protocol',
|
||||
|
||||
]
|
||||
widgets = {
|
||||
|
@ -56,7 +56,7 @@ class AssetUpdateForm(forms.ModelForm):
|
|||
fields = [
|
||||
'hostname', 'ip', 'port', 'nodes', 'is_active', 'platform',
|
||||
'public_ip', 'number', 'comment', 'admin_user', 'labels',
|
||||
'domain',
|
||||
'domain', 'protocol',
|
||||
]
|
||||
widgets = {
|
||||
'nodes': forms.SelectMultiple(attrs={
|
||||
|
|
|
@ -93,14 +93,21 @@ class SystemUserForm(PasswordAndKeyAuthForm):
|
|||
# Because we define custom field, so we need rewrite :method: `save`
|
||||
system_user = super().save()
|
||||
password = self.cleaned_data.get('password', '') or None
|
||||
login_mode = self.cleaned_data.get('login_mode', '') or None
|
||||
protocol = self.cleaned_data.get('protocol') or None
|
||||
auto_generate_key = self.cleaned_data.get('auto_generate_key', False)
|
||||
private_key, public_key = super().gen_keys()
|
||||
|
||||
if login_mode == SystemUser.MANUAL_LOGIN or protocol == SystemUser.TELNET_PROTOCOL:
|
||||
system_user.auto_push = 0
|
||||
system_user.save()
|
||||
|
||||
if auto_generate_key:
|
||||
logger.info('Auto generate key and set system user auth')
|
||||
system_user.auto_gen_auth()
|
||||
else:
|
||||
system_user.set_auth(password=password, private_key=private_key, public_key=public_key)
|
||||
|
||||
return system_user
|
||||
|
||||
def clean(self):
|
||||
|
@ -109,12 +116,24 @@ class SystemUserForm(PasswordAndKeyAuthForm):
|
|||
if not self.instance and not auto_generate:
|
||||
super().validate_password_key()
|
||||
|
||||
def is_valid(self):
|
||||
validated = super().is_valid()
|
||||
username = self.cleaned_data.get('username')
|
||||
login_mode = self.cleaned_data.get('login_mode')
|
||||
if login_mode == SystemUser.AUTO_LOGIN and not username:
|
||||
self.add_error(
|
||||
"username", _('* Automatic login mode,'
|
||||
' must fill in the username.')
|
||||
)
|
||||
return False
|
||||
return validated
|
||||
|
||||
class Meta:
|
||||
model = SystemUser
|
||||
fields = [
|
||||
'name', 'username', 'protocol', 'auto_generate_key',
|
||||
'password', 'private_key_file', 'auto_push', 'sudo',
|
||||
'comment', 'shell', 'priority',
|
||||
'comment', 'shell', 'priority', 'login_mode',
|
||||
]
|
||||
widgets = {
|
||||
'name': forms.TextInput(attrs={'placeholder': _('Name')}),
|
||||
|
@ -124,5 +143,8 @@ class SystemUserForm(PasswordAndKeyAuthForm):
|
|||
'name': '* required',
|
||||
'username': '* required',
|
||||
'auto_push': _('Auto push system user to asset'),
|
||||
'priority': _('High level will be using login asset as default, if user was granted more than 2 system user'),
|
||||
}
|
||||
'priority': _('High level will be using login asset as default, '
|
||||
'if user was granted more than 2 system user'),
|
||||
'login_mode': _('If you choose manual login mode, you do not '
|
||||
'need to fill in the username and password.')
|
||||
}
|
||||
|
|
|
@ -57,13 +57,27 @@ class Asset(models.Model):
|
|||
('MacOS', 'MacOS'),
|
||||
('BSD', 'BSD'),
|
||||
('Windows', 'Windows'),
|
||||
('Windows2016', 'Windows(2016)'),
|
||||
('Other', 'Other'),
|
||||
)
|
||||
|
||||
SSH_PROTOCOL = 'ssh'
|
||||
RDP_PROTOCOL = 'rdp'
|
||||
TELNET_PROTOCOL = 'telnet'
|
||||
PROTOCOL_CHOICES = (
|
||||
(SSH_PROTOCOL, 'ssh'),
|
||||
(RDP_PROTOCOL, 'rdp'),
|
||||
(TELNET_PROTOCOL, 'telnet (beta)'),
|
||||
)
|
||||
|
||||
id = models.UUIDField(default=uuid.uuid4, primary_key=True)
|
||||
ip = models.GenericIPAddressField(max_length=32, verbose_name=_('IP'),
|
||||
db_index=True)
|
||||
hostname = models.CharField(max_length=128, unique=True,
|
||||
verbose_name=_('Hostname'))
|
||||
protocol = models.CharField(max_length=128, default=SSH_PROTOCOL,
|
||||
choices=PROTOCOL_CHOICES,
|
||||
verbose_name=_('Protocol'))
|
||||
port = models.IntegerField(default=22, verbose_name=_('Port'))
|
||||
platform = models.CharField(max_length=128, choices=PLATFORM_CHOICES,
|
||||
default='Linux', verbose_name=_('Platform'))
|
||||
|
|
|
@ -19,7 +19,7 @@ signer = get_signer()
|
|||
class AssetUser(models.Model):
|
||||
id = models.UUIDField(default=uuid.uuid4, primary_key=True)
|
||||
name = models.CharField(max_length=128, unique=True, verbose_name=_('Name'))
|
||||
username = models.CharField(max_length=32, verbose_name=_('Username'), validators=[alphanumeric])
|
||||
username = models.CharField(max_length=32, blank=True, verbose_name=_('Username'), validators=[alphanumeric])
|
||||
_password = models.CharField(max_length=256, blank=True, null=True, verbose_name=_('Password'))
|
||||
_private_key = models.TextField(max_length=4096, blank=True, null=True, verbose_name=_('SSH private key'), validators=[private_key_validator, ])
|
||||
_public_key = models.TextField(max_length=4096, blank=True, verbose_name=_('SSH public key'))
|
||||
|
|
|
@ -95,9 +95,18 @@ class AdminUser(AssetUser):
|
|||
class SystemUser(AssetUser):
|
||||
SSH_PROTOCOL = 'ssh'
|
||||
RDP_PROTOCOL = 'rdp'
|
||||
TELNET_PROTOCOL = 'telnet'
|
||||
PROTOCOL_CHOICES = (
|
||||
(SSH_PROTOCOL, 'ssh'),
|
||||
(RDP_PROTOCOL, 'rdp'),
|
||||
(TELNET_PROTOCOL, 'telnet (beta)'),
|
||||
)
|
||||
|
||||
AUTO_LOGIN = 'auto'
|
||||
MANUAL_LOGIN = 'manual'
|
||||
LOGIN_MODE_CHOICES = (
|
||||
(AUTO_LOGIN, _('Automatic login')),
|
||||
(MANUAL_LOGIN, _('Manually login'))
|
||||
)
|
||||
|
||||
nodes = models.ManyToManyField('assets.Node', blank=True, verbose_name=_("Nodes"))
|
||||
|
@ -107,6 +116,7 @@ class SystemUser(AssetUser):
|
|||
auto_push = models.BooleanField(default=True, verbose_name=_('Auto push'))
|
||||
sudo = models.TextField(default='/bin/whoami', verbose_name=_('Sudo'))
|
||||
shell = models.CharField(max_length=64, default='/bin/bash', verbose_name=_('Shell'))
|
||||
login_mode = models.CharField(choices=LOGIN_MODE_CHOICES, default=AUTO_LOGIN, max_length=10, verbose_name=_('Login mode'))
|
||||
|
||||
def __str__(self):
|
||||
return '{0.name}({0.username})'.format(self)
|
||||
|
|
|
@ -43,7 +43,7 @@ class AssetGrantedSerializer(serializers.ModelSerializer):
|
|||
fields = (
|
||||
"id", "hostname", "ip", "port", "system_users_granted",
|
||||
"is_active", "system_users_join", "os", 'domain',
|
||||
"platform", "comment"
|
||||
"platform", "comment", "protocol",
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -18,6 +18,13 @@ class SystemUserSerializer(serializers.ModelSerializer):
|
|||
model = SystemUser
|
||||
exclude = ('_password', '_private_key', '_public_key')
|
||||
|
||||
def get_field_names(self, declared_fields, info):
|
||||
fields = super(SystemUserSerializer, self).get_field_names(declared_fields, info)
|
||||
fields.extend([
|
||||
'get_login_mode_display',
|
||||
])
|
||||
return fields
|
||||
|
||||
@staticmethod
|
||||
def get_unreachable_assets(obj):
|
||||
return obj.unreachable_assets
|
||||
|
@ -56,7 +63,10 @@ class AssetSystemUserSerializer(serializers.ModelSerializer):
|
|||
"""
|
||||
class Meta:
|
||||
model = SystemUser
|
||||
fields = ('id', 'name', 'username', 'priority', 'protocol', 'comment',)
|
||||
fields = (
|
||||
'id', 'name', 'username', 'priority',
|
||||
'protocol', 'comment', 'login_mode'
|
||||
)
|
||||
|
||||
|
||||
class SystemUserSimpleSerializer(serializers.ModelSerializer):
|
||||
|
|
|
@ -36,12 +36,13 @@
|
|||
{% endif %}
|
||||
<h3>{% trans 'Basic' %}</h3>
|
||||
{% bootstrap_field form.name layout="horizontal" %}
|
||||
{% bootstrap_field form.login_mode layout="horizontal" %}
|
||||
{% bootstrap_field form.username layout="horizontal" %}
|
||||
{% bootstrap_field form.priority layout="horizontal" %}
|
||||
{% bootstrap_field form.protocol layout="horizontal" %}
|
||||
|
||||
<h3 id="auth_title_id">{% trans 'Auth' %}</h3>
|
||||
{% block auth %}
|
||||
<h3>{% trans 'Auth' %}</h3>
|
||||
<div class="auto-generate">
|
||||
<div class="form-group">
|
||||
<label for="{{ form.auto_generate_key.id_for_label }}" class="col-sm-2 control-label">{% trans 'Auto generate key' %}</label>
|
||||
|
@ -80,15 +81,22 @@
|
|||
{% endblock %}
|
||||
{% block custom_foot_js %}
|
||||
<script>
|
||||
var auto_generate_key = '#'+'{{ form.auto_generate_key.id_for_label }}';
|
||||
var protocol_id = '#' + '{{ form.protocol.id_for_label }}';
|
||||
var login_mode_id = '#' + '{{ form.login_mode.id_for_label }}';
|
||||
|
||||
var auto_generate_key = '#'+'{{ form.auto_generate_key.id_for_label }}';
|
||||
var password_id = '#' + '{{ form.password.id_for_label }}';
|
||||
var private_key_id = '#' + '{{ form.private_key_file.id_for_label }}';
|
||||
var auto_push_id = '#' + '{{ form.auto_push.id_for_label }}';
|
||||
var sudo_id = '#' + '{{ form.sudo.id_for_label }}';
|
||||
var shell_id = '#' + '{{ form.shell.id_for_label }}';
|
||||
|
||||
var need_change_field = [
|
||||
auto_generate_key, private_key_id, auto_push_id, sudo_id, shell_id
|
||||
];
|
||||
var need_change_field_login_mode = [
|
||||
auto_generate_key, private_key_id, auto_push_id, password_id
|
||||
];
|
||||
|
||||
function protocolChange() {
|
||||
if ($(protocol_id + " option:selected").text() === 'rdp') {
|
||||
|
@ -96,7 +104,19 @@ function protocolChange() {
|
|||
$.each(need_change_field, function (index, value) {
|
||||
$(value).closest('.form-group').addClass('hidden')
|
||||
});
|
||||
} else {
|
||||
}
|
||||
else if ($(protocol_id + " option:selected").text() === 'telnet (beta)') {
|
||||
$('.auth-fields').removeClass('hidden');
|
||||
$.each(need_change_field, function (index, value) {
|
||||
$(value).closest('.form-group').addClass('hidden')
|
||||
});
|
||||
}
|
||||
else {
|
||||
if($(login_mode_id).val() === 'manual'){
|
||||
$(sudo_id).closest('.form-group').removeClass('hidden');
|
||||
$(shell_id).closest('.form-group').removeClass('hidden');
|
||||
return
|
||||
}
|
||||
authFieldsDisplay();
|
||||
$.each(need_change_field, function (index, value) {
|
||||
$(value).closest('.form-group').removeClass('hidden')
|
||||
|
@ -111,18 +131,35 @@ function authFieldsDisplay() {
|
|||
$('.auth-fields').removeClass('hidden');
|
||||
}
|
||||
}
|
||||
function loginModeChange(){
|
||||
if ($(login_mode_id).val() === 'manual'){
|
||||
$('#auth_title_id').addClass('hidden');
|
||||
$.each(need_change_field_login_mode, function(index, value){
|
||||
$(value).closest('.form-group').addClass('hidden')
|
||||
})
|
||||
}
|
||||
else if($(login_mode_id).val() === 'auto'){
|
||||
$('#auth_title_id').removeClass('hidden');
|
||||
$(password_id).closest('.form-group').removeClass('hidden')
|
||||
protocolChange();
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('.select2').select2();
|
||||
authFieldsDisplay();
|
||||
protocolChange();
|
||||
loginModeChange();
|
||||
})
|
||||
.on('change', protocol_id, function(){
|
||||
protocolChange();
|
||||
})
|
||||
.on('change', auto_generate_key, function(){
|
||||
authFieldsDisplay();
|
||||
});
|
||||
})
|
||||
.on('change', login_mode_id, function(){
|
||||
loginModeChange();
|
||||
})
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
|
@ -17,6 +17,7 @@
|
|||
{% bootstrap_field form.hostname layout="horizontal" %}
|
||||
{% bootstrap_field form.platform layout="horizontal" %}
|
||||
{% bootstrap_field form.ip layout="horizontal" %}
|
||||
{% bootstrap_field form.protocol layout="horizontal" %}
|
||||
{% bootstrap_field form.port layout="horizontal" %}
|
||||
{% bootstrap_field form.public_ip layout="horizontal" %}
|
||||
{% bootstrap_field form.domain layout="horizontal" %}
|
||||
|
@ -85,14 +86,14 @@ $(document).ready(function () {
|
|||
allowClear: true,
|
||||
templateSelection: format
|
||||
});
|
||||
$("#id_platform").change(function (){
|
||||
var platform = $("#id_platform option:selected").text();
|
||||
$("#id_protocol").change(function (){
|
||||
var protocol = $("#id_protocol option:selected").text();
|
||||
var port = 22;
|
||||
if(platform === 'Windows'){
|
||||
if(protocol === 'rdp'){
|
||||
port = 3389;
|
||||
}
|
||||
if(platform === 'Other'){
|
||||
port = null;
|
||||
if(protocol === 'telnet (beta)'){
|
||||
port = 23;
|
||||
}
|
||||
$("#id_port").val(port);
|
||||
});
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<h3>{% trans 'Basic' %}</h3>
|
||||
{% bootstrap_field form.hostname layout="horizontal" %}
|
||||
{% bootstrap_field form.ip layout="horizontal" %}
|
||||
{% bootstrap_field form.protocol layout="horizontal" %}
|
||||
{% bootstrap_field form.port layout="horizontal" %}
|
||||
{% bootstrap_field form.platform layout="horizontal" %}
|
||||
{% bootstrap_field form.public_ip layout="horizontal" %}
|
||||
|
|
|
@ -62,6 +62,10 @@
|
|||
<td>{% trans 'Username' %}:</td>
|
||||
<td><b>{{ system_user.username }}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Login mode' %}:</td>
|
||||
<td><b>{{ system_user.get_login_mode_display }}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Protocol' %}:</td>
|
||||
<td><b id="id_protocol_type">{{ system_user.protocol }}</b></td>
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
<th class="text-center">{% trans 'Name' %}</th>
|
||||
<th class="text-center">{% trans 'Username' %}</th>
|
||||
<th class="text-center">{% trans 'Protocol' %}</th>
|
||||
<th class="text-center">{% trans 'Login mode' %}</th>
|
||||
<th class="text-center">{% trans 'Asset' %}</th>
|
||||
<th class="text-center">{% trans 'Reachable' %}</th>
|
||||
<th class="text-center">{% trans 'Unreachable' %}</th>
|
||||
|
@ -48,7 +49,7 @@ function initTable() {
|
|||
var detail_btn = '<a href="{% url "assets:system-user-detail" pk=DEFAULT_PK %}">' + cellData + '</a>';
|
||||
$(td).html(detail_btn.replace('{{ DEFAULT_PK }}', rowData.id));
|
||||
}},
|
||||
{targets: 5, createdCell: function (td, cellData) {
|
||||
{targets: 6, createdCell: function (td, cellData) {
|
||||
var innerHtml = "";
|
||||
if (cellData !== 0) {
|
||||
innerHtml = "<span class='text-navy'>" + cellData + "</span>";
|
||||
|
@ -57,7 +58,7 @@ function initTable() {
|
|||
}
|
||||
$(td).html('<span href="javascript:void(0);" data-toggle="tooltip" title="' + cellData +'">' + innerHtml + '</span>');
|
||||
}},
|
||||
{targets: 6, createdCell: function (td, cellData) {
|
||||
{targets: 7, createdCell: function (td, cellData) {
|
||||
var innerHtml = "";
|
||||
if (cellData !== 0) {
|
||||
innerHtml = "<span class='text-danger'>" + cellData + "</span>";
|
||||
|
@ -66,7 +67,7 @@ function initTable() {
|
|||
}
|
||||
$(td).html('<span href="javascript:void(0);" data-toggle="tooltip" title="' + cellData + '">' + innerHtml + '</span>');
|
||||
}},
|
||||
{targets: 7, createdCell: function (td, cellData, rowData) {
|
||||
{targets: 8, createdCell: function (td, cellData, rowData) {
|
||||
var val = 0;
|
||||
var innerHtml = "";
|
||||
var total = rowData.assets_amount;
|
||||
|
@ -84,14 +85,14 @@ function initTable() {
|
|||
$(td).html('<span href="javascript:void(0);" data-toggle="tooltip" title="' + cellData + '">' + innerHtml + '</span>');
|
||||
|
||||
}},
|
||||
{targets: 9, createdCell: function (td, cellData, rowData) {
|
||||
{targets: 10, createdCell: function (td, cellData, rowData) {
|
||||
var update_btn = '<a href="{% url "assets:system-user-update" pk=DEFAULT_PK %}" class="btn btn-xs m-l-xs btn-info">{% trans "Update" %}</a>'.replace('{{ DEFAULT_PK }}', cellData);
|
||||
var del_btn = '<a class="btn btn-xs btn-danger m-l-xs btn_admin_user_delete" data-uid="{{ DEFAULT_PK }}">{% trans "Delete" %}</a>'.replace('{{ DEFAULT_PK }}', cellData);
|
||||
$(td).html(update_btn + del_btn)
|
||||
}}],
|
||||
ajax_url: '{% url "api-assets:system-user-list" %}',
|
||||
columns: [
|
||||
{data: "id" }, {data: "name" }, {data: "username" }, {data: "protocol"}, {data: "assets_amount" },
|
||||
{data: "id" }, {data: "name" }, {data: "username" }, {data: "protocol"}, {data: "get_login_mode_display"}, {data: "assets_amount" },
|
||||
{data: "reachable_amount"}, {data: "unreachable_amount"}, {data: "id"}, {data: "comment" }, {data: "id" }
|
||||
],
|
||||
op_html: $('#actions').html()
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
{% load bootstrap3 %}
|
||||
|
||||
{% block auth %}
|
||||
<h3>{% trans 'Auth' %}</h3>
|
||||
{% bootstrap_field form.password layout="horizontal" %}
|
||||
{% bootstrap_field form.private_key_file layout="horizontal" %}
|
||||
<div class="form-group">
|
||||
|
|
Binary file not shown.
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: Jumpserver 0.3.3\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-06-07 11:34+0800\n"
|
||||
"POT-Creation-Date: 2018-06-25 12:19+0800\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: ibuler <ibuler@qq.com>\n"
|
||||
"Language-Team: Jumpserver team<ibuler@qq.com>\n"
|
||||
|
@ -29,38 +29,38 @@ msgstr ""
|
|||
msgid "测试节点下资产是否可连接: {}"
|
||||
msgstr ""
|
||||
|
||||
#: assets/forms/asset.py:24 assets/models/asset.py:75 assets/models/user.py:103
|
||||
#: assets/forms/asset.py:24 assets/models/asset.py:89 assets/models/user.py:112
|
||||
#: assets/templates/assets/asset_detail.html:183
|
||||
#: assets/templates/assets/asset_detail.html:191
|
||||
#: assets/templates/assets/system_user_detail.html:175 perms/models.py:33
|
||||
#: assets/templates/assets/system_user_detail.html:179 perms/models.py:33
|
||||
msgid "Nodes"
|
||||
msgstr "节点管理"
|
||||
|
||||
#: assets/forms/asset.py:27 assets/forms/asset.py:66 assets/forms/asset.py:109
|
||||
#: assets/forms/asset.py:113 assets/models/asset.py:80
|
||||
#: assets/forms/asset.py:113 assets/models/asset.py:94
|
||||
#: assets/models/cluster.py:19 assets/models/user.py:72
|
||||
#: assets/templates/assets/asset_detail.html:73 templates/_nav.html:25
|
||||
msgid "Admin user"
|
||||
msgstr "管理用户"
|
||||
|
||||
#: assets/forms/asset.py:30 assets/forms/asset.py:69 assets/forms/asset.py:125
|
||||
#: assets/templates/assets/asset_create.html:35
|
||||
#: assets/templates/assets/asset_create.html:37
|
||||
#: assets/templates/assets/asset_create.html:36
|
||||
#: assets/templates/assets/asset_create.html:38
|
||||
#: assets/templates/assets/asset_list.html:75
|
||||
#: assets/templates/assets/asset_update.html:40
|
||||
#: assets/templates/assets/asset_update.html:42
|
||||
#: assets/templates/assets/asset_update.html:41
|
||||
#: assets/templates/assets/asset_update.html:43
|
||||
#: assets/templates/assets/user_asset_list.html:34
|
||||
msgid "Label"
|
||||
msgstr "标签"
|
||||
|
||||
#: assets/forms/asset.py:34 assets/forms/asset.py:73 assets/models/asset.py:71
|
||||
#: assets/forms/asset.py:34 assets/forms/asset.py:73 assets/models/asset.py:85
|
||||
#: assets/models/domain.py:46
|
||||
msgid "Domain"
|
||||
msgstr "网域"
|
||||
|
||||
#: assets/forms/asset.py:38 assets/forms/asset.py:63 assets/forms/asset.py:77
|
||||
#: assets/forms/asset.py:128 assets/templates/assets/asset_create.html:29
|
||||
#: assets/templates/assets/asset_update.html:34 perms/forms.py:40
|
||||
#: assets/forms/asset.py:128 assets/templates/assets/asset_create.html:30
|
||||
#: assets/templates/assets/asset_update.html:35 perms/forms.py:40
|
||||
#: perms/forms.py:47 perms/models.py:76
|
||||
#: perms/templates/perms/asset_permission_list.html:57
|
||||
#: perms/templates/perms/asset_permission_list.html:142
|
||||
|
@ -90,7 +90,7 @@ msgstr "如果有多个的互相隔离的网络,设置资产属于的网域,
|
|||
msgid "Select assets"
|
||||
msgstr "选择资产"
|
||||
|
||||
#: assets/forms/asset.py:105 assets/models/asset.py:67
|
||||
#: assets/forms/asset.py:105 assets/models/asset.py:81
|
||||
#: assets/models/domain.py:44 assets/templates/assets/admin_user_assets.html:53
|
||||
#: assets/templates/assets/asset_detail.html:69
|
||||
#: assets/templates/assets/domain_gateway_list.html:58
|
||||
|
@ -99,11 +99,11 @@ msgid "Port"
|
|||
msgstr "端口"
|
||||
|
||||
#: assets/forms/domain.py:14 assets/forms/label.py:13
|
||||
#: assets/models/asset.py:223 assets/templates/assets/admin_user_list.html:25
|
||||
#: assets/models/asset.py:237 assets/templates/assets/admin_user_list.html:25
|
||||
#: assets/templates/assets/domain_detail.html:60
|
||||
#: assets/templates/assets/domain_list.html:15
|
||||
#: assets/templates/assets/label_list.html:16
|
||||
#: assets/templates/assets/system_user_list.html:29 audits/models.py:11
|
||||
#: assets/templates/assets/system_user_list.html:30 audits/models.py:11
|
||||
#: audits/templates/audits/ftp_log_list.html:41
|
||||
#: audits/templates/audits/ftp_log_list.html:72 perms/forms.py:37
|
||||
#: perms/models.py:32
|
||||
|
@ -118,7 +118,7 @@ msgstr "端口"
|
|||
msgid "Asset"
|
||||
msgstr "资产"
|
||||
|
||||
#: assets/forms/domain.py:54 assets/forms/user.py:79 assets/forms/user.py:120
|
||||
#: assets/forms/domain.py:54 assets/forms/user.py:79 assets/forms/user.py:138
|
||||
#: assets/models/base.py:21 assets/models/cluster.py:18
|
||||
#: assets/models/domain.py:17 assets/models/group.py:20
|
||||
#: assets/models/label.py:17 assets/templates/assets/admin_user_detail.html:56
|
||||
|
@ -147,15 +147,15 @@ msgstr "资产"
|
|||
msgid "Name"
|
||||
msgstr "名称"
|
||||
|
||||
#: assets/forms/domain.py:55 assets/forms/user.py:80 assets/forms/user.py:121
|
||||
#: assets/forms/domain.py:55 assets/forms/user.py:80 assets/forms/user.py:139
|
||||
#: assets/models/base.py:22 assets/templates/assets/admin_user_detail.html:60
|
||||
#: assets/templates/assets/admin_user_list.html:24
|
||||
#: assets/templates/assets/domain_gateway_list.html:60
|
||||
#: assets/templates/assets/system_user_detail.html:62
|
||||
#: assets/templates/assets/system_user_list.html:27
|
||||
#: perms/templates/perms/asset_permission_user.html:55 users/forms.py:13
|
||||
#: users/forms.py:21 users/forms.py:30 users/models/authentication.py:45
|
||||
#: users/models/user.py:47 users/templates/users/_select_user_modal.html:14
|
||||
#: users/forms.py:31 users/models/authentication.py:45 users/models/user.py:47
|
||||
#: users/templates/users/_select_user_modal.html:14
|
||||
#: users/templates/users/login.html:56
|
||||
#: users/templates/users/login_log_list.html:49
|
||||
#: users/templates/users/user_detail.html:67
|
||||
|
@ -169,7 +169,7 @@ msgid "Password or private key passphrase"
|
|||
msgstr "密码或密钥密码"
|
||||
|
||||
#: assets/forms/user.py:25 assets/models/base.py:23 common/forms.py:113
|
||||
#: users/forms.py:15 users/forms.py:23 users/forms.py:32 users/forms.py:44
|
||||
#: users/forms.py:15 users/forms.py:33 users/forms.py:45
|
||||
#: users/templates/users/login.html:59
|
||||
#: users/templates/users/reset_password.html:53
|
||||
#: users/templates/users/user_create.html:10
|
||||
|
@ -192,17 +192,27 @@ msgstr "ssh密钥不合法"
|
|||
msgid "Password and private key file must be input one"
|
||||
msgstr "密码和私钥, 必须输入一个"
|
||||
|
||||
#: assets/forms/user.py:126
|
||||
#: assets/forms/user.py:124
|
||||
msgid "* Automatic login mode, must fill in the username."
|
||||
msgstr "自动登录模式,必须填写用户名"
|
||||
|
||||
#: assets/forms/user.py:144
|
||||
msgid "Auto push system user to asset"
|
||||
msgstr "自动推送系统用户到资产"
|
||||
|
||||
#: assets/forms/user.py:127
|
||||
#: assets/forms/user.py:145
|
||||
msgid ""
|
||||
"High level will be using login asset as default, if user was granted more "
|
||||
"than 2 system user"
|
||||
msgstr "高优先级的系统用户将会作为默认登录用户"
|
||||
|
||||
#: assets/models/asset.py:63 assets/models/domain.py:43
|
||||
#: assets/forms/user.py:147
|
||||
msgid ""
|
||||
"If you choose manual login mode, you do not need to fill in the username and "
|
||||
"password."
|
||||
msgstr "如果选择手动登录模式,用户名和密码则不需要填写"
|
||||
|
||||
#: assets/models/asset.py:74 assets/models/domain.py:43
|
||||
#: assets/templates/assets/_asset_list_modal.html:46
|
||||
#: assets/templates/assets/admin_user_assets.html:52
|
||||
#: assets/templates/assets/asset_detail.html:61
|
||||
|
@ -217,7 +227,7 @@ msgstr "高优先级的系统用户将会作为默认登录用户"
|
|||
msgid "IP"
|
||||
msgstr "IP"
|
||||
|
||||
#: assets/models/asset.py:66 assets/templates/assets/_asset_list_modal.html:45
|
||||
#: assets/models/asset.py:77 assets/templates/assets/_asset_list_modal.html:45
|
||||
#: assets/templates/assets/admin_user_assets.html:51
|
||||
#: assets/templates/assets/asset_detail.html:57
|
||||
#: assets/templates/assets/asset_list.html:86
|
||||
|
@ -229,98 +239,107 @@ msgstr "IP"
|
|||
msgid "Hostname"
|
||||
msgstr "主机名"
|
||||
|
||||
#: assets/models/asset.py:69 assets/templates/assets/asset_detail.html:97
|
||||
#: assets/models/asset.py:80 assets/models/domain.py:45
|
||||
#: assets/models/user.py:115
|
||||
#: assets/templates/assets/domain_gateway_list.html:59
|
||||
#: assets/templates/assets/system_user_detail.html:70
|
||||
#: assets/templates/assets/system_user_list.html:28
|
||||
#: terminal/templates/terminal/session_list.html:75
|
||||
msgid "Protocol"
|
||||
msgstr "协议"
|
||||
|
||||
#: assets/models/asset.py:83 assets/templates/assets/asset_detail.html:97
|
||||
msgid "Platform"
|
||||
msgstr "系统平台"
|
||||
|
||||
#: assets/models/asset.py:76 assets/models/domain.py:48
|
||||
#: assets/models/asset.py:90 assets/models/domain.py:48
|
||||
#: assets/models/label.py:20 assets/templates/assets/asset_detail.html:105
|
||||
msgid "Is active"
|
||||
msgstr "激活"
|
||||
|
||||
#: assets/models/asset.py:85 assets/templates/assets/asset_detail.html:65
|
||||
#: assets/models/asset.py:99 assets/templates/assets/asset_detail.html:65
|
||||
msgid "Public IP"
|
||||
msgstr "公网IP"
|
||||
|
||||
#: assets/models/asset.py:87 assets/templates/assets/asset_detail.html:113
|
||||
#: assets/models/asset.py:101 assets/templates/assets/asset_detail.html:113
|
||||
msgid "Asset number"
|
||||
msgstr "资产编号"
|
||||
|
||||
#: assets/models/asset.py:91 assets/templates/assets/asset_detail.html:77
|
||||
#: assets/models/asset.py:105 assets/templates/assets/asset_detail.html:77
|
||||
msgid "Vendor"
|
||||
msgstr "制造商"
|
||||
|
||||
#: assets/models/asset.py:93 assets/templates/assets/asset_detail.html:81
|
||||
#: assets/models/asset.py:107 assets/templates/assets/asset_detail.html:81
|
||||
msgid "Model"
|
||||
msgstr "型号"
|
||||
|
||||
#: assets/models/asset.py:95 assets/templates/assets/asset_detail.html:109
|
||||
#: assets/models/asset.py:109 assets/templates/assets/asset_detail.html:109
|
||||
msgid "Serial number"
|
||||
msgstr "序列号"
|
||||
|
||||
#: assets/models/asset.py:98
|
||||
#: assets/models/asset.py:112
|
||||
msgid "CPU model"
|
||||
msgstr "CPU型号"
|
||||
|
||||
#: assets/models/asset.py:99
|
||||
#: assets/models/asset.py:113
|
||||
msgid "CPU count"
|
||||
msgstr "CPU数量"
|
||||
|
||||
#: assets/models/asset.py:100
|
||||
#: assets/models/asset.py:114
|
||||
msgid "CPU cores"
|
||||
msgstr "CPU核数"
|
||||
|
||||
#: assets/models/asset.py:102 assets/templates/assets/asset_detail.html:89
|
||||
#: assets/models/asset.py:116 assets/templates/assets/asset_detail.html:89
|
||||
msgid "Memory"
|
||||
msgstr "内存"
|
||||
|
||||
#: assets/models/asset.py:104
|
||||
#: assets/models/asset.py:118
|
||||
msgid "Disk total"
|
||||
msgstr "硬盘大小"
|
||||
|
||||
#: assets/models/asset.py:106
|
||||
#: assets/models/asset.py:120
|
||||
msgid "Disk info"
|
||||
msgstr "硬盘信息"
|
||||
|
||||
#: assets/models/asset.py:109 assets/templates/assets/asset_detail.html:101
|
||||
#: assets/models/asset.py:123 assets/templates/assets/asset_detail.html:101
|
||||
msgid "OS"
|
||||
msgstr "操作系统"
|
||||
|
||||
#: assets/models/asset.py:111
|
||||
#: assets/models/asset.py:125
|
||||
msgid "OS version"
|
||||
msgstr "系统版本"
|
||||
|
||||
#: assets/models/asset.py:113
|
||||
#: assets/models/asset.py:127
|
||||
msgid "OS arch"
|
||||
msgstr "系统架构"
|
||||
|
||||
#: assets/models/asset.py:115
|
||||
#: assets/models/asset.py:129
|
||||
msgid "Hostname raw"
|
||||
msgstr "主机名原始"
|
||||
|
||||
#: assets/models/asset.py:119 assets/templates/assets/asset_create.html:33
|
||||
#: assets/models/asset.py:133 assets/templates/assets/asset_create.html:34
|
||||
#: assets/templates/assets/asset_detail.html:220
|
||||
#: assets/templates/assets/asset_update.html:38 templates/_nav.html:27
|
||||
#: assets/templates/assets/asset_update.html:39 templates/_nav.html:27
|
||||
msgid "Labels"
|
||||
msgstr "标签管理"
|
||||
|
||||
#: assets/models/asset.py:121 assets/models/base.py:29
|
||||
#: assets/models/asset.py:135 assets/models/base.py:29
|
||||
#: assets/models/cluster.py:28 assets/models/group.py:21
|
||||
#: assets/templates/assets/admin_user_detail.html:68
|
||||
#: assets/templates/assets/asset_detail.html:117
|
||||
#: assets/templates/assets/domain_detail.html:72
|
||||
#: assets/templates/assets/system_user_detail.html:96
|
||||
#: assets/templates/assets/system_user_detail.html:100
|
||||
#: ops/templates/ops/adhoc_detail.html:86 perms/models.py:38 perms/models.py:81
|
||||
#: perms/templates/perms/asset_permission_detail.html:98
|
||||
#: users/models/user.py:90 users/templates/users/user_detail.html:111
|
||||
msgid "Created by"
|
||||
msgstr "创建者"
|
||||
|
||||
#: assets/models/asset.py:124 assets/models/cluster.py:26
|
||||
#: assets/models/asset.py:138 assets/models/cluster.py:26
|
||||
#: assets/models/domain.py:20 assets/models/group.py:22
|
||||
#: assets/models/label.py:23 assets/templates/assets/admin_user_detail.html:64
|
||||
#: assets/templates/assets/domain_detail.html:68
|
||||
#: assets/templates/assets/system_user_detail.html:92
|
||||
#: assets/templates/assets/system_user_detail.html:96
|
||||
#: ops/templates/ops/adhoc_detail.html:90 ops/templates/ops/task_detail.html:63
|
||||
#: perms/models.py:39 perms/models.py:82
|
||||
#: perms/templates/perms/asset_permission_detail.html:94
|
||||
|
@ -329,7 +348,7 @@ msgstr "创建者"
|
|||
msgid "Date created"
|
||||
msgstr "创建日期"
|
||||
|
||||
#: assets/models/asset.py:126 assets/models/base.py:26
|
||||
#: assets/models/asset.py:140 assets/models/base.py:26
|
||||
#: assets/models/cluster.py:29 assets/models/domain.py:18
|
||||
#: assets/models/domain.py:47 assets/models/group.py:23
|
||||
#: assets/models/label.py:21 assets/templates/assets/admin_user_detail.html:72
|
||||
|
@ -338,8 +357,8 @@ msgstr "创建日期"
|
|||
#: assets/templates/assets/domain_detail.html:76
|
||||
#: assets/templates/assets/domain_gateway_list.html:61
|
||||
#: assets/templates/assets/domain_list.html:17
|
||||
#: assets/templates/assets/system_user_detail.html:100
|
||||
#: assets/templates/assets/system_user_list.html:33 common/models.py:30
|
||||
#: assets/templates/assets/system_user_detail.html:104
|
||||
#: assets/templates/assets/system_user_list.html:34 common/models.py:30
|
||||
#: ops/models/adhoc.py:42 perms/models.py:40 perms/models.py:83
|
||||
#: perms/templates/perms/asset_permission_detail.html:102 terminal/models.py:26
|
||||
#: terminal/templates/terminal/terminal_detail.html:63 users/models/group.py:13
|
||||
|
@ -392,7 +411,7 @@ msgid "Default"
|
|||
msgstr "默认"
|
||||
|
||||
#: assets/models/cluster.py:36 assets/models/label.py:13
|
||||
#: users/models/user.py:343
|
||||
#: users/models/user.py:345
|
||||
msgid "System"
|
||||
msgstr "系统"
|
||||
|
||||
|
@ -404,14 +423,6 @@ msgstr "默认Cluster"
|
|||
msgid "Cluster"
|
||||
msgstr "集群"
|
||||
|
||||
#: assets/models/domain.py:45 assets/models/user.py:106
|
||||
#: assets/templates/assets/domain_gateway_list.html:59
|
||||
#: assets/templates/assets/system_user_detail.html:66
|
||||
#: assets/templates/assets/system_user_list.html:28
|
||||
#: terminal/templates/terminal/session_list.html:75
|
||||
msgid "Protocol"
|
||||
msgstr "协议"
|
||||
|
||||
#: assets/models/group.py:30
|
||||
msgid "Asset group"
|
||||
msgstr "资产组"
|
||||
|
@ -431,10 +442,10 @@ msgstr "默认资产组"
|
|||
#: terminal/templates/terminal/command_list.html:32
|
||||
#: terminal/templates/terminal/command_list.html:72
|
||||
#: terminal/templates/terminal/session_list.html:33
|
||||
#: terminal/templates/terminal/session_list.html:71 users/forms.py:281
|
||||
#: users/models/user.py:31 users/models/user.py:331
|
||||
#: terminal/templates/terminal/session_list.html:71 users/forms.py:282
|
||||
#: users/models/user.py:31 users/models/user.py:333
|
||||
#: users/templates/users/user_group_detail.html:78
|
||||
#: users/templates/users/user_group_list.html:13 users/views/user.py:362
|
||||
#: users/templates/users/user_group_list.html:13 users/views/user.py:361
|
||||
msgid "User"
|
||||
msgstr "用户"
|
||||
|
||||
|
@ -451,7 +462,15 @@ msgstr "分类"
|
|||
msgid "Key"
|
||||
msgstr ""
|
||||
|
||||
#: assets/models/user.py:104
|
||||
#: assets/models/user.py:108
|
||||
msgid "Automatic login"
|
||||
msgstr "自动登录"
|
||||
|
||||
#: assets/models/user.py:109
|
||||
msgid "Manually login"
|
||||
msgstr "手动登录"
|
||||
|
||||
#: assets/models/user.py:113
|
||||
#: assets/templates/assets/_asset_group_bulk_update_modal.html:11
|
||||
#: assets/templates/assets/system_user_asset.html:21
|
||||
#: assets/views/admin_user.py:29 assets/views/admin_user.py:47
|
||||
|
@ -469,25 +488,30 @@ msgstr ""
|
|||
msgid "Assets"
|
||||
msgstr "资产管理"
|
||||
|
||||
#: assets/models/user.py:105
|
||||
#: assets/models/user.py:114
|
||||
msgid "Priority"
|
||||
msgstr "优先级"
|
||||
|
||||
#: assets/models/user.py:107 assets/templates/assets/_system_user.html:58
|
||||
#: assets/templates/assets/system_user_detail.html:118
|
||||
#: assets/templates/assets/system_user_update.html:11
|
||||
#: assets/models/user.py:116 assets/templates/assets/_system_user.html:59
|
||||
#: assets/templates/assets/system_user_detail.html:122
|
||||
#: assets/templates/assets/system_user_update.html:10
|
||||
msgid "Auto push"
|
||||
msgstr "自动推送"
|
||||
|
||||
#: assets/models/user.py:108 assets/templates/assets/system_user_detail.html:70
|
||||
#: assets/models/user.py:117 assets/templates/assets/system_user_detail.html:74
|
||||
msgid "Sudo"
|
||||
msgstr "Sudo"
|
||||
|
||||
#: assets/models/user.py:109 assets/templates/assets/system_user_detail.html:75
|
||||
#: assets/models/user.py:118 assets/templates/assets/system_user_detail.html:79
|
||||
msgid "Shell"
|
||||
msgstr "Shell"
|
||||
|
||||
#: assets/models/user.py:149 audits/models.py:12
|
||||
#: assets/models/user.py:119 assets/templates/assets/system_user_detail.html:66
|
||||
#: assets/templates/assets/system_user_list.html:29
|
||||
msgid "Login mode"
|
||||
msgstr "登录模式"
|
||||
|
||||
#: assets/models/user.py:159 audits/models.py:12
|
||||
#: audits/templates/audits/ftp_log_list.html:49
|
||||
#: audits/templates/audits/ftp_log_list.html:73 perms/forms.py:43
|
||||
#: perms/models.py:34 perms/models.py:78
|
||||
|
@ -601,32 +625,31 @@ msgid "Basic"
|
|||
msgstr "基本"
|
||||
|
||||
#: assets/templates/assets/_system_user.html:44
|
||||
#: assets/templates/assets/asset_create.html:25
|
||||
#: assets/templates/assets/asset_update.html:30
|
||||
#: assets/templates/assets/asset_create.html:26
|
||||
#: assets/templates/assets/asset_update.html:31
|
||||
#: assets/templates/assets/gateway_create_update.html:45
|
||||
#: assets/templates/assets/system_user_update.html:7
|
||||
#: users/templates/users/_user.html:21
|
||||
msgid "Auth"
|
||||
msgstr "认证"
|
||||
|
||||
#: assets/templates/assets/_system_user.html:47
|
||||
#: assets/templates/assets/_system_user.html:48
|
||||
msgid "Auto generate key"
|
||||
msgstr "自动生成密钥"
|
||||
|
||||
#: assets/templates/assets/_system_user.html:64
|
||||
#: assets/templates/assets/asset_create.html:59
|
||||
#: assets/templates/assets/asset_update.html:63
|
||||
#: assets/templates/assets/_system_user.html:65
|
||||
#: assets/templates/assets/asset_create.html:60
|
||||
#: assets/templates/assets/asset_update.html:64
|
||||
#: assets/templates/assets/gateway_create_update.html:53
|
||||
#: perms/templates/perms/asset_permission_create_update.html:45
|
||||
#: terminal/templates/terminal/terminal_update.html:42
|
||||
msgid "Other"
|
||||
msgstr "其它"
|
||||
|
||||
#: assets/templates/assets/_system_user.html:70
|
||||
#: assets/templates/assets/_system_user.html:71
|
||||
#: assets/templates/assets/admin_user_create_update.html:45
|
||||
#: assets/templates/assets/asset_bulk_update.html:23
|
||||
#: assets/templates/assets/asset_create.html:66
|
||||
#: assets/templates/assets/asset_update.html:70
|
||||
#: assets/templates/assets/asset_create.html:67
|
||||
#: assets/templates/assets/asset_update.html:71
|
||||
#: assets/templates/assets/domain_create_update.html:16
|
||||
#: assets/templates/assets/gateway_create_update.html:58
|
||||
#: assets/templates/assets/label_create_update.html:18
|
||||
|
@ -647,12 +670,12 @@ msgstr "其它"
|
|||
msgid "Reset"
|
||||
msgstr "重置"
|
||||
|
||||
#: assets/templates/assets/_system_user.html:71
|
||||
#: assets/templates/assets/_system_user.html:72
|
||||
#: assets/templates/assets/admin_user_create_update.html:46
|
||||
#: assets/templates/assets/asset_bulk_update.html:24
|
||||
#: assets/templates/assets/asset_create.html:67
|
||||
#: assets/templates/assets/asset_create.html:68
|
||||
#: assets/templates/assets/asset_list.html:108
|
||||
#: assets/templates/assets/asset_update.html:71
|
||||
#: assets/templates/assets/asset_update.html:72
|
||||
#: assets/templates/assets/domain_create_update.html:17
|
||||
#: assets/templates/assets/gateway_create_update.html:59
|
||||
#: assets/templates/assets/label_create_update.html:19
|
||||
|
@ -702,14 +725,14 @@ msgstr "资产列表"
|
|||
#: assets/templates/assets/admin_user_assets.html:54
|
||||
#: assets/templates/assets/admin_user_list.html:26
|
||||
#: assets/templates/assets/system_user_asset.html:52
|
||||
#: assets/templates/assets/system_user_list.html:30
|
||||
#: assets/templates/assets/system_user_list.html:31
|
||||
#: users/templates/users/user_group_granted_asset.html:47
|
||||
msgid "Reachable"
|
||||
msgstr "可连接"
|
||||
|
||||
#: assets/templates/assets/admin_user_assets.html:66
|
||||
#: assets/templates/assets/system_user_asset.html:64
|
||||
#: assets/templates/assets/system_user_detail.html:112
|
||||
#: assets/templates/assets/system_user_detail.html:116
|
||||
#: perms/templates/perms/asset_permission_detail.html:114
|
||||
msgid "Quick update"
|
||||
msgstr "快速更新"
|
||||
|
@ -722,7 +745,7 @@ msgstr "测试可连接性"
|
|||
#: assets/templates/assets/admin_user_assets.html:75
|
||||
#: assets/templates/assets/asset_detail.html:171
|
||||
#: assets/templates/assets/system_user_asset.html:81
|
||||
#: assets/templates/assets/system_user_detail.html:147
|
||||
#: assets/templates/assets/system_user_detail.html:151
|
||||
msgid "Test"
|
||||
msgstr "测试"
|
||||
|
||||
|
@ -736,7 +759,7 @@ msgstr "测试"
|
|||
#: assets/templates/assets/domain_list.html:42
|
||||
#: assets/templates/assets/label_list.html:38
|
||||
#: assets/templates/assets/system_user_detail.html:26
|
||||
#: assets/templates/assets/system_user_list.html:88
|
||||
#: assets/templates/assets/system_user_list.html:89
|
||||
#: perms/templates/perms/asset_permission_detail.html:30
|
||||
#: perms/templates/perms/asset_permission_list.html:191
|
||||
#: terminal/templates/terminal/terminal_detail.html:16
|
||||
|
@ -760,7 +783,7 @@ msgstr "更新"
|
|||
#: assets/templates/assets/domain_list.html:43
|
||||
#: assets/templates/assets/label_list.html:39
|
||||
#: assets/templates/assets/system_user_detail.html:30
|
||||
#: assets/templates/assets/system_user_list.html:89
|
||||
#: assets/templates/assets/system_user_list.html:90
|
||||
#: ops/templates/ops/task_list.html:72
|
||||
#: perms/templates/perms/asset_permission_detail.html:34
|
||||
#: perms/templates/perms/asset_permission_list.html:192
|
||||
|
@ -785,8 +808,8 @@ msgstr "选择节点"
|
|||
#: assets/templates/assets/admin_user_detail.html:100
|
||||
#: assets/templates/assets/asset_detail.html:200
|
||||
#: assets/templates/assets/asset_list.html:638
|
||||
#: assets/templates/assets/system_user_detail.html:192
|
||||
#: assets/templates/assets/system_user_list.html:138 templates/_modal.html:22
|
||||
#: assets/templates/assets/system_user_detail.html:196
|
||||
#: assets/templates/assets/system_user_list.html:139 templates/_modal.html:22
|
||||
#: terminal/templates/terminal/session_detail.html:108
|
||||
#: users/templates/users/user_detail.html:366
|
||||
#: users/templates/users/user_detail.html:391
|
||||
|
@ -804,12 +827,12 @@ msgid "Create admin user"
|
|||
msgstr "创建管理用户"
|
||||
|
||||
#: assets/templates/assets/admin_user_list.html:27
|
||||
#: assets/templates/assets/system_user_list.html:31
|
||||
#: assets/templates/assets/system_user_list.html:32
|
||||
msgid "Unreachable"
|
||||
msgstr "不可达"
|
||||
|
||||
#: assets/templates/assets/admin_user_list.html:28
|
||||
#: assets/templates/assets/system_user_list.html:32
|
||||
#: assets/templates/assets/system_user_list.html:33
|
||||
#: ops/templates/ops/adhoc_history.html:54
|
||||
#: ops/templates/ops/task_history.html:60
|
||||
msgid "Ratio"
|
||||
|
@ -820,7 +843,7 @@ msgstr "比例"
|
|||
#: assets/templates/assets/domain_gateway_list.html:62
|
||||
#: assets/templates/assets/domain_list.html:18
|
||||
#: assets/templates/assets/label_list.html:17
|
||||
#: assets/templates/assets/system_user_list.html:34
|
||||
#: assets/templates/assets/system_user_list.html:35
|
||||
#: ops/templates/ops/adhoc_history.html:59 ops/templates/ops/task_adhoc.html:64
|
||||
#: ops/templates/ops/task_history.html:65 ops/templates/ops/task_list.html:42
|
||||
#: perms/templates/perms/asset_permission_list.html:60
|
||||
|
@ -978,7 +1001,7 @@ msgid "Have assets, cancel"
|
|||
msgstr "存在资产,不能删除"
|
||||
|
||||
#: assets/templates/assets/asset_list.html:633
|
||||
#: assets/templates/assets/system_user_list.html:133
|
||||
#: assets/templates/assets/system_user_list.html:134
|
||||
#: users/templates/users/user_detail.html:361
|
||||
#: users/templates/users/user_detail.html:386
|
||||
#: users/templates/users/user_group_list.html:81
|
||||
|
@ -1003,7 +1026,7 @@ msgstr "删除"
|
|||
msgid "Asset Deleting failed."
|
||||
msgstr "删除失败"
|
||||
|
||||
#: assets/templates/assets/asset_update.html:59
|
||||
#: assets/templates/assets/asset_update.html:60
|
||||
msgid "Configuration"
|
||||
msgstr "配置"
|
||||
|
||||
|
@ -1053,17 +1076,17 @@ msgid "Assets of "
|
|||
msgstr "资产"
|
||||
|
||||
#: assets/templates/assets/system_user_asset.html:70
|
||||
#: assets/templates/assets/system_user_detail.html:135
|
||||
#: assets/templates/assets/system_user_detail.html:139
|
||||
msgid "Push system user now"
|
||||
msgstr "立刻推送系统"
|
||||
|
||||
#: assets/templates/assets/system_user_asset.html:73
|
||||
#: assets/templates/assets/system_user_detail.html:138
|
||||
#: assets/templates/assets/system_user_detail.html:142
|
||||
msgid "Push"
|
||||
msgstr "推送"
|
||||
|
||||
#: assets/templates/assets/system_user_asset.html:78
|
||||
#: assets/templates/assets/system_user_detail.html:144
|
||||
#: assets/templates/assets/system_user_detail.html:148
|
||||
msgid "Test assets connective"
|
||||
msgstr "测试资产可连接性"
|
||||
|
||||
|
@ -1075,28 +1098,28 @@ msgstr "任务已下发,查看ops任务列表"
|
|||
msgid "Task has been send, seen left assets status"
|
||||
msgstr "任务已下发,查看左侧资产状态"
|
||||
|
||||
#: assets/templates/assets/system_user_detail.html:81
|
||||
#: assets/templates/assets/system_user_detail.html:85
|
||||
msgid "Home"
|
||||
msgstr "家目录"
|
||||
|
||||
#: assets/templates/assets/system_user_detail.html:87
|
||||
#: assets/templates/assets/system_user_detail.html:91
|
||||
msgid "Uid"
|
||||
msgstr "Uid"
|
||||
|
||||
#: assets/templates/assets/system_user_detail.html:153
|
||||
#: assets/templates/assets/system_user_detail.html:339
|
||||
#: assets/templates/assets/system_user_detail.html:157
|
||||
#: assets/templates/assets/system_user_detail.html:343
|
||||
msgid "Clear auth"
|
||||
msgstr "清除认证信息"
|
||||
|
||||
#: assets/templates/assets/system_user_detail.html:156
|
||||
#: assets/templates/assets/system_user_detail.html:160
|
||||
msgid "Clear"
|
||||
msgstr "清除"
|
||||
|
||||
#: assets/templates/assets/system_user_detail.html:183
|
||||
#: assets/templates/assets/system_user_detail.html:187
|
||||
msgid "Add to node"
|
||||
msgstr "添加到节点"
|
||||
|
||||
#: assets/templates/assets/system_user_detail.html:339
|
||||
#: assets/templates/assets/system_user_detail.html:343
|
||||
msgid "success"
|
||||
msgstr "成功"
|
||||
|
||||
|
@ -1105,20 +1128,20 @@ msgstr "成功"
|
|||
msgid "Create system user"
|
||||
msgstr "创建系统用户"
|
||||
|
||||
#: assets/templates/assets/system_user_list.html:134
|
||||
#: assets/templates/assets/system_user_list.html:135
|
||||
msgid "This will delete the selected System Users !!!"
|
||||
msgstr "删除选择系统用户"
|
||||
|
||||
#: assets/templates/assets/system_user_list.html:142
|
||||
#: assets/templates/assets/system_user_list.html:143
|
||||
msgid "System Users Deleted."
|
||||
msgstr "已被删除"
|
||||
|
||||
#: assets/templates/assets/system_user_list.html:143
|
||||
#: assets/templates/assets/system_user_list.html:148
|
||||
#: assets/templates/assets/system_user_list.html:144
|
||||
#: assets/templates/assets/system_user_list.html:149
|
||||
msgid "System Users Delete"
|
||||
msgstr "删除系统用户"
|
||||
|
||||
#: assets/templates/assets/system_user_list.html:147
|
||||
#: assets/templates/assets/system_user_list.html:148
|
||||
msgid "System Users Deleting failed."
|
||||
msgstr "系统用户删除失败"
|
||||
|
||||
|
@ -1805,8 +1828,8 @@ msgstr "任务列表"
|
|||
msgid "Task run history"
|
||||
msgstr "执行历史"
|
||||
|
||||
#: perms/forms.py:18 users/forms.py:238 users/forms.py:243 users/forms.py:255
|
||||
#: users/forms.py:285
|
||||
#: perms/forms.py:18 users/forms.py:239 users/forms.py:244 users/forms.py:256
|
||||
#: users/forms.py:286
|
||||
msgid "Select users"
|
||||
msgstr "选择用户"
|
||||
|
||||
|
@ -1958,14 +1981,14 @@ msgstr "商业支持"
|
|||
msgid "Docs"
|
||||
msgstr "文档"
|
||||
|
||||
#: templates/_header_bar.html:37 templates/_nav_user.html:9 users/forms.py:121
|
||||
#: templates/_header_bar.html:37 templates/_nav_user.html:9 users/forms.py:122
|
||||
#: users/templates/users/_user.html:39
|
||||
#: users/templates/users/first_login.html:39
|
||||
#: users/templates/users/user_password_update.html:39
|
||||
#: users/templates/users/user_profile.html:17
|
||||
#: users/templates/users/user_profile_update.html:37
|
||||
#: users/templates/users/user_profile_update.html:57
|
||||
#: users/templates/users/user_pubkey_update.html:37 users/views/user.py:344
|
||||
#: users/templates/users/user_pubkey_update.html:37 users/views/user.py:343
|
||||
msgid "Profile"
|
||||
msgstr "个人信息"
|
||||
|
||||
|
@ -2022,13 +2045,13 @@ msgstr "关闭"
|
|||
|
||||
#: templates/_nav.html:10 users/views/group.py:28 users/views/group.py:44
|
||||
#: users/views/group.py:62 users/views/group.py:79 users/views/group.py:95
|
||||
#: users/views/login.py:277 users/views/login.py:335 users/views/user.py:66
|
||||
#: users/views/user.py:81 users/views/user.py:103 users/views/user.py:174
|
||||
#: users/views/user.py:329 users/views/user.py:381 users/views/user.py:416
|
||||
#: users/views/login.py:277 users/views/login.py:335 users/views/user.py:65
|
||||
#: users/views/user.py:80 users/views/user.py:102 users/views/user.py:175
|
||||
#: users/views/user.py:330 users/views/user.py:380 users/views/user.py:415
|
||||
msgid "Users"
|
||||
msgstr "用户管理"
|
||||
|
||||
#: templates/_nav.html:13 users/views/user.py:67
|
||||
#: templates/_nav.html:13 users/views/user.py:66
|
||||
msgid "User list"
|
||||
msgstr "用户列表"
|
||||
|
||||
|
@ -2334,11 +2357,11 @@ msgstr ""
|
|||
msgid "Invalid token or cache refreshed."
|
||||
msgstr ""
|
||||
|
||||
#: users/forms.py:38
|
||||
#: users/forms.py:39
|
||||
msgid "MFA code"
|
||||
msgstr "MFA 验证码"
|
||||
|
||||
#: users/forms.py:49 users/models/user.py:59
|
||||
#: users/forms.py:50 users/models/user.py:59
|
||||
#: users/templates/users/_select_user_modal.html:15
|
||||
#: users/templates/users/user_detail.html:87
|
||||
#: users/templates/users/user_list.html:25
|
||||
|
@ -2346,31 +2369,31 @@ msgstr "MFA 验证码"
|
|||
msgid "Role"
|
||||
msgstr "角色"
|
||||
|
||||
#: users/forms.py:52 users/forms.py:201
|
||||
#: users/forms.py:53 users/forms.py:202
|
||||
msgid "ssh public key"
|
||||
msgstr "ssh公钥"
|
||||
|
||||
#: users/forms.py:53 users/forms.py:202
|
||||
#: users/forms.py:54 users/forms.py:203
|
||||
msgid "ssh-rsa AAAA..."
|
||||
msgstr ""
|
||||
|
||||
#: users/forms.py:54
|
||||
#: users/forms.py:55
|
||||
msgid "Paste user id_rsa.pub here."
|
||||
msgstr "复制用户公钥到这里"
|
||||
|
||||
#: users/forms.py:72 users/templates/users/user_detail.html:200
|
||||
#: users/forms.py:73 users/templates/users/user_detail.html:200
|
||||
msgid "Join user groups"
|
||||
msgstr "添加到用户组"
|
||||
|
||||
#: users/forms.py:83 users/forms.py:216
|
||||
#: users/forms.py:84 users/forms.py:217
|
||||
msgid "Public key should not be the same as your old one."
|
||||
msgstr "不能和原来的密钥相同"
|
||||
|
||||
#: users/forms.py:87 users/forms.py:220 users/serializers.py:48
|
||||
#: users/forms.py:88 users/forms.py:221 users/serializers.py:48
|
||||
msgid "Not a valid ssh public key"
|
||||
msgstr "ssh密钥不合法"
|
||||
|
||||
#: users/forms.py:127
|
||||
#: users/forms.py:128
|
||||
msgid ""
|
||||
"Tip: when enabled, you will enter the MFA binding process the next time you "
|
||||
"log in. you can also directly bind in \"personal information -> quick "
|
||||
|
@ -2379,16 +2402,16 @@ msgstr ""
|
|||
"提示:启用之后您将会在下次登录时进入MFA绑定流程;您也可以在(个人信息->快速修"
|
||||
"改->更改MFA设置)中直接绑定!"
|
||||
|
||||
#: users/forms.py:137
|
||||
#: users/forms.py:138
|
||||
msgid "* Enable MFA authentication to make the account more secure."
|
||||
msgstr "* 启用MFA认证,使账号更加安全."
|
||||
|
||||
#: users/forms.py:142 users/models/user.py:71
|
||||
#: users/forms.py:143 users/models/user.py:71
|
||||
#: users/templates/users/first_login.html:45
|
||||
msgid "MFA"
|
||||
msgstr "MFA"
|
||||
|
||||
#: users/forms.py:147
|
||||
#: users/forms.py:148
|
||||
msgid ""
|
||||
"In order to protect you and your company, please keep your account, password "
|
||||
"and key sensitive information properly. (for example: setting complex "
|
||||
|
@ -2397,41 +2420,41 @@ msgstr ""
|
|||
"为了保护您和公司的安全,请妥善保管您的账户、密码和密钥等重要敏感信息;(如:"
|
||||
"设置复杂密码,启用MFA认证)"
|
||||
|
||||
#: users/forms.py:154 users/templates/users/first_login.html:48
|
||||
#: users/forms.py:155 users/templates/users/first_login.html:48
|
||||
#: users/templates/users/first_login.html:107
|
||||
#: users/templates/users/first_login.html:130
|
||||
msgid "Finish"
|
||||
msgstr "完成"
|
||||
|
||||
#: users/forms.py:160
|
||||
#: users/forms.py:161
|
||||
msgid "Old password"
|
||||
msgstr "原来密码"
|
||||
|
||||
#: users/forms.py:165
|
||||
#: users/forms.py:166
|
||||
msgid "New password"
|
||||
msgstr "新密码"
|
||||
|
||||
#: users/forms.py:170
|
||||
#: users/forms.py:171
|
||||
msgid "Confirm password"
|
||||
msgstr "确认密码"
|
||||
|
||||
#: users/forms.py:180
|
||||
#: users/forms.py:181
|
||||
msgid "Old password error"
|
||||
msgstr "原来密码错误"
|
||||
|
||||
#: users/forms.py:188
|
||||
#: users/forms.py:189
|
||||
msgid "Password does not match"
|
||||
msgstr "密码不一致"
|
||||
|
||||
#: users/forms.py:199
|
||||
#: users/forms.py:200
|
||||
msgid "Automatically configure and download the SSH key"
|
||||
msgstr "自动配置并下载SSH密钥"
|
||||
|
||||
#: users/forms.py:203
|
||||
#: users/forms.py:204
|
||||
msgid "Paste your id_rsa.pub here."
|
||||
msgstr "复制你的公钥到这里"
|
||||
|
||||
#: users/forms.py:231 users/models/user.py:79
|
||||
#: users/forms.py:232 users/models/user.py:79
|
||||
#: users/templates/users/first_login.html:42
|
||||
#: users/templates/users/user_password_update.html:45
|
||||
#: users/templates/users/user_profile.html:68
|
||||
|
@ -2464,7 +2487,7 @@ msgstr "Agent"
|
|||
msgid "Date login"
|
||||
msgstr "登录日期"
|
||||
|
||||
#: users/models/user.py:30 users/models/user.py:339
|
||||
#: users/models/user.py:30 users/models/user.py:341
|
||||
msgid "Administrator"
|
||||
msgstr "管理员"
|
||||
|
||||
|
@ -2506,7 +2529,7 @@ msgstr "微信"
|
|||
msgid "Source"
|
||||
msgstr "用户来源"
|
||||
|
||||
#: users/models/user.py:342
|
||||
#: users/models/user.py:344
|
||||
msgid "Administrator is the super user of system"
|
||||
msgstr "Administrator是初始的超级管理员"
|
||||
|
||||
|
@ -2649,7 +2672,7 @@ msgid "Setting"
|
|||
msgstr "设置"
|
||||
|
||||
#: users/templates/users/user_create.html:4
|
||||
#: users/templates/users/user_list.html:16 users/views/user.py:81
|
||||
#: users/templates/users/user_list.html:16 users/views/user.py:80
|
||||
msgid "Create user"
|
||||
msgstr "创建用户"
|
||||
|
||||
|
@ -2658,7 +2681,7 @@ msgid "Reset link will be generated and sent to the user. "
|
|||
msgstr "生成重置密码连接,通过邮件发送给用户"
|
||||
|
||||
#: users/templates/users/user_detail.html:19
|
||||
#: users/templates/users/user_granted_asset.html:18 users/views/user.py:175
|
||||
#: users/templates/users/user_granted_asset.html:18 users/views/user.py:176
|
||||
msgid "User detail"
|
||||
msgstr "用户详情"
|
||||
|
||||
|
@ -2793,8 +2816,8 @@ msgstr "用户删除失败"
|
|||
msgid "Administrator Settings force MFA login"
|
||||
msgstr "管理员设置强制使用MFA登录"
|
||||
|
||||
#: users/templates/users/user_profile.html:116 users/views/user.py:204
|
||||
#: users/views/user.py:258
|
||||
#: users/templates/users/user_profile.html:116 users/views/user.py:205
|
||||
#: users/views/user.py:259
|
||||
msgid "User groups"
|
||||
msgstr "用户组"
|
||||
|
||||
|
@ -2840,7 +2863,7 @@ msgid ""
|
|||
"corresponding private key."
|
||||
msgstr "新的公钥已设置成功,请下载对应的私钥"
|
||||
|
||||
#: users/templates/users/user_update.html:4 users/views/user.py:104
|
||||
#: users/templates/users/user_update.html:4 users/views/user.py:103
|
||||
msgid "Update user"
|
||||
msgstr "更新用户"
|
||||
|
||||
|
@ -2849,7 +2872,7 @@ msgid "Create account successfully"
|
|||
msgstr "创建账户成功"
|
||||
|
||||
#: users/utils.py:43
|
||||
#, fuzzy, python-format
|
||||
#, python-format
|
||||
msgid ""
|
||||
"\n"
|
||||
" Hello %(name)s:\n"
|
||||
|
@ -2998,7 +3021,7 @@ msgstr "用户组授权资产"
|
|||
msgid "Please enable cookies and try again."
|
||||
msgstr "设置你的浏览器支持cookie"
|
||||
|
||||
#: users/views/login.py:128 users/views/user.py:501 users/views/user.py:526
|
||||
#: users/views/login.py:128 users/views/user.py:500 users/views/user.py:525
|
||||
msgid "MFA code invalid"
|
||||
msgstr "MFA码认证失败"
|
||||
|
||||
|
@ -3039,7 +3062,7 @@ msgstr "Token错误或失效"
|
|||
msgid "Password not same"
|
||||
msgstr "密码不一致"
|
||||
|
||||
#: users/views/login.py:239 users/views/user.py:116 users/views/user.py:399
|
||||
#: users/views/login.py:239 users/views/user.py:118 users/views/user.py:398
|
||||
msgid "* Your password does not meet the requirements"
|
||||
msgstr "* 您的密码不符合要求"
|
||||
|
||||
|
@ -3051,46 +3074,46 @@ msgstr "首次登陆"
|
|||
msgid "Login log list"
|
||||
msgstr "登录日志"
|
||||
|
||||
#: users/views/user.py:128
|
||||
#: users/views/user.py:129
|
||||
msgid "Bulk update user success"
|
||||
msgstr "批量更新用户成功"
|
||||
|
||||
#: users/views/user.py:233
|
||||
#: users/views/user.py:234
|
||||
msgid "Invalid file."
|
||||
msgstr "文件不合法"
|
||||
|
||||
#: users/views/user.py:330
|
||||
#: users/views/user.py:331
|
||||
msgid "User granted assets"
|
||||
msgstr "用户授权资产"
|
||||
|
||||
#: users/views/user.py:363
|
||||
#: users/views/user.py:362
|
||||
msgid "Profile setting"
|
||||
msgstr "个人信息设置"
|
||||
|
||||
#: users/views/user.py:382
|
||||
#: users/views/user.py:381
|
||||
msgid "Password update"
|
||||
msgstr "密码更新"
|
||||
|
||||
#: users/views/user.py:417
|
||||
#: users/views/user.py:416
|
||||
msgid "Public key update"
|
||||
msgstr "密钥更新"
|
||||
|
||||
#: users/views/user.py:458
|
||||
#: users/views/user.py:457
|
||||
msgid "Password invalid"
|
||||
msgstr "用户名或密码无效"
|
||||
|
||||
#: users/views/user.py:552
|
||||
#: users/views/user.py:551
|
||||
msgid "MFA enable success"
|
||||
msgstr "MFA 绑定成功"
|
||||
|
||||
#: users/views/user.py:553
|
||||
#: users/views/user.py:552
|
||||
msgid "MFA enable success, return login page"
|
||||
msgstr "MFA 绑定成功,返回到登录页面"
|
||||
|
||||
#: users/views/user.py:555
|
||||
#: users/views/user.py:554
|
||||
msgid "MFA disable success"
|
||||
msgstr "MFA 解绑成功"
|
||||
|
||||
#: users/views/user.py:556
|
||||
#: users/views/user.py:555
|
||||
msgid "MFA disable success, return login page"
|
||||
msgstr "MFA 解绑成功,返回登录页面"
|
||||
|
|
|
@ -343,10 +343,11 @@ if AUTH_LDAP:
|
|||
AUTHENTICATION_BACKENDS.insert(0, AUTH_LDAP_BACKEND)
|
||||
|
||||
# Celery using redis as broker
|
||||
CELERY_BROKER_URL = 'redis://:%(password)s@%(host)s:%(port)s/3' % {
|
||||
CELERY_BROKER_URL = 'redis://:%(password)s@%(host)s:%(port)s/%(db)s' % {
|
||||
'password': CONFIG.REDIS_PASSWORD if CONFIG.REDIS_PASSWORD else '',
|
||||
'host': CONFIG.REDIS_HOST or '127.0.0.1',
|
||||
'port': CONFIG.REDIS_PORT or 6379,
|
||||
'db':CONFIG.REDIS_DB_CELERY_BROKER or 3,
|
||||
}
|
||||
CELERY_TASK_SERIALIZER = 'pickle'
|
||||
CELERY_RESULT_SERIALIZER = 'pickle'
|
||||
|
@ -367,10 +368,11 @@ CELERY_WORKER_HIJACK_ROOT_LOGGER = False
|
|||
CACHES = {
|
||||
'default': {
|
||||
'BACKEND': 'redis_cache.RedisCache',
|
||||
'LOCATION': 'redis://:%(password)s@%(host)s:%(port)s/4' % {
|
||||
'LOCATION': 'redis://:%(password)s@%(host)s:%(port)s/%(db)s' % {
|
||||
'password': CONFIG.REDIS_PASSWORD if CONFIG.REDIS_PASSWORD else '',
|
||||
'host': CONFIG.REDIS_HOST or '127.0.0.1',
|
||||
'port': CONFIG.REDIS_PORT or 6379,
|
||||
'db':CONFIG.REDIS_DB_CACHE or 4,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,9 +73,9 @@ class UserGrantedAssetsApi(ListAPIView):
|
|||
util = AssetPermissionUtil(user)
|
||||
for k, v in util.get_assets().items():
|
||||
if k.is_unixlike():
|
||||
system_users_granted = [s for s in v if s.protocol == 'ssh']
|
||||
system_users_granted = [s for s in v if s.protocol in ['ssh', 'telnet']]
|
||||
else:
|
||||
system_users_granted = [s for s in v if s.protocol == 'rdp']
|
||||
system_users_granted = [s for s in v if s.protocol in ['rdp', 'telnet']]
|
||||
k.system_users_granted = system_users_granted
|
||||
queryset.append(k)
|
||||
return queryset
|
||||
|
@ -124,9 +124,9 @@ class UserGrantedNodesWithAssetsApi(ListAPIView):
|
|||
assets = _assets.keys()
|
||||
for k, v in _assets.items():
|
||||
if k.is_unixlike():
|
||||
system_users_granted = [s for s in v if s.protocol == 'ssh']
|
||||
system_users_granted = [s for s in v if s.protocol in ['ssh', 'telnet']]
|
||||
else:
|
||||
system_users_granted = [s for s in v if s.protocol == 'rdp']
|
||||
system_users_granted = [s for s in v if s.protocol in ['rdp', 'telnet']]
|
||||
k.system_users_granted = system_users_granted
|
||||
node.assets_granted = assets
|
||||
queryset.append(node)
|
||||
|
|
|
@ -317,7 +317,6 @@ class SessionReplayViewSet(viewsets.ViewSet):
|
|||
|
||||
# 去default storage中查找
|
||||
for _local_path in (local_path, local_path_v1, session_path):
|
||||
print("Check {}".format(_local_path))
|
||||
if default_storage.exists(_local_path):
|
||||
url = default_storage.url(_local_path)
|
||||
return redirect(url)
|
||||
|
@ -329,6 +328,9 @@ class SessionReplayViewSet(viewsets.ViewSet):
|
|||
return HttpResponseNotFound()
|
||||
|
||||
target_path = os.path.join(default_storage.base_location, local_path) # 保存到storage的路径
|
||||
target_dir = os.path.dirname(target_path)
|
||||
if not os.path.isdir(target_dir):
|
||||
os.makedirs(target_dir, exist_ok=True)
|
||||
storage = jms_storage.get_multi_object_storage(configs)
|
||||
ok, err = storage.download(session_path, target_path)
|
||||
if not ok:
|
||||
|
|
|
@ -21,10 +21,10 @@ class Config:
|
|||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
# Development env open this, when error occur display the full process track, Production disable it
|
||||
DEBUG = True
|
||||
DEBUG = os.environ.get("DEBUG") or True
|
||||
|
||||
# DEBUG, INFO, WARNING, ERROR, CRITICAL can set. See https://docs.djangoproject.com/en/1.10/topics/logging/
|
||||
LOG_LEVEL = 'DEBUG'
|
||||
LOG_LEVEL = os.environ.get("LOG_LEVEL") or 'DEBUG'
|
||||
LOG_DIR = os.path.join(BASE_DIR, 'logs')
|
||||
|
||||
# Database setting, Support sqlite3, mysql, postgres ....
|
||||
|
@ -35,12 +35,12 @@ class Config:
|
|||
DB_NAME = os.path.join(BASE_DIR, 'data', 'db.sqlite3')
|
||||
|
||||
# MySQL or postgres setting like:
|
||||
# DB_ENGINE = 'mysql'
|
||||
# DB_HOST = '127.0.0.1'
|
||||
# DB_PORT = 3306
|
||||
# DB_USER = 'root'
|
||||
# DB_PASSWORD = ''
|
||||
# DB_NAME = 'jumpserver'
|
||||
# DB_ENGINE = os.environ.get("DB_ENGINE") or 'mysql'
|
||||
# DB_HOST = os.environ.get("DB_HOST") or '127.0.0.1'
|
||||
# DB_PORT = os.environ.get("DB_PORT") or 3306
|
||||
# DB_USER = os.environ.get("DB_USER") or 'jumpserver'
|
||||
# DB_PASSWORD = os.environ.get("DB_PASSWORD") or 'weakPassword'
|
||||
# DB_NAME = os.environ.get("DB_NAME") or 'jumpserver'
|
||||
|
||||
# When Django start it will bind this host and port
|
||||
# ./manage.py runserver 127.0.0.1:8080
|
||||
|
@ -48,9 +48,11 @@ class Config:
|
|||
HTTP_LISTEN_PORT = 8080
|
||||
|
||||
# Use Redis as broker for celery and web socket
|
||||
REDIS_HOST = '127.0.0.1'
|
||||
REDIS_PORT = 6379
|
||||
REDIS_PASSWORD = ''
|
||||
REDIS_HOST = os.environ.get("REDIS_HOST") or '127.0.0.1'
|
||||
REDIS_PORT = os.environ.get("REDIS_PORT") or 6379
|
||||
REDIS_PASSWORD = os.environ.get("REDIS_PASSWORD") or ''
|
||||
REDIS_DB_CELERY = os.environ.get('REDIS_DB') or 3
|
||||
REDIS_DB_CACHE = os.environ.get('REDIS_DB') or 4
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
|
|
@ -1 +1 @@
|
|||
libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk python-dev openssl libssl-dev libldap2-dev libsasl2-dev sqlite gcc automake
|
||||
libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk python-dev openssl libssl-dev libldap2-dev libsasl2-dev sqlite gcc automake libkrb5-dev
|
||||
|
|
|
@ -4,3 +4,5 @@
|
|||
python3 ../apps/manage.py makemigrations
|
||||
|
||||
python3 ../apps/manage.py migrate
|
||||
|
||||
python3 ../apps/manage.py makemigrations –merge
|
||||
|
|
Loading…
Reference in New Issue