### Detection Filter with Grouped Expressions Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown This example illustrates using parentheses to group expressions within a detection filter, demonstrating a negated OR condition for IP ranges. ```shell !(addr-in(10.0.0.0/8) || addr-in(192.168.0.0/16)) ``` -------------------------------- ### Run from Source with Go Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown Run the Cloudflare DDNS updater directly from its Go source code. This requires the Go toolchain to be installed. Set the CLOUDFLARE_API_TOKEN, DOMAINS, and PROXIED environment variables. ```bash CLOUDFLARE_API_TOKEN=YOUR-CLOUDFLARE-API-TOKEN \ DOMAINS=example.org,www.example.org,example.io \ PROXIED=true \ go run github.com/favonia/cloudflare-ddns/cmd/ddns@latest ``` -------------------------------- ### IPv4 Detection Filter Example Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown This example demonstrates how to configure an IPv4 detection filter to keep only addresses within a specific CIDR range. ```shell IP4_DETECTION_FILTER=addr-in(198.51.100.0/24) ``` -------------------------------- ### Docker Compose Setup with File-Based IPs for Testing Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown Sets up the updater to read IP addresses from local files (ip4.txt, ip6.txt) for testing simulated IP changes. Ensure the files exist and contain one IP per line. Remove test files and volumes after testing. ```yaml environment: - DOMAINS=ddns-test.example.org - IP4_PROVIDER=file:/ip4.txt - IP6_PROVIDER=file:/ip6.txt volumes: - $PWD/ip4.txt:/ip4.txt - $PWD/ip6.txt:/ip6.txt ``` -------------------------------- ### IPv6 Detection Filter with Negation Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown This example demonstrates an IPv6 detection filter that excludes addresses within a specific private range. ```shell IP6_DETECTION_FILTER=!addr-in(fc00::/7) ``` -------------------------------- ### Docker Compose Setup with Static IPs for Testing Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown Configures the updater to use static IP addresses for validation and testing. This is useful for testing without waiting for real IP changes. Remember to switch to production values after testing. ```yaml environment: - DOMAINS=ddns-test.example.org - IP4_PROVIDER=static:203.0.113.10 - IP6_PROVIDER=static:2001:db8::10 ``` -------------------------------- ### IPv4 Detection Filter with OR Condition Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown This example shows an IPv4 detection filter that keeps addresses within a CIDR range OR matching a specific IP address. ```shell IP4_DETECTION_FILTER=addr-in(198.51.100.0/24) || addr-in(203.0.113.7/32) ``` -------------------------------- ### Configure cloudflare_ddns environment variables on OpenBSD Source: https://github.com/favonia/cloudflare-ddns/blob/main/contrib/README.markdown Define environment variables for the cloudflare_ddns daemon in /etc/login.conf. Ensure values are not quoted. This example sets EMOJI to false and specifies API token and domains. ```sh cloudflare_ddns:\ :setenv=EMOJI=false,CLOUDFLARE_API_TOKEN=YOUR-CLOUDFLARE-API-TOKEN,DOMAINS=YOUR-DOMAINS:\ :tc=daemon: ``` -------------------------------- ### Static IP Address Provider Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown Uses explicit IP addresses or CIDR notation as a fixed set, separated by commas. Primarily for tests, debugging, and special fixed-input setups. ```text static:,,... ``` -------------------------------- ### Multi-line Text Format for IP Addresses Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown A line-based text format for multiple IP addresses or CIDR notations, used by URL and file providers. Blank lines are ignored, and '#' starts a comment. ```txt # Bare addresses 198.51.100.1 198.51.100.2 # Addresses in CIDR notation 198.51.100.0/24 198.51.100.128/25 # inline comments are supported ``` -------------------------------- ### Build and Type-Check Hostid6 Proofs Source: https://github.com/favonia/cloudflare-ddns/blob/main/proofs/README.markdown Builds the Hostid6 component in Lean 4, which type-checks all theorems. A 'sorry' in a proof will result in a build warning. ```sh cd proofs && lake build Hostid6 ``` -------------------------------- ### Run Docker Image Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown Execute the Cloudflare DDNS updater as a Docker container. Ensure you have a Cloudflare API token with appropriate permissions and set the DOMAINS and PROXIED environment variables. ```bash docker run \ --network host \ -e CLOUDFLARE_API_TOKEN=YOUR-CLOUDFLARE-API-TOKEN \ -e DOMAINS=example.org,www.example.org,example.io \ -e PROXIED=true \ favonia/cloudflare-ddns:1 ``` -------------------------------- ### Pull and Run Cloudflare DDNS Container Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown Pulls the latest Docker image for cloudflare-ddns and starts the container in detached mode. Use 'docker-compose logs cloudflare-ddns' to check its status. ```bash docker-compose pull cloudflare-ddns docker-compose up --detach --build cloudflare-ddns ``` -------------------------------- ### Build and Run the Oracle Binary Source: https://github.com/favonia/cloudflare-ddns/blob/main/proofs/README.markdown Builds the standalone oracle binary used for differential testing. This binary acts as a persistent process for request-response interactions. ```sh cd proofs && lake build oracle ``` -------------------------------- ### Create cloudflare_ddns user on OpenBSD Source: https://github.com/favonia/cloudflare-ddns/blob/main/contrib/README.markdown Use this command to create a dedicated user for the cloudflare-ddns daemon with no login shell and a home directory at /var/empty. ```sh useradd -s /sbin/nologin -d /var/empty _cloudflare_ddns ``` -------------------------------- ### Run Differential Test with Lean Oracle Source: https://github.com/favonia/cloudflare-ddns/blob/main/proofs/README.markdown Executes a differential test comparing the hostid6.Derive Go implementation against the Lean oracle. Requires the oracle binary to be built and available. ```sh cd proofs && lake build oracle && cd .. HOSTID6_LEAN_ORACLE="$PWD/proofs/.lake/build/bin/oracle" go test -tags lean_oracle ./internal/hostid6/... ``` -------------------------------- ### Docker Compose Setup to Reconcile Manual DNS Edits Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown Disables the cache for Cloudflare API responses by setting CACHE_EXPIRATION to '1ns'. This allows the updater to immediately reconcile DNS records changed directly in Cloudflare. Restore the default setting afterward. ```yaml environment: - CACHE_EXPIRATION=1ns ``` -------------------------------- ### Detection Lifecycle Placement Source: https://github.com/favonia/cloudflare-ddns/blob/main/docs/designs/features/detection-filter.markdown Illustrates where the detection filter is applied within the detection and derivation lifecycle. It runs after provider output normalization and before derivation. ```text detection: provider -> normalization -> filter derivation -> reconciliation ``` -------------------------------- ### Static Empty Provider Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown Clears existing managed content for the selected IP family. Use this to reset configurations without restarting the updater. ```text static.empty ``` -------------------------------- ### Verify Docker Image with Cosign Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown You can verify that the Docker images were built from this repository using cosign. This command checks the image identity and OIDC issuer. ```bash cosign verify favonia/cloudflare-ddns:1 \ --certificate-identity-regexp https://github.com/favonia/cloudflare-ddns/ \ --certificate-oidc-issuer https://token.actions.githubusercontent.com ``` -------------------------------- ### None Provider Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown Stops managing the specified IP family for the current run, preserving existing managed DNS records and WAF list items. ```text none ``` -------------------------------- ### Test Cloudflare Connectivity with Alpine Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown Use these commands to test DNS resolution and HTTPS connectivity to Cloudflare from within a Docker environment. This helps diagnose network issues if IP detection fails. ```bash docker run --rm alpine nslookup api.cloudflare.com ``` ```bash docker run --rm alpine wget -qO- https://api.cloudflare.com/cdn-cgi/trace ``` -------------------------------- ### Per-domain IPv6 Host ID Configuration Source: https://github.com/favonia/cloudflare-ddns/blob/main/CHANGELOG.markdown Configure specific IPv6 host IDs for domains, allow preserving detected host IDs, or compute EUI-64 host IDs from MAC addresses. ```shell IP6_DOMAINS=sub.example.com{hostid6=::2} ``` ```shell IP6_DOMAINS=sub.example.com{hostid6=preserve} ``` ```shell IP6_DOMAINS=sub.example.com{hostid6=mac(77:cc:a7:f9:45:94)} ``` ```shell DOMAINS=sub1.example.com{hostid6=::aad1},sub2.example.com{hostid6=preserve} ``` -------------------------------- ### Verify Hostid6 Changes Source: https://github.com/favonia/cloudflare-ddns/blob/main/proofs/README.markdown A maintenance rule requiring verification of Hostid6 changes by rebuilding the Lean proofs and running the differential test. This ensures consistency between the Go implementation and its formal model. ```sh cd proofs && lake build Hostid6 # type-checks every theorem; warns on any sorry HOSTID6_LEAN_ORACLE="$PWD/proofs/.lake/build/bin/oracle" go test -tags lean_oracle ./internal/hostid6/... ``` -------------------------------- ### URL Provider with IPv6 Connection Source: https://github.com/favonia/cloudflare-ddns/blob/main/README.markdown Fetches the IP address from a URL, always connecting to that URL over IPv6. Supports CIDR notation and multiple-address text format. ```text url.via6: ``` -------------------------------- ### Configuring Record Comment in Cloudflare DDNS Source: https://github.com/favonia/cloudflare-ddns/blob/main/CHANGELOG.markdown This snippet demonstrates how to configure the comment for newly created DNS records. By default, the comment is empty, but it can be set using the RECORD_COMMENT environment variable to restore previous behavior. ```bash RECORD_COMMENT=Created by cloudflare-ddns ```