[etherpad-web/oscp-backend] Fix permissions for unprivileged user
- From: Bartłomiej Piotrowski <bpiotrowski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [etherpad-web/oscp-backend] Fix permissions for unprivileged user
- Date: Wed, 13 May 2020 10:32:35 +0000 (UTC)
commit f2c9e0bfd77fc157e5d817d0ba65836d4bf26167
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date: Wed May 13 12:25:35 2020 +0200
Fix permissions for unprivileged user
Dockerfile | 8 +++++++-
fix-permissions.sh | 7 +++++++
2 files changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/Dockerfile b/Dockerfile
index 3f3ef60..2e3129e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -27,7 +27,13 @@ RUN npm install ep_adminpads \
ep_copy_paste_select_all \
ep_copy_paste_images
-COPY entrypoint.sh /entrypoint.sh
+ADD fix-permissions.sh /fix-permissions.sh
+ADD entrypoint.sh /entrypoint.sh
+
+RUN /fix-permissions.sh /opt/etherpad && \
+ /fix-permissions.sh /opt/app-root
+
+USER 1001
EXPOSE 9001
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/fix-permissions.sh b/fix-permissions.sh
new file mode 100755
index 0000000..97cb5e1
--- /dev/null
+++ b/fix-permissions.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+# Taken from https://raw.githubusercontent.com/openshift/sti-base/master/bin/fix-permissions
+# Fix permissions on the given directory to allow group read/write of
+# regular files and execute of directories.
+chgrp -R 0 $1
+chmod -R g+rw $1
+find $1 -type d -exec chmod g+x {} +
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]