[GH-ISSUE #991] Environmental variables #616

Closed
opened 2026-02-25 20:36:09 +03:00 by kerem · 8 comments
Owner

Originally created by @CaptainFrosty on GitHub (Apr 26, 2023).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/991

I am trying to add environmental variables to my container. I am using podman rather than docker if that matters. When I add an environmental file argument when I run it the application doesn't work. Then I tried using podman run --env 'WHOOGLE*' whoogle-search to add them from my system environment and that didn't work.

Originally created by @CaptainFrosty on GitHub (Apr 26, 2023). Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/991 I am trying to add environmental variables to my container. I am using podman rather than docker if that matters. When I add an environmental file argument when I run it the application doesn't work. Then I tried using `podman run --env 'WHOOGLE*' whoogle-search` to add them from my system environment and that didn't work.
kerem closed this issue 2026-02-25 20:36:09 +03:00
Author
Owner

@CaptainFrosty commented on GitHub (Apr 27, 2023):

❯ podman run --env-file=/home/jesse/whoogle.env whoogle-search
Apr 27 20:54:49.944 [notice] Tor 0.4.6.9 running on Linux with Libevent 2.1.12-stable, OpenSSL 1.1.1t, Zlib 1.2.12, Liblzma 5.2.5, Libzstd 1.5.0 and Unknown N/A as libc.
Apr 27 20:54:49.946 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Apr 27 20:54:49.947 [notice] Read configuration file "/etc/tor/torrc".
Apr 27 20:54:49.953 [notice] Opening Socks listener on 127.0.0.1:9050
Apr 27 20:54:49.954 [notice] Opened Socks listener connection (ready) on 127.0.0.1:9050
Apr 27 20:54:49.954 [notice] Opening Control listener on 127.0.0.1:9051
Apr 27 20:54:49.954 [notice] Opened Control listener connection (ready) on 127.0.0.1:9051
Apr 27 20:54:49.955 [warn] Fixing permissions on directory /var/lib/tor
^C
* Finished creating ddg bangs json

This is what happens when I try to run it with variables with either --env or --env-file. It locks up the terminal after the last message. I am not even trying to use Tor.

<!-- gh-comment-id:1526448135 --> @CaptainFrosty commented on GitHub (Apr 27, 2023): ``` ❯ podman run --env-file=/home/jesse/whoogle.env whoogle-search Apr 27 20:54:49.944 [notice] Tor 0.4.6.9 running on Linux with Libevent 2.1.12-stable, OpenSSL 1.1.1t, Zlib 1.2.12, Liblzma 5.2.5, Libzstd 1.5.0 and Unknown N/A as libc. Apr 27 20:54:49.946 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning Apr 27 20:54:49.947 [notice] Read configuration file "/etc/tor/torrc". Apr 27 20:54:49.953 [notice] Opening Socks listener on 127.0.0.1:9050 Apr 27 20:54:49.954 [notice] Opened Socks listener connection (ready) on 127.0.0.1:9050 Apr 27 20:54:49.954 [notice] Opening Control listener on 127.0.0.1:9051 Apr 27 20:54:49.954 [notice] Opened Control listener connection (ready) on 127.0.0.1:9051 Apr 27 20:54:49.955 [warn] Fixing permissions on directory /var/lib/tor ^C * Finished creating ddg bangs json ``` This is what happens when I try to run it with variables with either --env or --env-file. It locks up the terminal after the last message. I am not even trying to use Tor.
Author
Owner

@CaptainFrosty commented on GitHub (Apr 27, 2023):

The content of whoogle.env is just:

❯ cat whoogle.env
WHOOGLE_CONFIG_DISABLE=""
WHOOGLE_CONFIG_THEME="dark"
<!-- gh-comment-id:1526451262 --> @CaptainFrosty commented on GitHub (Apr 27, 2023): The content of whoogle.env is just: ``` ❯ cat whoogle.env WHOOGLE_CONFIG_DISABLE="" WHOOGLE_CONFIG_THEME="dark" ```
Author
Owner

@CaptainFrosty commented on GitHub (Apr 30, 2023):

Well, I guess I'll try a regular install next if I can't get any assistance concerning getting environmental variables to containers without somehow activating Tor instead.

<!-- gh-comment-id:1528928137 --> @CaptainFrosty commented on GitHub (Apr 30, 2023): Well, I guess I'll try a regular install next if I can't get any assistance concerning getting environmental variables to containers without somehow activating Tor instead.
Author
Owner

@CaptainFrosty commented on GitHub (Apr 30, 2023):

To be clear it works with no variables passed.

<!-- gh-comment-id:1528928288 --> @CaptainFrosty commented on GitHub (Apr 30, 2023): To be clear it works with no variables passed.
Author
Owner

@CaptainFrosty commented on GitHub (Apr 30, 2023):

Or I could try installing real Docker I suppose. If I HAVE to. 😁 Is the correct thing to do to use podman/docker run even when working with an already-running container? If that is the case, when is podman/docker exec used? Sorry I am not well-versed with containers. Just making sure I am using the right command, since the podman docs advise me that exec is generally for operations on already running containers.

<!-- gh-comment-id:1528928787 --> @CaptainFrosty commented on GitHub (Apr 30, 2023): Or I could try installing real Docker I suppose. If I HAVE to. :grin: Is the correct thing to do to use `podman/docker run` even when working with an already-running container? If that is the case, when is `podman/docker exec` used? Sorry I am not well-versed with containers. Just making sure I am using the right command, since the podman docs advise me that `exec` is generally for operations on already running containers.
Author
Owner

@benbusby commented on GitHub (May 1, 2023):

So just to clarify, Tor is activated by default -- it's installed as part of the container build, but doesn't have to be used. If you don't activate the "Use Tor" config on the front page, it will just silently run in the background. If the idea of having Tor running (even when not in use) is a problem, you can deactivate it with WHOOGLE_TOR_SERVICE=0.

Regarding the issue with environment variables, I'm not sure what the problem could be. My first guess is that the whoogle.env file isn't being copied into the correct location in the container. The app itself looks for that file in the root level of the repo itself (so alongside the readme, run.sh, etc). Can you shell into the container after it's running and see if your environment file is in the correct place?

<!-- gh-comment-id:1529925692 --> @benbusby commented on GitHub (May 1, 2023): So just to clarify, Tor is activated by default -- it's installed as part of the container build, but doesn't have to be used. If you don't activate the "Use Tor" config on the front page, it will just silently run in the background. If the idea of having Tor running (even when not in use) is a problem, you can deactivate it with `WHOOGLE_TOR_SERVICE=0`. Regarding the issue with environment variables, I'm not sure what the problem could be. My first guess is that the `whoogle.env` file isn't being copied into the correct location in the container. The app itself looks for that file in the root level of the repo itself (so alongside the readme, `run.sh`, etc). Can you shell into the container after it's running and see if your environment file is in the correct place?
Author
Owner

@MrRubberDucky commented on GitHub (May 8, 2023):

That command should work, no idea why it doesn't. You sure you have the .env file there? For me both podman run --detach --env-file=whoogle.env whoogle-search (while in /podman-files/) and podman run --detach --env-file=${HOME}/podman-files/whoogle.env whoogle-search fetch the same result (Tor disabled in .env with WHOOGLE_TOR_SERVICE=0, reflected in containers logs)

Granted I'm using Podman 4.3.1, --env-file= might just not be present in your podman version, or your .env file is malformed.

You can alternatively try deploying with podman-compose devel branch, if you need an example then look at Line 34 here https://github.com/MrRubberDucky/rubberverse.xyz/blob/main/podman-files/containers.yaml

<!-- gh-comment-id:1538324308 --> @MrRubberDucky commented on GitHub (May 8, 2023): That command should work, no idea why it doesn't. You sure you have the .env file there? For me both `podman run --detach --env-file=whoogle.env whoogle-search` (while in /podman-files/) and `podman run --detach --env-file=${HOME}/podman-files/whoogle.env whoogle-search` fetch the same result (Tor disabled in .env with `WHOOGLE_TOR_SERVICE=0`, reflected in containers logs) Granted I'm using Podman 4.3.1, --env-file= might just not be present in your podman version, or your .env file is malformed. You can alternatively try deploying with podman-compose devel branch, if you need an example then look at Line 34 here https://github.com/MrRubberDucky/rubberverse.xyz/blob/main/podman-files/containers.yaml
Author
Owner

@benbusby commented on GitHub (May 19, 2023):

@CaptainFrosty feel free to reopen this if you're still having issues!

<!-- gh-comment-id:1554997854 --> @benbusby commented on GitHub (May 19, 2023): @CaptainFrosty feel free to reopen this if you're still having issues!
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#616
No description provided.