mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
26f56626ce
refs https://github.com/TryGhost/Team/issues/510 - When the host config was introduced it was incorrectly introduced as host_settings instead of hostSettings - All other Ghost config uses camelCase, so changing this now before it becomes a problem - Note: Also removed some rogue return awaits that don't make sense. It's not possible to hit that case, but cleaning up anyway
24 lines
750 B
JavaScript
24 lines
750 B
JavaScript
const config = require('../../shared/config');
|
|
const db = require('../data/db');
|
|
const LimitService = require('@tryghost/limit-service');
|
|
let limitService = new LimitService();
|
|
|
|
const initFn = () => {
|
|
let helpLink;
|
|
|
|
if (!config.get('hostSettings') || !config.get('hostSettings:limits')) {
|
|
return;
|
|
}
|
|
|
|
if (config.get('hostSettings:billing:enabled') && config.get('hostSettings:billing:enabled') === true && config.get('hostSettings:billing:url')) {
|
|
helpLink = config.get('hostSettings:billing:url');
|
|
} else {
|
|
helpLink = 'https://ghost.org/help/';
|
|
}
|
|
|
|
limitService.loadLimits({limits: config.get('hostSettings:limits'), db, helpLink});
|
|
};
|
|
|
|
module.exports = limitService;
|
|
|
|
module.exports.init = initFn;
|