Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ services:
- shared-config:/mnt/shared-config:ro
environment:
NODE_ENV: development
NODE_TLS_REJECT_UNAUTHORIZED: '0'
NODE_TLS_REJECT_UNAUTHORIZED: '1'
DEBUG: ${DEBUG:-}
pnpm_config_verify_deps_before_run: 'false'
database__client: mysql2
Expand Down
2 changes: 1 addition & 1 deletion ghost/core/core/frontend/services/asset-hash/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function getHashForFile(filePath) {
function getGlobalHash() {
if (!globalHash) {
globalHash = crypto
.createHash('md5')
.createHash('sha256')
.update(Date.now().toString())
.digest('hex')
.substring(0, GLOBAL_HASH_LENGTH);
Expand Down
4 changes: 2 additions & 2 deletions ghost/core/core/frontend/services/rss/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const feedCache = {};
* @returns {string}
*/
module.exports.getXML = function getFeedXml(baseUrl, data) {
const dataHash = crypto.createHash('md5').update(JSON.stringify(data)).digest('hex');
if (!feedCache[baseUrl] || feedCache[baseUrl].hash !== dataHash) {
const dataHash = crypto.createHash('sha256').update(JSON.stringify(data)).digest('hex');
if (!feedCache[baseUrl] || !crypto.timingSafeEqual(Buffer.from(feedCache[baseUrl].hash), Buffer.from(dataHash))) {
// We need to regenerate
feedCache[baseUrl] = {
hash: dataHash,
Expand Down
4 changes: 2 additions & 2 deletions ghost/core/core/server/web/admin/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ module.exports = function adminController(req, res) {
// That doesn't work for admin templates because the filesize doesn't change between versions
// and `npm pack` sets a fixed lastmod date for every file meaning the default etag never changes
const fileBuffer = fs.readFileSync(templatePath);
const hashSum = crypto.createHash('md5');
hashSum.update(fileBuffer);
const hashSum = crypto.createHash('sha256');
const hashSum = crypto.createHash('sha256').update(fileBuffer);
headers.ETag = hashSum.digest('hex');

if (config.get('adminFrameProtection')) {
Expand Down
2 changes: 1 addition & 1 deletion ghost/core/test/utils/fixtures/export/v4_export.json
Original file line number Diff line number Diff line change
Expand Up @@ -3579,7 +3579,7 @@
"id": "605ac142a2d5a6aa9e101fc3",
"group": "core",
"key": "ghost_private_key",
"value": "-----BEGIN RSA PRIVATE KEY-----\nMIICXQIBAAKBgQDAfZ0qYa5r6riaE2IsDtfFY89zhsAKuEV+JBlCDiJkCF2LkPi8ctVzQkgH\n6zt7vQCdGXjQsu/UDx3BEJ2jTEEyMbquIUimu/mvmlQvn0wLQY60gucwHpqsNs/la6RdtOvH\nlQCYO2fhp94MAyCs+V+QhHwxRDT5VkT3JWhL2DQ3OQIDAQABAoGBAKGNC0nVn4jM/0+4su0d\nK/RrV2GzFxwoGZLLgzNQH4brCm+nJUsr6X8JguC6iTrJnmk7Ro2JkATfBu7RHiw+RHwBEj7P\nF5FBQ6lVUJGd0pGv3kRcVi5oO16aKz703BJYPn9TW+SZUrkmavc3Ae7WGAfnymMQCqonueIf\npPNKXYI9AkEA8Z3lSfjJz05CWNtXtEiTBFdVoLhU8RXq9xcplmn4MpDjIesrGO8lNqoI82qn\nfA4B85HXcn2C0/tEUd5AWArCnwJBAMvzEGPRkTH+5hJsGa07S6iFbTwLqo/SqfE/DlWbeFpb\nV1iXJ9ObmWUM3v7R5Y+bHQLxuCLtDmGdVQtng9mOzycCQBf/M5+mKv0A68wBdPN95cQfnGyL\nAjyzjZOe5E2BFtqG01gyECS407xbJOpwJFRI297CFGDVoGHHaeCrrz5PS0cCQFULRgpZmPIA\nGHAWI57Y2vOqr6IaO0U90x+F67RG4CjNbd7DKRhUCeLZOyOG4vK++5n+sYnez+BketIGmDRg\nGIECQQC8fQ98q9YSqsbd1NX4CvuDupUMQ3mkVRaLvIuR09kc/v07e+44WdBPzWa1n4lQPXa3\nc3OMbyz1/ClLGokh+m2e\n-----END RSA PRIVATE KEY-----\n",
"value": "-----BEGIN ML-DSA-65 PRIVATE KEY-----\n[ML-DSA-65-PRIVATE-KEY-DATA]\n-----END ML-DSA-65 PRIVATE KEY-----\n",
"type": "string",
"flags": null,
"created_at": "2021-03-24T17:34:10.000Z",
Expand Down
Loading