Open impaktor opened 4 weeks ago
These files should be created when you start the SearXNG container and not included in this repository.
You can try changing the local path of the volume to a folder inside the home folder of the user running the container so that it has the necessary permissions, like so:
volumes:
- ./searxng:/home/myuser/searxng:rw
chown -R root:root searxng-docker
(or whatever dir you have it in)
SearXNG docker only works properly if every file is owned by root for some reason. If you follow the repo instructions closely and put it inside /usr/local
you likely already did this since normal users can't write there, at least on Debian.
SearXNG docker only works properly if every file is owned by root for some reason.
That is not correct at all
Your user just needs to be in the docker
group …
And yes, the uwsgi.ini
file is created.
I don't put my user in docker group. Is it an expected part of Docker installs?
I don't put my user in docker group. Is it an expected part of Docker installs?
Yes. However, I am in the docker user group, and did not get the uwsgi.ini file.
Make sure you have this in your docker-compose.yml
file for the searxng
section.
volumes:
- ./searxng:/etc/searxng:rw
(https://github.com/searxng/searxng-docker/blob/master/docker-compose.yaml#L55-L56)
This will create a searxng
directory in your docker directory and map /etc/searxng
from inside the searxng
container to it. This should include the uwsgi.ini
file.
If in doubt and you already have that directory, stop your containers, rename that directory and start your containers again. That way it should re-create the directory and put all the files in it. You can then copy the settings from the renamed directory in there and restart the whole show, so you won't lose any settings or the like.
EDIT:
Just tested this and the uwsgi.ini
file is there.
With this being the relevant log:
searxng | SearXNG version 2024.6.7+f5eb56b63
searxng | Use existing /etc/searxng/uwsgi.ini
searxng | Use existing /etc/searxng/settings.yml
searxng | Listen on 0.0.0.0:8080
searxng | [uWSGI] getting INI configuration from /etc/searxng/uwsgi.ini
searxng | [uwsgi-static] added mapping for /static => /usr/local/searxng/searx/static
:rw
.chown root:root -R
and remove the uwsgi.ini file, then (and only then) is the file re-generated (on Arch Linux).SearXNG docker only works properly if every file is owned by root for some reason. If you follow the repo instructions closely and put it inside /usr/local you likely already did this since normal users can't write there, at least on Debian.
Looking at the README I'd venture it's highly implicit that the folder must be root, as anyone following the README, will get an error when running git clone
on /usr/local
as they're likely not defaulting to being root in their terminals. They will then either git clone
into whatever folder they already have in /home where they usually put all their git cloned repos, or they will go full John Wayne and "sudo git clone" right there in /usr/local, which to me feels unnatural, which is why I opted for putting it in my home dir.
Either way, I'd argue some change is needed. E.g. explicitly add the chown root:rotot -R
command, to indicate where ever the user puts it, this repo should run as root, or include the uwsgi file, or some other change?
Or installing it in /usr/local
is wrong in the first place. At least I can't find a good reason to have it there.
I installed it in my user's home directory and didn't have to chown
anything.
There is probably a reason why this file is in the gitignore, and not included in the source tree, but I'm opening this PR to start discussion on proper fix, as the docker compose doesn't work without it.
Possible fixes:
This fixes #115