Skip to main content

Loopia update ip

Utility to keep your domains pointing to the current external IP-adress using the Loopia-API to update your adresses.

Required privileges for API-key in the LoopiaAPI control panel

Required privileges:

  • addSubdomain
  • removeZoneRecord
  • updateZoneRecord
  • addZoneRecord
  • getSubdomains
  • getZoneRecords
  • removeSubdomain

Docker - Preferred usage

The preferred way to run this service is a Docker container with the configuration provided as a docker-compose file.

Create the following file structure


\ loopia-update-ip
├──\ config
│  ├── config.yaml
├──\ logs
├── docker-compose.yaml

Docker compose file: docker-compose.yaml

services:
  ftp:
    image: registry.gitlab.com/niklasme/loopia-update-ip
    container_name: loopia-update-ip
    volumes:
      - ./config:/config
      - ./logs:/logs
    restart: unless-stopped

Service configuration file: config.yaml

credentials:
    loopia_username: xyz@loopiaapi
    loopia_password: abc
domains:
  'mydomain.com':
    sub_domains:
      - www
      - video
    ttl: 3600

Start Docker container service

docker compose up

Verify that no errors are thrown and that your credentials are accepted. Press Ctrl-C to stop the service and relaunch in detached mode.

docker compose up -d

You can always check logs in the output file:

cat ./logs/loopia_update_ip.log

or by ouputing the logs from the Docker container

#> docker ps
CONTAINER ID   IMAGE                                           COMMAND                  CREATED          STATUS                 PORTS                                                                                      NAMES  
fc1a6ff4debd   registry.gitlab.com/niklasme/loopia-update-ip   "loopia-update-ip-se…"   10 minutes ago   Up 9 minutes                                                                                                      loopia-update-ip

#> docker logs fc1a6ff4debd

Example of log output:

 Starting service
 Logging to: /logs/loopia_update_ip.log
 Docker configuration file found!
 Domain: www.mydomain.com: Zone record 123.123.123.123 - External IP 123.123.123.123
	 No update required!
 Domain: video.mydomain.com: Zone record 123.123.123.123 - External IP 123.123.123.123
	 No update required!
 Domain: ftp.mydomain.com: Zone record 123.123.123.123 - External IP 123.123.123.123
	 No update required!
 Domain: docs.mydomain.com: Zone record 213.213.213.213 - External IP 123.123.123.123

 Updating zone record to 123.123.123.123 for docs.mydomain.com
 Domain: security.mydomain.com: Zone record 123.123.123.123 - External IP 123.123.123.123
	 No update required!
2024-03-30 17:14:37,637 - root - INFO - External IP-address is still 123.123.123.123
2024-03-30 17:14:55,707 - root - INFO - External IP-address is still 123.123.123.123
2024-03-30 17:15:13,765 - root - INFO - External IP-address is still 123.123.123.123

Python module usage

In default mode the external IP-adress will be fetched from internet and applied to the full domain name with ttl=3600

loopia-update-ip --username xyz@loopiaapi --password YourToken --domain www.mydomain.com

To set a specific IP-address and not resolve from internet

loopia-update-ip --username xyz@loopiaapi --password YourToken --domain www.mydomain.com  --ip 123.123.123.123

To start the service to continuously monitor if the external IP-address changes

loopia-update-ip-service --username xyz@loopiaapi --password YourToken --domain www.mydomain.com

You may save your configuration in the same way as for the Docker configuration. The configuration should the in your home folder at the following location:

~/.config/loopia_update_ip/config.yaml

Use the same syntax as described for Docker under section Service configuration file: config.yaml

Development only

Build Docker image locally

docker build -t loopia-update-ip
docker compose up

Metadata

Release files for loopia-update-ip 0.5.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loopia-update-ip 0.5.5
File Size Uploaded Provenance Actions
loopia_update_ip-0.5.5.tar.gz 23.3 kB Without provenance Details for loopia_update_ip-0.5.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for loopia-update-ip 0.5.5
File Interpreter ABI Platform Actions
loopia_update_ip-0.5.5-py3-none-any.whl Python 3 none any Details for loopia_update_ip-0.5.5-py3-none-any.whl

Total release size: 46.8 kB

Release files / loopia_update_ip-0.5.5.tar.gz

Download URL loopia_update_ip-0.5.5.tar.gz
Size 23.3 kB
Tags Source
SHA-256 checksum
How to use checksums
51b426c705d15e830f1db1608c99ab2ab0d25c9749177541bcffd858f27e1db6
BLAKE2b-256 checksum
How to use checksums
577bd491acfa93beb5574f050fc60563d032f2ae9e0bfaaa7fd1842b3115ffcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.10

Release files / loopia_update_ip-0.5.5-py3-none-any.whl

Download URL loopia_update_ip-0.5.5-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
561e2af6786097347187ea1dcc0f326dd2d80d740fb5efd67d6d77fe3111ee8f
BLAKE2b-256 checksum
How to use checksums
4e51cd450e5e563df0f75c464733ad5bb06d7e6166c6792833966f91f5981726
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.10

Security for loopia-update-ip 0.5.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page