Skip to content

Added 'public_ip' as an option for periphery configuration - #1568

Open
KapralMark wants to merge 3 commits into
moghtech:mainfrom
KapralMark:feat/periphery_public_ip_config
Open

Added 'public_ip' as an option for periphery configuration#1568
KapralMark wants to merge 3 commits into
moghtech:mainfrom
KapralMark:feat/periphery_public_ip_config

Conversation

@KapralMark

Copy link
Copy Markdown

Summary

Adds a public_ip option to Periphery (env: PERIPHERY_PUBLIC_IP) that
sets the host address explicitly instead of resolving it via OpenDNS.

Why

Periphery discovers the host public IP by querying the OpenDNS resolvers.
On air-gapped/offline networks that query can't be executed, and it causes the 'Server'
page to show Unknown IP for the machine.

Changes

File Change
client/core/rs/src/entities/config/periphery.rs added support for public_ip
bin/periphery/src/config.rs reads public_ip environment value, falling back to the config value
bin/periphery/src/state.rs tries to get public_ip instead of querying the OpenDNS resolvers
config/periphery.config.toml documented public_ip

Behavior

  • Set -> the DNS lookup is skipped and the set value is used.
  • Empty, whitespace, or unset -> existing OpenDNS behavior, unchanged.

Quick note: This change is cosmetic only. The public_ip value isn't used in any place other than the 'Server' tab.

Testing

  • cargo build - succeeds.
  • cargo test - succeeds.
  • rustfmt --check - succeeds.
  • With PERIPHERY_PUBLIC_IP set as an environment variable, the Server page shows the configured
    value and doesn't try to send an OpenDNS query.
  • With it unset, periphery uses OpenDNS, same as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant