mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
Merge pull request #1044 from nextcloud/enh/1036/fulltextsearch
add fulltextsearch as option
This commit is contained in:
commit
40efd3092f
18 changed files with 157 additions and 5 deletions
4
Containers/fulltextsearch/Dockerfile
Normal file
4
Containers/fulltextsearch/Dockerfile
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# Probably from here https://github.com/elastic/elasticsearch/blob/main/distribution/docker/src/docker/Dockerfile
|
||||
FROM elasticsearch:7.17.5
|
||||
|
||||
RUN elasticsearch /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-attachment
|
||||
|
|
@ -238,7 +238,8 @@ RUN set -ex; \
|
|||
chmod +r /upgrade.exclude && \
|
||||
chmod +x /cron.sh && \
|
||||
chmod +x /notify.sh && \
|
||||
chmod +x /activate-collabora.sh
|
||||
chmod +x /activate-collabora.sh && \
|
||||
chmod +x /activate-fulltextsearch.sh
|
||||
|
||||
RUN set -ex; \
|
||||
mkdir /mnt/ncdata; \
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
if [ "$COLLABORA_ENABLED" != yes ]; then
|
||||
# Basically sleep for forever if collabora is not enabled
|
||||
sleep 365d
|
||||
sleep inf
|
||||
fi
|
||||
while ! nc -z "$NC_DOMAIN" 443; do
|
||||
sleep 5
|
||||
|
|
@ -10,4 +10,4 @@ done
|
|||
sleep 10
|
||||
echo "Activating collabora config..."
|
||||
php /var/www/html/occ richdocuments:activate-config
|
||||
sleep 365d
|
||||
sleep inf
|
||||
|
|
|
|||
9
Containers/nextcloud/activate-fulltextsearch.sh
Normal file
9
Containers/nextcloud/activate-fulltextsearch.sh
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ "$FULLTEXTSEARCH_ENABLED" != yes ]; then
|
||||
# Basically sleep for forever if fulltextsearch is not enabled
|
||||
sleep inf
|
||||
fi
|
||||
echo "Activating fulltextsearch..."
|
||||
php /var/www/html/occ fulltextsearch:live -q
|
||||
sleep inf
|
||||
|
|
@ -434,5 +434,47 @@ if version_greater "$installed_version" "24.0.0.0"; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Fulltextsearch
|
||||
if [ "$FULLTEXTSEARCH_ENABLED" = 'yes' ]; then
|
||||
while ! nc -z "$FULLTEXTSEARCH_HOST" 9200; do
|
||||
echo "waiting for Fulltextsearch to become available..."
|
||||
sleep 5
|
||||
done
|
||||
if ! [ -d "/var/www/html/custom_apps/fulltextsearch" ]; then
|
||||
php /var/www/html/occ app:install fulltextsearch
|
||||
elif [ "$(php /var/www/html/occ config:app:get fulltextsearch enabled)" = "no" ]; then
|
||||
php /var/www/html/occ app:enable fulltextsearch
|
||||
else
|
||||
php /var/www/html/occ app:update fulltextsearch
|
||||
fi
|
||||
if ! [ -d "/var/www/html/custom_apps/fulltextsearch_elasticsearch" ]; then
|
||||
php /var/www/html/occ app:install fulltextsearch_elasticsearch
|
||||
elif [ "$(php /var/www/html/occ config:app:get fulltextsearch_elasticsearch enabled)" = "no" ]; then
|
||||
php /var/www/html/occ app:enable fulltextsearch_elasticsearch
|
||||
else
|
||||
php /var/www/html/occ app:update fulltextsearch_elasticsearch
|
||||
fi
|
||||
if ! [ -d "/var/www/html/custom_apps/files_fulltextsearch" ]; then
|
||||
php /var/www/html/occ app:install files_fulltextsearch
|
||||
elif [ "$(php /var/www/html/occ config:app:get files_fulltextsearch enabled)" = "no" ]; then
|
||||
php /var/www/html/occ app:enable files_fulltextsearch
|
||||
else
|
||||
php /var/www/html/occ app:update files_fulltextsearch
|
||||
fi
|
||||
php /var/www/html/occ fulltextsearch:configure '{"search_platform":"OCA\\FullTextSearch_Elasticsearch\\Platform\\ElasticSearchPlatform"}'
|
||||
php /var/www/html/occ fulltextsearch_elasticsearch:configure "{\"elastic_host\":\"http://$FULLTEXTSEARCH_HOST:9200\"}"
|
||||
php /var/www/html/occ files_fulltextsearch:configure "{\"files_pdf\":\"1\",\"files_office\":\"1\"}"
|
||||
else
|
||||
if [ -d "/var/www/html/custom_apps/fulltextsearch" ]; then
|
||||
php /var/www/html/occ app:remove fulltextsearch
|
||||
fi
|
||||
if [ -d "/var/www/html/custom_apps/fulltextsearch_elasticsearch" ]; then
|
||||
php /var/www/html/occ app:remove fulltextsearch_elasticsearch
|
||||
fi
|
||||
if [ -d "/var/www/html/custom_apps/files_fulltextsearch" ]; then
|
||||
php /var/www/html/occ app:remove files_fulltextsearch
|
||||
fi
|
||||
fi
|
||||
|
||||
# Remove the update skip file always
|
||||
rm -f /mnt/ncdata/skip.update
|
||||
|
|
|
|||
|
|
@ -35,3 +35,10 @@ stdout_logfile_maxbytes=0
|
|||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=/activate-collabora.sh
|
||||
|
||||
[program:activate-fulltextsearch]
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=/activate-fulltextsearch.sh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue