diff --git a/.env.example b/.env.example index b97b38b..bfef292 100644 --- a/.env.example +++ b/.env.example @@ -3,11 +3,6 @@ GITHUB_SECRET= SERVICE_LENS_ADDR= POSTGRES_URL= SERVICE_LENS_DATABASE_TABLE_PREFIX= -SERVICE_LENS_FGA_API_URL= -SERVICE_LENS_FGA_STORE_ID= -SERVICE_LENS_FGA_AUTHORIZATION_MODEL_ID= -SERVICE_LENS_OIDC_ISSUER= -SERVICE_LENS_OIDC_AUDIENCE= SERVICE_LENS_GITHUB_CALLBACK_URL= SERVICE_LENS_GITHUB_CLIENT_SECRET= SERVICE_LENS_GITHUB_CLIENT_ID= diff --git a/cmd/root.go b/cmd/root.go index 2f7219b..2962f6a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -54,11 +54,6 @@ func init() { Root.PersistentFlags().StringVar(&config.Flags.Environment, "environment", config.Flags.Environment, "environment") Root.PersistentFlags().StringVar(&config.Flags.DatabaseURI, "db-rul", config.Flags.DatabaseURI, "Database URI") Root.PersistentFlags().StringVar(&config.Flags.DatabaseTablePrefix, "db-table-prefix", config.Flags.DatabaseTablePrefix, "Database table prefix") - Root.PersistentFlags().StringVar(&config.Flags.FGAApiUrl, "fga-api-url", config.Flags.FGAApiUrl, "FGA API URL") - Root.PersistentFlags().StringVar(&config.Flags.FGAStoreID, "fga-store-id", config.Flags.FGAStoreID, "FGA Store ID") - Root.PersistentFlags().StringVar(&config.Flags.FGAAuthorizationModelID, "fga-authorization-model-id", config.Flags.FGAAuthorizationModelID, "FGA Authorization Model ID") - Root.PersistentFlags().StringVar(&config.Flags.OIDCIssuer, "oidc-issuer", config.Flags.OIDCIssuer, "OIDC Issuer") - Root.PersistentFlags().StringVar(&config.Flags.OIDCAudience, "oidc-audience", config.Flags.OIDCAudience, "OIDC Audience") Root.SilenceUsage = true } diff --git a/helm/charts/service-lens/templates/deployment.yaml b/helm/charts/service-lens/templates/deployment.yaml index e2d814d..d9016dd 100644 --- a/helm/charts/service-lens/templates/deployment.yaml +++ b/helm/charts/service-lens/templates/deployment.yaml @@ -62,10 +62,10 @@ spec: env: {{- if .Values.database.uri }} - - name: SERVICE_LENS_DATABASE_URI + - name: POSTGRES_URL value: "{{ .Values.database.uri }}" {{- else if .Values.database.uriSecret }} - - name: SERVICE_LENS_DATABASE_URI + - name: POSTGRES_URL valueFrom: secretKeyRef: name: "{{ .Values.database.uriSecret }}" @@ -82,21 +82,6 @@ spec: value: "{{ .Values.http.addr }}" {{- end }} - {{- if .Values.fga.uri }} - - name: TYPHOON_WEB_FGA_API_URL - value: "{{ .Values.fga.uri }}" - {{- end }} - - {{- if .Values.fga.storeId }} - - name: TYPHOON_WEB_FGA_STORE_ID - value: "{{ .Values.fga.storeId }}" - {{- end }} - - {{- if .Values.fga.authorizationModelId }} - - name: TYPHOON_WEB_FGA_AUTHORIZATION_MODEL_ID - value: "{{ .Values.fga.authorizationModelId }}" - {{- end }} - {{- if .Values.goth.github.clientID }} - name: SERVICE_LENS_GITHUB_CLIENT_ID value: "{{ .Values.goth.github.clientID }}" diff --git a/helm/charts/service-lens/templates/job.yaml b/helm/charts/service-lens/templates/job.yaml index f6f9935..cc93666 100644 --- a/helm/charts/service-lens/templates/job.yaml +++ b/helm/charts/service-lens/templates/job.yaml @@ -41,21 +41,16 @@ spec: value: "{{ .Values.database.prefix }}" {{- end }} {{- if .Values.database.uri }} - - name: SERVICE_LENS_DATABASE_URI + - name: POSTGRES_URL value: "{{ .Values.database.uri }}" {{- else if .Values.database.uriSecret }} - - name: SERVICE_LENS_DATABASE_URI + - name: POSTGRES_URL valueFrom: secretKeyRef: name: "{{ .Values.database.uriSecret }}" key: "uri" {{- end }} - {{- if .Values.migrate.timeout }} - - name: SERVICE_LENS_TIMEOUT - value: "{{ .Values.migrate.timeout }}" - {{- end }} - {{- with .Values.extraEnvVars }} {{- toYaml . | nindent 12 }} {{- end }} diff --git a/internal/cfg/config.go b/internal/cfg/config.go index 1571671..f3a5af0 100644 --- a/internal/cfg/config.go +++ b/internal/cfg/config.go @@ -6,18 +6,13 @@ import ( // Flags contains the command line flags. type Flags struct { - Environment string `envconfig:"SERVICE_LENS_ENV" default:"production"` - Addr string `envconfig:"SERVICE_LENS_ADDR" default:":8084"` - DatabaseURI string `envconfig:"POSTGRES_URL" default:""` - DatabaseTablePrefix string `envconfig:"SERVICE_LENS_DATABASE_TABLE_PREFIX" default:"service_lens_"` - FGAApiUrl string `envconfig:"SERVICE_LENS_FGA_API_URL" default:""` - FGAStoreID string `envconfig:"SERVICE_LENS_FGA_STORE_ID" default:""` - FGAAuthorizationModelID string `envconfig:"SERVICE_LENS_FGA_AUTHORIZATION_MODEL_ID" default:""` - OIDCIssuer string `envconfig:"SERVICE_LENS_OIDC_ISSUER" default:""` - OIDCAudience string `envconfig:"SERVICE_LENS_OIDC_AUDIENCE" default:""` - GitHubCallbackURL string `envconfig:"SERVICE_LENS_GITHUB_CALLBACK_URL" default:""` - GitHubClientID string `envconfig:"SERVICE_LENS_GITHUB_CLIENT_ID" default:""` - GitHubClientSecret string `envconfig:"SERVICE_LENS_GITHUB_CLIENT_SECRET" default:""` + Environment string `envconfig:"SERVICE_LENS_ENV" default:"production"` + Addr string `envconfig:"SERVICE_LENS_ADDR" default:":8084"` + DatabaseURI string `envconfig:"POSTGRES_URL" default:""` + DatabaseTablePrefix string `envconfig:"SERVICE_LENS_DATABASE_TABLE_PREFIX" default:"service_lens_"` + GitHubCallbackURL string `envconfig:"SERVICE_LENS_GITHUB_CALLBACK_URL" default:""` + GitHubClientID string `envconfig:"SERVICE_LENS_GITHUB_CLIENT_ID" default:""` + GitHubClientSecret string `envconfig:"SERVICE_LENS_GITHUB_CLIENT_SECRET" default:""` } // NewFlags returns a new instance of Flags.