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: {
|
read: {
|
||||||
permissions: false,
|
permissions: false,
|
||||||
query() {
|
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 = {
|
const response = {
|
||||||
version: ghostVersion.full,
|
version: ghostVersion.full,
|
||||||
environment: config.get('env'),
|
environment: config.get('env'),
|
||||||
|
@ -76,8 +76,8 @@ module.exports = {
|
|||||||
if (frame.options.source === 'github') {
|
if (frame.options.source === 'github') {
|
||||||
const [org, repo] = frame.options.ref.toLowerCase().split('/');
|
const [org, repo] = frame.options.ref.toLowerCase().split('/');
|
||||||
|
|
||||||
if (limitService.isLimited('custom_themes') && org.toLowerCase() !== 'tryghost') {
|
if (limitService.isLimited('customThemes') && org.toLowerCase() !== 'tryghost') {
|
||||||
await limitService.errorIfWouldGoOverLimit('custom_themes');
|
await limitService.errorIfWouldGoOverLimit('customThemes');
|
||||||
}
|
}
|
||||||
|
|
||||||
// omit /:ref so we fetch the default branch
|
// omit /:ref so we fetch the default branch
|
||||||
@ -139,8 +139,8 @@ module.exports = {
|
|||||||
method: 'add'
|
method: 'add'
|
||||||
},
|
},
|
||||||
async query(frame) {
|
async query(frame) {
|
||||||
if (limitService.isLimited('custom_themes')) {
|
if (limitService.isLimited('customThemes')) {
|
||||||
return await limitService.errorIfWouldGoOverLimit('custom_themes');
|
await limitService.errorIfWouldGoOverLimit('customThemes');
|
||||||
}
|
}
|
||||||
|
|
||||||
// @NOTE: consistent filename uploads
|
// @NOTE: consistent filename uploads
|
||||||
|
@ -53,8 +53,8 @@ module.exports = {
|
|||||||
method: 'add'
|
method: 'add'
|
||||||
},
|
},
|
||||||
async query(frame) {
|
async query(frame) {
|
||||||
if (limitService.isLimited('custom_themes')) {
|
if (limitService.isLimited('customThemes')) {
|
||||||
return await limitService.errorIfWouldGoOverLimit('custom_themes');
|
await limitService.errorIfWouldGoOverLimit('customThemes');
|
||||||
}
|
}
|
||||||
|
|
||||||
// @NOTE: consistent filename uploads
|
// @NOTE: consistent filename uploads
|
||||||
|
@ -53,8 +53,8 @@ module.exports = {
|
|||||||
method: 'add'
|
method: 'add'
|
||||||
},
|
},
|
||||||
async query(frame) {
|
async query(frame) {
|
||||||
if (limitService.isLimited('custom_themes')) {
|
if (limitService.isLimited('customThemes')) {
|
||||||
return await limitService.errorIfWouldGoOverLimit('custom_themes');
|
await limitService.errorIfWouldGoOverLimit('customThemes');
|
||||||
}
|
}
|
||||||
|
|
||||||
// @NOTE: consistent filename uploads
|
// @NOTE: consistent filename uploads
|
||||||
|
@ -66,10 +66,10 @@ const Integration = ghostBookshelf.Model.extend({
|
|||||||
async permissible(integrationModel, action) {
|
async permissible(integrationModel, action) {
|
||||||
const isAdd = (action === 'add');
|
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
|
// 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
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -6,17 +6,17 @@ let limitService = new LimitService();
|
|||||||
const initFn = () => {
|
const initFn = () => {
|
||||||
let helpLink;
|
let helpLink;
|
||||||
|
|
||||||
if (!config.get('host_settings') || !config.get('host_settings:limits')) {
|
if (!config.get('hostSettings') || !config.get('hostSettings:limits')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.get('host_settings:billing:enabled') && config.get('host_settings:billing:enabled') === true && 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('host_settings:billing:url');
|
helpLink = config.get('hostSettings:billing:url');
|
||||||
} else {
|
} else {
|
||||||
helpLink = 'https://ghost.org/help/';
|
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;
|
module.exports = limitService;
|
||||||
|
@ -8,10 +8,10 @@ async function getTotalMembers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = async () => {
|
module.exports = async () => {
|
||||||
const membersHostLimit = config.get('host_settings:limits:members');
|
const membersHostLimit = config.get('hostSettings:limits:members');
|
||||||
if (membersHostLimit) {
|
if (membersHostLimit) {
|
||||||
const allowedMembersLimit = membersHostLimit.max;
|
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();
|
const totalMembers = await getTotalMembers();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user