settings: move support config to support
This commit is contained in:
@@ -4,6 +4,8 @@ exports = module.exports = {
|
||||
getRemoteSupport,
|
||||
enableRemoteSupport,
|
||||
|
||||
getConfig,
|
||||
|
||||
_sshInfo: sshInfo
|
||||
};
|
||||
|
||||
@@ -14,6 +16,7 @@ const assert = require('assert'),
|
||||
path = require('path'),
|
||||
paths = require('./paths.js'),
|
||||
safe = require('safetydance'),
|
||||
settings = require('./settings.js'),
|
||||
shell = require('./shell.js');
|
||||
|
||||
// the logic here is also used in the cloudron-support tool
|
||||
@@ -50,3 +53,17 @@ async function enableRemoteSupport(enable, auditSource) {
|
||||
|
||||
await eventlog.add(eventlog.ACTION_SUPPORT_SSH, auditSource, { enable });
|
||||
}
|
||||
|
||||
async function getConfig() {
|
||||
const value = await settings.get(settings.SUPPORT_CONFIG_KEY);
|
||||
return value ? JSON.parse(value) : {
|
||||
email: 'support@cloudron.io',
|
||||
remoteSupport: true,
|
||||
ticketFormBody:
|
||||
'Use this form to open support tickets. You can also write directly to [support@cloudron.io](mailto:support@cloudron.io).\n\n'
|
||||
+ '* [Knowledge Base & App Docs](https://docs.cloudron.io/apps/?support_view)\n'
|
||||
+ '* [Custom App Packaging & API](https://docs.cloudron.io/custom-apps/tutorial/?support_view)\n'
|
||||
+ '* [Forum](https://forum.cloudron.io/)\n\n',
|
||||
submitTickets: true
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user