dashbrew icon indicating copy to clipboard operation
dashbrew copied to clipboard

777 folder permissions

Open Brunty opened this issue 10 years ago • 12 comments

I'm not sure if this is related to dashbrew or something's wrong with vagrant / the CMS I'm using for me (I'm not massively experienced with Vagrant outside of using pre-made puphpet setups really) so my apologies if it's not an dashbrew issue but something I'm misunderstanding.

I'm running bolt cms on a site, and it requires a few files / folders to have 777 permissions.

chmod -R 777 files/ app/database/ app/cache/ app/config/ theme/ extensions/

I set the permissions on my host machine, they display as 777 on the host machine, and within vagrant.

The site then complains that it can't write to the cache folder - I check the app/cache folder and the site has created some initial folders in there, but they've got 755 permissions and now the webserver can't write to them as they're owned by vagrant and the webserver is running as www-data.

I could go into the VM and change apache to run as vagrant instead of www-data but I'd prefer not to, is there a way of maintaining 777 permissions on the folders? (recursively inside them as well)

Brunty avatar Mar 04 '15 15:03 Brunty

Would there be a way to specify that certain folders require 777 permissions via the .dashbrew YAML file within the project?

Brunty avatar Mar 04 '15 15:03 Brunty

This is a common issue among Vagrant users who use the VirtualBox provider. It is because VirtualBox doesn't allow changing file permissions from within the VM. A quick fix for this would be to add :mount_options => [ "dmode=776", "fmode=666" ] to your Vagrantfile but I don't recommend it as it may other issues.

I think it would be very useful if we added a way to specify folder permissions in Dahsbrew project files.

mohatt avatar Mar 04 '15 16:03 mohatt

I was taking a look, a way to mount certain folders within a project with certain permissions would be a really nice feature in the .dashbrew files for projects.

Perhaps something like this?

---
myproject:
  title: My Project
  php:
    build: system
  vhost:
    servername: myproject.dev
    serveraliases:
      - www.myproject.dev
    ssl: true
  permissions:
    relative/path/to/folder: '0777'
    relative/path/to/another/folder: '0755'

Brunty avatar Mar 04 '15 16:03 Brunty

Looks good, thank you for looking into this :) I will try to get this feature done by next week.

mohatt avatar Mar 04 '15 18:03 mohatt

@mdkholy that would be amazing.

Off topic: This is a seriously cool project by the way, really nicely done.

Brunty avatar Mar 04 '15 18:03 Brunty

Thanks @Brunty :) I hope we could turn this into something useful to the PHP community.

mohatt avatar Mar 04 '15 19:03 mohatt

Also expect 'permissions' feature... Cool project! Thanks.

andpavlenko avatar Apr 09 '15 15:04 andpavlenko

Same here, :+1:

frdmn avatar Apr 21 '15 10:04 frdmn

Very nice Project! ... also expecting 'permissions' feature, :+1: Thanks!

elalemanyo avatar Apr 21 '15 10:04 elalemanyo

Thanks for your work on this project. also: +1

anotherfrontendguy avatar Aug 13 '15 17:08 anotherfrontendguy

Has this been implemented yet? I can't seem to find it in the docs.

~~BTW, wouldn't it be better to setup the box so that apache runs as user vagrant, like proposed here?~~ Sorry, just realized that PHP is running as FastCGI, so these settings won't have the desired effect

gebeer avatar Nov 01 '15 03:11 gebeer

Who found a solution ?

maximepvrt avatar Mar 29 '16 19:03 maximepvrt