Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission errors on Windows #24

Open
MetaMmodern opened this issue May 8, 2021 · 5 comments
Open

Permission errors on Windows #24

MetaMmodern opened this issue May 8, 2021 · 5 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request question Further information is requested

Comments

@MetaMmodern
Copy link

Hi!

Your library works strange and requires access to neighbour users folder!!!

The error occures here: \src\env\env.ts:14:23

image
Red line means my user, and green arrow means another Windows user.

Moreover, the same ine caused an error yesterday, but that time it tried to access my own user root folder.

Are you sure that we need that strange logic for dotenv support?

Add a bug label please.

@hiro5id
Copy link
Owner

hiro5id commented May 14, 2021

I'm just noticing this ticket now. I'll take a look tomorrow and i'll let you know what I find out.

@hiro5id hiro5id self-assigned this May 14, 2021
@hiro5id hiro5id added question Further information is requested enhancement New feature or request bug Something isn't working labels May 14, 2021
@hiro5id
Copy link
Owner

hiro5id commented May 15, 2021

@MetaMmodern I think I know what this has to do with. There is this feature where you can specify some environment variables either in .env file or in normal environment variables, to control different behaviour of the logger. For example you can tell it to not log time stamp.

When it looks for the optional .env file it walks up the tree trying to find one.

I believe you are experiencing a side effect of that action of looking for the .env file.

I will test this on a windows machine, I'm typically using Linux and Mac for my daily work.

In the mean time, do you have a different suggestion for the .env file searching mechanism?

It could be that it is walking up the tree and then inadvertently going too far and blundering into another user's folder somehow. But I need to pull out a Windows machine to see.

@hiro5id
Copy link
Owner

hiro5id commented May 15, 2021

hey @MetaMmodern could you try version 2.7.0 ? I have disabled the recursive walking of up the tree looking for .env files... It now only looks in the current directory of the executing process.

@MetaMmodern
Copy link
Author

MetaMmodern commented May 15, 2021

hey @MetaMmodern could you try version 2.7.0 ? I have disabled the recursive walking of up the tree looking for .env files... It now only looks in the current directory of the executing process.

Hi. Okay, I'll check it asap, but maybe you'd better use something like app-root-path to use find the fe only in project folder.

@MetaMmodern
Copy link
Author

@MetaMmodern I think I know what this has to do with. There is this feature where you can specify some environment variables either in .env file or in normal environment variables, to control different behaviour of the logger. For example you can tell it to not log time stamp.

When it looks for the optional .env file it walks up the tree trying to find one.

I believe you are experiencing a side effect of that action of looking for the .env file.

I will test this on a windows machine, I'm typically using Linux and Mac for my daily work.

In the mean time, do you have a different suggestion for the .env file searching mechanism?

It could be that it is walking up the tree and then inadvertently going too far and blundering into another user's folder somehow. But I need to pull out a Windows machine to see.

Sorry, didn't see this comment.
I think it woild be cool to have a *.config.json file instead of env. We've made such in our project. And as I mentioned you could use some third larty lib do determine the root folder of project and search for config file only there and not in higher folders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants