Remove home dir from files browser

I know I can add many dirs to this app, which is great, but I’d like to remove the home dir. My goal is to restrict uploads/downloads to only a specific location, after which point I scan the files and then move them to the users’ home directories. Is this possible? Thanks!

seems I figured this out. I did this:

edited /var/www/ood/apps/sys/dashboard/app/views/files/_favorites.html.erb and removed the lines:

      <li role="presentation" class="nav-item">
        <%= link_to files_path(Dir.home), class: "nav-link d bg-light" do %>
          <%= fa_icon "home", classes: '' %>
          Home Directory
        <% end %>
      </li>

edited /var/www/ood/apps/sys/dashboard/app/apps/ood_app.rb and commented out these lines as below:

  def links
    if role == "files"
      # assumes Home Directory is primary...
      [
#        OodAppLink.new(
#          title: "Home Directory",
#          description: manifest.description,
#          url: OodAppkit::Urls::Files.new(base_url: url).url(path: Dir.home),
#          icon_uri: "fas://home",
#          caption: caption,
#          new_tab: open_in_new_window?,
#          tile: tile
#        )
      ].concat(
        OodFilesApp.new.favorite_paths.map do |favorite_path|
          OodAppLink.new(

obviously set allow path as per config option and then added secondary path to initiator.

Glad to see you sorted it.

Instead of editing the files in /var/www/ood (which will be overwritten when you reinstall/update) you can provide the same overrides in /etc

Here’s the docs on overriding HTML pages.
https://osc.github.io/ood-documentation/latest/customizations.html#overriding-pages

Here’s an example of a monkey patch where we used to overwrite the functionality of the UsrRouter class. You can do the same thing with the OodApp class, i.e., redefine behavior in an initializer.

Thanks for the tip; I’ll see if I can get that going. Loving this software by the way, and your great help every time I post! Cheers

1 Like

Hmm having some trouble. I created /etc/ood/config/apps/dashboard/views/files/_favorites.html.erb with these contents:

  <div id="clipboard" class="sticky-top">
  </div>

  <nav>
    <ul id="favorites" class="nav nav-pills flex-column">
      <% OodFilesApp.new.favorite_paths.each do |p| %>
        <li class="nav-item">
          <%= link_to files_path(p.filesystem, p.path.to_s), class: "nav-link d bg-light" do %>
          <%= fa_icon p.icon, classes: '' %>
          <%= p.title || p.path.to_s  %>
          <% end %>
        </li>
      <% end %>
    </ul>
  </nav>

And I uncommented what I had edited before (in /var/www/ood/apps/sys/dashboard/app/apps/ood_app.rb). However that made the Home Directory link come back. Do I need to do both?

The Ruby .rb controls the navigation menu entries. The HTML file you’ve given is for the list on the left hand panel when you view the files page.

i.e., this:

Ah ok so that is also good for sure. To override this other file I edited, would I need to

mkdir /etc/ood/config/apps/dashboard/apps/
vim /etc/ood/config/apps/dashboard/apps/ood_app.rb

And put in the same file I was editing, but with the Home Dir commented out as I had done before? So essentially the same thing, but overriding it correctly this time?

Edit: no, still there after I do this.

Initializers (like the rb file you’re trying to make) go into initializers directory (the same directory of the site specific file that creates the list of favorites to begin with).

1 Like

It worked!! Thank you so much - really appreciate it.