Using ActivityPub with a static site

I have a website that is built using 11ty with self-hosted Ghost as the backend.

The static site is served by nginx at https://example.com

The Ghost backend lives at, on the same server, also served with nginx https://ghost.example.com

I have followed Working With Eleventy - Ghost Developer Docs and used GitHub - TryGhost/eleventy-starter-ghost: A starter template to build websites with Ghost & Eleventy as a starting point.

I would like to try Ghost’s new Social Web/ActivityPub integration. I see that it requires migrating to a docker-based installation. Before doing do I want to know if it will even work if I am only using Ghost as the backend. The Ghost blog is set to “private” so that the static site is the only published version.

I would hope that ActivityPub would still work on the ghost.example.com domain, although I am unsure. Perhaps it could work on the main domain. Ideally clicking through to a post would lead to the post on example.com/post-slug rather than ghost.example.com/post-slug

So is it possible? Has anyone done it? Is is supported? And gotchas to watch out for?

Having the site should not affect ActivityPub, but I doubt you’ll get any followers doing it this way. If you want to, by all means.

NGINX requires some changes to allow ActivityPub.
If you need it, I can supply it :slight_smile:

For ActivityPub itself, you will not need to migrate to a Docker-based installation. That should work on the “old” CLI as well, using Ghost’s hosted ap.ghost.org ActivityPub server.

Private mode is interesting. Just tested this and both notes and articles will federate − you can also read the articles in the ActivityPub reader, which is uhhh…interesting. And not what I would have expected.

However, the articles will always link to the Ghost site’s URL – in this case ghost.example.com. Since that’s in private mode, anyone following the link would just see the password field on the private page though.

Changes in your NGINX are necessary, as Karl pointed out. There’s an overview of these here:

I’m not sure why it would affect “getting any followers”. But I’ll mention that isn’t the priority for me.

1 Like

Am I to understand that by upgrading to Ghost v6 my self hosted blog is now attempting to do ActivityPub via a 3rd party service (ap.ghost.org). I’m kind of surprised that is happening without my explicit consent/turning something on/activating a config option. I don’t think that was clear in the docs, although I admit the docs on this situation have been hard to find, hence posting here. Did I miss something?

I would prefer to self-host the AP aspect rather than use some 3rd party service. Follow up question: How do I disable it? I assume it is not working presently because of the nginx config not being set correctly (thanks for sending that).

Have a look here:

Ghost-CLI installs have support for the social web features via the Ghost(Pro) hosted ActivityPub service and are not compatible with web analytics. To self-host web analytics or fully self-host the ActivityPub service, you will need to try the new docker compose install method.

So, Docker would make perfect sense for you, in that case.

What specifically would you like to disable? Usually, when things are not working properly with ActivityPub, I restart a Ghost site, and look at the logs. Upon startup, there is a message about ActivityPub, if things are messed up. Some is self-healing (webhooks not being in the proper state), some is a bit ambiguous and an indication that a configuration (usually the proxy) isn’t working properly.

I saw these docs, but I wanted to know before migrating if ActivityPub would work given that my site is private/using Ghost as a backend for a static site. It sounds like it will work to some extent, but anyone on the Fediverse trying to click through to a post will be taken to a password-prompt for the private site.

It would be nice to find a workaround to link to/use a different URL (replace domain but the slug is the same, for example). I’m wondering if anyone has done this. I understand I might be on my own.

I don’t totally understand, but is my current self hosted non-docker Ghost installation, which I have just upgraded to v6, now trying to use ap.ghost.org for the ActivityPub integration? Can I disable this? Where is this documented?

You can disable activitypub entirely in your Ghost Settings. It’s down towards email config and integrations.

I say it would hinder your followers since they rely on your site to find the handle of your site. It’s not like mastodon where discovery is available for everyone. Every post will also have an url on federation and your visitors will likely face the private site login page.

If all you want is just Activity Pub, there are other options out there that might be better suited for your purposes.

I am afraid this is something you’d need to explore with your NGINX setup. The ActivityPub setup relies on having the host header passed to identify a site. The routing is also pretty particular.

I don’t think it’s impossible, but it will be a deep journey into the ActivityPub server itself and the routing :smiley:

As far as I understand the documentation, yes, given that they mention that CLI-based installations work with the Ghost(Pro) hosted AP server.

Can you disable it? I don’t think so. The “workaround” is probably the Docker setup.

You could try to set up the self hosted AP server and route requests there, but I haven’t used the CLI setup to an extent that I could advise on that, I am afraid.

1 Like

Thanks, found it. It’s under “Growth”.

I agree there could be other options better suited! But I am excited about Ghost’s embrace of ActivityPub and want to at least explore it if possible, and I’m curious if anyone else has tried with a similar set up.