You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 23, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 23, 2026. It is now read-only.
Allow to include custom js/html when running ocis web #4735
There are plans to refine the way to load extensions. Right now there are three different keys in the json file for loading extensions. We want to have only one.
@labkode no recommended way. I can draw a picture of pros and cons:
using the WEB_UI_CONFIG env var pushes everything into one file (everything in one place), but that will internally load the file on every page load. It also means that you can make changes in the file and a page reload is sufficient, no service restart required.
using all the individual env vars keeps everything in memory - but it requires a service restart to take effect.
I'll update the acceptance criteria with the ability of loading scripts from a local path, however giving the learnings from the same topic with theming makes me slightly pessimistic that this will be feasible soon (given oCIS's nature of being a compiled binary and the testability of local files in our CI).
Is loading scripts locally a hard requirements from your side, or can the job be done by using remote ones for now? Also, can I assume that you're content with the other characteristics of the approach I outlined above?
Can we also have a way to import CSS in the exact same way? I know we can use branding, but that only allows us to set some variables and @elizavetaRa and I were discussing and we think it would be a good addition.
Can we also have a way to import CSS in the exact same way? I know we can use branding, but that only allows us to set some variables and @elizavetaRa and I were discussing and we think it would be a good addition.
Yes, absolutely! Loading custom css was already in a small PoC, we could bring it to the product easily.
We need an agile process to test changes in the ocis deployment. If changes can happen without having to re-compile is the easiest approach (like it was in OC10 with the theming apps).
We need an agile process to test changes in the ocis deployment. If changes can happen without having to re-compile is the easiest approach (like it was in OC10 with the theming apps).
Agreed, and this would be possible both by referencing external scripts (e.g. through https://raw.githubusercontent.com/example-script.js) or by having them load from a local path (which, as stated above, may be harder to implement and therefore take longer) - no need to recompile oCIS, however it works differently than in OC10
Activity
kulmann commentedon Feb 11, 2021
I agree that we need this.
The way we would want to configure this is probably via the config.json.
ocis webcan get its own arguments for configuring this via CLI.labkode commentedon Feb 11, 2021
@kulmann did I read correctly that when running
ocis serverI can have a custom config for the web service?kulmann commentedon Feb 11, 2021
Yes, you can provide a custom config file for the web service by running it with
WEB_UI_CONFIG="/path/to/config" ocis server.labkode commentedon Feb 11, 2021
@kulmann that is nice, do you have at hand what could be changed there? If there are some branding options we can start already playing with it.
kulmann commentedon Feb 11, 2021
It is still the same config like for oC Web with oc10. You can find an example here: https://github.com/owncloud/web/blob/master/config/config.json.sample-ocis
There are plans to refine the way to load extensions. Right now there are three different keys in the json file for loading extensions. We want to have only one.
For branding we will come up with a proper solution for this: https://github.com/owncloud/web/tree/master/packages/web-container/themes which will allow to configure the design tokens as well.
Since we want to maintain compatibility of oC Web with both oC10 and oCIS backends, the config.json is our preferred way for configuration for now.
labkode commentedon Feb 11, 2021
Thanks @kulmann , what is the recommend way to configure web?
I've already defined the following configuration env:
Should I move these env variables to the file and then only use
WEB_UI_CONFIG="/path/to/config?kulmann commentedon Feb 12, 2021
@labkode no recommended way. I can draw a picture of pros and cons:
WEB_UI_CONFIGenv var pushes everything into one file (everything in one place), but that will internally load the file on every page load. It also means that you can make changes in the file and a page reload is sufficient, no service restart required.pascalwengerter commentedon May 7, 2021
@labkode let's further narrow down the definition of done for this task in a scope that adds value to you/CERN!
Acceptance criteria
You can
config.jsonExample:
These scripts
<body>of the web containerlabkode commentedon May 7, 2021
Hi @pascalwengerter, one more item:
When defining the scripts, can we specify a local path like:
pascalwengerter commentedon May 11, 2021
I'll update the acceptance criteria with the ability of loading scripts from a local path, however giving the learnings from the same topic with theming makes me slightly pessimistic that this will be feasible soon (given oCIS's nature of being a compiled binary and the testability of local files in our CI).
Is loading scripts locally a hard requirements from your side, or can the job be done by using remote ones for now? Also, can I assume that you're content with the other characteristics of the approach I outlined above?
diocas commentedon May 16, 2021
Can we also have a way to import CSS in the exact same way? I know we can use branding, but that only allows us to set some variables and @elizavetaRa and I were discussing and we think it would be a good addition.
kulmann commentedon May 16, 2021
Yes, absolutely! Loading custom css was already in a small PoC, we could bring it to the product easily.
labkode commentedon May 17, 2021
We need an agile process to test changes in the ocis deployment. If changes can happen without having to re-compile is the easiest approach (like it was in OC10 with the theming apps).
pascalwengerter commentedon May 18, 2021
Agreed, and this would be possible both by referencing external scripts (e.g. through
https://raw.githubusercontent.com/example-script.js) or by having them load from a local path (which, as stated above, may be harder to implement and therefore take longer) - no need to recompile oCIS, however it works differently than in OC10fschade commentedon Sep 26, 2022
done in #7689, currently only for the experimental branch, can be backported later.
fschade commentedon Feb 14, 2023
@labkode finally backported, #8432.
cc.: @dragotin