Data Explorer Queries accessible to public

I recognize that for security reasons we would not want the public to be to define new queries.

But there could be some really cool uses for a query created by an admin and accessible not only to admins and moderators but also to the public.

For example, it would be interesting let users do a full-text boolean search on the contents of a Category.

Or maybe a user wants to enter a keyword and then download a list of all the external links referenced in posts which have that keyword in the title.

I do not think this is possible currently with the Data Explorer plugin - correct?

How hard would it be to do this as a personal project or perhaps as a paid project in the Discourse Marketplace?

There are currently plans to make data explorer queries available to staff in general, but not everyone, no.

4 Likes

If I wanted to create a custom version of the plugin that allowed queries by other groups of users, would it be as simple as assigning permissions to specific sets of users? Or is it more complex than that for some reason?

It would not be simple to extend this to support arbitrary group permissions, would require extensive internal changes. For starters none of the client side payload is even delivered to non staff, the backend API is blocked from non staff, there is no UX to specify permission per query. And so on.

3 Likes

OK - fair enough

If I wanted to write my own front-end to display the data - is it possible for me to determine the credentials to access the database for my forum hosted on Digital Ocean?

Discourse has a very robust API, the sky is the limit.

3 Likes

Thanks for the API suggestion. That may well be the ultimate answer.

First though I am pondering the SQL or Postegre database itself. I regularly use an SQL front-end/reporting tool in my work and thus I am very familiar with creating reports directly from a database. Is it possible to determine the URL and password to access the database for a Discourse forum which I host?

If you want to access the database from an external source I believe that you’d need to switch to a two container configuration and open up the database port. If you have a budget, I can help). You can search here for “two container” but you’ll need to understand docker pretty well to get to what you want. (oh, but here is this How to move from standalone container to separate web and data containers)

Edit: since you purchased a two container install, you just need to add a line to the data container and use the password that’s in the file.

It would likely help if you describe your use case rather than focus on solutions that might not be appropriate. What data do you want to expose to whom?

3 Likes

Hi Jeff, Do you have a timeline for the data explorer access by staff?

1 Like

Last October! Discourse 2.4.0.beta5 Release Notes

Apologies, we never posted an update here. You can now allow groups read-only access to any Data Explorer query. As an admin, access the query you want to give a group access to, and then enter the group name into the Allow groups to access this query box. Once saved, users can see the query on the group page at example.com/g

5 Likes

All good now. Thanks!

4 Likes