Re: [Tiki-devel] Ubuntu workflow file permissions problem
Jonny Bradley via TikiWiki-devel <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Gary
Sounds like fun! :D
I have a feeling that you're missing being in the www-data group, the command to add yourself is probably something like: (warning, it starts with `sudo`!)
sudo usermod -a -G www-data gary_c-l (according to https://askubuntu.com/a/79566)
This is because apache runs as www-data as a user in the www-data group, ands it sets the files it makes to that, so even if they're group writable you need to be in that group too.
Our setup.sh knows about this and should set the directory perms accordingly.
However... (just adding yourself to the group as above should help Gary, this next bit is a bit experimental)
Since Smarty 3.x it no longer respects the pref i added a while ago smarty_cache_perms so smarty temp files are all made only owner (www-data) writable, but i found a sneaky way round this i think (*nix gurus may be able to improve this, and my version only is tested so far on macOS/BSD). I have it set up as an alias like this:
alias tikitemp='sudo chmod -R +a "group:staff allow list, add_file, search, add_subdirectory, delete_child, readattr, writeattr, readextattr, writeextattr, readsecurity, file_inherit, directory_inherit" temp'
And it's the +a part that does the magic (ACL manupulation) which i only barely understand, so i hope others might be able to correct me if this is wrong (and don't try it on a production server yet ;)
The "staff" group is a Mac thing and both my user and apache are in it, so all files it makes can be deleted by me without needing to sudo it.
Hope that makes some sense?
jonny
> On 28 Apr 2021, at 10:50, Gary Cunningham-Lee <gary_c-39LOpZwlz1/[email protected]> wrote:
>
> Hi,
>
> I installed Ubuntu for my Tiki workflow but am having problems with file permissions.
>
> When I try to compile a theme, I get errors like this:
>
> error: Cache file temp/templates_c/en_classic^e25f244fed1033ebba5e1dbcf6879325e27d2d5a_0.file.tiki-show_page.tpl.php is not writable
> error: Cache file temp/public/codemirror_modes.js is not writable
> error: Cache file modules/cache/mod-3950d803c4ed09b131c78e5cbb7db2ce is not writable
>
> so I do a sudo chmod -R 777 on the directories involved and then can run php console.php scss:compile MyTheme -- once. But the next time I try to compile, I get the error again, so I need to reset the permissions again, so something is not right. I need to find out how to set permissions to permanently fix this.
>
> Most of the files and directories have permissions like
>
> -rw-r--r-- 1 gary_c-l www-data 3095 Apr 9 19:41 INSTALL
>
> And the directories and files in the error messages have
>
> drwxrwxrwx 9 gary_c-l www-data 4096 Apr 28 18:27 temp
>
> (gary_c-l is my user in this installation. I had to set gary_c-l as owner in order for PhpStorm and other applications to be able to make file changes, unless there is another way to achieve that.)
>
> How can I set ownership or permissions so that I can compile theme files without having to reset permissions every time? Any help would be appreciated.
>
> -- Gary
>
>
>
>
> _______________________________________________
> TikiWiki-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel