BlogoText / blogotext

A little more than a lightweight SQLite Blog-Engine.
Other
137 stars 30 forks source link

Filepermissions #324

Open ragnar76 opened 7 years ago

ragnar76 commented 7 years ago

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

remrem commented 7 years ago

Yep, need a review ...

extragornax commented 7 years ago

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

remrem commented 7 years ago

@extragornax You mean, run the chmod by PHP ?

extragornax commented 7 years ago

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

remrem commented 7 years ago

@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.

extragornax commented 7 years ago

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

remrem commented 7 years ago

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

ragnar76 commented 7 years ago

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.

extragornax commented 7 years ago

@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.

ragnar76 commented 7 years ago

@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)

extragornax commented 7 years ago

@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