533 Commits

Author SHA1 Message Date
Adam Nadrowski
75506536fa Merge pull request #3 from shadyeip/ci/auto-release-on-main
ci: auto-release with date-based versioning on merge to main
v2026.02.09
2026-02-09 12:48:03 -05:00
Adam Nadrowski
a65f546776 ci: auto-release with date-based versioning on merge to main
Release workflow now triggers on push to main and auto-generates
date-based version tags (v2026.02.09, v2026.02.09.1, etc.).
Manual dispatch and explicit v* tags still work.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 12:47:36 -05:00
Adam Nadrowski
a9d8e8005e Merge pull request #2 from shadyeip/ci/improve-workflows
ci: restrict acceptance tests to manual dispatch only
2026-02-09 12:43:56 -05:00
Adam Nadrowski
32510c0a75 ci: restrict acceptance tests to manual dispatch only
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 12:42:01 -05:00
Adam Nadrowski
d9f0c626d5 Merge pull request #1 from shadyeip/ci/improve-workflows
ci: add PR validation and fix workflows for go-unifi dependency
2026-02-09 12:41:07 -05:00
Adam Nadrowski
fb2d9762d8 ci: remove PR trigger from acceptance tests
Acceptance tests require a running UniFi controller and are too
heavyweight to run on every PR. They still run on push to main,
daily schedule, and manual workflow_dispatch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 12:34:52 -05:00
Adam Nadrowski
ff67359ba4 ci: add PR validation checks and fix workflows for go-unifi dependency
- CI: run gofmt, go vet, and golangci-lint on PRs; full build on merge to main
- Release: checkout go-unifi alongside provider, add manual dispatch trigger,
  make GPG signing optional

Both workflows now checkout shadyeip/go-unifi to satisfy the replace directive
in go.mod.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 12:29:37 -05:00
Adam Nadrowski
a56df16830 fix: use local go-unifi with omitempty fix for zone policy bug
Switch go-unifi dependency from remote fork to local module which includes
the fix for empty string fields (firewall_zone_id, etc.) being sent in
network API requests, causing all zone policies to disappear from the UI.

Also updates Makefile with cross-compile and deploy targets, and README
with self-contained build/install instructions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 23:00:11 -05:00
shadyeip
13da1c0347 docs: add installation instructions for fork 2026-02-05 15:33:33 -05:00
shadyeip
4de7c8c5ec feat: add destination.network_ids support to unifi_firewall_zone_policy
- Add NetworkIDs and MatchOppositeNetworks to destination model
  - Add network_ids schema attribute to destination block
  - Handle NETWORK matching target in AsUnifiModel and mergeDestination
  - Update go.mod to use shadyeip/go-unifi fork with destination network support
2026-02-05 15:30:21 -05:00
shadyeip
61ff63c1d7 feat: add destination.network_ids support to firewall zone policy
- Add NetworkIDs and MatchOppositeNetworks to destination model
- Add schema attributes for destination.network_ids
- Handle NETWORK matching target in AsUnifiModel and mergeDestination
- Fix Port type conversion (int32 to string) for API compatibility
- Update go.mod to use local go-unifi with destination network support

Fixes: destination.network_ids silently ignored on update
2026-02-05 15:23:34 -05:00
shadyeip
8a8d180343 fix: handle empty network_group and ipv6_interface_type for WAN networks
WAN networks return empty values for these fields from the API, causing
perpetual drift against schema defaults. Now explicitly set defaults
when API returns empty for WAN networks.
2026-02-05 15:05:50 -05:00
shadyeip
4cbd40ac56 fix: make index field read-only in unifi_firewall_zone_policy
The UniFi API ignores index on create/update - ordering is controlled
via a separate batch-reorder endpoint. Making index computed-only
prevents "Provider produced inconsistent result after apply" errors.
2026-02-05 15:05:18 -05:00
dependabot[bot]
7dc512dff4 build(deps): bump golang.org/x/net from 0.37.0 to 0.38.0 in the go_modules group (#83)
build(deps): bump golang.org/x/net in the go_modules group

Bumps the go_modules group with 1 update: [golang.org/x/net](https://github.com/golang/net).


Updates `golang.org/x/net` from 0.37.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.37.0...v0.38.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-20 06:57:01 +02:00
Mateusz Filipowicz
b9284f7758 docs: improve documentation for 1.0.0 release (#75)
* docs: add examples and recreate TF documentation

* update readme

* add information about experimental support of firewall zones
2025-03-22 19:13:16 +01:00
Mateusz Filipowicz
a133383b43 feat: support customizing guest portal logo and background with unifi_portal_file and unifi_setting_guest_access resources (#74)
* feat: support customizing guest portal logo and background with `unifi_portal_file` and `unifi_setting_guest_access` resources

* ci: run acceptance tests on go.mod changes

* f
2025-03-22 17:31:30 +01:00
Mateusz Filipowicz
8dd4bfcb97 feat: support Firewall Zone Policy resources with unifi_firewall_zone_policy (#73)
* feat: support Firewall Zone Policy resources with `unifi_firewall_zone_policy`

* lint
2025-03-22 15:16:06 +01:00
Mateusz Filipowicz
cdc0254289 refactor: reorganize code to make it more readable (#71) 2025-03-21 11:52:55 +01:00
dependabot[bot]
86fdc0b27a build(deps): bump github.com/deckarep/golang-set/v2 from 2.7.0 to 2.8.0 (#62)
Bumps [github.com/deckarep/golang-set/v2](https://github.com/deckarep/golang-set) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/deckarep/golang-set/releases)
- [Commits](https://github.com/deckarep/golang-set/compare/v2.7.0...v2.8.0)

---
updated-dependencies:
- dependency-name: github.com/deckarep/golang-set/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mateusz Filipowicz <matfilipowicz@gmail.com>
2025-03-21 07:09:54 +01:00
dependabot[bot]
3ae1d7ec66 build(deps): bump golangci/golangci-lint-action from 6.5.1 to 6.5.2 (#65)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.5.1 to 6.5.2.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v6.5.1...v6.5.2)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-21 07:08:34 +01:00
dependabot[bot]
bd9b32c27b build(deps): bump github.com/hashicorp/terraform-plugin-testing from 1.11.0 to 1.12.0 (#67)
build(deps): bump github.com/hashicorp/terraform-plugin-testing

Bumps [github.com/hashicorp/terraform-plugin-testing](https://github.com/hashicorp/terraform-plugin-testing) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/hashicorp/terraform-plugin-testing/releases)
- [Changelog](https://github.com/hashicorp/terraform-plugin-testing/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/terraform-plugin-testing/compare/v1.11.0...v1.12.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/terraform-plugin-testing
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-21 07:08:01 +01:00
dependabot[bot]
b585a209aa build(deps): bump the go_modules group with 2 updates (#64)
Bumps the go_modules group with 2 updates: [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) and [github.com/docker/buildx](https://github.com/docker/buildx).


Updates `github.com/containerd/containerd/v2` from 2.0.2 to 2.0.4
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.0.2...v2.0.4)

Updates `github.com/docker/buildx` from 0.21.1 to 0.21.3
- [Release notes](https://github.com/docker/buildx/releases)
- [Commits](https://github.com/docker/buildx/compare/v0.21.1...v0.21.3)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/docker/buildx
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-21 07:01:49 +01:00
Mateusz Filipowicz
45ba7aace9 feat: support Firewall Zone resource and datasource (#70)
* feat: support Firewall Zone resource and datasource

* disable flaky test
2025-03-21 07:00:34 +01:00
Mateusz Filipowicz
ca21f79083 feat: support Guest Access settings with resource_setting_guest_access (#61)
* feat: support Guest Access settings with `resource_setting_guest_access`

* feat: add support for redirect after authentication in guest access settings

* feat: add support for Facebook authentication in guest access settings

* feat: add support for Google authentication in guest access settings

* feat: add support for RADIUS authentication in guest access settings

* feat: add support for Wechat authentication in guest access settings

* feat: add support for Facebook Wifi authentication in guest access settings

* feat: add support for restricted DNS servers

* feat: add support for guest portal UI customization

* feat: add support for restricted subnet in guest portal

* feat: retry client action on HTTP 401, but first attempt relogging in

* require controllr version 7.4 for several portal customization attributes

* enable acceptance tests workflow concurrency
2025-03-17 14:53:28 +01:00
Mateusz Filipowicz
28d28f17f6 feat: simplify unifi_setting_usg resource by making geo IP fitering and UPNP enabled fields only computed (#60)
* feat: simplify setting_usg resource by making geo IP fitering and UPNP enabled fields only computed

* rename block to mode
2025-03-16 23:56:32 +01:00
Mateusz Filipowicz
02d10929c9 feat: remove filter from dns_record datasource and use plain structure (#58) 2025-03-16 16:25:50 +01:00
Mateusz Filipowicz
b269563553 ci: remove constraint on acceptance tests parallelism (#59) 2025-03-16 15:55:10 +01:00
Mateusz Filipowicz
ff14bd365f fix: user ip in user datasource is populated with localDnsRecord (#57)
* fix: user `ip` in user datasource is populated with `localDnsRecord`

* add test
2025-03-16 14:08:54 +01:00
Mateusz Filipowicz
e9600c6e06 feat: add support for Intrution Prevention System (IPS) settings with unifi_setting_ips resource (#56)
* feat: add support for Intrution Prevention System (IPS) settings with `unifi_setting_ips` resource

* require IPS features enabled on controller

* require version 7.4

* require version 7.5 for advanced_filtering_preference

* feat: use Remember Me to prolong session for user/pass authentication

* run some setting mgmt tests on 7.0+ due to auto_upgrade_hour not working until device is adopted and auto upgrade logic is different and not supported
2025-03-16 12:53:46 +01:00
Mateusz Filipowicz
8b6ff55a18 feat: completely support for all site-wide management settings in resource_setting_mgmt (#54)
* feat: completely support for all site-wide management settings in resource_setting_mgmt

* require controller version minimum 7.3 for debug_tools_enabled
2025-03-15 10:47:14 +01:00
Mateusz Filipowicz
fbb6296e9e refactor: migrate resource_setting_mgmt to Terraform Plugin Framework 2025-03-14 10:17:51 +01:00
dependabot[bot]
65f30999e9 build(deps): bump golangci/golangci-lint-action from 6.5.0 to 6.5.1 (#48)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.5.0 to 6.5.1.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v6.5.0...v6.5.1)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 07:32:22 +01:00
dependabot[bot]
55e6bbb4e9 build(deps): bump github.com/golangci/golangci-lint from 1.64.6 to 1.64.7 (#49)
build(deps): bump github.com/golangci/golangci-lint

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.64.6 to 1.64.7.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.64.6...v1.64.7)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 07:30:07 +01:00
Mateusz Filipowicz
7440febd10 feat: add support for UniFi Switch (USW) settings with unifi_setting_usw resource (#53) 2025-03-14 07:19:45 +01:00
Mateusz Filipowicz
34c495021f fix: invalid handling of site of DNS resource and datasources (#52) 2025-03-14 01:03:09 +01:00
Mateusz Filipowicz
5d1643ed80 refactor: move BaseSettingResource to reusable in broader scope GenericResource (#51) 2025-03-14 00:34:29 +01:00
Mateusz Filipowicz
9f2573d72c feat: add support for Remote Syslog settings with unifi_setting_rsyslog resource (#47)
* feat: add support for Remote Syslog settings with `unifi_setting_rsyslog` resource

* set controller version constraint on 8.5 for rsyslogd

* require controller version 7.2 for teleport

* fix: use dedicated site for USG setting tests to not interfere with other resources
2025-03-12 00:59:03 +01:00
Mateusz Filipowicz
f82bce6de0 feat: add support for Deep Packet Inspection (DPI) settings with unifi_setting_dpi resource (#45) 2025-03-11 11:33:43 +01:00
Mateusz Filipowicz
72dcdd03ce feat: add support for LCD Monitor (LCM) settings with unifi_setting_lcd_monitor resource (#46) 2025-03-11 11:07:45 +01:00
Mateusz Filipowicz
fcea1e0ba4 feat: support complete USG resource (#44)
* feat: add support for UPNP and Geo IP filtering to USG settings resource

* feat: support complete USG settings resource

* fix messages in required_together_if.go

* improve docs of USG resource

* tests: require version at least 9.0 for unbind_wan_monitors

* feat: require version at least 8.5 for dns_verification

* fix: use go-unifi 1.5.2 to fix NTP

* require 7.0 or later for timeout preference

* require 7.0 or later for geo IP filtering
2025-03-11 02:17:24 +01:00
Mateusz Filipowicz
35c74bf59d refactor: migrate USG setting resource to Terraform Plugin Framework (#42)
* refactor: migrate USG setting resource to Terraform Plugin Framework

* remove setting_usg from old provider

* add USG resource to provider v2
2025-03-05 12:38:44 +01:00
dependabot[bot]
eb8fc3871e build(deps): bump github.com/filipowm/go-unifi from 1.4.0 to 1.5.0 (#40)
Bumps [github.com/filipowm/go-unifi](https://github.com/filipowm/go-unifi) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/filipowm/go-unifi/releases)
- [Changelog](https://github.com/filipowm/go-unifi/blob/main/.goreleaser.yaml)
- [Commits](https://github.com/filipowm/go-unifi/compare/v1.4.0...v1.5.0)

---
updated-dependencies:
- dependency-name: github.com/filipowm/go-unifi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 22:10:38 +01:00
Mateusz Filipowicz
7856ec4764 feat: add Teleport support with unifi_setting_teleport resource (#39)
* feat: add Telepor support with `unifi_setting_teleport` resource

* add cidr validators

* fix teleport tests by specifying version constraints

* fix teleport version needed

* require version 7.1

* lint
2025-03-03 21:08:50 +01:00
Mateusz Filipowicz
5da978a5d3 feat: add SSL inspection resource support with unifi_setting_ssl_inspection resource (#38)
* feat: add SSL inspection resource support with `unifi_setting_ssl_inspection` resource

* add version contstraint
2025-03-02 20:46:49 +01:00
dependabot[bot]
6a87f28545 build(deps): bump github.com/hashicorp/terraform-plugin-docs from 0.20.1 to 0.21.0 (#33)
build(deps): bump github.com/hashicorp/terraform-plugin-docs

Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.20.1 to 0.21.0.
- [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases)
- [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.20.1...v0.21.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/terraform-plugin-docs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-02 18:21:39 +01:00
Mateusz Filipowicz
ef2221cab9 feat: add network optimization resource support with unifi_setting_network_optimization resource (#37)
* feat: add network optimization resource support with `unifi_setting_network_optimization` resource
2025-03-02 01:41:08 +01:00
Mateusz Filipowicz
8b5ed14d8d feat: add NTP setting resource support with unifi_setting_ntp resource (#36)
* feat: add NTP setting resource support with `unifi_setting_ntp` resource

* linting

* fix missing method

* add missing validators
2025-03-02 01:10:41 +01:00
Mateusz Filipowicz
a78667e669 feat: add magic site-to-site VPN setting resource support with unifi_setting_magic_site_to_site_vpn resource (#35)
* feat: add magic site-to-site VPN setting resource support with `unifi_setting_magic_site_to_site_vpn` resource

* do not use default

* require controller version >=7.4 for magic site to site vpn tests
2025-03-01 23:12:06 +01:00
Mateusz Filipowicz
f815ffef79 feat: add locale setting resource support with unifi_setting_locale resource (#34)
* feat: add locale setting resource support with `unifi_setting_locale` resource

* lint
2025-03-01 18:03:58 +01:00
Mateusz Filipowicz
273d0daddd feat: add automatic speedtest setting resource support with unifi_setting_auto_speedtest resource (#32)
* feat: add automatic speedtest setting resource support with `unifi_setting_auto_speedtest` resource

* restore lowered test paralellism

* refactoring and fixes

* fix speedtest after refactor

* run speedtest test on versions [7.2,7.4.156), cause later it was removed from USG which is used in tests
2025-03-01 15:38:17 +01:00