Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3768786
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/entrypoint.sh b/entrypoint.sh
index 4305f4a..793e190 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -1,83 +1,83 @@
#!/bin/bash
set -e
rewire_openfire() {
rm -rf /usr/share/openfire/{conf,resources/security,lib/log4j.xml,plugins,embedded-db}
ln -sf ${OPENFIRE_DATA_DIR}/conf /usr/share/openfire/
ln -sf ${OPENFIRE_DATA_DIR}/conf/security /usr/share/openfire/resources/
ln -sf ${OPENFIRE_DATA_DIR}/conf/log4j.xml /usr/share/openfire/lib/
ln -sf ${OPENFIRE_DATA_DIR}/plugins /usr/share/openfire/
ln -sf ${OPENFIRE_DATA_DIR}/embedded-db /usr/share/openfire/
}
initialize_data_dir() {
echo "Initializing ${OPENFIRE_DATA_DIR}..."
mkdir -p ${OPENFIRE_DATA_DIR}
- chmod -R 0755 ${OPENFIRE_DATA_DIR}
+ chmod -R 0750 ${OPENFIRE_DATA_DIR}
chown -R ${OPENFIRE_USER}:${OPENFIRE_USER} ${OPENFIRE_DATA_DIR}
# migrates data volume directory structure
if [ -d ${OPENFIRE_DATA_DIR}/openfire ]; then
echo "Migrating existing data..."
mv ${OPENFIRE_DATA_DIR}/openfire/etc ${OPENFIRE_DATA_DIR}/conf
mv ${OPENFIRE_DATA_DIR}/openfire/lib/plugins ${OPENFIRE_DATA_DIR}/plugins
mv ${OPENFIRE_DATA_DIR}/openfire/lib/embedded-db ${OPENFIRE_DATA_DIR}/embedded-db
rm -rf ${OPENFIRE_DATA_DIR}/openfire
fi
[ -d ${OPENFIRE_DATA_DIR}/etc ] && mv ${OPENFIRE_DATA_DIR}/etc ${OPENFIRE_DATA_DIR}/conf
[ -d ${OPENFIRE_DATA_DIR}/lib/plugins ] && mv ${OPENFIRE_DATA_DIR}/lib/plugins ${OPENFIRE_DATA_DIR}/plugins
[ -d ${OPENFIRE_DATA_DIR}/lib/embedded-db ] && mv ${OPENFIRE_DATA_DIR}/lib/embedded-db ${OPENFIRE_DATA_DIR}/embedded-db
rm -rf ${OPENFIRE_DATA_DIR}/lib
# remove admin plugin from plugins directory
if [ -d ${OPENFIRE_DATA_DIR}/plugins/admin ]; then
rm -rf ${OPENFIRE_DATA_DIR}/plugins/admin
fi
# initialize the data volume
if [ ! -d ${OPENFIRE_DATA_DIR}/conf ]; then
sudo -HEu ${OPENFIRE_USER} cp -a /etc/openfire ${OPENFIRE_DATA_DIR}/conf
fi
sudo -HEu ${OPENFIRE_USER} mkdir -p ${OPENFIRE_DATA_DIR}/{plugins,embedded-db}
sudo -HEu ${OPENFIRE_USER} rm -rf ${OPENFIRE_DATA_DIR}/plugins/admin
sudo -HEu ${OPENFIRE_USER} ln -sf /var/lib/openfire/plugins/admin ${OPENFIRE_DATA_DIR}/plugins/admin
# create version file
CURRENT_VERSION=
[[ -f ${OPENFIRE_DATA_DIR}/VERSION ]] && CURRENT_VERSION=$(cat ${OPENFIRE_DATA_DIR}/VERSION)
if [[ ${OPENFIRE_VERSION} != ${CURRENT_VERSION} ]]; then
echo -n "${OPENFIRE_VERSION}" | sudo -HEu ${OPENFIRE_USER} tee ${OPENFIRE_DATA_DIR}/VERSION >/dev/null
fi
}
initialize_log_dir() {
echo "Initializing ${OPENFIRE_LOG_DIR}..."
mkdir -p ${OPENFIRE_LOG_DIR}
chmod -R 0755 ${OPENFIRE_LOG_DIR}
chown -R ${OPENFIRE_USER}:${OPENFIRE_USER} ${OPENFIRE_LOG_DIR}
}
# allow arguments to be passed to openfire launch
if [[ ${1:0:1} = '-' ]]; then
EXTRA_ARGS="$@"
set --
fi
# default behaviour is to launch openfire
if [[ -z ${1} ]]; then
rewire_openfire
initialize_data_dir
initialize_log_dir
exec start-stop-daemon --start --chuid ${OPENFIRE_USER}:${OPENFIRE_USER} --exec /usr/bin/java -- \
-server \
-DopenfireHome=/usr/share/openfire \
-Dopenfire.lib.dir=/usr/share/openfire/lib \
-classpath /usr/share/openfire/lib/startup.jar \
-jar /usr/share/openfire/lib/startup.jar ${EXTRA_ARGS}
else
exec "$@"
fi
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 25, 10:30 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260005
Default Alt Text
(3 KB)
Attached To
Mode
rDO Docker image for Openfire
Attached
Detach File
Event Timeline
Log In to Comment