Open ShlomiD83 opened 11 months ago
Good idea. I realised your request in the last PR #17 😄
Now you can setup a FREQUENCY_MINUTES
param in the ENV variables.
This is an integer that indicates every how many minutes the IP will be updated.
Hi @derogab,
thanks for the quick update but the latest image throws an error on startup.
2023-10-31T05:12:37.805859529Z TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
2023-10-31T05:12:38.906928900Z Traceback (most recent call last):
2023-10-31T05:12:38.906971383Z File "/usr/src/app/./app.py", line 48, in
I've set my FREQUENCY_MINUTES to 5 in my .env file, but even without it the error persists.
So, your .env
file is something like...
NOIP_USER=yourusername
NOIP_PASSWORD=yourpassword
NOIP_HOSTNAME=yourhost.domain.com
FREQUENCY_MINUTES=5
Correct?
So, your
.env
file is something like...NOIP_USER=yourusername NOIP_PASSWORD=yourpassword NOIP_HOSTNAME=yourhost.domain.com FREQUENCY_MINUTES=5
Correct?
Yes, that's correct.
Just released an update with PR #18.
It improve the get of the custom frequency value and it allow you to check if you setup custom frequency correctly. It should no longer fail by giving you that error, but it may still give you a DEBUG log if the custom frequency is not set.
Make sure you
.env.template
to .env
file.FREQUENCY_MINUTES
in the .env
fileLet me know :)
I've correctly cloned .env.template to .env file. but it ignores my setting and defaults to 15 minutes.
2023-10-31T09:06:53.208198309Z [DEBUG] Custom frequency is not set. Setting default (15). 2023-10-31T09:06:53.208319654Z [INFO] Ready to update every 15 minute(s). 2023-10-31T09:06:53.208335591Z [INFO] App started.
I've added the env variables to my stack directly and now it seems to check every 5 minutes.
version: '3' services: no-ip-updater: container_name: no-ip-updater image: ghcr.io/derogab/no-ip-updater:latest restart: unless-stopped environment:
edit: it seems to fail checking, I'll try another way.
2023-10-31T09:06:53.208198309Z [DEBUG] Custom frequency is not set. Setting default (15).
This is confirmation that for some reason the .env file is not loading correctly from your execution.
It could be that the PATH from which you started the docker-compose
command was not-standard. For example, it often happens when you start docker-compose from a folder other than ./
or you have the .env
file in a different folder (unless you specify the correct path in docker-compose).
I'm using Portainer, I've uploaded the .env files from the GUI.
environment:
- NOIP_USER=myusername
- NOIP_PASSWORD=mypassword
- NOIP_HOSTNAME=myhost.domain.com
- FREQUENCY_MINUTES=5
It seems to be a good alternative.
it seems to fail checking, I'll try another way.
Do you mean the IP update?
it seems to fail checking, I'll try another way.
Do you mean the IP update?
2023-10-31T09:39:16.489714348Z [INFO] Ready to update every 5 minute(s). 2023-10-31T09:39:16.489786931Z [INFO] App started. 2023-10-31T09:44:17.272012435Z Traceback (most recent call last): 2023-10-31T09:44:17.272102246Z File "/usr/local/lib/python3.12/site-packages/urllib3/util/url.py", line 425, in parse_url 2023-10-31T09:44:17.272441216Z host, port = _HOST_PORT_RE.match(host_port).groups() # type: ignore[union-attr] 2023-10-31T09:44:17.272871898Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-10-31T09:44:17.273024127Z AttributeError: 'NoneType' object has no attribute 'groups' 2023-10-31T09:44:17.273055001Z 2023-10-31T09:44:17.273074468Z The above exception was the direct cause of the following exception: 2023-10-31T09:44:17.273094401Z 2023-10-31T09:44:17.273117459Z Traceback (most recent call last): 2023-10-31T09:44:17.273131047Z File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 434, in prepare_url 2023-10-31T09:44:17.273584324Z scheme, auth, host, port, path, query, fragment = parse_url(url) 2023-10-31T09:44:17.273982174Z ^^^^^^^^^^^^^^ 2023-10-31T09:44:17.274047178Z File "/usr/local/lib/python3.12/site-packages/urllib3/util/url.py", line 451, in parse_url 2023-10-31T09:44:17.274497114Z raise LocationParseError(source_url) from e 2023-10-31T09:44:17.274644776Z urllib3.exceptions.LocationParseError: Failed to parse: https://username:password@dynupdate.no-ip.com/nic/update?hostname=example.ddns.com&myip=1.2.3.4 2023-10-31T09:44:17.274677437Z 2023-10-31T09:44:17.274698057Z During handling of the above exception, another exception occurred: 2023-10-31T09:44:17.274718697Z 2023-10-31T09:44:17.274736512Z Traceback (most recent call last): 2023-10-31T09:44:17.274759574Z File "/usr/src/app/./app.py", line 27, in update_ip 2023-10-31T09:44:17.275002763Z r = requests.get("https://{}:{}@dynupdate.no-ip.com/nic/update?hostname={}&myip={}".format(USER, PASSWORD, HOSTNAME, ip)) 2023-10-31T09:44:17.275719355Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-10-31T09:44:17.275758624Z File "/usr/local/lib/python3.12/site-packages/requests/api.py", line 73, in get 2023-10-31T09:44:17.276048085Z return request("get", url, params=params, kwargs) 2023-10-31T09:44:17.276415045Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-10-31T09:44:17.276492063Z File "/usr/local/lib/python3.12/site-packages/requests/api.py", line 59, in request 2023-10-31T09:44:17.276753427Z return session.request(method=method, url=url, kwargs)
that's the error I get when setting the env variables directly in my stack via Portainer.
I think I found a workaround. I've set the username, password & hostname via an env file, and the update frequency via an environment variable in my stack. it seems to work and check & update every 5 minutes now.
Hi @derogab , new error after updating to the latest version.
2023-11-01T11:15:18.813780831Z [ERROR] No-IP credentials are not set.
credentials are set via an .env file like before.
Hi, Is it possible to change the cron schedule via env variables?