Skip to content

feat: add allowed_hosts and trusted_networks to host resource - #340

Open
andopando19 wants to merge 1 commit into
devopsarr:mainfrom
andopando19:feat/host-allowed-hosts
Open

andopando19 wants to merge 1 commit into
devopsarr:mainfrom
andopando19:feat/host-allowed-hosts

Conversation

@andopando19

Copy link
Copy Markdown

Fixes #339

Current Radarr rejects saving the host config without Allowed Hosts unless authentication is required for everyone, so radarr_host can't be applied any more. This adds allowed_hosts and trusted_networks to the radarr_host resource and data source.

Behaviour

  • Both are optional sets of strings. If they're left out, the current value from Radarr is kept, so existing configs keep working without changes. On create, the provider reads the current values first so it never sends an empty value.
  • The API stores them as comma-separated strings. The provider splits them into sets and joins them with ", " when sending. Radarr reformats trustedNetworks on save (a,b comes back as a, b), so a plain string attribute would give "inconsistent result after apply" errors.

Tests

  • The host acceptance test now sets allowed_hosts, because the test config uses required = "disabledForLocalAddresses", which Radarr now rejects without allowed hosts. It also sets trusted_networks and checks both after create and update.
  • Example and docs are updated.
  • The host resource and data source acceptance tests pass against Radarr 6.4.4.10685. I also checked by hand that a config without either attribute keeps the existing values and plans clean afterwards.

Depends on

A radarr-go release that includes allowedHosts and trustedNetworks on HostConfigResource, generated with devopsarr/sdk-generator#585. This branch won't compile until then. I'll add the go.mod bump once it's released.

🤖 Generated with Claude Code

Recent versions reject the host config without allowed hosts unless
authentication is required for everyone, so the resource could no longer
be applied. Both attributes are optional and default to the current value.

Requires a radarr-go release that includes allowedHosts and trustedNetworks
in HostConfigResource.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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