diff --git a/backend/src/index.js b/backend/src/index.js index c91f3e9be..7ed7bf70a 100644 --- a/backend/src/index.js +++ b/backend/src/index.js @@ -12,6 +12,6 @@ const serverConfig = { const server = createServer() server.start(serverConfig, options => { /* eslint-disable-next-line no-console */ - console.log(`Server ready at ${process.env.GRAPHQL_URI} 🚀`) + console.log(`Server ready at ${process.env.CLIENT_URI} 🚀`) ActivityPub.init(server) }) diff --git a/backend/src/middleware/activityPubMiddleware.js b/backend/src/middleware/activityPubMiddleware.js index 6c737faff..dcb5ae93c 100644 --- a/backend/src/middleware/activityPubMiddleware.js +++ b/backend/src/middleware/activityPubMiddleware.js @@ -49,7 +49,7 @@ export default { CreateUser: async (resolve, root, args, context, info) => { const keys = generateRsaKeyPair() Object.assign(args, keys) - args.actorId = `${process.env.GRAPHQL_URI}/activitypub/users/${args.slug}` + args.actorId = `${activityPub.host}/activitypub/users/${args.slug}` return resolve(root, args, context, info) } } diff --git a/webapp/nuxt.config.js b/webapp/nuxt.config.js index 70ab6333d..7669af8f2 100644 --- a/webapp/nuxt.config.js +++ b/webapp/nuxt.config.js @@ -121,6 +121,18 @@ module.exports = { proxy: true }, proxy: { + '/activityPub': { + // make this configurable (nuxt-dotenv) + target: process.env.GRAPHQL_URI || 'http://localhost:4000', + pathRewrite: { '^/activityPub': '' }, + toProxy: true, // cloudflare needs that + changeOrigin: true, + headers: { + Accept: 'application/json', + 'X-UI-Request': true, + 'X-API-TOKEN': process.env.BACKEND_TOKEN || 'NULL' + } + }, '/api': { // make this configurable (nuxt-dotenv) target: process.env.GRAPHQL_URI || 'http://localhost:4000',