[GH-ISSUE #316] [BUG] Docker container is unhealthy with basic auth #222

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

Originally created by @almottier on GitHub (May 14, 2021).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/316

Describe the bug
Docker container is unhealthy when I use basic auth with env var WHOOGLE_USER and WHOOGLE_PASS.

To Reproduce

root@da05c4b66963:/whoogle# wget http://localhost:5000
--2021-05-14 22:41:40--  http://localhost:5000/
Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:5000... connected.
HTTP request sent, awaiting response... 401 UNAUTHORIZED

Username/Password Authentication Failed.
root@da05c4b66963:/whoogle# echo $?
6

Deployment Method

  • Docker

Version of Whoogle Search

  • 0.4.1
Originally created by @almottier on GitHub (May 14, 2021). Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/316 **Describe the bug** Docker container is unhealthy when I use basic auth with env var `WHOOGLE_USER` and `WHOOGLE_PASS`. **To Reproduce** ``` root@da05c4b66963:/whoogle# wget http://localhost:5000 --2021-05-14 22:41:40-- http://localhost:5000/ Resolving localhost (localhost)... 127.0.0.1, ::1 Connecting to localhost (localhost)|127.0.0.1|:5000... connected. HTTP request sent, awaiting response... 401 UNAUTHORIZED Username/Password Authentication Failed. root@da05c4b66963:/whoogle# echo $? 6 ``` **Deployment Method** - Docker **Version of Whoogle Search** - 0.4.1
kerem 2026-02-25 20:35:12 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@nandor-magyar commented on GitHub (May 15, 2021):

The app itself includes some of the responsibilites would be better handled by a separate web-server (nginx or else) imo.
I tried to fix this locally, with using a new route that is just returning "" - the @auth_required decorator is left out.
This naturally works and I am happy to send a PR, but I haven't found any formatter/linter guidance in the readme or just missed.

The Dockerfile:

HEALTHCHECK  --interval=30s --timeout=5s \
  CMD wget -qO- --no-verbose --tries=1 http://localhost:${EXPOSE_PORT}/healthz || exit 1

The new route:

@app.route("/healthz", methods=["GET"])
def healthcheck():
    return ""
<!-- gh-comment-id:841658575 --> @nandor-magyar commented on GitHub (May 15, 2021): The app itself includes some of the responsibilites would be better handled by a separate web-server (nginx or else) imo. I tried to fix this locally, with using a new route that is just returning "" - the `@auth_required` decorator is left out. This naturally works and I am happy to send a PR, but I haven't found any formatter/linter guidance in the readme or just missed. The Dockerfile: ``` HEALTHCHECK --interval=30s --timeout=5s \ CMD wget -qO- --no-verbose --tries=1 http://localhost:${EXPOSE_PORT}/healthz || exit 1 ``` The new route: ``` @app.route("/healthz", methods=["GET"]) def healthcheck(): return "" ```
Author
Owner

@benbusby commented on GitHub (May 18, 2021):

Thanks @nandor-magyar, I just implemented your solution with 1fdf226802 (as well as switching to a curl based healthcheck to avoid some problems that another user encountered with wget).

<!-- gh-comment-id:843294817 --> @benbusby commented on GitHub (May 18, 2021): Thanks @nandor-magyar, I just implemented your solution with 1fdf226802d67445f7570b34a3323463e165770d (as well as switching to a `curl` based healthcheck to avoid some problems that another user encountered with `wget`).
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#222
No description provided.