Skip to content
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

meilisearch key permissions #30753

Open
mapolone opened this issue Apr 28, 2024 · 2 comments
Open

meilisearch key permissions #30753

mapolone opened this issue Apr 28, 2024 · 2 comments
Labels

Comments

@mapolone
Copy link

Description

ISSUE_INDEXER_CONN_STR = "http://xxxx.7700/"

Hello, I'm using a test installation of meilisearch with master key configured and managing keys creation with its API. So far:

  • Created an index named gitea_issues as in configuration file
  • Created a key with the following permissions on the same index as documented here:
"actions": ["search", "documents.*"]
"indexes": ["gitea_issues"]

I'd expect that once set the key, gitea would start normally but I got this error instead:

Apr 28 22:37:16 node gitea[3230588]: 2024/04/28 22:37:16 ...er/issues/indexer.go:111:func1() [F] Unable to issueIndexer.Init with connection http://localhost:7700 Error: unaccepted status code found: 403 expected: [202], MeilisearchApiError Message: The provided API key is invalid., Code: invalid_api_key, Type: auth, Link: https://docs.meilisearch.com/errors#invalid_api_key (path "POST /indexes" with method "CreateIndex")

Using the default admin API key (although not recommended) it works as expected. At this point I'm wondering why is it asking to create a new index when the specified one already exists. And also if I change the previous actions to allow index creations it fails with the same error.

Gitea Version

1.21.11

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.34.1

Operating System

Ubuntu 22.04.4

How are you running Gitea?

systemd on Ubuntu 22.04.4

Database

PostgreSQL

@mapolone mapolone changed the title meilisearch token settings meilisearch key permissions Apr 28, 2024
@techknowlogick
Copy link
Member

The connection string needs to have the key included in it, eg http://:apikey@localhost:7700 (note the prefix of :)

@mapolone
Copy link
Author

mapolone commented Apr 29, 2024

Sorry, there's a typo in the previous message. The apikey is already prefixed by : (from the running configuration):

ISSUE_INDEXER_CONN_STR = http://:300...e65@localhost:7700

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants