Add supportConfig in database
This commit is contained in:
@@ -50,6 +50,7 @@ exports = module.exports = {
|
||||
setFooter: setFooter,
|
||||
|
||||
getAppstoreListingConfig: getAppstoreListingConfig,
|
||||
getSupportConfig: getSupportConfig,
|
||||
|
||||
provider: provider,
|
||||
|
||||
@@ -81,6 +82,7 @@ exports = module.exports = {
|
||||
REGISTRY_CONFIG_KEY: 'registry_config',
|
||||
SYSINFO_CONFIG_KEY: 'sysinfo_config',
|
||||
APPSTORE_LISTING_CONFIG_KEY: 'appstore_listing_config',
|
||||
SUPPORT_CONFIG_KEY: 'support_config',
|
||||
|
||||
// strings
|
||||
APP_AUTOUPDATE_PATTERN_KEY: 'app_autoupdate_pattern',
|
||||
@@ -163,6 +165,17 @@ let gDefaults = (function () {
|
||||
whitelist: null // null imples, not set. this is an object and not an array
|
||||
};
|
||||
|
||||
result[exports.SUPPORT_CONFIG_KEY] = {
|
||||
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://cloudron.io/documentation/apps/?support_view)\n'
|
||||
+ '* [Custom App Packaging & API](https://cloudron.io/developer/packaging/?support_view)\n'
|
||||
+ '* [Forum](https://forum.cloudron.io/)\n\n',
|
||||
submitTickets: true
|
||||
};
|
||||
|
||||
result[exports.FOOTER_KEY] = '© 2020 [Cloudron](https://cloudron.io) [Forum <i class="fa fa-comments"></i>](https://forum.cloudron.io)';
|
||||
|
||||
return result;
|
||||
@@ -539,6 +552,17 @@ function getAppstoreListingConfig(callback) {
|
||||
});
|
||||
}
|
||||
|
||||
function getSupportConfig(callback) {
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
settingsdb.get(exports.SUPPORT_CONFIG_KEY, function (error, value) {
|
||||
if (error && error.reason === BoxError.NOT_FOUND) return callback(null, gDefaults[exports.SUPPORT_CONFIG_KEY]);
|
||||
if (error) return callback(error);
|
||||
|
||||
callback(null, JSON.parse(value));
|
||||
});
|
||||
}
|
||||
|
||||
function getLicenseKey(callback) {
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user