Giter Club home page Giter Club logo

Comments (14)

cuu508 avatar cuu508 commented on July 19, 2024 2

@lyducka I think you get 400 because 192.168.0.28 is not in ALLOWED_HOSTS. Try this:

docker run \
  -it \
  --rm \
  --name=healthchecks \
  -p 8000:8000 \
  -e ALLOWED_HOSTS=192.168.0.28 \
  -e DEBUG=False \
  -e DB=sqlite \
  -e DB_NAME=/tmp/hc.sqlite \
  -e SITE_ROOT=http://192.168.0.28:8000 \
  healthchecks/healthchecks:latest

from healthchecks.

droidus avatar droidus commented on July 19, 2024 1

I re-visited my .env file, updated localhost addresses to my actual internal IP assigned to the host, and it is now working.

from healthchecks.

cuu508 avatar cuu508 commented on July 19, 2024

What URL is returning 400?

from healthchecks.

droidus avatar droidus commented on July 19, 2024

I am accessing via the internal IP.

from healthchecks.

cuu508 avatar cuu508 commented on July 19, 2024

Is the URL you are accessing "/"?

What is your configuration?

from healthchecks.

wabol avatar wabol commented on July 19, 2024

Excuse me, where can find the. env, I had the same question. thanks!

from healthchecks.

cuu508 avatar cuu508 commented on July 19, 2024

@lyducka you have to create it. See the first step in the "Getting Started" section here: https://github.com/healthchecks/healthchecks/tree/master/docker

from healthchecks.

wabol avatar wabol commented on July 19, 2024

@cuu508 Thank you for getting back to me. I appreciate your response.

I attempted to use Docker Hub at 'https://hub.docker.com/r/healthchecks/healthchecks', but I encountered a 400 Bad Request error with the web GUI. I followed the instructions provided in this GitHub repository 'https://github.com/healthchecks/healthchecks/tree/master/docker', but unfortunately, I encountered the same error.

I have already utilized the Docker CLI and docker-compose on Docker Hub. The operating system of my container is CentOS 7, and the Docker version I'm using is 24.0.2.

If you have some time, I would greatly appreciate your assistance with this issue.

Below is the logs

image

from healthchecks.

cuu508 avatar cuu508 commented on July 19, 2024

@lyducka can you please try the following command as-is:

docker run \
  -it \
  --rm \
  --name=healthchecks \
  -p 8000:8000 \
  -e ALLOWED_HOSTS=localhost \
  -e APPRISE_ENABLED=False \
  -e DB=sqlite \
  -e DB_CONN_MAX_AGE=0 \
  -e DB_HOST= \
  -e DB_NAME=/tmp/hc.sqlite \
  -e DB_PASSWORD= \
  -e DB_PORT= \
  -e DB_SSLMODE= \
  -e DB_TARGET_SESSION_ATTRS= \
  -e DB_USER= \
  -e DEBUG=False \
  -e [email protected] \
  -e DISCORD_CLIENT_ID= \
  -e DISCORD_CLIENT_SECRET= \
  -e EMAIL_HOST= \
  -e EMAIL_HOST_PASSWORD= \
  -e EMAIL_HOST_USER= \
  -e EMAIL_PORT=587 \
  -e EMAIL_USE_TLS=True \
  -e EMAIL_USE_VERIFICATION=True \
  -e INTEGRATIONS_ALLOW_PRIVATE_IPS=False \
  -e LINENOTIFY_CLIENT_ID= \
  -e LINENOTIFY_CLIENT_SECRET= \
  -e MASTER_BADGE_LABEL=Mychecks \
  -e MATRIX_ACCESS_TOKEN= \
  -e MATRIX_HOMESERVER= \
  -e MATRIX_USER_ID= \
  -e MATTERMOST_ENABLED=True \
  -e MSTEAMS_ENABLED=True \
  -e OPSGENIE_ENABLED=True \
  -e PAGERTREE_ENABLED=True \
  -e PD_APP_ID= \
  -e PD_ENABLED=True \
  -e PING_BODY_LIMIT=10000 \
  -e PING_EMAIL_DOMAIN=localhost \
  -e PING_ENDPOINT=http://localhost:8000/ping/ \
  -e PROMETHEUS_ENABLED=True \
  -e PUSHBULLET_CLIENT_ID= \
  -e PUSHBULLET_CLIENT_SECRET= \
  -e PUSHOVER_API_TOKEN= \
  -e PUSHOVER_EMERGENCY_EXPIRATION=86400 \
  -e PUSHOVER_EMERGENCY_RETRY_DELAY=300 \
  -e PUSHOVER_SUBSCRIPTION_URL= \
  -e REGISTRATION_OPEN=True \
  -e REMOTE_USER_HEADER= \
  -e RP_ID= \
  -e S3_ACCESS_KEY= \
  -e S3_BUCKET= \
  -e S3_ENDPOINT= \
  -e S3_REGION= \
  -e S3_SECRET_KEY= \
  -e S3_TIMEOUT=60 \
  -e SECRET_KEY=---123 \
  -e SHELL_ENABLED=False \
  -e SIGNAL_CLI_SOCKET= \
  -e SITE_LOGO_URL= \
  -e SITE_NAME=Mychecks \
  -e SITE_ROOT=http://localhost:8000 \
  -e SLACK_CLIENT_ID= \
  -e SLACK_CLIENT_SECRET= \
  -e SLACK_ENABLED=True \
  -e SPIKE_ENABLED=True \
  -e TELEGRAM_BOT_NAME=ExampleBot \
  -e TELEGRAM_TOKEN= \
  -e TRELLO_APP_KEY= \
  -e TWILIO_ACCOUNT= \
  -e TWILIO_AUTH= \
  -e TWILIO_FROM= \
  -e TWILIO_USE_WHATSAPP=False \
  -e USE_PAYMENTS=False \
  -e VICTOROPS_ENABLED=True \
  -e WEBHOOKS_ENABLED=True \
  -e ZULIP_ENABLED=True \
  healthchecks/healthchecks:latest

Does it work? i.e., does the container start, and do you see any errors when opening http://localhost:8000 in the browser?

from healthchecks.

wabol avatar wabol commented on July 19, 2024

@lyducka can you please try the following command as-is:

docker run \
  -it \
  --rm \
  --name=healthchecks \
  -p 8000:8000 \
  -e ALLOWED_HOSTS=localhost \
  -e APPRISE_ENABLED=False \
  -e DB=sqlite \
  -e DB_CONN_MAX_AGE=0 \
  -e DB_HOST= \
  -e DB_NAME=/tmp/hc.sqlite \
  -e DB_PASSWORD= \
  -e DB_PORT= \
  -e DB_SSLMODE= \
  -e DB_TARGET_SESSION_ATTRS= \
  -e DB_USER= \
  -e DEBUG=False \
  -e [email protected] \
  -e DISCORD_CLIENT_ID= \
  -e DISCORD_CLIENT_SECRET= \
  -e EMAIL_HOST= \
  -e EMAIL_HOST_PASSWORD= \
  -e EMAIL_HOST_USER= \
  -e EMAIL_PORT=587 \
  -e EMAIL_USE_TLS=True \
  -e EMAIL_USE_VERIFICATION=True \
  -e INTEGRATIONS_ALLOW_PRIVATE_IPS=False \
  -e LINENOTIFY_CLIENT_ID= \
  -e LINENOTIFY_CLIENT_SECRET= \
  -e MASTER_BADGE_LABEL=Mychecks \
  -e MATRIX_ACCESS_TOKEN= \
  -e MATRIX_HOMESERVER= \
  -e MATRIX_USER_ID= \
  -e MATTERMOST_ENABLED=True \
  -e MSTEAMS_ENABLED=True \
  -e OPSGENIE_ENABLED=True \
  -e PAGERTREE_ENABLED=True \
  -e PD_APP_ID= \
  -e PD_ENABLED=True \
  -e PING_BODY_LIMIT=10000 \
  -e PING_EMAIL_DOMAIN=localhost \
  -e PING_ENDPOINT=http://localhost:8000/ping/ \
  -e PROMETHEUS_ENABLED=True \
  -e PUSHBULLET_CLIENT_ID= \
  -e PUSHBULLET_CLIENT_SECRET= \
  -e PUSHOVER_API_TOKEN= \
  -e PUSHOVER_EMERGENCY_EXPIRATION=86400 \
  -e PUSHOVER_EMERGENCY_RETRY_DELAY=300 \
  -e PUSHOVER_SUBSCRIPTION_URL= \
  -e REGISTRATION_OPEN=True \
  -e REMOTE_USER_HEADER= \
  -e RP_ID= \
  -e S3_ACCESS_KEY= \
  -e S3_BUCKET= \
  -e S3_ENDPOINT= \
  -e S3_REGION= \
  -e S3_SECRET_KEY= \
  -e S3_TIMEOUT=60 \
  -e SECRET_KEY=---123 \
  -e SHELL_ENABLED=False \
  -e SIGNAL_CLI_SOCKET= \
  -e SITE_LOGO_URL= \
  -e SITE_NAME=Mychecks \
  -e SITE_ROOT=http://localhost:8000 \
  -e SLACK_CLIENT_ID= \
  -e SLACK_CLIENT_SECRET= \
  -e SLACK_ENABLED=True \
  -e SPIKE_ENABLED=True \
  -e TELEGRAM_BOT_NAME=ExampleBot \
  -e TELEGRAM_TOKEN= \
  -e TRELLO_APP_KEY= \
  -e TWILIO_ACCOUNT= \
  -e TWILIO_AUTH= \
  -e TWILIO_FROM= \
  -e TWILIO_USE_WHATSAPP=False \
  -e USE_PAYMENTS=False \
  -e VICTOROPS_ENABLED=True \
  -e WEBHOOKS_ENABLED=True \
  -e ZULIP_ENABLED=True \
  healthchecks/healthchecks:latest

Does it work? i.e., does the container start, and do you see any errors when opening http://localhost:8000 in the browser?

Hi @cuu508, thanks for your reply. Yes, I use this run a healthchecks service on my Ubuntu, I attempted to access http://192.168.0.28:8000/ on my computer using Chrome, as the Ubuntu server at 192.168.0.28 doesn't have a browser. However, I'm facing an issue where the page isn't loading. I even tried modifying the 'ALLOWED_HOSTS' setting to '0.0.0.0', but unfortunately, the error persists.
Below is the screenshot of the error.
image

image

from healthchecks.

wabol avatar wabol commented on July 19, 2024

@cuu508 Wow, thank you very much! Extremely helpful! it works.
I mistakenly thought that ALLOWED_HOSTS was a limitation of the client.
Thank you again!

from healthchecks.

wabol avatar wabol commented on July 19, 2024

If you use nginx proxy to healthchecks, please set 'ALLOWED_HOSTS=*' 'SITE_ROOT=http://you-domain-name.com' 'PING_ENDPOINT=http://you-domain-name.com/ping/ ' when you use docker run you healthchecks service.

from healthchecks.

cuu508 avatar cuu508 commented on July 19, 2024

PING_ENDPOINT's default value is SITE_ROOT + /ping/, so you should not need to set it explicitly.

Instead of setting ALLOWED_HOSTS=* (which disables Host header validation), you can set it to ALLOWED_HOSTS=you-domain-name.com.

from healthchecks.

wabol avatar wabol commented on July 19, 2024

Very helpful, thank you!

PING_ENDPOINT's default value is SITE_ROOT + /ping/, so you should not need to set it explicitly.

Instead of setting ALLOWED_HOSTS=* (which disables Host header validation), you can set it to ALLOWED_HOSTS=you-domain-name.com.

from healthchecks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.