mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 07:03:38 +00:00
Disabled Studio connection in production environment
This commit is contained in:
parent
260c300168
commit
67de1b791f
@ -43,7 +43,7 @@ module.exports = function (strapi) {
|
||||
const _self = this;
|
||||
let firstConnectionAttempt = true;
|
||||
|
||||
if (_.isPlainObject(strapi.config.studio) && !_.isEmpty(strapi.config.studio) && strapi.config.studio.enabled === true) {
|
||||
if (_.isPlainObject(strapi.config.studio) && !_.isEmpty(strapi.config.studio) && strapi.config.studio.enabled === true && strapi.config.environment === 'development') {
|
||||
const manager = io.Manager(strapi.config.studio.url, {
|
||||
reconnectionDelay: 2000,
|
||||
reconnectionDelayMax: 5000,
|
||||
@ -114,20 +114,7 @@ module.exports = function (strapi) {
|
||||
strapi.log.info('Connected with the Studio server.');
|
||||
});
|
||||
} else {
|
||||
socket.emit('testEncryption', {
|
||||
appId: strapi.config.studio.appId,
|
||||
env: strapi.config.environment,
|
||||
encrypted: strapi.rsa.encrypt({
|
||||
secretKey: strapi.config.studio.secretKey,
|
||||
data: 'ok'
|
||||
})
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
strapi.log.warn(err);
|
||||
}
|
||||
|
||||
strapi.log.info('Connected with the Studio server.');
|
||||
});
|
||||
strapi.log.warn('The use of the Studio is restricted to development environment.');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user