diff --git a/.gitignore b/.gitignore index 4c06dab..ba0d5b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *\~ .\#* \#*\# -.config/ \ No newline at end of file +.config/ +goss.yaml diff --git a/build-n-test.sh b/build-n-test.sh index f177150..3d0a77d 100755 --- a/build-n-test.sh +++ b/build-n-test.sh @@ -15,7 +15,12 @@ for image in "${images[@]}"; do docker build -t $tag -f $image.Dockerfile . echo "Testing image" + cp goss-default.yaml goss.yaml 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 diff --git a/common/entrypoint.sh b/common/entrypoint.sh index f6d4282..6f2f589 100755 --- a/common/entrypoint.sh +++ b/common/entrypoint.sh @@ -1,8 +1,8 @@ #!/bin/sh # Set defaults for uid and gid to not be root -if [ -n $GID ]; then GID=100; fi -if [ -n $UID ]; then UID=1000; fi +if [ -z $GID ]; then GID=100; fi +if [ -z $UID ]; then UID=1000; fi if [ "$GID" -ne "0" ]; then GROUP=jdownloader diff --git a/goss.yaml b/goss-default.yaml similarity index 75% rename from goss.yaml rename to goss-default.yaml index 5fadbc4..edae253 100644 --- a/goss.yaml +++ b/goss-default.yaml @@ -1,17 +1,26 @@ file: /opt/JDownloader/JDownloader.jar: exists: true - mode: "0644" + mode: + or: + - "0664" + - "0644" filetype: file contains: [] /opt/JDownloader/sevenzipjbinding1509.jar: exists: true - mode: "0664" + mode: + or: + - "0664" + - "0644" filetype: file contains: [] /opt/JDownloader/sevenzipjbinding1509Linux.jar: exists: true - mode: "0664" + mode: + or: + - "0664" + - "0644" filetype: file contains: [] package: diff --git a/goss-uid-test.yaml b/goss-uid-test.yaml new file mode 100644 index 0000000..12757b7 --- /dev/null +++ b/goss-uid-test.yaml @@ -0,0 +1,9 @@ +user: + jdownloader: + exists: true + uid: 1001 + gid: 101 + groups: + - jdownloader + home: [] + shell: /bin/false