I have an interesting use case here and im trying to figure out whether i should try to account for it by contributing to a preexisting module (this one) or by starting a new project.

The use case is i am running a site on a drupal specific hosting platform that uses nginx. However the provider prefers that you don't edit nginx.conf as they often overwrite this file. This rules out doing the analogous rewrite rules that you are doing with apache in this mod. They do, however, provide two private files directorites in /sites/*/files/private and /private that are set to 403 FORBIDDEN.

What i would need for this specific use case and in terms of this module is an additional mode that doesnt use .htaccess but instead grabs any file that is stored in the private directory and changes its path to /system/files/private (or otherwise) on the drupal end, thus accomplishing the same functionality independent of apache. Of course this relies/assumed that the user has set the private directory to forbidden on their own webserver.

Is this functionality you would be interesting in incorporating into this module or should i just start a new project? If you are interested this is my proposition:

Create a 2.x branch that functions more or less in the same way as the 1.x branch but that has drupal handle the path rewrite and is more or less cross webserver compatible. I will detail a roadmap for this in a comment below.

Comments

pirog’s picture

The changes in the 2.x branch would, and i am up to all suggestions on how to do any of these things, be:

Having drupal handle the redirect

Have drupal keep track of private files (attachment or filefield) and if a file is private then provide a link to that file using /system/files/private/FILENAME instead of the filepath.

Setting the private directory to forbidden

In lieu of setting rewrite rules with .htaccess the module would instead set the private directory to forbidden using a .htaccess file for apache and outputting the needed code snippet to be applied for nginx. Integration with other webservers could happen also.

Handling changes in private directory location

If a user changes the location of the private directory what happens to the old directory? Should the user be responsible for removing the htaccess file or changing the nginx.conf or should the module help with that, or would it be better to keep previously private directories private?

I've already written a bunch of code for the above so let me know if you want me to throw it up here as a possible 2.x branch or whether i should throw it someplace else! Either way is cool with me.

anrikun’s picture

Could you provide a patch for current version?

johnhanley’s picture

The changes you suggest are perfectly valid and reasonable, but are fairly drastic for a relatively small module that's very specific in scope. Given that Drupal 6 is nearing its life cycle it's highly unlikely there's much enthusiasm for taking this on.

I'd recommend modifying the module to suit your particular needs.

pirog’s picture

It would be a cool feature but I also am starting to come around to the "this is probably just not worth it" opinion.

johnhanley’s picture

Heck, don't let me discourage you from pursuing a new idea and fulfilling a need! I'm just not sure if at this point it makes sense to roll it into this module. :-)

johnhanley’s picture

Status: Active » Closed (won't fix)

Closing due to Drupal 6 end-of-life cycle.