riccox/meilisearch-ui

Ability to set default instance

omid opened this issue · 6 comments

omid commented

I would like to integrate meilisearch-ui within the dev env, but I need to setup connection everytime I reset the docker containers.
It would be better if we could pass meilisearch instance configurations via env vars.

I would like to also add my opinion on this, as I have been pondering upon this for a while. We would like to have a self-contained package (Helm Chart/Docker Compose) to spin up a working setup for our clients. The Meilisearch UI is bundled in this package, but currently right now we are not yet able to make the UI integrate automatically to the stack.

If I understand the code correctly, we have to do some major refactoring to have this type of feature. Two approaches of the top of my mind:

  • We need to move all Meilisearch API call to the Next.js backend.
  • We can have the Next.js provision a short-lived Admin permission key from the backend and pass it to the frontend. This way we don't have to do major refactoring, but may polute the key space of Meilisearch.

Another addition that should be implemented for this specific feature set is authentication. Maybe a simple BasicAuth should be enough.

Happy to hear your thoughts on this @riccox, I would like to also contribute to the project for this particular feature set.

riccox commented

@antran22 Your idea is similar with some of my current ideas basicly.
For this feature, my current ideas are below:

First approach, need huge refactoring:

  • Use Next.js backend to process api request for preventing must CORS settings before using, this step need lots of works to refactor.
  • Bring additional database to store instance config data.
  • Add basic auth to protect app.

Another way (easy to realize):

  • Use a feature flag at startup to switch common mode & single-instance mode, and refactoring app start way for this.
  • Common mode mean the app we used now, single-instance mode can only use one instance config which is provided at startup, and auto enter indexes page at this mode start.
  • Still need add CORS settings into your instance server manually when adding each meilisearch instances.

On a related note, I'd like the ability to pass the server host via a query string, and then be prompted for the password only if that instance isn't already saved in the browser.

That is, go to https://meili-manager.vercel.app/#/?host=http://127.0.0.1:7700

I'm guessing many of us go there the first time we try this.

@omid @tacman @antran22

The new version v0.7.1 with singleton feature has been published. Hope you can try it.

Thanks! Can you add the version to the page somewhere, it's helpful for making sure I'm running the right version.

image

@tacman The screenshot you posted is not Meilisearch-UI app. 😅

You will find the app version & its hash tag at the bottom of the page if you are using Meilisearch-UI.