Skip to content

Commit

Permalink
Merge pull request #25 from nimbolus/force-unlock
Browse files Browse the repository at this point in the history
feat: add feature flag and test for force-unlock
  • Loading branch information
lu1as authored May 1, 2024
2 parents 8affe3b + 7bf26c9 commit f8e8dae
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 220 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,19 @@ docker-compose up -d

The following table describes the default configuration, although the backend server will run with these values, it's not scalable and therefore only for testing purposes.

| Environment Variable | Type | Default | Description |
|----------------------|--------|------------|---------------------------------------------------------------------------------------------------|
| LOG_LEVEL | string | `info` | Log level (options are: `fatal`, `info`, `warning`, `debug`, `trace`) |
| LISTEN_ADDR | string | `:8080` | Address the HTTP server listens on |
| TLS_KEY | string | -- | Path to TLS key file for listening with TLS (fallback to HTTP if not specified) |
| TLS_CERT | string | -- | Path to TLS certificate file for listening with TLS (fallback to HTTP if not specified) |
| STORAGE_BACKEND | string | `fs` | Module for state file storage (checkout [docs/storage.md](./docs/storage.md) for other options) |
| STORAGE_FS_DIR | string | `./states` | File system directory for `fs` storage module to store state files |
| KMS_BACKEND | string | `local` | Module used for encryption (checkout [docs/kms.md](./docs/kms.md) for other options) |
| KMS_KEY | string | -- | Key for `local` KMS module, if not defined, the server will generate a new one and exit |
| LOCK_BACKEND | string | `local` | Module used for locking the state (checkout [docs/lock.md](./docs/lock.md) for other options) |
| AUTH_BASIC_ENABLED | bool | `true` | HTTP basic auth is enabled by default (checkout [docs/auth.md](./docs/auth.md) for other options) |
| Environment Variable | Type | Default | Description |
|------------------------|--------|------------|----------------------------------------------------------------------------------------------------------------|
| LOG_LEVEL | string | `info` | Log level (options are: `fatal`, `info`, `warning`, `debug`, `trace`) |
| LISTEN_ADDR | string | `:8080` | Address the HTTP server listens on |
| TLS_KEY | string | -- | Path to TLS key file for listening with TLS (fallback to HTTP if not specified) |
| TLS_CERT | string | -- | Path to TLS certificate file for listening with TLS (fallback to HTTP if not specified) |
| STORAGE_BACKEND | string | `fs` | Module for state file storage (checkout [docs/storage.md](./docs/storage.md) for other options) |
| STORAGE_FS_DIR | string | `./states` | File system directory for `fs` storage module to store state files |
| KMS_BACKEND | string | `local` | Module used for encryption (checkout [docs/kms.md](./docs/kms.md) for other options) |
| KMS_KEY | string | -- | Key for `local` KMS module, if not defined, the server will generate a new one and exit |
| LOCK_BACKEND | string | `local` | Module used for locking the state (checkout [docs/lock.md](./docs/lock.md) for other options) |
| AUTH_BASIC_ENABLED | bool | `true` | HTTP basic auth is enabled by default (checkout [docs/auth.md](./docs/auth.md) for other options) |
| FORCE_UNLOCK_ENABLED | bool | `true` | Force-unlock feature enables the native Terraform behavior which unlocks the state even if no lock id was sent |

## Usage

Expand Down
11 changes: 4 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ require (
github.com/go-test/deep v1.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.7.1 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.5 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
Expand All @@ -64,10 +63,8 @@ require (
github.com/klauspost/compress v1.17.5 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/mattn/go-zglob v0.0.4 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
Expand All @@ -81,15 +78,13 @@ require (
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.46.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
Expand All @@ -101,16 +96,18 @@ require (
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.153.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit f8e8dae

Please sign in to comment.