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

Cannot update .env #495

Open
saeedvaziry opened this issue Feb 16, 2025 · 5 comments · May be fixed by #496
Open

Cannot update .env #495

saeedvaziry opened this issue Feb 16, 2025 · 5 comments · May be fixed by #496
Labels
bug Something isn't working
Milestone

Comments

@saeedvaziry
Copy link
Member

Describe the bug
.env is not being updated when the site is isolated.

To Reproduce

  1. Create an isolated site with Laravel type for example
  2. Try to update .env file
@saeedvaziry saeedvaziry added the bug Something isn't working label Feb 16, 2025
@saeedvaziry saeedvaziry added this to the v2 milestone Feb 16, 2025
@saeedvaziry saeedvaziry added this to Vito Feb 16, 2025
@saeedvaziry saeedvaziry moved this to Todo in Vito Feb 16, 2025
@RichardAnderson
Copy link
Member

RichardAnderson commented Feb 16, 2025

Looking into this. Seems SFTP errors are being ignored (they don't throw exceptions by default) and the following error is being reported:

NET_SFTP_STATUS_PERMISSION_DENIED: Permission denied

The vito user does have access to the folder using groups, however, looks like SFTP is doing something special and ignoring group membership, and given it's not root, rejecting the transfer. However, for security, the .env file needs to be owned by the isolated user, not vito, so we will need to find another way to get the file content onto the server.

Worth noting - editFile won't work for any isolated site.

@RichardAnderson RichardAnderson linked a pull request Feb 16, 2025 that will close this issue
@buddhaCode
Copy link

It doesn't work for non-isolated sites, either.
#455

@saeedvaziry
Copy link
Member Author

@buddhaCode could be a permission issue. maybe you can share the ls -la output of the website's directory?

currently with the latest version I can update the .env file

@buddhaCode
Copy link

No, still can't see a textarea control, when I open the "update .env" action.

Here is the output.

total 664
drwxr-xr-x 15 vito vito 4096 Feb 18 16:25 . 
drwxr-xr-x 8 vito vito 4096 Jan 30 11:19 .. 
drwxr-xr-x 10 vito vito 4096 Jan 30 11:19 app 
-rw-r--r-- 1 vito vito 350 Jan 30 11:19 artisan 
drwxr-xr-x 3 vito vito 4096 Jan 30 11:19 bootstrap 
-rw-r--r-- 1 vito vito 3209 Jan 30 11:19 composer.json 
-rw-r--r-- 1 vito vito 474826 Jan 30 11:19 composer.lock 
drwxr-xr-x 2 vito vito 4096 Jan 30 11:19 config 
drwxr-xr-x 5 vito vito 4096 Jan 30 11:19 database 
-rw-r--r-- 1 vito vito 258 Jan 30 11:19 .editorconfig 
drwxr-xr-x 8 vito vito 4096 Jan 30 11:19 .git 
-rw-r--r-- 1 vito vito 186 Jan 30 11:19 .gitattributes 
drwxr-xr-x 3 vito vito 4096 Jan 30 11:19 .github 
-rw-r--r-- 1 vito vito 247 Jan 30 11:19 .gitignore 
drwxr-xr-x 5 vito vito 4096 Jan 30 11:19 lang 
-rw-r--r-- 1 vito vito 445 Jan 30 11:19 package.json 
-rw-r--r-- 1 vito vito 99575 Jan 30 11:19 package-lock.json 
-rw-r--r-- 1 vito vito 1175 Jan 30 11:19 phpunit.xml 
-rw-r--r-- 1 vito vito 142 Jan 30 11:19 postcss.config.js 
drwxr-xr-x 5 vito vito 4096 Jan 30 11:20 public 
-rw-r--r-- 1 vito vito 190 Jan 30 11:19 README.md 
drwxr-xr-x 7 vito vito 4096 Jan 30 11:19 resources 
drwxr-xr-x 2 vito vito 4096 Jan 30 11:19 routes 
drwxr-xr-x 7 vito vito 4096 Jan 30 11:19 storage 
drwxr-xr-x 4 vito vito 4096 Jan 30 11:19 tests 
drwxrwxr-x 61 vito vito 4096 Jan 30 11:20 vendor 
-rw-r--r-- 1 vito vito 373 Jan 30 11:19 vite.config.js

There even is no .env file. I created one manually via the web console. But still no textarea control and no content when I open the update env action.

@RichardAnderson
Copy link
Member

@buddhaCode are you running Vito over SSL through a reverse proxy? If so, I've seen this before, and some additional configuration steps are required to ensure resources render correctly.

If the above is true, you can following the steps here: https://vitodeploy.com/getting-started/securing.html#update-environment-variables

Essentially, it's adding the two following environment variables:

APP_URL=https://YOUR_DOMAIN
ASSET_URL=https://YOUR_DOMAIN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

3 participants