Have the Meilisearch API Key stored in the main site's database #2

Open
opened 1 year ago by craig.oates · 0 comments
Owner

At the moment, the API key is hard-coded. This was okay during the initial stages of the site's development (which hadn't reached '1.0' yet). With that said, it was something I just forget to change and I didn't stumble across it until the site's first deployment. I was so comfortable with the dev. environment just working I forgot about how it would need to change in the production environment.

Anyway...

This function (in search.lisp) needs to call out to nera.lisp and grab the API key from there. That means the site-settings model will need updating, as well.

At this moment in time, the JavaScript files have hard-coded versions of the API Keys:

But they will need they keys dynamically added like the server URL here (as part of the site-settings model passed to the Djula template).

At the time of writing, I'm unsure on how to track this. Should I put it as a check-list here? Or, break out each task into its own issue and track them individually? I'm going to finish creating this issue and come back to how to track it later.

At the moment, the API key is hard-coded. This was okay during the initial stages of the site's development (which hadn't reached '1.0' yet). With that said, it was something I just forget to change and I didn't stumble across it until the site's first deployment. I was so comfortable with the dev. environment just working I forgot about how it would need to change in the production environment. Anyway... [This function](https://git.abbether.net/return-to-ritherdon/ritherdon-archive/src/commit/9650008ce9bfea19340e8292ced37d9205ad80a7/src/search.lisp#L111) (in `search.lisp`) needs to call out to `nera.lisp` and grab the API key from there. That means the [site-settings](https://git.abbether.net/return-to-ritherdon/ritherdon-archive/src/commit/9650008ce9bfea19340e8292ced37d9205ad80a7/src/models/site-settings.lisp) model will need updating, as well. At this moment in time, the JavaScript files have hard-coded versions of the API Keys: - [full-search.js](https://git.abbether.net/return-to-ritherdon/ritherdon-archive/src/commit/9650008ce9bfea19340e8292ced37d9205ad80a7/static/js/full-search.js#L31) - [quick-search.js](https://git.abbether.net/return-to-ritherdon/ritherdon-archive/src/commit/9650008ce9bfea19340e8292ced37d9205ad80a7/static/js/quick-search.js#L25) But they will need they keys dynamically added like the `server` URL [here](https://git.abbether.net/return-to-ritherdon/ritherdon-archive/src/commit/9650008ce9bfea19340e8292ced37d9205ad80a7/templates/search.html#L33) (as part of the `site-settings` model passed to the Djula template). At the time of writing, I'm unsure on how to track this. Should I put it as a check-list here? Or, break out each task into its own issue and track them individually? I'm going to finish creating this issue and come back to how to track it later.
craig.oates added the
enhancement
label 1 year ago
craig.oates self-assigned this 1 year ago
craig.oates added this to the Site Up-Keep project 1 year ago
craig.oates referenced this issue from a commit 1 year ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.