hnhx/librex

librex browser search integration - firefox with LibreX Docker container

myobfee opened this issue · 3 comments

In utilizing right-click option to add local LibreX instance as default browser search engine, any subsequent browser searches fail as LibreX defaults to docker IP/port (127.0.0.1:8080) instead of proxied domain for browser bar searches. Using Cosmos as proxy front-end: https://github.com/azukaar/Cosmos-Server. LibreX works when accessed via external URL directly.

Hoping there is an un-documented environment variable to add to the docker-compose.yml to address so external domain is used in browser search query instead of docker IP/port (127.0.0.1:8080)

Yeah seeing this too when trying to do it with docker-compose. No matter what files I tried to edit or trying to pass the variable in the Dockerfile, it wouldn't work.

I added -e "OPEN_SEARCH_HOST="https://yourinstance.tld" to the docker run command and it solved the issue for me.
You can check this quickly by going to yourinstance.tld/opensearch.xml and making sure that the template= section has the domain you set.

Overall, the command should look like this:
docker run --name librex -e "OPEN_SEARCH_HOST="https://yourinstance.tld" -e SOME_OTHER_VARIABLE="someothervalue" -p 8080:8080 librex/librex:latest. If you're using a different port, make sure it's the port on the left of the : that you're changing.

I'm a mess with docker so I dunno what the actual fix is, but I hope one is found soon for docker-compose.

I faced the same issue with Firefox. You can solve this creating a new opensearch.xml file or extracting it from your container and change it to point to your domain. Finally, mount this .xml on your compose file and recreate the container.

  - /volume3/docker/librex/nginx:/var/log/nginx
  - /volume3/docker/librex/logs:/var/log/php7
  - /volume3/docker/librex/opensearch.xml:/var/www/html/opensearch.xml

Regards

Yes, I would love to have a env var. I think that's what Change opensearch.xml to point to your domain means here.