Allow build-time config #392
Labels
No labels
bug
config
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
orinoco/shacl-vue#392
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Some existing features can pose a security risk, especially in the context of a multi-tenant-based approach. It makes sense that a tenant configures the user-facing aspects of their UI, but some config options (thinking specifically of security-related options) should remain under the sole control of the system administrator.
This, IMO, identifies the need to separate build-time configuration from runtime configuration. Runtime config is
shacl-vue's current configuration approach: a config file is supplied (in one of several possible ways) and interpreted at app startup in the browser. In the tenant-based context, this config is supplied by the tenant. However, as the administrators we might want to have configurable security options (e.g. "allowed file types to fetch", "allowlist of domains", "maximum file size to fetch"...), with defaults.shacl-vuealready supports similar build time environment variables, in avite-standard way. See e.g. https://cerebra.fz-juelich.de/service/mui/src/branch/main/.forgejo/workflows/publish.yml#L42-L46, where environment variables are set before thenpm run build:appcall. So my thought is to use a similar approach for security and other build-time config options. But since these options are often structured objects / arrays it'll be easier to provide them in json/yaml format rather than env strings. The latter is possible via a JSON string, but this is not useful for editing and tracking changes.So I'm currently thinking of supporting a generic build time config approach. We want configured options to become available to the app (across html and vue files) in a way that is analogous or identical to how vite env variables are handled:
export VITE_SOME_VARIABLE=123 => import.meta.env.VITE_SOME_VARIABLEin vue files, and<p>Some variable: %VITE_SOME_VARIABLE%</p>in html. Perhaps it is possible to just provide a build-time config file upfront and then in thevite.config.app.mjsfile we read this and inject it into the standard vite env structure.This is now supported by
3ecb09d495Still needs documentation
Added in #394