[GH-ISSUE #631] WHOOGLE_CONFIG_TOR is not working #399

Closed
opened 2026-02-25 20:35:39 +03:00 by kerem · 14 comments
Owner

Originally created by @ngosang on GitHub (Jan 29, 2022).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/631

I was running Whoogle with TOR disabled with the Docker image 0.7.0.
After the update to the latest image (0.7.1) I'm not able to disable Tor with the environment variable WHOOGLE_CONFIG_TOR.
I know there are breaking changes in the docker-compose file but I'm not using those options. This is my docker file and It's running TOR even if I set the environment variable WHOOGLE_CONFIG_TOR=0

  whoogle:
    image: benbusby/whoogle-search:latest
    container_name: whoogle
    ports:
     - "5000:5000"
    environment:
      - "WHOOGLE_CONFIG_DISABLE=1"
      - "WHOOGLE_CONFIG_COUNTRY=ES"
      - "WHOOGLE_CONFIG_LANGUAGE=lang_es"
      - "WHOOGLE_CONFIG_SAFE=0"
      - "WHOOGLE_CONFIG_VIEW_IMAGE=1"
      - "WHOOGLE_CONFIG_GET_ONLY=1"
      - "WHOOGLE_CONFIG_TOR=0"
    restart: unless-stopped
Originally created by @ngosang on GitHub (Jan 29, 2022). Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/631 I was running Whoogle with TOR disabled with the Docker image 0.7.0. After the update to the latest image (0.7.1) I'm not able to disable Tor with the environment variable `WHOOGLE_CONFIG_TOR`. I know there are breaking changes in the docker-compose file but I'm not using those options. This is my docker file and It's running TOR even if I set the environment variable `WHOOGLE_CONFIG_TOR=0` ```yaml whoogle: image: benbusby/whoogle-search:latest container_name: whoogle ports: - "5000:5000" environment: - "WHOOGLE_CONFIG_DISABLE=1" - "WHOOGLE_CONFIG_COUNTRY=ES" - "WHOOGLE_CONFIG_LANGUAGE=lang_es" - "WHOOGLE_CONFIG_SAFE=0" - "WHOOGLE_CONFIG_VIEW_IMAGE=1" - "WHOOGLE_CONFIG_GET_ONLY=1" - "WHOOGLE_CONFIG_TOR=0" restart: unless-stopped ```
kerem 2026-02-25 20:35:39 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@DUOLabs333 commented on GitHub (Jan 30, 2022):

Stop the Whoogle container. Is TOR still running?

<!-- gh-comment-id:1025242644 --> @DUOLabs333 commented on GitHub (Jan 30, 2022): Stop the Whoogle container. Is TOR still running?
Author
Owner

@ngosang commented on GitHub (Jan 31, 2022):

You mean stop and start the container? I don't have Tor installed in the host. Tor process is running inside the container. As you can see in my Docker-compose I'm not mapping external volumes.

<!-- gh-comment-id:1025268391 --> @ngosang commented on GitHub (Jan 31, 2022): You mean stop and start the container? I don't have Tor installed in the host. Tor process is running inside the container. As you can see in my Docker-compose I'm not mapping external volumes.
Author
Owner

@DUOLabs333 commented on GitHub (Jan 31, 2022):

Ok, stop the Tor process, then restart the container. Does Tor start?

<!-- gh-comment-id:1025271572 --> @DUOLabs333 commented on GitHub (Jan 31, 2022): Ok, stop the Tor process, then restart the container. Does Tor start?
Author
Owner

@ngosang commented on GitHub (Jan 31, 2022):

  1. I kill the tor process inside the container.
/whoogle $ ps aux
PID   USER     TIME  COMMAND
    1 whoogle   0:00 {run} /bin/sh ./run
    7 whoogle   0:00 {start-tor.sh} /bin/sh misc/tor/start-tor.sh
   11 whoogle   0:02 tor -f /etc/tor/torrc
   15 whoogle   0:16 python3 -um app --host 0.0.0.0 --port 5000
  305 whoogle   0:00 sh
  316 whoogle   0:00 ps aux

/whoogle $ kill -9 11

/whoogle $ ps aux
PID   USER     TIME  COMMAND
    1 whoogle   0:00 {run} /bin/sh ./run
   15 whoogle   0:16 python3 -um app --host 0.0.0.0 --port 5000
  305 whoogle   0:00 sh
  359 whoogle   0:00 ps aux
  1. I restart the container

  2. Tor process is running again

/whoogle $ ps aux
PID   USER     TIME  COMMAND
    1 whoogle   0:00 {run} /bin/sh ./run
    7 whoogle   0:00 {start-tor.sh} /bin/sh misc/tor/start-tor.sh
   11 whoogle   0:01 tor -f /etc/tor/torrc
   15 whoogle   0:01 python3 -um app --host 0.0.0.0 --port 5000
   23 whoogle   0:00 sh
   30 whoogle   0:00 ps aux
<!-- gh-comment-id:1025441481 --> @ngosang commented on GitHub (Jan 31, 2022): 1) I kill the tor process inside the container. ``` /whoogle $ ps aux PID USER TIME COMMAND 1 whoogle 0:00 {run} /bin/sh ./run 7 whoogle 0:00 {start-tor.sh} /bin/sh misc/tor/start-tor.sh 11 whoogle 0:02 tor -f /etc/tor/torrc 15 whoogle 0:16 python3 -um app --host 0.0.0.0 --port 5000 305 whoogle 0:00 sh 316 whoogle 0:00 ps aux /whoogle $ kill -9 11 /whoogle $ ps aux PID USER TIME COMMAND 1 whoogle 0:00 {run} /bin/sh ./run 15 whoogle 0:16 python3 -um app --host 0.0.0.0 --port 5000 305 whoogle 0:00 sh 359 whoogle 0:00 ps aux ``` 2) I restart the container 3) Tor process is running again ``` /whoogle $ ps aux PID USER TIME COMMAND 1 whoogle 0:00 {run} /bin/sh ./run 7 whoogle 0:00 {start-tor.sh} /bin/sh misc/tor/start-tor.sh 11 whoogle 0:01 tor -f /etc/tor/torrc 15 whoogle 0:01 python3 -um app --host 0.0.0.0 --port 5000 23 whoogle 0:00 sh 30 whoogle 0:00 ps aux ```
Author
Owner

@DUOLabs333 commented on GitHub (Jan 31, 2022):

Ok, I'll look into this.

<!-- gh-comment-id:1025640820 --> @DUOLabs333 commented on GitHub (Jan 31, 2022): Ok, I'll look into this.
Author
Owner

@DUOLabs333 commented on GitHub (Feb 1, 2022):

Weird -- can you uninstall tor and try again? Paste the logs from the whoogle application itself.

<!-- gh-comment-id:1027145556 --> @DUOLabs333 commented on GitHub (Feb 1, 2022): Weird -- can you uninstall tor and try again? Paste the logs from the whoogle application itself.
Author
Owner

@benbusby commented on GitHub (Feb 1, 2022):

Seems like we should be checking the WHOOGLE_CONFIG_TOR value at the beginning of misc/tor/start-tor.sh and skipping the remainder of the script if the var is set to 0. Otherwise the process gets started independently of Whoogle itself.

Edit: That being said, this becomes a bit confusing since WHOOGLE_CONFIG_TOR is just a config setting for enabling/disabling Tor routing, not starting/stopping the service itself. There should maybe be a separate variable to control the Tor service itself.

<!-- gh-comment-id:1027161806 --> @benbusby commented on GitHub (Feb 1, 2022): Seems like we should be checking the `WHOOGLE_CONFIG_TOR` value at the beginning of `misc/tor/start-tor.sh` and skipping the remainder of the script if the var is set to 0. Otherwise the process gets started independently of Whoogle itself. Edit: That being said, this becomes a bit confusing since `WHOOGLE_CONFIG_TOR` is just a config setting for enabling/disabling Tor routing, not starting/stopping the service itself. There should maybe be a separate variable to control the Tor service itself.
Author
Owner

@DUOLabs333 commented on GitHub (Feb 1, 2022):

Tor is only started automatically in the Dockerfile -- that's why I didn't notice the problem on my end.

<!-- gh-comment-id:1027163965 --> @DUOLabs333 commented on GitHub (Feb 1, 2022): Tor is only started automatically in the Dockerfile -- that's why I didn't notice the problem on my end.
Author
Owner

@ngosang commented on GitHub (Feb 5, 2022):

I can help with testing when you have some kind of fix.

<!-- gh-comment-id:1030630421 --> @ngosang commented on GitHub (Feb 5, 2022): I can help with testing when you have some kind of fix.
Author
Owner

@kapiorr commented on GitHub (Feb 18, 2022):

same for me

<!-- gh-comment-id:1044984143 --> @kapiorr commented on GitHub (Feb 18, 2022): same for me
Author
Owner

@szampardi commented on GitHub (Feb 20, 2022):

creating an executable start-tor.sh file in the same directory as docker-compose.yml with the following content:

#!/bin/sh
true

and mounting it into the container:

    volumes:
      - ./start-tor.sh:/whoogle/misc/tor/start-tor.sh:ro

helped get rid of tor

<!-- gh-comment-id:1046138270 --> @szampardi commented on GitHub (Feb 20, 2022): creating an executable `start-tor.sh` file in the same directory as `docker-compose.yml` with the following content: ```shell #!/bin/sh true ``` and mounting it into the container: ``` volumes: - ./start-tor.sh:/whoogle/misc/tor/start-tor.sh:ro ``` helped get rid of tor
Author
Owner

@FlorianWendelborn commented on GitHub (Mar 7, 2022):

@szampardi’s workaround works for me. The container logs no longer get spammed with Tor-related messages.

<!-- gh-comment-id:1061196696 --> @FlorianWendelborn commented on GitHub (Mar 7, 2022): @szampardi’s workaround works for me. The container logs no longer get spammed with Tor-related messages.
Author
Owner

@dhernan3 commented on GitHub (May 7, 2022):

My start-tor.sh is(sorry I don't know how to format text):
#!/bin/sh if [ $WHOOGLE_CONFIG_TOR == 0 ]; then true else if [ "$(whoami)" != "root" ]; then tor -f /etc/tor/torrc else if (grep alpine /etc/os-release >/dev/null); then rc-service tor start else service tor start fi fi fi

This way I can start tor changing env variable

<!-- gh-comment-id:1120153799 --> @dhernan3 commented on GitHub (May 7, 2022): My start-tor.sh is(sorry I don't know how to format text): `#!/bin/sh if [ $WHOOGLE_CONFIG_TOR == 0 ]; then true else if [ "$(whoami)" != "root" ]; then tor -f /etc/tor/torrc else if (grep alpine /etc/os-release >/dev/null); then rc-service tor start else service tor start fi fi fi ` This way I can start tor changing env variable
Author
Owner

@ShlomiD83 commented on GitHub (May 9, 2022):

creating an executable start-tor.sh file in the same directory as docker-compose.yml with the following content:

#!/bin/sh
true

and mounting it into the container:

    volumes:
      - ./start-tor.sh:/whoogle/misc/tor/start-tor.sh:ro

helped get rid of tor

I've used your workaround, the logs aren't spammed with Tor related entries anymore.
I only see 1 line "/bin/sh: misc/tor/start-tor.sh: not found"

is that what I'm supposed to see?

<!-- gh-comment-id:1120695917 --> @ShlomiD83 commented on GitHub (May 9, 2022): > creating an executable `start-tor.sh` file in the same directory as `docker-compose.yml` with the following content: > > ```shell > #!/bin/sh > true > ``` > > and mounting it into the container: > > ``` > volumes: > - ./start-tor.sh:/whoogle/misc/tor/start-tor.sh:ro > ``` > > helped get rid of tor I've used your workaround, the logs aren't spammed with Tor related entries anymore. I only see 1 line "/bin/sh: misc/tor/start-tor.sh: not found" is that what I'm supposed to see?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/whoogle-search#399
No description provided.