You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
2.0 KiB
81 lines
2.0 KiB
#!/bin/bash
|
|
|
|
KAZ_ROOT=$(cd $(dirname $0)/../..; pwd)
|
|
. "${KAZ_ROOT}/bin/.commonFunctions.sh"
|
|
setKazVars
|
|
. "${DOCKERS_ENV}"
|
|
. "${KAZ_KEY_DIR}/SetAllPass.sh"
|
|
|
|
cd $(dirname $0)
|
|
PWD=$(pwd)
|
|
ORGA_DIR=$(basename ${PWD})
|
|
|
|
if [[ "${ORGA_DIR}" != *"-orga" ]]
|
|
then
|
|
printKazError "it's not an orga dir"
|
|
exit
|
|
fi
|
|
ORGA=${ORGA_DIR%-orga}
|
|
if [[ -z "${ORGA}" ]]
|
|
then
|
|
printKazError "it's not an orga dir"
|
|
exit
|
|
fi
|
|
|
|
TPL_DIR="${DOCK_VOL}/orga_${ORGA}-wikiLibtpl/_data"
|
|
PLG_DIR="${DOCK_VOL}/orga_${ORGA}-wikiPlugins/_data"
|
|
CONF_DIR="${DOCK_VOL}/orga_${ORGA}-wikiConf/_data"
|
|
DNLD_DIR="${KAZ_DNLD_DIR}/dokuwiki"
|
|
DockerServName="${ORGA}-${dokuwikiServName}"
|
|
WIKI_URL="${httpProto}://${ORGA}-${dokuwikiHost}.${domain}"
|
|
|
|
WIKI_TITLE=Kaz
|
|
WIKI_ROOT=Kaz
|
|
WIKI_EMAIL=wiki@kaz.local
|
|
WIKI_PASS=azerty
|
|
|
|
|
|
printKazMsg "init wiki ${ORGA}"
|
|
|
|
if ! [[ "$(docker ps -f name=${DockerServName} | grep -w ${DockerServName})" ]]; then
|
|
printKazError "Dokuwiki not running... abort"
|
|
exit
|
|
fi
|
|
|
|
if [ ! -f "${CONF_DIR}/local.php" ] ; then
|
|
printKazMsg "\n *** Premier lancement de Dokuwiki"
|
|
|
|
waitUrl "${WIKI_URL}"
|
|
|
|
curl -X POST \
|
|
-d "l=fr" \
|
|
-d "d[title]=${WIKI_TITLE}" \
|
|
-d "d[acl]=true" \
|
|
-d "d[superuser]=${WIKI_ROOT}" \
|
|
-d "d[fullname]=Admin"\
|
|
-d "d[email]=${WIKI_EMAIL}" \
|
|
-d "d[password]=${WIKI_PASS}" \
|
|
-d "d[confirm]=${WIKI_PASS}" \
|
|
-d "d[policy]=1" \
|
|
-d "d[allowreg]=false" \
|
|
-d "d[license]=lic_0" \
|
|
-d "d[pop]=false" \
|
|
"${WIKI_URL}/install.php"
|
|
|
|
|
|
unzipInDir "${DNLD_DIR}/docnavwiki.zip" "${TPL_DIR}/"
|
|
chown -R www-data: "${TPL_DIR}/"
|
|
|
|
for plugin in captcha ckgedit smtp todo wrap wrapadd; do
|
|
unzipInDir "${DNLD_DIR}/${plugin}.zip" "${PLG_DIR}"
|
|
done
|
|
chown -R www-data: "${PLG_DIR}/"
|
|
|
|
cd wiki-conf
|
|
# XXX initialiser admin:<pass>:admin:<mel>:admin,user
|
|
rsync -auHAX local.php users.auth.php acl.auth.php "${CONF_DIR}/"
|
|
chown -R www-data: "${CONF_DIR}/"
|
|
|
|
sed -i -e "s|\(.*conf\['title'\].*=.*'\).*';|\1${ORGA}';|g" "${CONF_DIR}/local.php"
|
|
sed -i -e "s|\(.*conf\['lang'\].*=.*'\)en';|\1fr';|g" "${CONF_DIR}/dokuwiki.php"
|
|
fi
|
|
|