I’m trying to allow Swifttype’s crawler (Swiftbot) to crawl our private discourse instance and they’re telling me I need to allow authentication access on discourse itself. Except I’m finding no documentation for such.
For context, I have discourse as the forum for my main site, I’m trying to add a site-wide search so users can search for discourse content from anywhere on my site. And this is what swifttype plugin does.
Is there any way to do this within docker on digitalocean?
In this case, our discourse is actually private and not indexed at all by search engines, which is why we need to make an exception somewhere for this specific user-agent Swiftbot.
I don’t think we’ve ever encountered this situation before. You would need to authenticate the crawler as a regular user, probably through the Discourse API. Do we have any examples of this @techapj?
To crawl the topics via Discourse API just provide your API key and username, and the requests made will be authenticated as regular user. For example:
To achieve the same via cURL request, pass api_key and api_username as param. For example:
curl -X GET -d api_key="API_KEY" -d api_username="ADMIN_USERNAME" http://discourse.example.com/latest.json
```
Both of the above examples will fetch all the latest topics (even for private Discourse instance).
@Joey_Tuan for more detailed API documentation, please see this topic:
https://meta.discourse.org/t/discourse-api-documentation/22706?u=techapj
Do NOT use the key of an admin though. That would be incredibly dangerous! Just use the key of a trust level zero user. If the key gets out there, anyone can use it.