blogotext icon indicating copy to clipboard operation
blogotext copied to clipboard

Filepermissions

Open ragnar76 opened this issue 7 years ago • 11 comments

Hi.

I've just made a fresh clone of blogotext. and i ended up with this notice:

BlogoText has no write rights (chmod of home folder must be 644 at least, 777 recommended).

Do you think it's a good idea to have all files (and directories) read, write and executable for everyone? Imho, it's better to give 0755 to directories and 0644 to files. Also, the owner should be the one which the fileserver is running. For example www-data on debian or apache|nginx|... on centos.

bye

ragnar76 avatar Oct 08 '17 13:10 ragnar76

Yep, need a review ...

remrem avatar Oct 08 '17 15:10 remrem

Could that be implemented in the setup procedure ? A large scale php chmod with the retrieval of the fileserver username as mentioned above

extragornax avatar Oct 11 '17 08:10 extragornax

@extragornax You mean, run the chmod by PHP ?

remrem avatar Oct 11 '17 09:10 remrem

@remrem yes (Check that and that user perm ) but we'd have to investigate the possible errors and issues with that

extragornax avatar Oct 11 '17 09:10 extragornax

@extragornax , I don't think this a good idea. I don't want to modify the user system (this is the user job) and there is some hosting providers who disallow or change the behavior of this kind of php function, so we can't be really sure of the results of doing change on the files owner or permissions by PHP.

remrem avatar Oct 11 '17 09:10 remrem

That's what I mean in my previous message, it's not safe but it's possible.

extragornax avatar Oct 11 '17 09:10 extragornax

Can you take a look on this wiki page and let me know of what you think of it (something to change or add) ?

remrem avatar Oct 11 '17 09:10 remrem

it's probably a good start to set the right permissions here at github. if i make a fresh clone, a lot of files have 0755 while others have 0644. same with directories. admin has 0777 while themes have 0755.

ragnar76 avatar Oct 11 '17 09:10 ragnar76

@remrem little edit, I added clearer markers, the list made it pretty weird

@ragnar76 how can you set file permissions on GH ? I'm pretty sure the clone gathers the inherited permissions instead of the ones you post on GH (if they ever push). Personally when I clone, everything is on 744 permission.

extragornax avatar Oct 11 '17 10:10 extragornax

@extragornax hm... dunno but i've found this: https://www.reddit.com/r/git/comments/3icu9d/how_to_change_file_permissions_on_github/

so the easiest way to change the rights before commit. To make it easy, you can use "find"

find . -name '' -type d -exec /bin/chmod -v 0755 {} ; find . -name '' -type f -exec /bin/chmod -v 0644 {} ;

note the "d" and "f" in type which stands for directory and file (obviously)

ragnar76 avatar Oct 12 '17 22:10 ragnar76

@ragnar76 Interesting I also found why my files where on 744, I had a script running for another project... So we just need to ask the user to put 777 on the host folder and then just leave the file permissions on everything else

extragornax avatar Oct 13 '17 08:10 extragornax