diff --git a/core/client/app/index.html b/core/client/app/index.html
index 1b3d24e432..fddadc8673 100644
--- a/core/client/app/index.html
+++ b/core/client/app/index.html
@@ -31,13 +31,13 @@
- {{#each configuration}}
-
+ {{#each configuration as |config key|}}
+
{{/each}}
- {{#unless skip_google_fonts}}
+ {{#if configuration.useGoogleFonts.value}}
- {{/unless}}
+ {{/if}}
diff --git a/core/client/app/routes/about.js b/core/client/app/routes/about.js
index f20db7a353..36a7a9bc4f 100644
--- a/core/client/app/routes/about.js
+++ b/core/client/app/routes/about.js
@@ -18,7 +18,7 @@ export default AuthenticatedRoute.extend(styleBody, {
model() {
let cachedConfig = this.get('cachedConfig');
- let configUrl = this.get('ghostPaths.url').api('configuration');
+ let configUrl = this.get('ghostPaths.url').api('configuration', 'about');
if (cachedConfig) {
return cachedConfig;
@@ -26,12 +26,8 @@ export default AuthenticatedRoute.extend(styleBody, {
return this.get('ajax').request(configUrl)
.then((configurationResponse) => {
- let configKeyValues = configurationResponse.configuration;
+ let [cachedConfig] = configurationResponse.configuration;
- cachedConfig = {};
- configKeyValues.forEach((configKeyValue) => {
- cachedConfig[configKeyValue.key] = configKeyValue.value;
- });
this.set('cachedConfig', cachedConfig);
return cachedConfig;
diff --git a/core/server/api/configuration.js b/core/server/api/configuration.js
index f730f09b7f..5144bc4d48 100644
--- a/core/server/api/configuration.js
+++ b/core/server/api/configuration.js
@@ -2,9 +2,7 @@
// RESTful API for browsing the configuration
var _ = require('lodash'),
config = require('../config'),
- errors = require('../errors'),
Promise = require('bluebird'),
- i18n = require('../i18n'),
configuration;
@@ -15,28 +13,24 @@ function labsFlag(key) {
};
}
-function getValidKeys() {
- var validKeys = {
- fileStorage: {value: (config.fileStorage !== false), type: 'bool'},
- publicAPI: labsFlag('publicAPI'),
- apps: {value: (config.apps === true), type: 'bool'},
- version: {value: config.ghostVersion, type: 'string'},
- environment: process.env.NODE_ENV,
- database: config.database.client,
- mail: _.isObject(config.mail) ? config.mail.transport : '',
- blogUrl: {value: config.url.replace(/\/$/, ''), type: 'string'},
- blogTitle: {value: config.theme.title, type: 'string'},
- routeKeywords: {value: JSON.stringify(config.routeKeywords), type: 'json'}
- };
-
- return validKeys;
+function getAboutConfig() {
+ return {
+ version: config.ghostVersion,
+ environment: process.env.NODE_ENV,
+ database: config.database.client,
+ mail: _.isObject(config.mail) ? config.mail.transport : ''
+ };
}
-function formatConfigurationObject(val, key) {
+function getBaseConfig() {
return {
- key: key,
- value: (_.isObject(val) && _.has(val, 'value')) ? val.value : val,
- type: _.isObject(val) ? (val.type || null) : null
+ fileStorage: {value: (config.fileStorage !== false), type: 'bool'},
+ useGoogleFonts: {value: !config.isPrivacyDisabled('useGoogleFonts'), type: 'bool'},
+ useGravatar: {value: !config.isPrivacyDisabled('useGravatar'), type: 'bool'},
+ publicAPI: labsFlag('publicAPI'),
+ blogUrl: {value: config.url.replace(/\/$/, ''), type: 'string'},
+ blogTitle: {value: config.theme.title, type: 'string'},
+ routeKeywords: {value: JSON.stringify(config.routeKeywords), type: 'json'}
};
}
@@ -48,26 +42,23 @@ function formatConfigurationObject(val, key) {
configuration = {
/**
- * ### Browse
- * Fetch all configuration keys
- * @returns {Promise(Configurations)}
- */
- browse: function browse() {
- return Promise.resolve({configuration: _.map(getValidKeys(), formatConfigurationObject)});
- },
-
- /**
- * ### Read
- *
+ * Always returns {configuration: []}
+ * Sometimes the array contains configuration items
+ * @param {Object} options
+ * @returns {Promise