Skip to content

Commit

Permalink
Get rid of HTTP auth env/config vars
Browse files Browse the repository at this point in the history
These are no longer needed.

Signed-off-by: Manuel Mendez <[email protected]>
  • Loading branch information
mmlb committed Jan 27, 2022
1 parent f1d2c91 commit 84a5656
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 24 deletions.
28 changes: 10 additions & 18 deletions cmd/tink-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,16 @@ var version = "devel"
// DaemonConfig represents all the values you can configure as part of the tink-server.
// You can change the configuration via environment variable, or file, or command flags.
type DaemonConfig struct {
Facility string
PGDatabase string
PGUSer string
PGPassword string
PGSSLMode string
OnlyMigration bool
GRPCAuthority string
TLSCert string
CertDir string
HTTPAuthority string
HTTPBasicAuthUsername string
HTTPBasicAuthPassword string
Facility string
PGDatabase string
PGUSer string
PGPassword string
PGSSLMode string
OnlyMigration bool
GRPCAuthority string
TLSCert string
CertDir string
HTTPAuthority string
}

func (c *DaemonConfig) AddFlags(fs *pflag.FlagSet) {
Expand Down Expand Up @@ -87,12 +85,6 @@ func (c *DaemonConfig) PopulateFromLegacyEnvVar() {
if httpAuthority := os.Getenv("TINKERBELL_HTTP_AUTHORITY"); httpAuthority != "" {
c.HTTPAuthority = httpAuthority
}
if basicAuthUser := os.Getenv("TINK_AUTH_USERNAME"); basicAuthUser != "" {
c.HTTPBasicAuthUsername = basicAuthUser
}
if basicAuthPass := os.Getenv("TINK_AUTH_PASSWORD"); basicAuthPass != "" {
c.HTTPBasicAuthPassword = basicAuthPass
}
}

func main() {
Expand Down
4 changes: 0 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ services:
PGUSER: tinkerbell
TINKERBELL_GRPC_AUTHORITY: :42113
TINKERBELL_HTTP_AUTHORITY: :42114
TINK_AUTH_USERNAME: ${TINKERBELL_TINK_USERNAME}
TINK_AUTH_PASSWORD: ${TINKERBELL_TINK_PASSWORD}
depends_on:
tink-server-migration:
condition: service_started
Expand Down Expand Up @@ -64,8 +62,6 @@ services:
PGUSER: tinkerbell
TINKERBELL_GRPC_AUTHORITY: :42113
TINKERBELL_HTTP_AUTHORITY: :42114
TINK_AUTH_USERNAME: ${TINKERBELL_TINK_USERNAME}
TINK_AUTH_PASSWORD: ${TINKERBELL_TINK_PASSWORD}
depends_on:
db:
condition: service_healthy
Expand Down
2 changes: 0 additions & 2 deletions docs/ENVVARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ The follow describes environment variables available to be set when running Tink

| Name | Type | Service(s) | Description |
| ---------------------------------------------------------------------------------------------- | ------ | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `TINK_AUTH_USERNAME=tink` | string | server | username to use for basic auth to http endpoints |
| `TINK_AUTH_PASSWORD=tink` | string | server | password to use for basic auth to http endpoints |
| `TINKERBELL_CERT_URL=http://127.0.0.1:42114/cert` | string | cli/worker | url from which to get a TLS certificate, needed when Tink Server's TLS cert is signed by an unknown certificate authority, ie self-signed |
| `CERTS_DIR=/certs` | string | server | a directory which contains the `bundle.pem` and `server-key.pem` files, for use when running Tink with TLS |
| `TINKERBELL_CERTS_DIR=/certs` | string | server | same as `CERTS_DIR`, deprecated in server |
Expand Down

0 comments on commit 84a5656

Please sign in to comment.