simao-silva / noip-renewer

Renewing No-IP hosts by browser automation
https://hub.docker.com/r/simaofsilva/noip-renewer
MIT License
76 stars 23 forks source link

unable to use TOTP #221

Closed daNutzzzzz closed 3 weeks ago

daNutzzzzz commented 1 month ago

Hi, linked to https://github.com/simao-silva/noip-renewer/issues/200

im still getting account blocked...

docker run --rm --name=noip-renewer --network=bridge-net --env NO_IP_USERNAME=REDCATED --env NO_IP_PASSWORD=REDCATED --env NO_IP_TOTP_KEY=REDCATED simaofsilva/noip-renewer:latest
Using user agent "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:109.0) Gecko/20100101 Firefox/121.0"
Opening browser
Could not login. Check if account is blocked.
simao-silva commented 1 month ago

Hi, Can you again using image simaofsilva/noip-renewer:c01467b-alpine?

daNutzzzzz commented 1 month ago

Hi, Can you again using image simaofsilva/noip-renewer:c01467b-alpine?

Same results

Using user agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Safari/605.1.15" Opening browser Could not login. Check if account is blocked.

simao-silva commented 1 month ago

Can you login on a browser without issues? Are you redirected to the dashboard right after you enter the TOTP code?

daNutzzzzz commented 1 month ago

Can you login on a browser without issues? Are you redirected to the dashboard right after you enter the TOTP code?

Yes i login fine after TOTP code and it takes me to dashboard.

ray1025 commented 1 month ago

Please check your computer's clock accuracy using this website: https://time.is/. The TOTP key requires the correct time to function properly.

daNutzzzzz commented 1 month ago

Please check your computer's clock accuracy using this website: https://time.is/. The TOTP key requires the correct time to function properly.

Hi, the clock is running correctly.

ray1025 commented 1 month ago

You mentioned that you've pulled the latest image, your computer's clock is correct, and your account is fine. The last issue might be an incorrect TOTP_KEY. Please make sure to double-check your TOTP_KEY. The TOTP_KEY is displayed only once when you initially enable 2FA, right under the QR code. If you didn't save it, you can disable and then re-enable 2FA to generate a new one. For more details, please refer to this link.

ray1025 commented 1 month ago

Here is the script I use for automated execution. It has been running successfully for over 10 days:

docker pull simaofsilva/noip-renewer
docker run --rm --env NO_IP_USERNAME="EMAIL" --env NO_IP_PASSWORD="PASSWORD" --env NO_IP_TOTP_KEY="KEY" simaofsilva/noip-renewer
daNutzzzzz commented 1 month ago

You mentioned that you've pulled the latest image, your computer's clock is correct, and your account is fine. The last issue might be an incorrect TOTP_KEY. Please make sure to double-check your TOTP_KEY. The TOTP_KEY is displayed only once when you initially enable 2FA, right under the QR code. If you didn't save it, you can disable and then re-enable 2FA to generate a new one. For more details, please refer to this link.

# Hi Ray, that is the key im using

daNutzzzzz commented 1 month ago

Here is the script I use for automated execution. It has been running successfully for over 10 days:

docker pull simaofsilva/noip-renewer
docker run --rm --env NO_IP_USERNAME="EMAIL" --env NO_IP_PASSWORD="PASSWORD" --env NO_IP_TOTP_KEY="KEY" simaofsilva/noip-renewer

Pretty much the same as mine

ray1025 commented 1 month ago

@daNutzzzzz Please use this image for testing: raymond1025/noip-renewer-dev I've added a feature to detect errors with the two-factor authentication code.

daNutzzzzz commented 1 month ago

@daNutzzzzz Please use this image for testing: raymond1025/noip-renewer-dev I've added a feature to detect errors with the two-factor authentication code.

thank you, it said invalid code albeit the one i took from the site so i will reset my 2FA and retry.

Ok i reset it and tried with the new code and get the same error "invalid code"

ray1025 commented 1 month ago

If you've changed and double-checked your TOTP KEY and are still getting an "Invalid code..." error, it's likely an issue with your device's clock. Could you try using a different device?

daNutzzzzz commented 1 month ago

If you've changed and double-checked your TOTP KEY and are still getting an "Invalid code..." error, it's likely an issue with your device's clock. Could you try using a different device?

Date is correct

image

Same error on another device

ray1025 commented 1 month ago

Please use this image for testing: raymond1025/noip-renewer-dev-v2 In this version, I’ve added a feature to sync the clock using Google's NTP server.

daNutzzzzz commented 1 month ago

Please use this image for testing: raymond1025/noip-renewer-dev-v2 In this version, I’ve added a feature to sync the clock using Google's NTP server.

thanks, tired on both machines and still "invalid code" :(

ray1025 commented 1 month ago

Sorry...I'm really out of ideas at this point...

daNutzzzzz commented 1 month ago

Sorry...I'm really out of ideas at this point...

its ok, i truly appreciate the support you've given.

Kucharskov commented 4 weeks ago

Comment moved to https://github.com/simao-silva/noip-renewer/issues/225

Kucharskov commented 4 weeks ago

Hi, Can you again using image simaofsilva/noip-renewer:c01467b-alpine?

When i used this specified image it works perfectly :)

daNutzzzzz commented 4 weeks ago

Hi guys (mostly @simao-silva)! I have simmilar issue, but my output is a little bit bigger:

Using user agent "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:109.0) Gecko/20100101 Firefox/121.0"
Opening browser
Traceback (most recent call last):
  File "/app/renew.py", line 146, in <module>
    totp_input.send_keys(totp.now())
  File "/opt/venv/lib/python3.12/site-packages/selenium/webdriver/remote/webelement.py", line 231, in send_keys
    self._execute(
  File "/opt/venv/lib/python3.12/site-packages/selenium/webdriver/remote/webelement.py", line 395, in _execute
    return self._parent.execute(command, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute
    self.error_handler.check_response(response)
  File "/opt/venv/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: Element <input id="challenge_code" name="challenge_code" type="hidden"> is not reachable by keyboard
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5
ElementNotInteractableError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:353:5
webdriverSendKeysToElement@chrome://remote/content/marionette/interaction.sys.mjs:668:13
interaction.sendKeysToElement@chrome://remote/content/marionette/interaction.sys.mjs:642:11
sendKeysToElement@chrome://remote/content/marionette/actors/MarionetteCommandsChild.sys.mjs:540:29
receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.sys.mjs:150:31

i think you need to open your own ticket as it doesnt look the same as mine.,

simao-silva commented 4 weeks ago

@daNutzzzzz are you still getting issues with TOTP?

daNutzzzzz commented 4 weeks ago

@daNutzzzzz are you still getting issues with TOTP?

unfortunately yes and noip support is run by a bot :(

simao-silva commented 4 weeks ago

@daNutzzzzz can you try again using image simaofsilva/noip-renewer:debug? Check for line with message 2FA code: and see if the TOTP code this script is going to use matches the code generate by your TOTP generator app.

daNutzzzzz commented 3 weeks ago

ok so ive tried again, the issue i have is that it takes so long to process that i run through multiple 2fa code on my auth app to be able to match the code the script outputs.

edit: ive re-reun the script and recorded all the codes generated in that time and the code the scrip outputs doesn't match any of them.

simao-silva commented 3 weeks ago

Try running with -e TZ=YOUR TIMEZONE , e.g. -e TZ=Europe/London, and see if the codes still do not match.

daNutzzzzz commented 3 weeks ago

Try running with -e TZ=YOUR TIMEZONE , e.g. -e TZ=Europe/London, and see if the codes still do not match.

Hi, i did and no it still fails.

daNutzzzzz commented 3 weeks ago

Using user agent "Mozilla/5.0 (X11; Linux i686; rv:115.0) Gecko/20100101 Firefox/115.0" Opening browser Login successful Confirming hosts phase Checking if host "xxxxxxxx.net" needs confirmation Host "xxxxxxxx.net" confirmed Error: Message: The element with the reference 2f1e69f5-af35-4f84-9da4-cc5de0a7de80 is stale; either its node document is not the active document, or it is no longer connected to the DOM; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception Stacktrace: RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8 WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5 StaleElementReferenceError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:725:5 getKnownElement@chrome://remote/content/marionette/json.sys.mjs:401:11 deserializeJSON@chrome://remote/content/marionette/json.sys.mjs:259:20 cloneObject@chrome://remote/content/marionette/json.sys.mjs:59:24 deserializeJSON@chrome://remote/content/marionette/json.sys.mjs:289:16 cloneObject@chrome://remote/content/marionette/json.sys.mjs:59:24 deserializeJSON@chrome://remote/content/marionette/json.sys.mjs:289:16 json.deserialize@chrome://remote/content/marionette/json.sys.mjs:293:10 receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.sys.mjs:72:30

Logging off

This has nothing to do with the issue im experiencing, please create your own issue.

ray1025 commented 3 weeks ago

@daNutzzzzz Hello, I've used Synology NAS, Windows 11, VPS (Ubuntu Server), and GitHub Actions, but I couldn't reproduce the error. Could you let me know what device you’re running Docker on?

daNutzzzzz commented 3 weeks ago

@daNutzzzzz Hello, I've used Synology NAS, Windows 11, VPS (Ubuntu Server), and GitHub Actions, but I couldn't reproduce the error. Could you let me know what device you’re running Docker on?

  1. Ubuntu/Debian Docker Servers
  2. Can you share your github actions and i'll test..
ray1025 commented 3 weeks ago

@daNutzzzzz Here's the Workflow file I use. You can modify the "docker_image:" to run the image you prefer. For instructions on how to set up secrets, please refer to this link.

name: noip-renewer-dev

on:
  workflow_dispatch:

jobs:
  checkin:
    runs-on: ubuntu-latest
    env:
      docker_image: simaofsilva/noip-renewer:debug

    steps:
      - name: Pull noip-renewer
        run: docker pull $docker_image

      - name: Run noip-renewer
        run: docker run --rm --env NO_IP_USERNAME="${{ secrets.NOIP_USERNAME }}" --env NO_IP_PASSWORD="${{ secrets.NOIP_PASSWORD }}" --env NO_IP_TOTP_KEY="${{ secrets.NOIP_OTP }}" $docker_image
        continue-on-error: true

Screenshot: 2024-06-06

daNutzzzzz commented 3 weeks ago

@daNutzzzzz Here's the Workflow file I use. You can modify the "docker_image:" to run the image you prefer. For instructions on how to set up secrets, please refer to this link.

name: noip-renewer-dev

on:
  workflow_dispatch:

jobs:
  checkin:
    runs-on: ubuntu-latest
    env:
      docker_image: simaofsilva/noip-renewer:debug

    steps:
      - name: Pull noip-renewer
        run: docker pull $docker_image

      - name: Run noip-renewer
        run: docker run --rm --env NO_IP_USERNAME="${{ secrets.NOIP_USERNAME }}" --env NO_IP_PASSWORD="${{ secrets.NOIP_PASSWORD }}" --env NO_IP_TOTP_KEY="${{ secrets.NOIP_OTP }}" $docker_image
        continue-on-error: true

Screenshot: 2024-06-06

Thanks Ray,

Ive run this and it failed with the current code, so ive tried disabling and re-enabling 2FA on noip dashboard two more times and finally its now working! both in GH Actions and in my homelab.

Thank you @ray1025 @simao-silva for your continued support with this, it clearly is an issue with the NOIP TOTP keys being issued, that i have raised with them but they dont care.