Skip to content

Added configurable user for shell commands #785

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

Merged
merged 3 commits into from
Apr 18, 2025

Conversation

fkrzski
Copy link
Contributor

@fkrzski fkrzski commented Apr 16, 2025

Reopened PR #779 (I don't see Reopen pull request button`

Problem

Laravel Sail defaults executing commands as sail user in a container, which causes problems in some environments where:

  • Specific user is required
  • There is a need to integrate with external system with specific user
  • Development teams have set standards for users in containers (My case)
  • Users have problems with file permissions

Solution

I introduce APP_USER env variable, which:

  • Defaults to sail to preserve backwards compatibility
  • Aloows developers to specify their own user in the .env. file
  • Is used in all commands where -u sail was previously set

Benefits

  • Developers can customize the container without modifying the source code
  • Easier integration with existing file systems and databases
  • The same user can be used in development, testing and production
  • Eliminates problems with file permissions during development

Backward compatibility

  • Default value "sail" provides identical behavior as before
  • Existing installations that do not define the new variable are not affected

Impact

Low

@taylorotwell taylorotwell merged commit 00cd196 into laravel:1.x Apr 18, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants