# Remove home dir from files browser

**URL:** <https://discourse.openondemand.org/t/remove-home-dir-from-files-browser/3978>\
**Category:** Get Help\
**Created:** [January 22, 2025, 7:32pm UTC](https://discourse.openondemand.org/t/remove-home-dir-from-files-browser/3978 "2025-01-22T19:32:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastian-burlacu](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/sebastian-burlacu/32/2440_2.png) [@sebastian-burlacu](https://discourse.openondemand.org/u/sebastian-burlacu)\
**Post date:** [January 22, 2025, 7:32pm UTC](https://discourse.openondemand.org/t/remove-home-dir-from-files-browser/3978/1 "2025-01-22T19:32:51Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![sebastian-burlacu](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/sebastian-burlacu/32/2440_2.png) [@sebastian-burlacu](https://discourse.openondemand.org/u/sebastian-burlacu)\
**Post date:** [January 22, 2025, 7:44pm UTC](https://discourse.openondemand.org/t/remove-home-dir-from-files-browser/3978/2 "2025-01-22T19:44:26Z")

</div>

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:

```auto
      <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:

```auto
  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.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [January 22, 2025, 7:51pm UTC](https://discourse.openondemand.org/t/remove-home-dir-from-files-browser/3978/3 "2025-01-22T19:51:39Z")

</div>

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](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.

> <https://github.com/OSC/osc-ood-config/blob/v153/apps.awesim.org/apps/dashboard/initializers/usr_router_patch.rb>

---

<div class="post-metadata">

**Author:** ![sebastian-burlacu](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/sebastian-burlacu/32/2440_2.png) [@sebastian-burlacu](https://discourse.openondemand.org/u/sebastian-burlacu)\
**Post date:** [January 24, 2025, 4:08pm UTC](https://discourse.openondemand.org/t/remove-home-dir-from-files-browser/3978/4 "2025-01-24T16:08:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sebastian-burlacu](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/sebastian-burlacu/32/2440_2.png) [@sebastian-burlacu](https://discourse.openondemand.org/u/sebastian-burlacu)\
**Post date:** [February 3, 2025, 6:00pm UTC](https://discourse.openondemand.org/t/remove-home-dir-from-files-browser/3978/5 "2025-02-03T18:00:18Z")

</div>

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

```auto
  <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?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [February 3, 2025, 6:07pm UTC](https://discourse.openondemand.org/t/remove-home-dir-from-files-browser/3978/6 "2025-02-03T18:07:17Z")

</div>

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:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/3/379058db4aefd14a9aafe1e708cd02a3697f2dd1.png)

---

<div class="post-metadata">

**Author:** ![sebastian-burlacu](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/sebastian-burlacu/32/2440_2.png) [@sebastian-burlacu](https://discourse.openondemand.org/u/sebastian-burlacu)\
**Post date:** [February 3, 2025, 6:14pm UTC](https://discourse.openondemand.org/t/remove-home-dir-from-files-browser/3978/7 "2025-02-03T18:14:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [February 3, 2025, 6:27pm UTC](https://discourse.openondemand.org/t/remove-home-dir-from-files-browser/3978/8 "2025-02-03T18:27:42Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![sebastian-burlacu](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/sebastian-burlacu/32/2440_2.png) [@sebastian-burlacu](https://discourse.openondemand.org/u/sebastian-burlacu)\
**Post date:** [February 3, 2025, 6:39pm UTC](https://discourse.openondemand.org/t/remove-home-dir-from-files-browser/3978/9 "2025-02-03T18:39:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [August 2, 2025, 6:40pm UTC](https://discourse.openondemand.org/t/remove-home-dir-from-files-browser/3978/10 "2025-08-02T18:40:32Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
