Skip to content

Added configurable user for shell commands #779

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

Closed
wants to merge 2 commits into from

Conversation

fkrzski
Copy link
Contributor

@fkrzski fkrzski commented Mar 25, 2025

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

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ShellCheck found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@taylorotwell
Copy link
Member

I am closing this pull request because it lacks sufficient explanation, tests, or both. It is difficult for us to merge pull requests without these things because the change may introduce breaking changes to the framework.

Feel free to re-submit your change with a thorough explanation of the feature and tests - integration tests are preferred over unit tests. Please include it's benefit to end users; the reasons it does not break any existing features; how it makes building web applications easier, etc.

Thanks!

@fkrzski
Copy link
Contributor Author

fkrzski commented Apr 16, 2025

I was updated description of feature

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