forked from coop-cloud/nextcloud
feat: add elasticsearch
This commit is contained in:
parent
c4ea5e053e
commit
d03895c872
|
@ -62,3 +62,6 @@ DEFAULT_QUOTA="10 GB"
|
|||
# AUTHENTIK_DOMAIN=authentik.example.com
|
||||
# SECRET_AUTHENTIK_SECRET_VERSION=v1
|
||||
# SECRET_AUTHENTIK_ID_VERSION=v1
|
||||
|
||||
#COMPOSE_FILE="$COMPOSE_FILE:compose.elasticsearch.yml"
|
||||
#SECRET_ELASTICSEARCH_PASSWORD_VERSION=v1
|
||||
|
|
44
README.md
44
README.md
|
@ -244,3 +244,47 @@ docker exec -u www-data $(docker ps -f name=foo_com_app -q) ./occ preview:pre-ge
|
|||
```
|
||||
|
||||
This app will improve performance of image browsing at the cost of storage space.
|
||||
|
||||
## Fulltextsearch with elasticsearch
|
||||
|
||||
1. For this you need to install these apps:
|
||||
- [fulltextsearch](https://github.com/nextcloud/fulltextsearch)
|
||||
- [fulltextsearch_elasticsearch](https://github.com/nextcloud/fulltextsearch_elasticsearch)
|
||||
- [files_fulltextsearch](https://github.com/nextcloud/files_fulltextsearch)
|
||||
|
||||
2. To enable the elasticsearch index uncomment the following lines in your env file:
|
||||
```
|
||||
#COMPOSE_FILE="$COMPOSE_FILE:compose.elasticsearch.yml"
|
||||
#SECRET_ELASTICSEARCH_PASSWORD_VERSION=v1
|
||||
```
|
||||
|
||||
3. Next you need to generate the secret for elasticsearch:
|
||||
```bash
|
||||
abra app secret generate <domain> elasticsearch_password v1
|
||||
```
|
||||
|
||||
You need to write down the password, since you need this later!
|
||||
|
||||
4. Now you can deploy your app:
|
||||
```bash
|
||||
abra app deploy <domain>
|
||||
```
|
||||
|
||||
5. After the deployment finished go to the settings page for fulltext and configure it:
|
||||
|
||||
- Set `Search Platform` to `Elasticsearch`
|
||||
- Set `Address of the Servlet` to `http://elastic:<password>@elasticsearch:9200/`
|
||||
- Set `Index` to a random index name
|
||||
- Select what should be index
|
||||
|
||||
6. Now test if nextcloud can connect to elasticsearch:
|
||||
```
|
||||
abra app cmd <domain> app run_occ '"fulltextsearch:test"'
|
||||
```
|
||||
|
||||
6. If the connection was successfull populate the index with data:
|
||||
```
|
||||
abra app cmd <domain> app run_occ '"fulltextsearch:index"'
|
||||
```
|
||||
|
||||
7. Check if the search works correctly by searching for a word which occurs in a file on your nextcloud
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
version: "3.8"
|
||||
|
||||
services:
|
||||
elasticsearch:
|
||||
image: "docker.elastic.co/elasticsearch/elasticsearch:8.11.3"
|
||||
environment:
|
||||
- cluster.name=docker-cluster
|
||||
- bootstrap.memory_lock=true
|
||||
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
|
||||
- discovery.type=single-node
|
||||
# Disable authentication and ssl completely
|
||||
# - xpack.security.enabled=false
|
||||
# Use this to enable Basic Authentication:
|
||||
- xpack.security.enabled=true
|
||||
- xpack.security.http.ssl.enabled=false
|
||||
- ELASTIC_PASSWORD_FILE=/var/run/secrets/elasticsearch_password
|
||||
ulimits:
|
||||
memlock:
|
||||
soft: -1
|
||||
hard: -1
|
||||
volumes:
|
||||
- elasticsearch:/usr/share/elasticsearch/data
|
||||
networks:
|
||||
- internal
|
||||
secrets:
|
||||
- source: elasticsearch_password
|
||||
uid: "1000"
|
||||
gid: "1000"
|
||||
mode: 0600
|
||||
|
||||
secrets:
|
||||
elasticsearch_password:
|
||||
external: true
|
||||
name: ${STACK_NAME}_elasticsearch_password_${SECRET_ELASTICSEARCH_PASSWORD_VERSION}
|
||||
|
||||
volumes:
|
||||
elasticsearch:
|
Loading…
Reference in New Issue