cfcaballero
Dabbler
- Joined
- Nov 26, 2017
- Messages
- 45
Hi all:
I finally got this working after a couple of false starts in the past. This post is NOT a step-by-step guide. It's a fresh recollection from my admittedly skimpy notes, but I think it hits all the major points. YMMV, etc.
I did this in a fresh install of the most recent NextCloud ("NC") plugin (v19.0.3) running on FreeNAS-11.3-U4.1 (hardware specs in my sig).
First, of course, go ahead and install the plugin and test that it's working at the IP address you specified. Depending on your networking setup and the related options you picked for the jail, remember that you may not be able to access the webserver from outside the jail until you edit the config file. As always, Google search is your friend, as is testing from inside the jail using curl.
The default credentials for the install will be located at /root/PLUGIN_INFO
Next, you need to install the NC apps for full-text search. Note that these don't actually perform the full text search, they just create the "scaffolding".
This article is dated in terms of version, and a different platform, but still gives all the major steps, you just replace them with the relevant steps for a FreeNAS/FreeBSD jail.
https://fribeiro.org/post/2018-02-07-nextcloud-full-text-elasticsearch/
This link was also useful, but you can skip logstash.
http://blog.dushin.net/2019/08/installing-elk-on-freenas-jail/
use "pkg install" to search and find elasticsearch (I recommend you install Kibana also to more easily manage Elastic). I wound up installing the following:
Now we run into the first major deviation from the links I posted and other instructions I found while searching. The command to run the ingestion plugin doesn't work because the local java JDK/JRE cannot be found. So, I used the locate command to find where my java runtime bin folder was, then used the following command:
Once that is settled, your command to add the ingestion plugin becomes:
Now, the next step is to add the files you want to be indexed as external files in NC. There is one CRITICAL step here that if you omit, will result in you waiting for an index to be generated but getting no search results, and it took me some serious Google foo for me to find the answer.
First, I recommend that you use the jail mount points mechanism to make the files visible to the jail. You will have to learn about file permissions and whatnot, but you should be learning that, IMO, if you are using jails/plugins anyway. Also, I think it's both safer and more performant than trying to have the jail mount the files using networking, as you don't have enter credentials into NC and don't incur network stack overhead.
The CRITICAL step is to enter the relevant (to your NC setup) user names and groups in the "Available for" field, even though the help text in the empty field states that leaving it blank makes the external files available to all users. That in itself is true, but it has the side effect of having the NC Full Text Search apps ignore the index results because the user and group fields are blank. This "Available for" field is present when you add the external storage under "Administration" Settings, not in the "Personal" settings. If you wish to make the mount point available to a single user only under Personal Settings, I imagine that will likely work given my experience, but I have not tested it.
Now, the final step is to start indexing the external files. Don't make the same mistake I first did and target your entire share at first! Find a subfolder of your mount point that contains a reasonable number of index-able files, and try and include some PDF and other content-heavy files to make sure the ingestion plugin is properly indexing the contents.
The commend to start indexing (again, which I found using locate):
When you index your full set of file shares, I recommend you run this command in a detachable shell using screen or tmux.
That's all folks. I will try and answer any questions, but am busy, so don't expect much, and make sure and use Google searches first. The answers are usually out there if you are persistent (and make sure you look for results from using the same apps on other platforms). Good luck!
I finally got this working after a couple of false starts in the past. This post is NOT a step-by-step guide. It's a fresh recollection from my admittedly skimpy notes, but I think it hits all the major points. YMMV, etc.
I did this in a fresh install of the most recent NextCloud ("NC") plugin (v19.0.3) running on FreeNAS-11.3-U4.1 (hardware specs in my sig).
First, of course, go ahead and install the plugin and test that it's working at the IP address you specified. Depending on your networking setup and the related options you picked for the jail, remember that you may not be able to access the webserver from outside the jail until you edit the config file. As always, Google search is your friend, as is testing from inside the jail using curl.
The default credentials for the install will be located at /root/PLUGIN_INFO
Next, you need to install the NC apps for full-text search. Note that these don't actually perform the full text search, they just create the "scaffolding".
This article is dated in terms of version, and a different platform, but still gives all the major steps, you just replace them with the relevant steps for a FreeNAS/FreeBSD jail.
https://fribeiro.org/post/2018-02-07-nextcloud-full-text-elasticsearch/
This link was also useful, but you can skip logstash.
http://blog.dushin.net/2019/08/installing-elk-on-freenas-jail/
use "pkg install" to search and find elasticsearch (I recommend you install Kibana also to more easily manage Elastic). I wound up installing the following:
- elasticsearch7-7.9.1
- kibana7-7.9.1
- openjdk8-8.265.01.1
Now we run into the first major deviation from the links I posted and other instructions I found while searching. The command to run the ingestion plugin doesn't work because the local java JDK/JRE cannot be found. So, I used the locate command to find where my java runtime bin folder was, then used the following command:
export JAVA_HOME=/usr/local/openjdk8
Once that is settled, your command to add the ingestion plugin becomes:
/usr/local/lib/elasticsearch/bin/elasticsearch-plugin install ingest-attachment
Now, the next step is to add the files you want to be indexed as external files in NC. There is one CRITICAL step here that if you omit, will result in you waiting for an index to be generated but getting no search results, and it took me some serious Google foo for me to find the answer.
First, I recommend that you use the jail mount points mechanism to make the files visible to the jail. You will have to learn about file permissions and whatnot, but you should be learning that, IMO, if you are using jails/plugins anyway. Also, I think it's both safer and more performant than trying to have the jail mount the files using networking, as you don't have enter credentials into NC and don't incur network stack overhead.
The CRITICAL step is to enter the relevant (to your NC setup) user names and groups in the "Available for" field, even though the help text in the empty field states that leaving it blank makes the external files available to all users. That in itself is true, but it has the side effect of having the NC Full Text Search apps ignore the index results because the user and group fields are blank. This "Available for" field is present when you add the external storage under "Administration" Settings, not in the "Personal" settings. If you wish to make the mount point available to a single user only under Personal Settings, I imagine that will likely work given my experience, but I have not tested it.
Now, the final step is to start indexing the external files. Don't make the same mistake I first did and target your entire share at first! Find a subfolder of your mount point that contains a reasonable number of index-able files, and try and include some PDF and other content-heavy files to make sure the ingestion plugin is properly indexing the contents.
The commend to start indexing (again, which I found using locate):
sudo -u www php /usr/local/www/nextcloud/occ fulltextsearch:index
When you index your full set of file shares, I recommend you run this command in a detachable shell using screen or tmux.
That's all folks. I will try and answer any questions, but am busy, so don't expect much, and make sure and use Google searches first. The answers are usually out there if you are persistent (and make sure you look for results from using the same apps on other platforms). Good luck!
Last edited: