Version 2.0 preperation question

I’m trying to prepare for v2 however it’s still moaning about “File Access Restrictions”. I’ve added “N8N_RESTRICT_FILE_ACCESS_TO=‘/home’” to my .env because I have multiple different SMB mounts mapped inside various folders within “/home” but the migration report is still moaning at me, is it not checking properly or something?

hi, you should not add this to you environnement as n8n default is to access only its folder :wink:

Hi,

Thanks for the reply but I want to override the default behaviour by setting the N8N_RESTRICT_FILE_ACCESS_TO variable correctly, which I believe I’ve done but the migration assistant is still saying I have workflows that are affected.

if one of your workflows read/write files in another directory then you will have to specify it here too.
and you can try to add the /home/”user”/.n8n folder too, user is “node” if you use the docker image.

Hi,

So in the docker-compose I map volumes like this:

./files/mydirectory:/home/node/mydirectory

So in the environment variable, I set:

N8N_RESTRICT_FILE_ACCESS_TO=‘/home/node’

From my understanding, this should be fine, no? If so, I presume the migration report isn’t being clever enough to understand that this is ok and is reporting it as affected workflows.

FYI I use the docker image.

I don’t think it will grant n8n acess to subfolders in your directory, so you should specify them like so:

N8N_RESTRICT_FILE_ACCESS_TO=”/home/node/ : /home/node/.n8n : /home/node/yourdirectory”

Really? Surely not! I have 100’s of folders in these volumes, surely I don’t have to list every folder? That’s crazy!

Hey @aurora !

P.S you should not use “/’curly”/’ in your env or Docker variables… (usually happens when you copy/paste and interpreter transforms them ).

In your case, should work the :

Simple without

N8N_RESTRICT_FILE_ACCESS_TO=/home/node

Or :

N8N_RESTRICT_FILE_ACCESS_TO=“/home/node” (see the quotes are not curly “) !!!

Cheers!

P.S @Nestor , next check n8n Docs :slight_smile:

1 Like

Thank you!

It was the copy/paste that messed with it, I had a single ‘ either side but I’ve updated it to: N8N_RESTRICT_FILE_ACCESS_TO=/home/node

However the migration report still complains about it, so as long as you’re right, I can ignore the warning about all of my workflows using file access (else I’ve got a big problem post v2 update!). This was my concern and was expecting it to understand the file access environment variable to validate.

I nearly broke down in tears when I thought you had to list every sub directory in the variable :smiley:

1 Like

Hello,

I’ve the same question, I had nearly 40 subdirectory in /home/node/"sub” and I was wondering if I had N8N_RESTRICT_FILE_ACCESS_TO=/home/node will also take in consideration my sub directories ? Or maybe something like this N8N_RESTRICT_FILE_ACCESS_TO=/home/node/* ?

If not it will be a pain because I have workflows that create directories in /home/node in function of variable

It’s the reason I’ve not marked Parintele_Damaskin’s reply as the answer, they were simply telling me to not use curly braces because of the copy/paste here.

Could someone in the know please confirm if all subdirectories are covered if we just use /home/node?

Thanks

Is anyone able to test this or answer the question please? I’m unable to update until this is clear.

Thanks

Hey @Kent1 and @aurora !

Sorry for the late answer… but I take them in order , and based where I am mentioned.

In the docs:

The variable :

Limits access to files in these directories. Provide multiple files as a semicolon-separated list (“;”)….

N8N_RESTRICT_FILE_ACCESS_TO works with directory paths, not with glob patterns like *… and I suppose that meas you can provide multiple directories as a colon-separated list.

Butt the v2.0 breaking-change note suggests that when you allow a directory, file nodes can access files “in the ~/.n8n-files directory”…

Soo…. Is this “recursive”?

Responding as well with a question :thinking: lol.

Cheers!

P.S didn’t tried yet the latest version, and definitely with this matter .

Thanks again ParIntele_Damaskin, however the question still remains if subdirectories are included :slight_smile:

Bump, hoping someone out there can confirm this.

Anyone? Please? :slight_smile:

Don’t worry I’ve updated and got the answer, subdirectories appear to be included (which was the logical thing). Ignore the migration report, it doesn’t report it properly.

2 Likes

Ahh… sorry @aurora !

I wasn’t tagged so just scrolling trough replies now.

Since I have just installed the v2.2.1(beta), I need time to structure based on my project requirements, and when I get there, i will let you know.

But I assume if I set N8N_RESTRICT_FILE_ACCESS_TO=/data/shared for example, write/read logically is recursive trough that “path” .

I cannot confirm you this right now, but nowhere is mentioned that is recursive or not, we have to deduct that, since there is possible to set multiple paths(which may be buggy).

Cheers!

It’s ok, I bit the bullet and just upgraded and hoped for the best, it all appears to be working so it’s recursive (which is what I’d expect).

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