Skip to content

Improve Elasticsearch documentation with ES_PRESET and security settings #1279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

renchap
Copy link
Member

@renchap renchap commented Aug 18, 2023

This adds the documentation for setting up ES authentication, as well as the new ES_PRESET settings from mastodon/mastodon#26483

@vercel
Copy link

vercel bot commented Aug 18, 2023

@renchap is attempting to deploy a commit to the Mastodon Team on Vercel.

A member of the Team first needs to authorize it.

@renchap
Copy link
Member Author

renchap commented Aug 18, 2023

Things that could be improved:

@DalekDave
Copy link

Renaud, thank you for writing this documentation. I had already started preparing to undertake the task of getting Elasticsearch up and running for Burnout Cafe. I had assembled some useful-looking how-to's at:

I also installed Elasticsearch 7.17.12 from the ES PPA.
I am going to read and follow your instructions and provide feedback and suggestions where appropriate.

When I have Burnout Café up and running to perfection with full-text search, I would very much like to contribute work on documentation to the Mastodon project, and will contact you about that. You're also welcome to start that conversation, if you like, by mailing me at admin@burnout.cafe.

I'll start the Elasticsearch setup right now and respond back to this ticket.

@DalekDave
Copy link

DalekDave commented Aug 19, 2023

Renaud, I did manage to get my Elasticsearch working on my instance following your instructions. Thank you for your time spent on that.

Couple of little typo errors:

  • "build-in" should be "built-in"
  • "roles" : [ "mastodon_full_access", ] <-- there is an erroneous comma in the single-value array

I'm not sure what the documentation is going to look like after the integration of your new content, but I would have a few comments:

  1. Was the Linux mastodon user supposed to execute a command from the command line? I didn't, and I have been able to successfully search for text snippets from posts on my burnout.cafe Mastodon instance.

In the existing documentation on Github it says I should execute:

RAILS_ENV=production bundle exec rails chewy:deploy

However, I still haven't done that and full-text searching seems to work anyway.

In the existing documentation at docs.joinmastodon.org, it says I should execute:

RAILS_ENV=production bin/tootctl search deploy

But I did not do that after today's seemingly-successful integration, and (as I said above) full-text searching seems to be working anyway.

Note that the two commands stated in the Github documentation and the docs.joinmastodon.org documentation are different. Which should I execute? Both? Or are neither necessary?
Could we clarify that?

  1. In my humble opinion, it would be better not to refer people to go follow the ES documentation on elastic.co. It would be better to include all the necessary instructions in the Mastodon documentation, with a link to the ES documentation to look at if other info is desired.
    The ES 7 version is not the latest, and there are unlikely to be any modifications to the installation and configuration steps. The ES documentation at elastic.co also sends you to install Kabana and I actually went and created a Nginx proxy to access the Kabana Web interface, thinking I would be needing that. But I didn't, since we created the role and the user from the Linux command line as root.

For the two curl commands that do that, it was not stated that they should be executed from the Linux command line as root.
Could we clarify that?

Please feel free to contact me at admin@burnout.cafe if I can help you guys out with documentation writing. I have long experience in documentation copy-writing, as well as experience in end user technical support.

@ClearlyClaire
Copy link
Contributor

In the existing documentation on Github it says I should execute:

Can you link to the documentation that instructs to do that?

Copy link
Contributor

@ClearlyClaire ClearlyClaire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1279 (comment) points out a few issues

I'm a bit surprised to see direct calls to Elasticsearch's API, doesn't Elasticsearch provide CLI utilities for that? Otherwise this looks ok. Note that I'm not really knowledgeable in Elasticsearch though.

@DalekDave
Copy link

In the existing documentation on Github it says I should execute:
RAILS_ENV=production bundle exec rails chewy:deploy

Can you link to the documentation that instructs to do that?

It's under 'Run chewy:deploy to create & populate index' at:

https://github.com/martindale/mastodon-docs/blob/master/Running-Mastodon/Elasticsearch-guide.md

In the documentation at docs.joinmastodon.org, it says I should execute:

RAILS_ENV=production bin/tootctl search deploy

@renchap
Copy link
Member Author

renchap commented Sep 5, 2023

I'm a bit surprised to see direct calls to Elasticsearch's API, doesn't Elasticsearch provide CLI utilities for that?

Maybe in Kibana, but otherwise you are supposed to rely on curl

In the existing documentation on Github it says I should execute:
RAILS_ENV=production bundle exec rails chewy:deploy

Can you link to the documentation that instructs to do that?

It's under 'Run chewy:deploy to create & populate index' at:

https://github.com/martindale/mastodon-docs/blob/master/Running-Mastodon/Elasticsearch-guide.md

This repository is an old fork of the official documentation, and is very out of date. Please use docs.joinmastodon.org for our latest documentation.

For the two curl commands that do that, it was not stated that they should be executed from the Linux command line as root.

They do not need to be executed as root, they can be from any user (and you should try to not execute anything as root when it is not needed, to reduce the risk for errors.

@vercel
Copy link

vercel bot commented Sep 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 5, 2023 9:14pm

@ClearlyClaire ClearlyClaire merged commit dd54f29 into mastodon:master Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants