0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Added Ghost ActivityPub internal integration (#21540)

refs https://linear.app/ghost/issue/AP-500

Rather than having to manually create an integration for communication
with the ActivityPub service, we are going to have an internal
integration which will then be used to handle webhooks between Ghost &
ActivityPub

The 'internal' type has been used to keep it out of the UI/API but
available for all Pro customers, which is necessary during the private
beta.

---------

Co-authored-by: Michael Barrett <mike@ghost.org>
This commit is contained in:
Fabien 'egg' O'Carroll 2024-11-07 13:55:11 +00:00 committed by GitHub
parent bb9a69edfe
commit 8f9dbcd0ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 48 additions and 1 deletions

View file

@ -0,0 +1,40 @@
const logging = require('@tryghost/logging');
const {createTransactionalMigration, meta} = require('../../utils');
const ObjectID = require('bson-objectid').default;
module.exports = createTransactionalMigration(
async function up(knex) {
logging.info('Adding Ghost ActivityPub integration');
const existing = await knex
.select('id')
.from('integrations')
.where('slug', '=', 'ghost-activitypub')
.andWhere('type', '=', 'internal')
.first();
if (existing) {
logging.warn('Found existing Ghost ActivityPub integration');
return;
}
await knex
.insert({
id: (new ObjectID).toHexString(),
type: 'internal',
slug: 'ghost-activitypub',
name: 'Ghost ActivityPub',
description: 'Internal Integration for ActivityPub',
created_at: knex.raw('current_timestamp'),
created_by: meta.MIGRATION_USER
})
.into('integrations');
},
async function down(knex) {
logging.info('Removing Ghost ActivityPub integration');
await knex
.del()
.from('integrations')
.where('slug', '=', 'ghost-activitypub')
.andWhere('type', '=', 'internal');
}
);

View file

@ -814,6 +814,13 @@
"description": "Internal Content API integration for Admin access",
"type": "core",
"api_keys": [{"type": "content"}]
},
{
"slug": "ghost-activitypub",
"name": "Ghost ActivityPub",
"description": "Internal Integration for ActivityPub",
"type": "internal",
"api_keys": []
}
]
}

View file

@ -36,7 +36,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = 'f12341a0c74998eeb4628322fd0982fb';
const currentFixturesHash = '475f488105c390bb0018db90dce845f1';
const currentFixturesHash = '80e79d1efd5da275e19cb375afb4ad04';
const currentSettingsHash = '47a75e8898fab270174a0c905cb3e914';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';