Avoid using /tmp/ for bind mounts and non-tmpfs binds (#29488)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2025-03-13 14:51:01 +00:00
committed by GitHub
parent 917d53a56f
commit 962136d453
4 changed files with 9 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/sh
# Loads modules from `/tmp/element-web-modules` into config.json's `modules` field
# Loads modules from `/modules` into config.json's `modules` field
set -e
@@ -15,15 +15,15 @@ mkdir -p /tmp/element-web-config
cp /app/config*.json /tmp/element-web-config/
# If there are modules to be loaded
if [ -d "/tmp/element-web-modules" ]; then
cd /tmp/element-web-modules
if [ -d "/modules" ]; then
cd /modules
for MODULE in *
do
# If the module has a package.json, use its main field as the entrypoint
ENTRYPOINT="index.js"
if [ -f "/tmp/element-web-modules/$MODULE/package.json" ]; then
ENTRYPOINT=$(jq -r '.main' "/tmp/element-web-modules/$MODULE/package.json")
if [ -f "/modules/$MODULE/package.json" ]; then
ENTRYPOINT=$(jq -r '.main' "/modules/$MODULE/package.json")
fi
entrypoint_log "Loading module $MODULE with entrypoint $ENTRYPOINT"