-
Notifications
You must be signed in to change notification settings - Fork 834
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
fix(customize) sets permissions in line with Kong install #526
base: master
Are you sure you want to change the base?
Conversation
@@ -423,6 +423,14 @@ fi | |||
%s | |||
%s | |||
|
|||
# set ownership to kong user/group | |||
find /usr/local/share/lua/5.1/ -type f -exec chown 1000:1000 "{}" + |
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.
@gszr maybe this can be changed to chown kong:kong
. wdyt?
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.
what about s/1000/id -u/g
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.
@hutchic sorry, didn't get that?
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.
instead of assuming 1000:1000
can we get the uid:gid with the id
command?
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.
so I tried this:
KUSR=$(id -u kong)
KGRP=$(id -g kong)
find /usr/local/share/lua/5.1/ -type f -exec chown $KUSR:$KGRP "{}" +
find /usr/local/share/lua/5.1/ -type d -exec chown $KUSR:$KGRP "{}" +
But the result is
/usr/local/share/lua/5.1 $ ls -l
total 344
-rw-r--r-- 1 kong nogroup 29426 Dec 15 18:19 MessagePack.lua
-rw-r--r-- 1 kong nogroup 2788 Dec 15 18:19 ansicolors.lua
-rw-r--r-- 1 kong nogroup 12069 Dec 15 18:19 binaryheap.lua
drwxr-xr-x 1 kong nogroup 4096 Dec 17 19:24 cassandra
-rw-r--r-- 1 kong nogroup 32158 Dec 15 18:19 date.lua
-rw-r--r-- 1 kong nogroup 10591 Dec 15 18:19 etlua.lua
-rw-r--r-- 1 kong nogroup 10167 Dec 15 18:19 ffi-zlib.lua
-rw-r--r-- 1 kong nogroup 9543 Dec 15 18:19 inspect.lua
Which I find weird, originally it was;
/usr/local/share/lua/5.1 $ ls -l
total 296
-rw-r--r-- 1 1000 1000 29426 Dec 15 18:19 MessagePack.lua
-rw-r--r-- 1 1000 1000 2788 Dec 15 18:19 ansicolors.lua
-rw-r--r-- 1 1000 1000 12069 Dec 15 18:19 binaryheap.lua
drwxr-xr-x 2 1000 1000 4096 Dec 17 19:24 cassandra
-rw-r--r-- 1 1000 1000 32158 Dec 15 18:19 date.lua
-rw-r--r-- 1 1000 1000 10591 Dec 15 18:19 etlua.lua
-rw-r--r-- 1 1000 1000 10167 Dec 15 18:19 ffi-zlib.lua
-rw-r--r-- 1 1000 1000 9543 Dec 15 18:19 inspect.lua
Using the id
command on alpine gives me this:
/usr/local/share/lua/5.1 $ id -u kong
100
/usr/local/share/lua/5.1 $ id -g kong
65533
Not sure where we do it, but seems we set the ownership to 1000:1000
, and not to kong:kong
in the original docker builds.
So how should this customize behave?
needs updating after #632 gets merged |
Closing this due to lack of activity. Please re-open if needed. |
This is still needed. It's just that #632 has been a moving target, so that needs fixing first |
When using the
customize
feature, anything installed will be owned byroot
. This updates the files to be identically owned as the original Kong installed plugins.Here's after a customize run (the readme example), installing 2 plugins: