mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 18:52:14 +03:00
Updated host config to correctly use camelCase
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
This commit is contained in:
parent
84e5bdc46a
commit
26f56626ce
@ -9,7 +9,7 @@ module.exports = {
|
||||
read: {
|
||||
permissions: false,
|
||||
query() {
|
||||
const billingUrl = config.get('host_settings:billing:enabled') ? config.get('host_settings:billing:url') : '';
|
||||
const billingUrl = config.get('hostSettings:billing:enabled') ? config.get('hostSettings:billing:url') : '';
|
||||
const response = {
|
||||
version: ghostVersion.full,
|
||||
environment: config.get('env'),
|
||||
|
@ -76,8 +76,8 @@ module.exports = {
|
||||
if (frame.options.source === 'github') {
|
||||
const [org, repo] = frame.options.ref.toLowerCase().split('/');
|
||||
|
||||
if (limitService.isLimited('custom_themes') && org.toLowerCase() !== 'tryghost') {
|
||||
await limitService.errorIfWouldGoOverLimit('custom_themes');
|
||||
if (limitService.isLimited('customThemes') && org.toLowerCase() !== 'tryghost') {
|
||||
await limitService.errorIfWouldGoOverLimit('customThemes');
|
||||
}
|
||||
|
||||
// omit /:ref so we fetch the default branch
|
||||
@ -139,8 +139,8 @@ module.exports = {
|
||||
method: 'add'
|
||||
},
|
||||
async query(frame) {
|
||||
if (limitService.isLimited('custom_themes')) {
|
||||
return await limitService.errorIfWouldGoOverLimit('custom_themes');
|
||||
if (limitService.isLimited('customThemes')) {
|
||||
await limitService.errorIfWouldGoOverLimit('customThemes');
|
||||
}
|
||||
|
||||
// @NOTE: consistent filename uploads
|
||||
|
@ -53,8 +53,8 @@ module.exports = {
|
||||
method: 'add'
|
||||
},
|
||||
async query(frame) {
|
||||
if (limitService.isLimited('custom_themes')) {
|
||||
return await limitService.errorIfWouldGoOverLimit('custom_themes');
|
||||
if (limitService.isLimited('customThemes')) {
|
||||
await limitService.errorIfWouldGoOverLimit('customThemes');
|
||||
}
|
||||
|
||||
// @NOTE: consistent filename uploads
|
||||
|
@ -53,8 +53,8 @@ module.exports = {
|
||||
method: 'add'
|
||||
},
|
||||
async query(frame) {
|
||||
if (limitService.isLimited('custom_themes')) {
|
||||
return await limitService.errorIfWouldGoOverLimit('custom_themes');
|
||||
if (limitService.isLimited('customThemes')) {
|
||||
await limitService.errorIfWouldGoOverLimit('customThemes');
|
||||
}
|
||||
|
||||
// @NOTE: consistent filename uploads
|
||||
|
@ -66,10 +66,10 @@ const Integration = ghostBookshelf.Model.extend({
|
||||
async permissible(integrationModel, action) {
|
||||
const isAdd = (action === 'add');
|
||||
|
||||
if (isAdd && limitService.isLimited('custom_integrations')) {
|
||||
if (isAdd && limitService.isLimited('customIntegrations')) {
|
||||
// CASE: if your site is limited to a certain number of custom integrations
|
||||
// Inviting a new custom integration requires we check we won't go over the limit
|
||||
await limitService.errorIfWouldGoOverLimit('custom_integrations');
|
||||
await limitService.errorIfWouldGoOverLimit('customIntegrations');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -6,17 +6,17 @@ let limitService = new LimitService();
|
||||
const initFn = () => {
|
||||
let helpLink;
|
||||
|
||||
if (!config.get('host_settings') || !config.get('host_settings:limits')) {
|
||||
if (!config.get('hostSettings') || !config.get('hostSettings:limits')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (config.get('host_settings:billing:enabled') && config.get('host_settings:billing:enabled') === true && config.get('host_settings:billing:url')) {
|
||||
helpLink = config.get('host_settings:billing:url');
|
||||
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('host_settings:limits'), db, helpLink});
|
||||
limitService.loadLimits({limits: config.get('hostSettings:limits'), db, helpLink});
|
||||
};
|
||||
|
||||
module.exports = limitService;
|
||||
|
@ -8,10 +8,10 @@ async function getTotalMembers() {
|
||||
}
|
||||
|
||||
module.exports = async () => {
|
||||
const membersHostLimit = config.get('host_settings:limits:members');
|
||||
const membersHostLimit = config.get('hostSettings:limits:members');
|
||||
if (membersHostLimit) {
|
||||
const allowedMembersLimit = membersHostLimit.max;
|
||||
const hostUpgradeLink = config.get('host_settings:limits').upgrade_url;
|
||||
const hostUpgradeLink = config.get('hostSettings:limits').upgrade_url;
|
||||
|
||||
const totalMembers = await getTotalMembers();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user