-
Notifications
You must be signed in to change notification settings - Fork 60
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
In starter
and starter_dev
file permissions don't allow for composer commands after init
#306
Comments
It turned out that switching to run everything as nginx was going to require a full refactor. I chose to take the simpler route of just addressing the immediate issues with the linked PR. |
I'm getting different results on Linux vs OSX make starter on Linux:
make starter on OSX:
Then on both I ran
Local permissions for linux:
Local permissions for OSX:
|
This seems to only be an issue on OSX, but I don't understand why. If I install on Linux then run
But if I try to run that on my Macbook it just fails and says it couldn't delete default.services.yml, even though I'm running the composer update through the container as root. It seems like composer wants to remove the default files and replace them, but for some reason it can't. I would think that running code inside the container should work the same no matter what the host machine is, but that doesn't seem to be the case. I also just did a fresh It also seems like what I'm seeing is slightly different to what Noah is seeing. |
Composer can and usually does run as root. When it installs a new module, the permissions will reflect that ( .PHONY: set-codebase-owner
.SILENT: set-codebase-owner
## Updates codebase folder to be owned by the host user and nginx group.
set-codebase-owner:
@echo ""
@echo "Setting codebase/ folder owner back to $(shell id -u):101"
sudo find ./codebase -not -user $(shell id -u) -not -path '*/sites/default/files/*' -exec chown $(shell id -u):101 {} \;
sudo find ./codebase -not -group 101 -not -path '*/sites/default/files/*' -exec chown $(shell id -u):101 {} \;
@echo " └─ Done"
@echo "" |
PR added #320 |
@DonRichards @noahwsmith @rosiel I think I've found the issue. It seems that root can append to a read only file on some machines, but not others. It's not a starter issue, but it's happening with the starter site because it is trying to append a patch to settings.php (assets/patches/default_settings.txt) which is not happening with make local. On the linux machine if I bash into the drupal container I can do this:
On my Mac I get this:
What I can't figure out is why. Both have the following permissions: So the options I can see to fix this are:
|
I've done a bit more digging into this, and the patch for settings.php doesn't actually seem to be necessary for Isle installs. All it is doing is adding this line to settings.php: So we could probably just remove the scaffolding bit in composer.json and it would be fine. I'm not sure if this would cause issues for installs outside of Isle though. |
After either
make starter
ormake starter_dev
the owner of theweb
directory appears to be root, and theweb/sites/default/settings.php
file is unwritable, even though every composer command needs to be able to append to it (apparently):I think if we have the
composer install
be run as thenginx
user this can be avoided. I will also fix theu+w
aspect of the settings.php file in my MR.The text was updated successfully, but these errors were encountered: