mirror of
https://github.com/SaraSmiseth/prosody.git
synced 2025-01-18 05:00:36 +00:00
Download prosody-modules only once.
This commit is contained in:
parent
2500028412
commit
9e24592826
5 changed files with 19 additions and 72 deletions
11
Dockerfile
11
Dockerfile
|
@ -65,8 +65,11 @@ COPY prosody.cfg.lua /usr/local/etc/prosody/prosody.cfg.lua
|
||||||
COPY docker-entrypoint.sh /entrypoint.sh
|
COPY docker-entrypoint.sh /entrypoint.sh
|
||||||
COPY conf.d/*.cfg.lua /usr/local/etc/prosody/conf.d/
|
COPY conf.d/*.cfg.lua /usr/local/etc/prosody/conf.d/
|
||||||
|
|
||||||
COPY docker-prosody-module-* /usr/local/bin/
|
COPY *.bash /usr/local/bin/
|
||||||
RUN docker-prosody-module-install \
|
|
||||||
|
RUN download-prosody-modules.bash
|
||||||
|
|
||||||
|
RUN docker-prosody-module-install.bash \
|
||||||
bookmarks `# XEP-0411: Bookmarks Conversion` \
|
bookmarks `# XEP-0411: Bookmarks Conversion` \
|
||||||
carbons `# message carbons (XEP-0280)` \
|
carbons `# message carbons (XEP-0280)` \
|
||||||
cloud_notify `# XEP-0357: Push Notifications` \
|
cloud_notify `# XEP-0357: Push Notifications` \
|
||||||
|
@ -76,10 +79,12 @@ RUN docker-prosody-module-install \
|
||||||
smacks `# stream management (XEP-0198)` \
|
smacks `# stream management (XEP-0198)` \
|
||||||
throttle_presence `# presence throttling in CSI`
|
throttle_presence `# presence throttling in CSI`
|
||||||
|
|
||||||
RUN docker-prosody-module-copy \
|
RUN docker-prosody-module-copy.bash \
|
||||||
http_upload `# file sharing (XEP-0363)` \
|
http_upload `# file sharing (XEP-0363)` \
|
||||||
vcard_muc `# XEP-0153: vCard-Based Avatar (MUC)`
|
vcard_muc `# XEP-0153: vCard-Based Avatar (MUC)`
|
||||||
|
|
||||||
|
RUN rm -rf "/usr/src/prosody-modules"
|
||||||
|
|
||||||
USER prosody
|
USER prosody
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
|
@ -1,19 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
source="/usr/src/prosody-modules"
|
source="/usr/src/prosody-modules"
|
||||||
target="/usr/local/lib/prosody/custom-modules"
|
target="/usr/local/lib/prosody/custom-modules"
|
||||||
|
|
||||||
srcExists=
|
|
||||||
if [ -d ${source} ]; then
|
|
||||||
srcExists=1
|
|
||||||
fi
|
|
||||||
docker-prosody-module-source pullTo ${source}
|
|
||||||
|
|
||||||
if [ -z "$srcExists" ]; then
|
|
||||||
touch ${source}/.docker-delete-me
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd ${source}
|
cd ${source}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
|
@ -49,7 +39,3 @@ for ext in $exts; do
|
||||||
echo " - copying to ${target}"
|
echo " - copying to ${target}"
|
||||||
cp -r "${source}/mod_${ext}" "${target}/"
|
cp -r "${source}/mod_${ext}" "${target}/"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -e ${source}/.docker-delete-me ]; then
|
|
||||||
docker-prosody-module-source deleteFrom ${source}
|
|
||||||
fi
|
|
|
@ -1,20 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
source="/usr/src/prosody-modules"
|
source="/usr/src/prosody-modules"
|
||||||
target="/usr/local/lib/prosody/custom-modules"
|
target="/usr/local/lib/prosody/custom-modules"
|
||||||
config="/usr/local/etc/prosody/conf.d/01-modules.cfg.lua"
|
config="/usr/local/etc/prosody/conf.d/01-modules.cfg.lua"
|
||||||
|
|
||||||
srcExists=
|
|
||||||
if [ -d ${source} ]; then
|
|
||||||
srcExists=1
|
|
||||||
fi
|
|
||||||
docker-prosody-module-source pullTo ${source}
|
|
||||||
|
|
||||||
if [ -z "$srcExists" ]; then
|
|
||||||
touch ${source}/.docker-delete-me
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd ${source}
|
cd ${source}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
|
@ -54,7 +44,3 @@ for ext in $exts; do
|
||||||
new_config=$(cat "${config}" | module="${ext}" perl -0pe 's/(modules_enabled[ ]*=[ ]*{[^}]*)};/$1\n\t"$ENV{module}";\n};/')
|
new_config=$(cat "${config}" | module="${ext}" perl -0pe 's/(modules_enabled[ ]*=[ ]*{[^}]*)};/$1\n\t"$ENV{module}";\n};/')
|
||||||
echo "${new_config}" > "${config}"
|
echo "${new_config}" > "${config}"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -e ${source}/.docker-delete-me ]; then
|
|
||||||
docker-prosody-module-source deleteFrom ${source}
|
|
||||||
fi
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
dir=$2
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
echo "usage: $0 COMMAND DIR"
|
|
||||||
echo
|
|
||||||
echo "Manage prosody-modules source lifecycle."
|
|
||||||
echo
|
|
||||||
echo "Commands:"
|
|
||||||
echo " pullTo extract prosody-module sources into directory ${dir} if not already done."
|
|
||||||
echo " deleteFrom delete extracted prosody-module sources located into ${dir} if not already done."
|
|
||||||
echo
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
pullTo)
|
|
||||||
mkdir -p "${dir}"
|
|
||||||
|
|
||||||
if [ ! -f "${dir}/.docker-pulled" ]; then
|
|
||||||
wget https://hg.prosody.im/prosody-modules/archive/tip.tar.gz
|
|
||||||
tar -xzf tip.tar.gz -C "${dir}" --strip-components=1
|
|
||||||
rm tip.tar.gz
|
|
||||||
touch "${dir}/.docker-pulled"
|
|
||||||
fi
|
|
||||||
|
|
||||||
;;
|
|
||||||
|
|
||||||
deleteFrom)
|
|
||||||
rm -rf "${dir}"
|
|
||||||
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
usage
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
9
download-prosody-modules.bash
Executable file
9
download-prosody-modules.bash
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
dir="/usr/src/prosody-modules"
|
||||||
|
|
||||||
|
mkdir -p "${dir}"
|
||||||
|
wget https://hg.prosody.im/prosody-modules/archive/tip.tar.gz
|
||||||
|
tar -xzf tip.tar.gz -C "${dir}" --strip-components=1
|
||||||
|
rm tip.tar.gz
|
Loading…
Reference in a new issue