repo
stringlengths
5
106
file_url
stringlengths
78
301
file_path
stringlengths
4
211
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:56:49
2026-01-05 02:23:25
truncated
bool
2 classes
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/web/middleware/frontend-caching.js
ghost/core/core/frontend/web/middleware/frontend-caching.js
/** * @file Middleware to set the appropriate cache headers on the frontend */ const config = require('../../../shared/config'); const shared = require('../../../server/web/shared'); const {api} = require('../../services/proxy'); /** * Calculate the member's active tier. * @param {object} member - The member objec...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/web/middleware/handle-image-sizes.js
ghost/core/core/frontend/web/middleware/handle-image-sizes.js
const _ = require('lodash'); const path = require('path'); const {NoContentError} = require('@tryghost/errors'); const imageTransform = require('@tryghost/image-transform'); const storage = require('../../../server/adapters/storage'); const activeTheme = require('../../services/theme-engine/active'); const config = req...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/web/middleware/error-handler.js
ghost/core/core/frontend/web/middleware/error-handler.js
const hbs = require('express-hbs'); const _ = require('lodash'); const path = require('path'); const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const sentry = require('../../../shared/sentry'); const config = require('../../../shared/config'); const renderer = require('../../services/r...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/web/middleware/static-theme.js
ghost/core/core/frontend/web/middleware/static-theme.js
const path = require('path'); const config = require('../../../shared/config'); const themeEngine = require('../../services/theme-engine'); const express = require('../../../shared/express'); const AASA_PATH = '/.well-known/apple-app-site-association'; function isDeniedFile(file) { const deniedFileTypes = ['.hbs',...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/web/routers/serve-favicon.js
ghost/core/core/frontend/web/routers/serve-favicon.js
const fs = require('fs-extra'); const path = require('path'); const crypto = require('crypto'); const config = require('../../../shared/config'); const {blogIcon} = require('../../../server/lib/image'); const urlUtils = require('../../../shared/url-utils'); const settingsCache = require('../../../shared/settings-cache'...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/cover-image.js
ghost/core/core/frontend/meta/cover-image.js
const urlUtils = require('../../shared/url-utils'); const getContextObject = require('./context-object.js'); const _ = require('lodash'); function getCoverImage(data) { const context = data.context ? data.context : null; const contextObject = getContextObject(data, context); if (_.includes(context, 'home'...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/excerpt.js
ghost/core/core/frontend/meta/excerpt.js
const generateExcerpt = require('./generate-excerpt'); function getExcerpt(data) { // NOTE: should use 'post' OR 'page' once https://github.com/TryGhost/Ghost/issues/10042 is resolved if (!data.post) { return; } // There's a specific order for description fields (not <meta name="description" />...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/description.js
ghost/core/core/frontend/meta/description.js
const _ = require('lodash'); const settingsCache = require('../../shared/settings-cache'); const generateExcerpt = require('./generate-excerpt'); function getDescription(data, root, options = {}) { const context = root ? root.context : null; let description = ''; // We only return meta_description if pro...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/image-dimensions.js
ghost/core/core/frontend/meta/image-dimensions.js
const _ = require('lodash'); const {getImageWithSize} = require('../utils/images'); const config = require('../../shared/config'); const imageSizeCache = require('../../server/lib/image').cachedImageSizeFromUrl; /** * Get Image dimensions * @param {object} metaData * @returns {Promise<object>} metaData * @descript...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/structured-data.js
ghost/core/core/frontend/meta/structured-data.js
const socialUrls = require('@tryghost/social-urls'); function getStructuredData(metaData) { let structuredData; let card = 'summary'; if (metaData.twitterImage || metaData.coverImage.url) { card = 'summary_large_image'; } structuredData = { 'og:site_name': metaData.site.title, ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/canonical-url.js
ghost/core/core/frontend/meta/canonical-url.js
const _ = require('lodash'); const urlUtils = require('../../shared/url-utils'); const getUrl = require('./url'); function getCanonicalUrl(data) { if ((_.includes(data.context, 'post') || _.includes(data.context, 'page')) && data.post && data.post.canonical_url) { return data.post.canonical_url; ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/published-date.js
ghost/core/core/frontend/meta/published-date.js
const getContextObject = require('./context-object.js'); function getPublishedDate(data) { let context = data.context ? data.context[0] : null; const contextObject = getContextObject(data, context); if (contextObject && contextObject.published_at) { return new Date(contextObject.published_at).toI...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/author-url.js
ghost/core/core/frontend/meta/author-url.js
const urlService = require('../../server/services/url'); const getContextObject = require('./context-object.js'); function getAuthorUrl(data, absolute) { let context = data.context ? data.context[0] : null; const contextObject = getContextObject(data, context); if (data.author) { return urlServic...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/index.js
ghost/core/core/frontend/meta/index.js
// Public API (only used in proxy.js) module.exports = { get: require('./get-meta'), // ghost_head getAssetUrl: require('./asset-url'), // asset getMetaDataExcerpt: require('./generate-excerpt'), // excerpt getMetaDataDescription: require('./description'), // meta_desc getMetaDataTitle: require('./t...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/context-object.js
ghost/core/core/frontend/meta/context-object.js
const settingsCache = require('../../shared/settings-cache'); const _ = require('lodash'); function getContextObject(data, context) { let chosenContext; // @TODO: meta layer is very broken, it's really hard to understand what it's doing // The problem is that handlebars root object is structured different...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/og-image.js
ghost/core/core/frontend/meta/og-image.js
const _ = require('lodash'); const getContextObject = require('./context-object.js'); const urlUtils = require('../../shared/url-utils'); const settingsCache = require('../../shared/settings-cache'); function getOgImage(data) { const context = data.context ? data.context : null; const contextObject = getContex...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/modified-date.js
ghost/core/core/frontend/meta/modified-date.js
const getContextObject = require('./context-object.js'); function getModifiedDate(data) { let context = data.context ? data.context : null; let modDate; const contextObject = getContextObject(data, context); if (contextObject) { modDate = contextObject.updated_at || null; if (modDate)...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/creator-url.js
ghost/core/core/frontend/meta/creator-url.js
const getContextObject = require('./context-object.js'); const _ = require('lodash'); function getCreatorTwitterUrl(data) { const context = data.context ? data.context : null; const contextObject = getContextObject(data, context); if ((_.includes(context, 'post') || _.includes(context, 'page')) && context...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/og-type.js
ghost/core/core/frontend/meta/og-type.js
function getOgType(data) { let context = data.context ? data.context[0] : null; if (context === 'author') { return 'profile'; } if (context === 'post') { return 'article'; } return 'website'; } module.exports = getOgType;
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/title.js
ghost/core/core/frontend/meta/title.js
const _ = require('lodash'); const settingsCache = require('../../shared/settings-cache'); function optionalString(test, string) { if (test) { return string; } return ''; } function getTitle(data, root, options = {}) { const context = root ? root.context : null; const siteTitle = settingsC...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/blog-logo.js
ghost/core/core/frontend/meta/blog-logo.js
const urlUtils = require('../../shared/url-utils'); const settingsCache = require('../../shared/settings-cache'); const {blogIcon} = require('../../server/lib/image'); function getBlogLogo() { const logo = {}; if (settingsCache.get('logo')) { logo.url = urlUtils.urlFor('image', {image: settingsCache.g...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/schema.js
ghost/core/core/frontend/meta/schema.js
const config = require('../../shared/config'); const escapeExpression = require('../services/theme-engine/engine').escapeExpression; const socialUrls = require('@tryghost/social-urls'); const _ = require('lodash'); function schemaImageObject(metaDataVal) { let imageObject; if (!metaDataVal || !metaDataVal.url)...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/twitter-image.js
ghost/core/core/frontend/meta/twitter-image.js
const _ = require('lodash'); const urlUtils = require('../../shared/url-utils'); const getContextObject = require('./context-object.js'); const settingsCache = require('../../shared/settings-cache'); function getTwitterImage(data) { const context = data.context ? data.context : null; const contextObject = getC...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/keywords.js
ghost/core/core/frontend/meta/keywords.js
const ghostHelperUtils = require('@tryghost/helpers').utils; function getKeywords(data) { if (data.post && data.post.tags && data.post.tags.length > 0) { return ghostHelperUtils.visibility.filter(data.post.tags, ['public'], function processItem(item) { return item.name; }); } re...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/generate-excerpt.js
ghost/core/core/frontend/meta/generate-excerpt.js
function generateExcerpt(excerpt, truncateOptions) { truncateOptions = truncateOptions || {}; if (!truncateOptions.words && !truncateOptions.characters) { truncateOptions.words = 50; } // Just uses downsize to truncate, not format const downsize = require('downsize'); return downsize(e...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/get-meta.js
ghost/core/core/frontend/meta/get-meta.js
const settingsCache = require('../../shared/settings-cache'); const urlUtils = require('../../shared/url-utils'); const logging = require('@tryghost/logging'); // These are in filename order const getAuthorFacebook = require('./author-fb-url'); const getAuthorImage = require('./author-image'); const getAuthorUrl = req...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/rss-url.js
ghost/core/core/frontend/meta/rss-url.js
const routingService = require('../services/routing'); function getRssUrl(data, absolute) { return routingService.registry.getRssUrl({ absolute: absolute }); } module.exports = getRssUrl;
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/author-fb-url.js
ghost/core/core/frontend/meta/author-fb-url.js
const getContextObject = require('./context-object.js'); const _ = require('lodash'); function getAuthorFacebookUrl(data) { const context = data.context ? data.context : null; const contextObject = getContextObject(data, context); if ((_.includes(context, 'post') || _.includes(context, 'page')) && context...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/paginated-url.js
ghost/core/core/frontend/meta/paginated-url.js
const _ = require('lodash'); const urlUtils = require('../../shared/url-utils'); function getPaginatedUrl(page, data, absolute) { // If we don't have enough information, return null right away if (!data || !data.relativeUrl || !data.pagination) { return null; } // routeKeywords.page: 'page' ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/asset-url.js
ghost/core/core/frontend/meta/asset-url.js
const crypto = require('crypto'); const config = require('../../shared/config'); const {blogIcon} = require('../../server/lib/image'); const urlUtils = require('../../shared/url-utils'); const {SafeString} = require('../services/handlebars'); /** * Serve either uploaded favicon or default * @return {string} */ func...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/url.js
ghost/core/core/frontend/meta/url.js
const urlUtils = require('../../shared/url-utils'); const urlService = require('../../server/services/url'); const {checks} = require('../services/data'); function getUrl(data, absolute) { if (checks.isPost(data)) { /** * @NOTE * * We return the post preview url if you are making...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/frontend/meta/author-image.js
ghost/core/core/frontend/meta/author-image.js
const urlUtils = require('../../shared/url-utils'); const getContextObject = require('./context-object.js'); const _ = require('lodash'); function getAuthorImage(data, absolute) { const context = data.context ? data.context : null; const contextObject = getContextObject(data, context); if ((_.includes(con...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/overrides.js
ghost/core/core/server/overrides.js
const luxon = require('luxon'); const moment = require('moment-timezone'); /** * force UTC * - old way: you can require moment or moment-timezone * - new way: you should use Luxon - work is in progress to switch from moment. * * - you are allowed to use new Date() to instantiate datetime values for models, ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/notify.js
ghost/core/core/server/notify.js
/** * We call notify server started when the server is ready to serve traffic * When the server is started, but not ready, it is only able to serve 503s * * If the server isn't able to reach started, notifyServerStarted is called with an error * A status message, any error, and debug info are all passed to managin...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/GhostServer.js
ghost/core/core/server/GhostServer.js
// # Ghost Server // Handles the creation of an HTTP Server for Ghost const debug = require('@tryghost/debug')('server'); const errors = require('@tryghost/errors'); const tpl = require('@tryghost/tpl'); const logging = require('@tryghost/logging'); const metrics = require('@tryghost/metrics'); const notify = require('...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/xmlrpc.js
ghost/core/core/server/services/xmlrpc.js
const _ = require('lodash'); const xml = require('xml'); const config = require('../../shared/config'); const urlService = require('./url'); const errors = require('@tryghost/errors'); const tpl = require('@tryghost/tpl'); const logging = require('@tryghost/logging'); const request = require('@tryghost/request'); const...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/limits.js
ghost/core/core/server/services/limits.js
const errors = require('@tryghost/errors'); const config = require('../../shared/config'); const db = require('../data/db'); const logging = require('@tryghost/logging'); const LimitService = require('@tryghost/limit-service'); let limitService = new LimitService(); const init = () => { let helpLink; if (conf...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/slack.js
ghost/core/core/server/services/slack.js
const errors = require('@tryghost/errors'); const tpl = require('@tryghost/tpl'); const logging = require('@tryghost/logging'); const request = require('@tryghost/request'); const {blogIcon} = require('../lib/image'); const urlUtils = require('../../shared/url-utils'); const urlService = require('./url'); const setting...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/Users.js
ghost/core/core/server/services/Users.js
// @ts-check const path = require('path'); const ObjectId = require('bson-objectid').default; /** * @TODO: pass these in as dependencies */ const DomainEvents = require('@tryghost/domain-events/lib/DomainEvents'); /** * @typedef {Object} IdbBackup * @prop {() => Promise<string>} backup */ /** * @typedef {Objec...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/i18n.js
ghost/core/core/server/services/i18n.js
const debug = require('@tryghost/debug')('i18n'); /** @type {import('i18next').i18n} */ let i18nInstance; module.exports.init = function () { const i18n = require('@tryghost/i18n'); const events = require('../lib/common/events'); const settingsCache = require('../../shared/settings-cache'); const labs...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/custom-theme-settings.js
ghost/core/core/server/services/custom-theme-settings.js
const CustomThemeSettingsService = require('../../shared/custom-theme-settings-cache/CustomThemeSettingsService'); const customThemeSettingsCache = require('../../shared/custom-theme-settings-cache'); const models = require('../models'); class CustomThemeSettingsServiceWrapper { init() { this.api = new Cus...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/VerificationTrigger.js
ghost/core/core/server/services/VerificationTrigger.js
const errors = require('@tryghost/errors'); const DomainEvents = require('@tryghost/domain-events'); const {MemberCreatedEvent} = require('../../shared/events'); const messages = { emailVerificationNeeded: `We're hard at work processing your import. To make sure you get great deliverability, we'll need to enable s...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/oembed/index.js
ghost/core/core/server/services/oembed/index.js
module.exports = require('./service');
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/oembed/service.js
ghost/core/core/server/services/oembed/service.js
const config = require('../../../shared/config'); const storage = require('../../adapters/storage'); const externalRequest = require('../../lib/request-external'); const OEmbedService = require('./OEmbedService'); const oembed = new OEmbedService({config, externalRequest, storage}); const NFT = require('./NFTOEmbedPr...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/oembed/OEmbedService.js
ghost/core/core/server/services/oembed/OEmbedService.js
// native fetch is not allowed in this file, use `this.externalRequest` instead to avoid SSRF /* eslint no-restricted-globals: ["error", "fetch"] */ const errors = require('@tryghost/errors'); const tpl = require('@tryghost/tpl'); const logging = require('@tryghost/logging'); const _ = require('lodash'); const charset...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/oembed/TwitterOEmbedProvider.js
ghost/core/core/server/services/oembed/TwitterOEmbedProvider.js
const logging = require('@tryghost/logging'); /** * @typedef {import('./oembed').ICustomProvider} ICustomProvider * @typedef {import('./oembed').IExternalRequest} IExternalRequest */ const TWITTER_PATH_REGEX = /\/status\/(\d+)/; /** * @implements ICustomProvider */ class TwitterOEmbedProvider { /** * @...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/oembed/NFTOEmbedProvider.js
ghost/core/core/server/services/oembed/NFTOEmbedProvider.js
/** * @typedef {import('./oembed').ICustomProvider} ICustomProvider * @typedef {import('./oembed').IExternalRequest} IExternalRequest */ const OPENSEA_ETH_PATH_REGEX = /^\/assets\/ethereum\/(0x[a-f0-9]+)\/(\d+)/; /** * @implements ICustomProvider */ class NFTOEmbedProvider { /** * @param {object} depend...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/posts-public/index.js
ghost/core/core/server/services/posts-public/index.js
module.exports = require('./service');
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/posts-public/service.js
ghost/core/core/server/services/posts-public/service.js
class PostsPublicServiceWrapper { async init() { if (this.api) { // Already done return; } // Wire up all the dependencies const adapterManager = require('../adapter-manager'); const config = require('../../../shared/config'); const EventRegis...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/jobs/index.js
ghost/core/core/server/services/jobs/index.js
module.exports = require('./job-service');
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/jobs/job-service.js
ghost/core/core/server/services/jobs/job-service.js
/** * Minimal wrapper around our external lib * Intended for passing any Ghost internals such as logging and config */ const JobManager = require('@tryghost/job-manager'); const logging = require('@tryghost/logging'); const models = require('../../models'); const sentry = require('../../../shared/sentry'); const do...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/announcement-bar-service/AnnouncementVisibilityValues.js
ghost/core/core/server/services/announcement-bar-service/AnnouncementVisibilityValues.js
// Available visibilities: // 'visitors' - anonymous visitors // 'free_members' - free members // 'paid_members' - paid members (aka non-free members) class AnnouncementVisibilityValues { static VISITORS = 'visitors'; static FREE_MEMBERS = 'free_members'; static PAID_MEMBERS = 'paid_members'; } module.expo...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/announcement-bar-service/index.js
ghost/core/core/server/services/announcement-bar-service/index.js
const settingsCache = require('../../../shared/settings-cache'); const AnnouncementBarSettings = require('./AnnouncementBarSettings'); const announcementBarService = new AnnouncementBarSettings({ getAnnouncementSettings: () => ({ announcement: settingsCache.get('announcement_content'), announcement...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/announcement-bar-service/AnnouncementBarSettings.js
ghost/core/core/server/services/announcement-bar-service/AnnouncementBarSettings.js
const AnnouncementVisibilityValues = require('./AnnouncementVisibilityValues'); class AnnouncementBarSettings { #getAnnouncementSettings; static VisibilityValues = AnnouncementVisibilityValues; /** * * @param {Object} deps * @param {() => {announcement: string, announcement_visibility: str...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/email-suppression-list/index.js
ghost/core/core/server/services/email-suppression-list/index.js
module.exports = require('./service');
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/email-suppression-list/service.js
ghost/core/core/server/services/email-suppression-list/service.js
const models = require('../../models'); const configService = require('../../../shared/config'); const settingsCache = require('../../../shared/settings-cache'); const labs = require('../../../shared/labs'); const MailgunClient = require('../lib/MailgunClient'); const MailgunEmailSuppressionList = require('./MailgunEma...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/email-suppression-list/EmailSuppressionList.js
ghost/core/core/server/services/email-suppression-list/EmailSuppressionList.js
/* eslint-disable ghost/filenames/match-regex */ const assert = require('assert/strict'); /** * @typedef {object} EmailSuppressionInfo * @prop {'spam' | 'failed'} reason * @prop {Date} timestamp */ /** * @typedef {object} EmailSuppressedData * @prop {true} suppressed * @prop {EmailSuppressionInfo} info */ /...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/email-suppression-list/InMemoryEmailSuppressionList.js
ghost/core/core/server/services/email-suppression-list/InMemoryEmailSuppressionList.js
const {AbstractEmailSuppressionList, EmailSuppressionData} = require('./EmailSuppressionList'); module.exports = class InMemoryEmailSuppressionList extends AbstractEmailSuppressionList { store = ['spam@member.test', 'fail@member.test']; async removeEmail(email) { if ((email === 'fail@member.test' || e...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/email-suppression-list/MailgunEmailSuppressionList.js
ghost/core/core/server/services/email-suppression-list/MailgunEmailSuppressionList.js
const {AbstractEmailSuppressionList, EmailSuppressionData, EmailSuppressedEvent} = require('./EmailSuppressionList'); const SpamComplaintEvent = require('../email-service/events/SpamComplaintEvent'); const EmailBouncedEvent = require('../email-service/events/EmailBouncedEvent'); const DomainEvents = require('@tryghost/...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/invites/index.js
ghost/core/core/server/services/invites/index.js
const settingsCache = require('../../../shared/settings-cache'); const settingsHelpers = require('../settings-helpers'); const mailService = require('../../services/mail'); const urlUtils = require('../../../shared/url-utils'); const Invites = require('./Invites'); module.exports = new Invites({ settingsCache, ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/invites/Invites.js
ghost/core/core/server/services/invites/Invites.js
const security = require('@tryghost/security'); const tpl = require('@tryghost/tpl'); const logging = require('@tryghost/logging'); const messages = { invitedByName: '{invitedByName} has invited you to join {blogName}', invitedByNoName: 'You have been invited to join {blogName}', errorSendingEmail: { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/link-redirection/RedirectEvent.js
ghost/core/core/server/services/link-redirection/RedirectEvent.js
/** * @typedef {object} RedirectEventData * @prop {URL} url * @prop {import('./LinkRedirect')} link */ module.exports = class RedirectEvent { /** * @param {RedirectEventData} data * @param {Date} timestamp */ constructor(data, timestamp) { this.data = data; this.timestamp = t...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/link-redirection/index.js
ghost/core/core/server/services/link-redirection/index.js
const urlUtils = require('../../../shared/url-utils'); const LinkRedirectRepository = require('./LinkRedirectRepository'); const adapterManager = require('../adapter-manager'); const config = require('../../../shared/config'); const EventRegistry = require('../../lib/common/events'); class LinkRedirectsServiceWrapper ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/link-redirection/LinkRedirectsService.js
ghost/core/core/server/services/link-redirection/LinkRedirectsService.js
const crypto = require('crypto'); const DomainEvents = require('@tryghost/domain-events'); const RedirectEvent = require('./RedirectEvent'); const LinkRedirect = require('./LinkRedirect'); /** * @typedef {object} ILinkRedirectRepository * @prop {(url: URL) => Promise<LinkRedirect|undefined>} getByURL * @prop {({fil...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/link-redirection/LinkRedirect.js
ghost/core/core/server/services/link-redirection/LinkRedirect.js
const ObjectID = require('bson-objectid').default; module.exports = class LinkRedirect { /** @type {ObjectID} */ link_id; /** @type {URL} */ from; /** @type {URL} */ to; /** @type {boolean} */ edited; constructor(data) { if (!data.id) { this.link_id = new Object...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/link-redirection/LinkRedirectRepository.js
ghost/core/core/server/services/link-redirection/LinkRedirectRepository.js
const LinkRedirect = require('./LinkRedirect'); const ObjectID = require('bson-objectid').default; const debug = require('@tryghost/debug')('LinkRedirectRepository'); module.exports = class LinkRedirectRepository { /** @type {Object} */ #LinkRedirect; /** @type {Object} */ #urlUtils; /** @type {Boo...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/newsletters/index.js
ghost/core/core/server/services/newsletters/index.js
const NewslettersService = require('./NewslettersService.js'); const SingleUseTokenProvider = require('../members/SingleUseTokenProvider'); const mail = require('../mail'); const models = require('../../models'); const urlUtils = require('../../../shared/url-utils'); const limitService = require('../limits'); const lab...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/newsletters/NewslettersService.js
ghost/core/core/server/services/newsletters/NewslettersService.js
const _ = require('lodash'); const logging = require('@tryghost/logging'); const verifyEmailTemplate = require('./emails/verify-email'); const debug = require('@tryghost/debug')('services:newsletters'); const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const sentry = require('../../../s...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/newsletters/emails/verify-email.js
ghost/core/core/server/services/newsletters/emails/verify-email.js
module.exports = ({email, url}) => ` <!doctype html> <html> <head> <meta name="viewport" content="width=device-width"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Confirm your email address</title> <style> /* ------------------------------------- RESPONSIVE A...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/setup.js
ghost/core/core/server/services/auth/setup.js
const _ = require('lodash'); const config = require('../../../shared/config'); const errors = require('@tryghost/errors'); const tpl = require('@tryghost/tpl'); const logging = require('@tryghost/logging'); const moment = require('moment'); const models = require('../../models'); const mail = require('../mail'); const...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/index.js
ghost/core/core/server/services/auth/index.js
module.exports = { get authorize() { return require('./authorize'); }, get authenticate() { return require('./authenticate'); }, get session() { return require('./session'); }, get setup() { return require('./setup'); }, get passwordreset() { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/passwordreset.js
ghost/core/core/server/services/auth/passwordreset.js
const _ = require('lodash'); const security = require('@tryghost/security'); const errors = require('@tryghost/errors'); const tpl = require('@tryghost/tpl'); const moment = require('moment'); const models = require('../../models'); const urlUtils = require('../../../shared/url-utils'); const mail = require('../mail')...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/authenticate.js
ghost/core/core/server/services/auth/authenticate.js
const session = require('./session'); const apiKeyAuth = require('./api-key'); const members = require('./members'); const authenticate = { authenticateAdminApi: [apiKeyAuth.admin.authenticate, session.authenticate], authenticateAdminApiWithUrl: [apiKeyAuth.admin.authenticateWithUrl], authenticateContentA...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/authorize.js
ghost/core/core/server/services/auth/authorize.js
const errors = require('@tryghost/errors'); const tpl = require('@tryghost/tpl'); const messages = { authorizationFailed: 'Authorization failed', missingContentMemberOrIntegration: 'Unable to determine the authenticated member or integration. Check the supplied Content API Key and ensure cookies are being pass...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/session/SessionStore.js
ghost/core/core/server/services/auth/session/SessionStore.js
const {Store} = require('express-session'); module.exports = class SessionStore extends Store { constructor(SessionModel) { super(); this.SessionModel = SessionModel; } destroy(sid, callback) { this.SessionModel .destroy({session_id: sid}) .then(() => { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/session/session-service.js
ghost/core/core/server/services/auth/session/session-service.js
const { BadRequestError } = require('@tryghost/errors'); const errors = require('@tryghost/errors'); const emailTemplate = require('./emails/signin'); const UAParser = require('ua-parser-js'); const got = require('got'); const IPV4_REGEX = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[0...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/session/index.js
ghost/core/core/server/services/auth/session/index.js
const adapterManager = require('../../adapter-manager'); const createSessionService = require('./session-service'); const sessionFromToken = require('./session-from-token'); const createSessionMiddleware = require('./middleware'); const settingsCache = require('../../../../shared/settings-cache'); const {GhostMailer} =...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/session/middleware.js
ghost/core/core/server/services/auth/session/middleware.js
const errors = require('@tryghost/errors'); function SessionMiddleware({sessionService}) { async function createSession(req, res, next) { try { if (req.skipVerification) { await sessionService.createVerifiedSessionForUser(req, res, req.user); } else { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/session/express-session.js
ghost/core/core/server/services/auth/session/express-session.js
const util = require('util'); const session = require('express-session'); const config = require('../../../../shared/config'); const settingsCache = require('../../../../shared/settings-cache'); const models = require('../../../models'); const urlUtils = require('../../../../shared/url-utils'); const SessionStore = re...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/session/session-from-token.js
ghost/core/core/server/services/auth/session/session-from-token.js
module.exports = SessionFromToken; /** * @typedef {object} User * @prop {string} id */ /** * @typedef {import('express').Request} Req * @typedef {import('express').Response} Res * @typedef {import('express').NextFunction} Next * @typedef {import('express').RequestHandler} RequestHandler */ /** * Returns a c...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/session/emails/signin.js
ghost/core/core/server/services/auth/session/emails/signin.js
module.exports = ({t, siteTitle, email, siteDomain, siteUrl, siteLogo, token, deviceDetails, is2FARequired}) => ` <!doctype html> <html> <head> <meta name="viewport" content="width=device-width"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>🔑 ${t('Your verification code for ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/api-key/index.js
ghost/core/core/server/services/auth/api-key/index.js
module.exports = { get admin() { return require('./admin'); }, get content() { return require('./content'); } };
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/api-key/admin.js
ghost/core/core/server/services/auth/api-key/admin.js
const jwt = require('jsonwebtoken'); const url = require('url'); const models = require('../../../models'); const errors = require('@tryghost/errors'); const limitService = require('../../../services/limits'); const {legacyApiPathMatch} = require('../../../services/api-version-compatibility'); const tpl = require('@try...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/api-key/content.js
ghost/core/core/server/services/auth/api-key/content.js
const models = require('../../../models'); const errors = require('@tryghost/errors'); const limitService = require('../../../services/limits'); const tpl = require('@tryghost/tpl'); const messages = { invalidRequest: 'Invalid Request', unknownContentApiKey: 'Unknown Content API Key', invalidApiKeyType: 'I...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/auth/members/index.js
ghost/core/core/server/services/auth/members/index.js
const {expressjwt: jwt} = require('express-jwt'); const {UnauthorizedError} = require('@tryghost/errors'); const membersService = require('../../members'); const config = require('../../../../shared/config'); let UNO_MEMBERINO; async function createMiddleware() { const url = require('url'); const {protocol, h...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/update-check/run-update-check.js
ghost/core/core/server/services/update-check/run-update-check.js
const {parentPort, workerData} = require('worker_threads'); const postParentPortMessage = (message) => { if (parentPort) { parentPort.postMessage(message); } }; // Exit early when cancelled to prevent stalling shutdown. No cleanup needed when cancelling as everything is idempotent and will pick up // ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/update-check/index.js
ghost/core/core/server/services/update-check/index.js
/* eslint-disable max-lines */ const _ = require('lodash'); const api = require('../../api').endpoints; const config = require('../../../shared/config'); const urlUtils = require('../../../shared/url-utils'); const jobsService = require('../jobs'); const databaseInfo = require('../../data/db/info'); const request = ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/update-check/UpdateCheckService.js
ghost/core/core/server/services/update-check/UpdateCheckService.js
const _ = require('lodash'); const url = require('url'); const crypto = require('crypto'); const moment = require('moment'); const exec = require('child_process').exec; const util = require('util'); const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const logging = require('@tryghost/logg...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/staff/index.js
ghost/core/core/server/services/staff/index.js
const DomainEvents = require('@tryghost/domain-events'); const labs = require('../../../shared/labs'); class StaffServiceWrapper { init() { if (this.api) { // Prevent creating duplicate DomainEvents subscribers return; } const StaffService = require('./StaffService'...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/staff/StaffServiceEmails.js
ghost/core/core/server/services/staff/StaffServiceEmails.js
const {promises: fs, readFileSync} = require('fs'); const path = require('path'); const moment = require('moment'); const glob = require('glob'); const EmailAddressParser = require('../email-address/EmailAddressParser'); class StaffServiceEmails { constructor({logging, models, mailer, settingsHelpers, settingsCach...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/staff/milestone-email-config.js
ghost/core/core/server/services/staff/milestone-email-config.js
/** * * @param {string} siteTitle * @param {string} formattedValue * * @returns {Object.<string, object>} */ const milestoneEmailConfig = (siteTitle, formattedValue) => { const arrContent = { subject: `${siteTitle} hit ${formattedValue} ARR`, heading: `Congrats! You reached ${formattedValue} A...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/staff/StaffService.js
ghost/core/core/server/services/staff/StaffService.js
const {MemberCreatedEvent, SubscriptionCancelledEvent, SubscriptionActivatedEvent} = require('../../../shared/events'); const MilestoneCreatedEvent = require('../milestones/MilestoneCreatedEvent'); // @NOTE: 'StaffService' is a vague name that does not describe what it's actually doing. // Possibly, "StaffNoti...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/staff/email-templates/new-paid-started.txt.js
ghost/core/core/server/services/staff/email-templates/new-paid-started.txt.js
module.exports = function (data) { // Be careful when you indent the email, because whitespaces are visible in emails! return ` Congratulations! You have a new paid member: "${data.memberData.name}" --- Sent to ${data.toEmail} from ${data.siteDomain}. If you would no longer like to receive these notification...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/staff/email-templates/new-milestone-received.txt.js
ghost/core/core/server/services/staff/email-templates/new-milestone-received.txt.js
module.exports = function (data) { // Be careful when you indent the email, because whitespaces are visible in emails! return ` Congratulations! ${data.subject} --- Sent to ${data.toEmail} from ${data.siteDomain}. If you would no longer like to receive these notifications you can adjust your settings at ${da...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/staff/email-templates/new-free-signup.txt.js
ghost/core/core/server/services/staff/email-templates/new-free-signup.txt.js
module.exports = function (data) { // Be careful when you indent the email, because whitespaces are visible in emails! return ` Congratulations! You have a new free member: "${data.memberData.name}" --- Sent to ${data.toEmail} from ${data.siteDomain}. If you would no longer like to receive these notification...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/staff/email-templates/donation.txt.js
ghost/core/core/server/services/staff/email-templates/donation.txt.js
module.exports = function (data) { // Be careful when you indent the email, because whitespaces are visible in emails! return ` Cha-ching! You received a one-time payment from of ${data.donation.amount} from "${data.donation.name}". Message: ${data.donation.donationMessage ? data.donation.donationMessage : 'N...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/staff/email-templates/recommendation-received.txt.js
ghost/core/core/server/services/staff/email-templates/recommendation-received.txt.js
module.exports = function (data) { const {recommendation} = data; // Be careful when you indent the email, because whitespaces are visible in emails! return ` You have been recommended by ${recommendation.title || recommendation.url}. --- Sent to ${data.toEmail} from ${data.siteDomain}. If you would no l...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/staff/email-templates/mention-report.txt.js
ghost/core/core/server/services/staff/email-templates/mention-report.txt.js
module.exports = function (data) { const {mentions} = data; // Create a list of new mentions with a link to the source const mentionsList = mentions.map((mention) => { return `- ${mention.sourceSiteTitle} (${mention.sourceUrl})`; }).join('\n'); // Be careful when you indent the email, becau...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/staff/email-templates/new-paid-cancellation.txt.js
ghost/core/core/server/services/staff/email-templates/new-paid-cancellation.txt.js
module.exports = function (data) { // Be careful when you indent the email, because whitespaces are visible in emails! return ` Hey there, A paid member's subscription has just been canceled: "${data.memberData.name}" --- Sent to ${data.toEmail} from ${data.siteDomain}. If you would no longer like to receive...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/media-inliner/index.js
ghost/core/core/server/services/media-inliner/index.js
module.exports = require('./service');
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false