commit | author | age
|
0cf5a6
|
1 |
#!/bin/bash |
JK |
2 |
|
|
3 |
# Solr configuration |
|
4 |
cd "${SOLR_PREFIX}/solr/server" |
|
5 |
if [ ! -f solr/solr.xml ]; then |
|
6 |
cp -Rf solr.bak/* solr/ |
|
7 |
chown -R solr:solr solr |
|
8 |
chown -R solr:solr "${SOLR_PREFIX}/solr-data" |
|
9 |
fi |
|
10 |
|
|
11 |
cd "${CASEBOX_PREFIX}/casebox" |
|
12 |
|
|
13 |
# Casebox file ownership |
|
14 |
if [ "`stat -c %U data`" != "${APACHE_USER}" ]; then |
|
15 |
chown -Rf "${APACHE_USER}:${APACHE_GROUP}" data logs |
|
16 |
fi |
|
17 |
|
|
18 |
# Apache configuration |
|
19 |
if [ ! -f ${APACHE_VHOST_CONFIG} ]; then |
|
20 |
envsubst < docker/apache.conf > "${APACHE_VHOST_CONFIG}" |
|
21 |
fi |
|
22 |
|
|
23 |
# Casebox configuration template |
|
24 |
if [ ! -f config_install.ini ]; then |
|
25 |
envsubst < docker/casebox.ini > config_install.ini |
|
26 |
fi |
|
27 |
|
|
28 |
# Solr schemas (not mentioned in installation guide) |
|
29 |
if [ ! -L "${SOLR_PREFIX}/solr/server/solr/configsets/cb_default" ]; then |
|
30 |
ln -s "${CASEBOX_PREFIX}/casebox/sys/solr_configsets/default_config" \ |
|
31 |
"${SOLR_PREFIX}/solr/server/solr/configsets/cb_default" |
|
32 |
fi |
|
33 |
if [ ! -L "${SOLR_PREFIX}/solr/server/solr/configsets/cb_log" ]; then |
|
34 |
ln -s "${CASEBOX_PREFIX}/casebox/sys/solr_configsets/log_config" \ |
|
35 |
"${SOLR_PREFIX}/solr/server/solr/configsets/cb_log" |
|
36 |
fi |
|
37 |
|
|
38 |
# Solr |
|
39 |
sudo -u solr "${SOLR_PREFIX}/solr/bin/solr" start |
|
40 |
|
|
41 |
# Casebox configuration |
|
42 |
if [ ! -f httpsdocs/config.ini ]; then |
|
43 |
php bin/install.php -f config_install.ini |
|
44 |
|
|
45 |
# Fix file uploads (not mentioned in installation guide) |
|
46 |
mkdir -p "data/tmp/${CASEBOX_CORE}/incomming" |
|
47 |
chown -Rf "${APACHE_USER}:${APACHE_GROUP}" data |
|
48 |
fi |
|
49 |
|
|
50 |
# Cron daemon |
|
51 |
cron |
|
52 |
|
|
53 |
# Cron jobs |
|
54 |
if [ ! -f casebox_crontab ]; then |
|
55 |
echo "*/2 * * * * php -f '${CASEBOX_PREFIX}/casebox/sys/crons/run_cron.php' -- -n send_notifications -c all" > casebox_crontab |
|
56 |
echo "*/2 * * * * php -f '${CASEBOX_PREFIX}/casebox/sys/crons/run_cron.php' -- -n extract_files_content -c all" >> casebox_crontab |
|
57 |
echo "*/5 * * * * php -f '${CASEBOX_PREFIX}/casebox/sys/crons/run_cron.php' -- -n check_mail -c all" >> casebox_crontab |
|
58 |
echo "*/2 * * * * php -f '${CASEBOX_PREFIX}/casebox/sys/crons/cron_receive_comments.php'" >> casebox_crontab |
|
59 |
crontab -u ${APACHE_USER} casebox_crontab |
|
60 |
fi |
|
61 |
|
|
62 |
# LibreOffice (file conversion) |
|
63 |
sudo -u "${APACHE_USER}" unoconv --listener & |
|
64 |
|
|
65 |
# Apache |
|
66 |
APACHE_ARGUMENTS=-DFOREGROUND apache2ctl start |