I’m trying to set up a dashboard in my development sandbox, but the new requirement for all configuration files to be owned by root seems to be preventing me from having a local config for my development dashboard. Is there a way to disable the root ownership requirement for development apps?
There’s a hack here to have OOD look at a different directory for that dev dashboard which then lets you create your own custom files. The env var you want is OOD_CONFIG_D_DIRECTORY="/users/<project>/<user>/ondemand/dev/dashboard/config/ondemand.d/" which you’ll notice is pointing to the dev dashboard config/ondemand.d directory where I can now land config files that OOD will pick up and use for my dev dashboard.
Here’s the general page: Enabling App Development — Open OnDemand 4.0.0 documentation
And some of this remapping for the configs using the env var is discussed here: ondemand.d/*.yml files — Open OnDemand 4.0.0 documentation
I did that, but it won’t read anything from those files. I even copied the production files there just to make sure I wasn’t introducing any errors … but all I get is a blank dashboard – just like it was when I upgraded to 4.0 and hadn’t set the correct permissions on the config files in config/ondemand.d …
That’s strange. Is the .env.local file where you set that variable in the development code directory as well? I would also check all those permissions on the files you transferred and ensure you own them and they are readable.
Yes … I was trying to follow the tutorial …
I copied the dashboard app file from /var/www/ood/app/sys to my dev directory (~/ondemand/dev) – that gives me a variation of the production dashboard – but the custom widgets we have don’t display properly (not unexpected).
I created the .env.local file in my dev directory. I put the variable in to do the brand color – and it has no effect. I put the variable to set the config directory, and it gives me a blank dashboard – except that the menubar still has all the customizations we put on the production dashboard. The widgets are totally gone.
I’ve tried setting the RAILS_ENV variable in the .env.local to try to get it to allow non-root files (I looked at the source), but it doesn’t seem to be having an effect. Is there another place where I could set that variable that would be effective?
That should be the correct spot to set it.
All i know is i have a symlink in that directory for my dashboard that looks to go back to ondemand/misc where I have the actual dashboard code sitting. I’m confused looking at this though because I don’t get why this is done or how I knew to do this.
@jeff.ohrstrom Do you remember how to do this? I don’t.
Is there any embedded debug logging already present in the dashboard that I can enable to show what’s happening?
This is what I’ve been using in my ~/ondemand/dev/dashboard/.env.local file for some time, so I can test and commit my dev changes to a git repo before pulling them into production.
OOD_BRAND_BG_COLOR="#DE3163"
OOD_BRAND_LINK_ACTIVE_BG_COLOR="#D73B68"
OOD_LOAD_EXTERNAL_CONFIG=1
OOD_LOAD_EXTERNAL_BC_CONFIG=1
MOTD_PATH="/path/to/home/gits/ood-rc/etc/motd.ood.md"
OOD_CONFIG_D_DIRECTORY="/path/to/home/gits/ood-rc/etc/ood/config/ondemand.d"
OOD_LOCALES_ROOT="/path/to/home/gits/ood-rc/etc/ood/config/locales"
OOD_BC_APP_CONFIG_ROOT="/path/to/home/gits/ood-rc/etc/ood/config/apps"
OOD_APP_CONFIG_ROOT="/path/to/home/gits/ood-rc/etc/ood/config/apps/dashboard"
OOD_PUBLIC_ROOT="/path/to/home/gits/ood-rc/var/www/ood/public"
And all the files in my dev repo etc/ood/config/ondemand.d directory are owned by me
The file ownership is a red herring because that check is only made in production. This class is important to the discussion as it is the one responsible for loading configs and propagating them throughout the application.
Thank you for your config example @hansen-m. I believe these are the 2 configs you’re missing @dredwilliams. IIRC - without looking at the ConfigurationSingleton class, the app only loads configs in production by default. In development mode (or test for that matter) it won’t read external configuration, so you likely need to flip OOD_LOAD_EXTERNAL_CONFIG for it to load things. Then OOD_LOAD_EXTERNAL_BC_CONFIG if you want to load external batch connect configurations.