settings: move support config to support

This commit is contained in:
Girish Ramakrishnan
2023-08-02 22:21:30 +05:30
parent eb4213d61d
commit fccc2d04a9
8 changed files with 62 additions and 33 deletions

View File

@@ -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
};
}