2019-08-09 17:11:24 +03:00
|
|
|
const ghostVersion = require('../../lib/ghost-version');
|
|
|
|
const settingsCache = require('../../services/settings/cache');
|
2020-05-28 13:57:02 +03:00
|
|
|
const urlUtils = require('../../../shared/url-utils');
|
2019-08-09 17:11:24 +03:00
|
|
|
|
|
|
|
const site = {
|
|
|
|
docName: 'site',
|
|
|
|
|
|
|
|
read: {
|
|
|
|
permissions: false,
|
|
|
|
query() {
|
2020-04-27 17:15:56 +03:00
|
|
|
const response = {
|
2019-08-09 17:11:24 +03:00
|
|
|
title: settingsCache.get('title'),
|
2020-04-17 12:30:31 +03:00
|
|
|
description: settingsCache.get('description'),
|
|
|
|
logo: settingsCache.get('logo'),
|
2021-03-03 15:40:12 +03:00
|
|
|
icon: settingsCache.get('icon'),
|
2020-06-23 15:33:57 +03:00
|
|
|
accent_color: settingsCache.get('accent_color'),
|
2019-08-09 17:11:24 +03:00
|
|
|
url: urlUtils.urlFor('home', true),
|
2020-04-30 21:50:40 +03:00
|
|
|
version: ghostVersion.safe
|
2019-08-09 17:11:24 +03:00
|
|
|
};
|
2021-04-27 21:49:09 +03:00
|
|
|
if (settingsCache.get('oauth_client_id') && settingsCache.get('oauth_client_secret')) {
|
|
|
|
// Only set the oauth flag if oauth is enabled to avoid API changes
|
|
|
|
response.oauth = true;
|
|
|
|
}
|
2020-04-27 17:15:56 +03:00
|
|
|
|
|
|
|
return response;
|
2019-08-09 17:11:24 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = site;
|