websocket settings

This commit is contained in:
yuri
2019-03-15 16:50:59 +02:00
parent bd09d2a2cb
commit 136bad46ce
5 changed files with 45 additions and 8 deletions

View File

@@ -119,7 +119,10 @@
"daemonProcessTimeout": "Daemon Process Timeout",
"cronDisabled": "Disable Cron",
"maintenanceMode": "Maintenance Mode",
"useWebSocket": "Use WebSocket"
"useWebSocket": "Use WebSocket",
"webSocketSslAllowSelfSigned": "Allow self-signed SSL certificate",
"webSocketSslCertificateFile": "SSL certificate file path",
"webSocketSslCertificateKeyFile": "SSL certificate file path key file path"
},
"options": {
"weekStart": {

View File

@@ -4,8 +4,7 @@
"rows": [
[{"name": "useCache"}, {"name": "siteUrl"}],
[{"name": "b2cMode"}, {"name": "aclStrictMode"}],
[{"name": "maintenanceMode"}, {"name": "cronDisabled"}],
[{"name": "useWebSocket"}, false]
[{"name": "maintenanceMode"}, {"name": "cronDisabled"}]
]
},
{
@@ -40,5 +39,13 @@
[{"name": "calendarEntityList"}, {"name": "activitiesEntityList"}],
[false, {"name": "historyEntityList"}]
]
},
{
"label": "WebSocket",
"rows": [
[{"name": "useWebSocket"}, false],
[{"name": "webSocketSslCertificateFile"}, {"name": "webSocketSslCertificateKeyFile"}],
[{"name": "webSocketSslAllowSelfSigned"}, false]
]
}
]

View File

@@ -555,6 +555,15 @@
},
"useWebSocket": {
"type": "bool"
},
"webSocketSslCertificateFile": {
"type": "varchar"
},
"webSocketSslCertificateKeyFile": {
"type": "varchar"
},
"webSocketSslAllowSelfSigned": {
"type": "bool"
}
}
}

View File

@@ -38,10 +38,28 @@ Espo.define('views/admin/settings', 'views/settings/record/edit', function (Dep)
if (this.getHelper().getAppParam('isRestrictedMode') && !this.getUser().isSuperAdmin()) {
this.hideField('cronDisabled');
this.hideField('maintenanceMode');
this.hideField('useWebSocket');
this.setFieldReadOnly('useWebSocket');
this.setFieldReadOnly('siteUrl');
}
this.hideField('webSocketSslCertificateFile');
this.hideField('webSocketSslCertificateKeyFile');
this.hideField('webSocketSslAllowSelfSigned');
} else {
this.controlWebSocketFieldsVisibility();
this.listenTo(this.model, 'change:useWebSocket', this.controlWebSocketFieldsVisibility);
}
},
controlWebSocketFieldsVisibility: function () {
if (this.model.get('useWebSocket')) {
this.showField('webSocketSslCertificateFile');
this.showField('webSocketSslCertificateKeyFile');
this.showField('webSocketSslAllowSelfSigned');
} else {
this.hideField('webSocketSslCertificateFile');
this.hideField('webSocketSslCertificateKeyFile');
this.hideField('webSocketSslAllowSelfSigned');
}
}
});
});

View File

@@ -75,9 +75,9 @@ if ($useSsl) {
$webSocket,
$loop,
[
'local_cert' => $config->get('webSocketSslCertificateFile', 'cert.pem'),
'local_pk' => $config->get('webSocketSslCertificateKeyFile', 'key.pem'),
'allow_self_signed' => $config->get('webSocketSslAllowSelfSigned', true),
'local_cert' => $config->get('webSocketSslCertificateFile'),
'local_pk' => $config->get('webSocketSslCertificateKeyFile'),
'allow_self_signed' => $config->get('webSocketSslAllowSelfSigned', false),
'verify_peer' => false,
]
);