Good morning to you all!
During the last days I’ve been working on a new sub-application for the dashboard (same functioning as File Manager) to visualize the documentation contained in our repositories but in HTML format.
I’ve managed to get it working with a basic and simple design, the problem comes when I try to add some front-end to the development. In a very simple way I have seen that I can have without problem the CSS in the views themselves (stored in ‘app/views/html_viewer/’) but to have them in a more correct way what I do is to move them to my own CSS files. I have created in the /app/assets/ section a folder for ‘stylesheets’. So far so good, the problem comes now:
When I try to launch the application with one of my users I get the following message:
<<Errno::EACCES: Permission denied @ dir_s_mkdir - /var/www/ood/apps/sys/dashboard/tmp/cache>.
As far as I can see it is trying to create a sub-directory inside the dashboard TMP, but it doesn’t have the necessary permissions. In order to debug what I have done is to create this folder manually, assigned to root and added the 777 permissions. Once this is done and accessing with a user, I can see that the application works and a whole structure has been created under the cache folder, creating even ‘cache/assets/sprockets/v4.0.0/…(here multiple files)’.
The problem is that these files are now owned by the user himself, for example:
-rw-r–r-- 1 user users_group 2657 Aug 27 11:00 xxxxxxxxx
And therefore only this user can access the application. Could it be that the dashboard cache should point somewhere else? Some bug in the application?
Thank you very much for your help and best regards to all!
How are you launching the application? I want to say, as an off the top guess, that you’re launching it in a non-production mode. Like it’s launching in dev mode or something.
The error you’re running into doesn’t happen in regular installations because the application launches in production mode and doesn’t use the tmp/
directory.
I’m not sure how you’re going about doing this, editing the files inline maybe? IDK if that’s the best route. You’d likely want to fork the github repository, make all the additions you want, build an RPM from that and install that RPM (or .deb as the case may be).
Hello Jeff.
I’m not sure about the non-production or production modes that you are talking.
What I did it’s to start with the development in a base Open Ondemand installation that we have in our local rack. From here I took the dashboard application folder “/var/www/ood/apps/sys/dashboard/” and started to work . I added a new controller under “app/controllers”, modify the “config/router.rb” and finally added the new views in “app/views/” section. At the end I added a new folder named as the APP and the corresponding manifest.yml in this folder. As I said, seems to be working in a correct way, only this problem with the use of custom CSS files.
I’m not sure if this process that I followed is the cause of this problems
Rails may recognize that there are stylesheets here it needs to recompile. Maybe you should drop your custom css files in apache’s public directory and use the custom_css
configuration to load the new css files.
https://osc.github.io/ood-documentation/latest/reference/files/ondemand-d-ymls.html?highlight=custom_css
Maybe it’s not a mode issue (production vs development mode) - seems like it just doesn’t like that you’ve added CSS files. The actual distribution compiles the CSS during the RPM build, so it may be trying to recompile them now.
In any case - I think custom_css
could work or inlining them in the views. Or you could fork and rebuild the package itself.