Open lambirou opened 1 month ago
Hey, thanks for this great idea! Is there an API key on Ollama?
@n4ze3m no ollama doesnt not have any auth built it. the expectation is that it sits within a local host env behind a proxy server and app/backend and that auth is managed there. Trying to add auth header in this extension will not make the setup any more secure.
I will add an option in the advanced URL configuration for the headers :)
Here is my nginx configuration to add an Authorization Basic header in the request to the Ollama API. I use Apache's htpasswd to manage HTTP users.
server {
...
location @reverse_proxy {
...
proxy_set_header Authorization $http_authorization;
proxy_pass_header Authorization;
proxy_pass_request_headers on;
...
}
...
auth_basic "Administrator’s Area";
auth_basic_user_file /etc/apache2/.htpasswd;
...
}
The HTTP header:
Content-Type: application/json
Accept: application/json
Authorization: Basic cmVkaTpxSlczbk01cFlaNzM=
The hash is the concatenation of user:password
hashed in base64.
@n4ze3m No Ollama does not integrate API key management but using Authorization headers in reverse proxy can be an interesting alternative.
Any update? Need this feature badly...
I will add an option to pass custom headers in the next version (v1.1.14), which will be released on Monday or Tuesday.
Hello, everyone! v1.1.14 has been released, which includes the option to configure custom headers for Ollama. Please let me know if you encounter any issues using this feature. Thanks!
A huge thank you for the efforts you put into this project. But in my tests the headers I provided are not added to the request to the API.
Hey, sorry about that. Which header key was used? I will try to fix it in the next release.
Currently, requests to the Ollama API do not include an 'Authorization' header. To strengthen the security of API calls, it is necessary to add an 'Authorization' header with Basic or Bearer authentication.
Tasks to complete: