karlomikus / vue-salt-rim

Salt Rim is a Vue based web client used for connecting to Bar Assistant server instance.
https://barassistant.app
MIT License
92 stars 17 forks source link

Configuration for Meilisearch when API Key is required appears to be missing from documentation #170

Closed proffalken closed 4 months ago

proffalken commented 4 months ago

When setting up the Bar Assistant server there is a configuration flag for connecting to Meiliesearch using the MASTER_KEY as an API Token.

At the moment, I am seeing the following in the Meilesearch logs when trying to add a cocktail to a menu:

[2024-05-05T18:27:10Z DEBUG actix_web::middleware::logger] Error in response: ResponseError { code: 403, message: "The provided API key is invalid.", error_code: "invalid_api_key", error_type: "auth", error_link: "https://docs.meilisearch.com/errors#invalid_api_key" }

The browser returns a 403 error, unless logging in Meilesearch is set to something other than DEBUG, at which point it returns a basic 400 error (See https://github.com/karlomikus/bar-assistant/issues/278 ).

This code appears to suggest that I should be able to set the search_driver_api_key somehow, but I can't see anything in the code that will enable me to do that.

Is there an environment variable I'm missing here to get me authenticated to Meilesearch from the front-end?

karlomikus commented 4 months ago

You get the api key via Bar Assistant server endpoint GET /bars/{id}, you'll need to check your BarAssistant<>Meilisearch config.

You can also try to logout, then login back in, go to bars, and select a new bar.

proffalken commented 4 months ago

@karlomikus - thanks, that set me on the right path.

I'd had a few attempts at getting this running and it turned out that the issue was stale data in Bar Assistant API Server for the API Keys in Meilesearch.

I tore down the entire stack, deleted all the storage, and recreated everything and it now works perfectly well - thanks for such a great platform!