I need to show a directory listing of a folder outside of the Rails app
structure. Moving the folder is not an option. In fact, changing
anything (including modes) is not possible for the folder.
I have working directory listing code in Ruby, but if I call chdir in
Rails to set the working directory to a folder outside the app tree,
nothing is returned to the browser. It’s fine if I chdir to a folder
inside the public folder.
To get this to work in Ruby, I needed to change the UID for the Ruby
file. I don’t think this approach will work in Rails.
I understand the security issues here, but would like to somehow say
that it’s safe to chdir to a particular directory. I can’t find any
discussion of Rails safety/security similar to the $SAFE information in
the Pickaxe book.