-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Feature request: do not overwrite custom .htaccess content #22473
Description
I'd like to ask for a small improvement in NC server - do not overwrite custom .htaccess content during upgrade. Let me provide an example:
One of my NC installations is used to store sensitive documents of company; therefore, I added a few lines of code into .htaccess file to ensure that users can only access files from office computers. In other words, if IP is not whitelisted, it gets "Forbidden" error. I'd like NC to offer this feature by default, but I have no bit problems writing .htaccess code manually.
The only problem is that NC overwrites .htaccess file during every update, and I need to manually re-add custom code. Not the biggest issue in the world, but it still bugs me a lot.
Would it be possible to copy custom content from old .htaccess to new .htaccess during upgrade? I realize it might be difficult to scan and parse custom code, so maybe NC could support some type of pattern? For example, if user enters these lines into file:
###start_of_custom_code_for_nc
some custom code goes here...
###end_of_custom_code_for_nc
it would be super-easy for NC upgrade wizard to identify, extract, and transfer custom code into new .htaccess. Of course, it's just an idea, and if someone has a better one for preserving custom code, I'm listening!