mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
add fulltextsearch as option
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
2ba61b8971
commit
8010030a5d
17 changed files with 155 additions and 3 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
|
||||
|
|
@ -237,7 +237,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; \
|
||||
|
|
|
|||
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 365d
|
||||
fi
|
||||
echo "Activating fulltextsearch..."
|
||||
php /var/www/html/occ fulltextsearch:live -q
|
||||
sleep 365d
|
||||
|
|
@ -423,5 +423,47 @@ if version_greater "24.0.0.0" "$installed_version"; 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