Grist workspace as subfolder in /docker/grist/persist/docs/as-workspace-name

Hello Grist team.
I try to connect FastReport report generator to .grist DB.
At the moment, we cannot get direct remote access to read the database via a link (it would be ideal)
Is possible set env variable to create subfolder in /docker/grist/persist/docs/workspace-name when create workspace, for restrict access for readed DB?

What kind of direct remote access via link are you looking for? If you want to download the .grist document, there is an endpoint for that: /download

For example, here is a download link for one of the public templates: https://templates.getgrist.com/api/docs/hdXy57qLiyNf/download

No, I haven’t seen anyone build something like that. One possibility might be to write a small script that periodically looks at the docs and workspaces tables of landing.db, and makes appropriate symbolic links for the documents? The part that looks at landing.db could be something like:

$ sqlite3 --json landing.db "select docs.id as docId, workspaces.name as workspaceId from docs \
  left join workspaces on workspaces.id = docs.workspace_id"
[{"docId":"gYUtop4FKXVBut3qNohLwX","workspaceId":"Horizon"},
 {"docId":"2TyL8dSsGYJoiKkubYZSpC","workspaceId":"Horizon"},
 ...
 {"docId":"8AYBGnC9bD6Xix7bw6DiRT","workspaceId":"Home"},
 {"docId":"qwDbDfRAUG8EWtFRgmiDCn","workspaceId":"Home"}]

Sorry, I’m only figuring out self-hosted grist.
I have mapped docker container volume on my host /persist
If i set GRIST_ORG_IN_PATH=true
I expect that self-hosted grist for example grist.app implements team site (test) not as subdomain (test.grist.app) but as path grist.app/test/
I was hoping that in this mode in volume on my host /persist creates folder test and I will be able to set access to document file permissions at /persist/test
But I can normaly use grist only with this variables:

I understand that maybe team site mode for self-hosted grist not available
Therefore, I hoped that in the GRIST_SINGLE_ORG=test mode when creating Workspaces (ws) grist can create folder on /persist/test/ws

Ah, I see. No, neither team names nor workspace names map onto directories on disk. They can both be retrieved from the database though. For example this query:

$ sqlite3 --json landing.db "select docs.id as docId, workspaces.name as workspace, orgs.name as team from docs \
  left join workspaces on workspaces.id = docs.workspace_id \
left join orgs on orgs.id = workspaces.org_id"

will report workspace names and team site names for all documents, which could then be soft-linked into directories as you wish by a small script:

[{"docId":"sample_1","workspace":"Horizon","team":"NASA"},
 {"docId":"sample_2","workspace":"Horizon","team":"NASA"},
 {"docId":"sample_8","workspace":"Trees","team":"Primately"},
 {"docId":"sample_12","workspace":"Deep","team":"Abyss"},
 {"docId":"sample_20","workspace":"Tailor Made","team":"Shiny"},
 ...]
1 Like