-
Notifications
You must be signed in to change notification settings - Fork 109
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
add a cache_dir_mode option to set the permission mode on the cached … #147
base: main
Are you sure you want to change the base?
Conversation
5abb79b
to
b5430c5
Compare
Hi Nathan, After your PR I've looked into what is currently happening with cache file modes and understood that they are not unified. For unoptimisable images the mode gets set to 644 and for optimised images it is 600. |
thanks for the response and looking into this, @toy! two tasks are foreground (webserver/user) and background (image processing). i push long tasks to the background, but still let console users and the webserver run foreground tasks when explicitly requested. all the users are part of a shared group, so allowing group rw seemed to do the trick the mode 600 files were causing the issue, so i think this should fix it, but there was one more place i had to set permissions for some reason |
@@ -38,6 +39,9 @@ def process | |||
@src ||= @original | |||
@dst ||= @original.temp_path | |||
|
|||
FileUtils.chmod(@cache_dir_mode, @src) unless @cache_dir_mode.nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also had to set the permissions here, i think because temp_path was giving mode 600
files
With my commit on master I just fixed the bug with getting 600 permissions on cached files. |
ill try it out & report back. thx again! |
so, the problem persists, specifically when different users try to create a temp path in the cache directory |
Does the temp path have the appropriate permissions? |
Yeah, it's the sub paths that somehow get the wrong permission.
i forget exactly how they end up, but these folders, inside of
`image_optim` somehow get less than group write permission:
```
user@server:/pathtoapp# ls -lah tmp/cache/image_optim/
total 1.1M
drwxrwsr-x 258 appuser appgroup 4.0K Apr 18 13:57 .
drwxrwsr-x 4 appuser appgroup 4.0K Apr 7 15:39 ..
drwxrwsr-x 2 appuser appgroup 4.0K Apr 24 11:02 00
drwxrwsr-x 2 appuser appgroup 4.0K Apr 24 12:42 01
drwxrwsr-x 2 appuser appgroup 4.0K Apr 24 10:54 02
drwxrwsr-x 2 appuser appgroup 4.0K Apr 24 10:55 03
drwxrwsr-x 2 appuser appgroup 4.0K Apr 24 10:57 04
drwxrwsr-x 2 appuser appgroup 4.0K Apr 21 08:33 05
drwxrwsr-x 2 appuser appgroup 4.0K Apr 24 12:42 06
drwxrwsr-x 2 appuser appgroup 4.0K Apr 24 10:54 07
drwxrwsr-x 2 appuser appgroup 4.0K Apr 24 10:29 08
drwxrwsr-x 2 appuser appgroup 4.0K Apr 21 18:36 09
...
```
…On Mon, Apr 24, 2017 at 1:23 PM Ivan Kuchin ***@***.***> wrote:
Does the temp path have the appropriate permissions?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#147 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAYZmr2WiiZY4QS34eUV9qBOnz4FGerYks5rzQTEgaJpZM4M05X_>
.
|
|
ahh, yeah, i force them to this now, both every time the app is deployed
and also whenever a temp folder is created. they were not like this unless
i do something like:
master...nathantsoi:master#diff-b37d0fe1c1eff7137fb93ff52c00f246R38
or
maybe it was this...
master...nathantsoi:master#diff-703bcbd9b656b2b44a5ee1b756725eafR42
not
100% sure.
…On Mon, Apr 24, 2017 at 1:57 PM Ivan Kuchin ***@***.***> wrote:
rwxrwsr-x mean all permissions for owner and group + setgid, so seems
that this should work
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#147 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAYZmmi4sciOcFyg2FKU0MozewYk2mQnks5rzQzRgaJpZM4M05X_>
.
|
Running In my case, all input files have Cache is configured to output cached images in |
After having commented, I tried |
@gpakosz Just released |
@toy thank you! |
Cool, thx guys. I'll try the latest version. Any idea on handling the
permissions on folders w/in the temp directory?
…On Thu, May 4, 2017, 4:22 AM Gregory Pakosz ***@***.***> wrote:
@toy <https://github.com/toy> thank you!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#147 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAYZmmonFgozz9sJaWLd5rlnN6NCpvboks5r2bT8gaJpZM4M05X_>
.
|
|
…tmp files
useful for environments where a foreground task and background task are run by different users