uptime-kuma icon indicating copy to clipboard operation
uptime-kuma copied to clipboard

How to Let Uptime Kuma check status page behind Authelia?

Open masterwishx opened this issue 2 years ago • 6 comments

⚠️ Please verify that this bug has NOT been raised before.

  • [X] I checked and didn't find similar issue

🛡️ Security Policy

📝 Describe your problem

How to Let Uptime Kuma check status page behind Authelia using Nginx Proxy Manager . Becouse of authelia in NPM its redirect to auth.mysite.com but i need to check photo.mysite.com. can i somehow configure Kuma or it should be done in NMP to avoid redirect when GET come from kuma.mysite.com ? how to do it in nginx ?

🐻 Uptime-Kuma Version

Lasted

💻 Operating System and Arch

Unraid Linux x64

🌐 Browser

Chrome

🐋 Docker Version

No response

🟩 NodeJS Version

No response

masterwishx avatar Jun 10 '22 10:06 masterwishx

I think therr are two ways to achive this.

  • Use the internal hostname or ip when the uptime kuma is located at the same network.
  • By using the custom nginx configuration option of the nginx proxy manager, you can expose some path without authentication step.

daeho-ro avatar Jun 12 '22 00:06 daeho-ro

Use the internal hostname or ip

its good idea but its more like to check if container is running , but if some other problem exist in cloudflare or some other its better to check if www.mysite.com is avalible. what custom nginx config i can use for example ?

masterwishx avatar Jun 12 '22 16:06 masterwishx

Oops, there is well constructed access control function in authelia, see the docs. You could add the policy to bypass the authentication for the specific path.

daeho-ro avatar Jun 12 '22 22:06 daeho-ro

Oops

Thanks its what i need i can add also proxy cloudflare ips but dont know what the right way to add kuma method GET ( "Uptime-Kuma/1.17.1" "-") or better some other methods ?

masterwishx avatar Jul 02 '22 16:07 masterwishx

Oops

Thanks its what i need i can add also proxy cloudflare ips but dont know what the right way to add kuma method GET ( "Uptime-Kuma/1.17.1" "-") or better some other methods ?

@masterwishx I can help you with this.

Inside your Uptime Kuma, you want to change the monitor type from "HTTPS" to "Push", this will essentially make it work in the reverse order. You will be given a unique URL. This is uptime kuma hosting it's own Push Server essentially.

The next step is to go to your other computer, hosted elsewhere, and set up a cron job in linux or scheduled task in windows to essentially go to that unique url every 60 sec. basically, your calling out to uptime kuma, rather than allow uptime to call into that project and get hung up on the authelia wall.

here is an example: Add this into a Cron Job you can do a curl -s https://status.techbytes.ca/api/push/VolAP8jfYR?msg=OK&ping= (this is a fake url i made to show you, replace this with your URL)

hopefully this helps you out :)

Chris TechBytes.ca

londontechbytes avatar Jul 22 '22 01:07 londontechbytes

I can help you with this.

Thanks i will try it .

masterwishx avatar Jul 22 '22 08:07 masterwishx

We are clearing up our old issues and your ticket has been open for 3 months with no activity. Remove stale label or comment or this will be closed in 2 days.

github-actions[bot] avatar Oct 20 '22 12:10 github-actions[bot]

I still didn't found the easy way to do it...

masterwishx avatar Oct 21 '22 15:10 masterwishx

We are clearing up our old issues and your ticket has been open for 3 months with no activity. Remove stale label or comment or this will be closed in 2 days.

github-actions[bot] avatar Jan 20 '23 00:01 github-actions[bot]

Is anyone found the easy way for it?

masterwishx avatar Jan 20 '23 06:01 masterwishx

We are clearing up our old issues and your ticket has been open for 3 months with no activity. Remove stale label or comment or this will be closed in 2 days.

github-actions[bot] avatar Apr 20 '23 12:04 github-actions[bot]

This issue was closed because it has been stalled for 2 days with no activity.

github-actions[bot] avatar Apr 22 '23 12:04 github-actions[bot]

This issue is the first result for "uptime kuma authelia", so in the interest of future people: I solved this by going into the authelia volume/directory and modifying the access_control in the configuration.yml file.

This new bypass entry must appear before the two_factor entries; otherwise, it won't work.

access_control:
  default_policy: deny
  rules:
    # Rules applied to everyone
    - domain: authelia.example.tld
      policy: bypass
    - domain: "*.example.tld"
      policy: bypass
      networks:
      - 'xx.xx.xx.xx/32' # My home IP. Use /32 for a single IP address
      - '192.168.0.0/16'   # My home network
    - domain: "*.example.tld"
      policy: two_factor
    - domain: "example.tld"
      policy: two_factor

Hope this helps someone!

LunaUrsa avatar Jun 12 '23 17:06 LunaUrsa

In your setup bypass from Authelia for home LAN and home Ip. In my case I have not static Home Ip and also cloudflare proxy....

masterwishx avatar Jun 13 '23 11:06 masterwishx