Merge pull request #26 from PlusMinus0/dev

Fix for UID and GID
This commit is contained in:
PlusMinus0 2018-11-22 10:18:41 +01:00 committed by GitHub
commit 05ac78dc73
5 changed files with 30 additions and 6 deletions

3
.gitignore vendored
View file

@ -1,4 +1,5 @@
*\~ *\~
.\#* .\#*
\#*\# \#*\#
.config/ .config/
goss.yaml

View file

@ -15,7 +15,12 @@ for image in "${images[@]}"; do
docker build -t $tag -f $image.Dockerfile . docker build -t $tag -f $image.Dockerfile .
echo "Testing image" echo "Testing image"
cp goss-default.yaml goss.yaml
dgoss run $tag dgoss run $tag
echo "Testing again with UID and GID"
cp goss-uid-test.yaml goss.yaml
dgoss run -e UID=1001 -e GID=101 $tag
done done

View file

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
# Set defaults for uid and gid to not be root # Set defaults for uid and gid to not be root
if [ -n $GID ]; then GID=100; fi if [ -z $GID ]; then GID=100; fi
if [ -n $UID ]; then UID=1000; fi if [ -z $UID ]; then UID=1000; fi
if [ "$GID" -ne "0" ]; then if [ "$GID" -ne "0" ]; then
GROUP=jdownloader GROUP=jdownloader

View file

@ -1,17 +1,26 @@
file: file:
/opt/JDownloader/JDownloader.jar: /opt/JDownloader/JDownloader.jar:
exists: true exists: true
mode: "0644" mode:
or:
- "0664"
- "0644"
filetype: file filetype: file
contains: [] contains: []
/opt/JDownloader/sevenzipjbinding1509.jar: /opt/JDownloader/sevenzipjbinding1509.jar:
exists: true exists: true
mode: "0664" mode:
or:
- "0664"
- "0644"
filetype: file filetype: file
contains: [] contains: []
/opt/JDownloader/sevenzipjbinding1509Linux.jar: /opt/JDownloader/sevenzipjbinding1509Linux.jar:
exists: true exists: true
mode: "0664" mode:
or:
- "0664"
- "0644"
filetype: file filetype: file
contains: [] contains: []
package: package:

9
goss-uid-test.yaml Normal file
View file

@ -0,0 +1,9 @@
user:
jdownloader:
exists: true
uid: 1001
gid: 101
groups:
- jdownloader
home: []
shell: /bin/false