2021-04-07 15:31:44 +12:00
|
|
|
const errors = require('@tryghost/errors');
|
2021-03-03 12:35:45 +00:00
|
|
|
const config = require('../../shared/config');
|
|
|
|
const db = require('../data/db');
|
|
|
|
const LimitService = require('@tryghost/limit-service');
|
|
|
|
let limitService = new LimitService();
|
|
|
|
|
|
|
|
const initFn = () => {
|
|
|
|
let helpLink;
|
|
|
|
|
2021-03-04 11:34:11 +00:00
|
|
|
if (config.get('hostSettings:billing:enabled') && config.get('hostSettings:billing:enabled') === true && config.get('hostSettings:billing:url')) {
|
|
|
|
helpLink = config.get('hostSettings:billing:url');
|
2021-03-03 12:35:45 +00:00
|
|
|
} else {
|
|
|
|
helpLink = 'https://ghost.org/help/';
|
|
|
|
}
|
|
|
|
|
2021-04-07 15:31:44 +12:00
|
|
|
limitService.loadLimits({limits: config.get('hostSettings:limits'), db, helpLink, errors});
|
2021-03-03 12:35:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = limitService;
|
|
|
|
|
|
|
|
module.exports.init = initFn;
|