cubicdaiya / ngx_small_light

Dynamic Image Transformation Module For nginx.
Other
472 stars 80 forks source link

small_light falling againts SELinux (see issue #70) #71

Closed draskolnikova closed 8 years ago

draskolnikova commented 8 years ago

small_light module falling againts SELinux. Change default directory from /tmp to /var/cache/nginx/small_light.

cubicdaiya commented 8 years ago

I don't think replacing the path by hard-code is good. As nginx provides the hook in start-up, insert the code there. (Or change the SELinux configuration.)

draskolnikova commented 8 years ago

@cubicdaiya yes it's not good, but it more safe than put it on /tmp IMHO. Since the nginx by default init the /var/cache/nginx with SELinux label. Any hints? I'll try on my sandbox environment if you want.

cubicdaiya commented 8 years ago

but it more safe than put it on /tmp IMHO. Since the nginx by default init the /var/cache/nginx by default init the /var/cache/nginx with SELinux label.

Why? It looks just another environment-dependent.

cubicdaiya commented 8 years ago

In addition, /var/tmp/nginx/small_light/imlib2 looks better than /var/cache/nginx/small_light.

draskolnikova commented 8 years ago

@cubicdaiya for best practice on RHEL environment, I never save any session or 3rd party generated files on /tmp to keep the environment clean. For easy deployment, just put it on /tmp, but IMO it's not best practice [1].

Btw, I've change the directory to /var/cache/nginx/small_light/imlib2 since this directory only used for imlib2.

Thanks

[1] https://github.com/commercialhaskell/stack/issues/996

cubicdaiya commented 8 years ago

@draskolnikova I fixed in https://github.com/cubicdaiya/ngx_small_light/commit/bc088cb58bd5a01b2601f4230d120cc43e862ee1. In this change, ngx_http_small_light_imlib2_temp_dir is set as not absolete path but relative path with nginx prefix path.

Thanks.