-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add a Stripe settings secret to server #10308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| apiVersion: v1 | ||
| data: | ||
| settings: eyJwdWJsaXNoYWJsZUtleSI6InBrX3Rlc3RfNTFLeHVyN0dhZFJYbTUwbzNJNXJKQTNvbnkxdGNmdTNkM0NOd3BUWFR6QURkWTJISmlvRk1XTGdTa2M1d2h0UkZRam85UG5kM3pYYUdlcktQcXRmN0REQ3kwMFhBb01kbjZhIiwic2VjcmV0S2V5Ijoic2tfdGVzdF81MUt4dXI3R2FkUlhtNTBvM0NtVFJWc1Q2Q0xqd0VlSlhsWWtmdjZHajREQm42aVlVeDJQWUlUNDhjVlI5dlNUS0s1b2hwQTVCdWdycU5NUU9WVzN0NVJIODAwS011T3lEZ1QifQo= | ||
| kind: Secret | ||
| metadata: | ||
| name: stripe-config | ||
| namespace: ${NAMESPACE} | ||
| type: Opaque | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,6 +91,14 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { | |
| return nil | ||
| }) | ||
|
|
||
| stripeSecret := "" | ||
| _ = ctx.WithExperimental(func(cfg *experimental.Config) error { | ||
| if cfg.WebApp != nil && cfg.WebApp.Server != nil { | ||
| stripeSecret = cfg.WebApp.Server.StripeSecret | ||
| } | ||
| return nil | ||
| }) | ||
|
|
||
| disableWsGarbageCollection := false | ||
| _ = ctx.WithExperimental(func(cfg *experimental.Config) error { | ||
| if cfg.WebApp != nil && cfg.WebApp.Server != nil { | ||
|
|
@@ -208,8 +216,9 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { | |
| ImageBuilderAddr: "image-builder-mk3:8080", | ||
| CodeSync: CodeSync{}, | ||
| VSXRegistryUrl: fmt.Sprintf("https://open-vsx.%s", ctx.Config.Domain), // todo(sje): or "https://{{ .Values.vsxRegistry.host | default "open-vsx.org" }}" if not using OpenVSX proxy | ||
| EnablePayment: chargebeeSecret != "", | ||
| EnablePayment: chargebeeSecret != "" || stripeSecret != "", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why put this behind payment? Can we not enable this by default? I'm assuming the secret we have would only go into a test mode of stripe anyway so there's no risk enabling. This would also help remove yet another config option.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we want to enable anything Stripe-related in Self-Hosted, where payment is disabled.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense. However, currently the stripe config is in experimental mode and only configured for preview. That alone should be enough for it to not be deployed in self-hosted. Am I missing something?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is actually the other way around, right? I.e. we set
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, that makes more sense. Would it make sense to separate them then? We may want to keep Chargbee enabled, but disable Stripe.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the code makes sense as-is. "enablePayment" is a legacy field that we should aim to remove when we kill the chargbee integration. Until we're there, and especially in the context of this PR, it make sense to keep it. Might make sense to try and remove it from the config surface altogether (and only keep it internall where it make sense) in a separate PR. |
||
| ChargebeeProviderOptionsFile: fmt.Sprintf("%s/providerOptions", chargebeeMountPath), | ||
| StripeSettingsFile: fmt.Sprintf("%s/settings", stripeMountPath), | ||
| InsecureNoDomain: false, | ||
| PrebuildLimiter: map[string]int{ | ||
| // default limit for all cloneURLs | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -188,6 +188,29 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) { | |||||||||||||||||||||||||||||||||||||||||||||
| return nil | ||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| _ = ctx.WithExperimental(func(cfg *experimental.Config) error { | ||||||||||||||||||||||||||||||||||||||||||||||
| if cfg.WebApp != nil && cfg.WebApp.Server != nil && cfg.WebApp.Server.StripeSecret != "" { | ||||||||||||||||||||||||||||||||||||||||||||||
| stripeSecret := cfg.WebApp.Server.StripeSecret | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| volumes = append(volumes, | ||||||||||||||||||||||||||||||||||||||||||||||
| corev1.Volume{ | ||||||||||||||||||||||||||||||||||||||||||||||
| Name: "stripe-config", | ||||||||||||||||||||||||||||||||||||||||||||||
| VolumeSource: corev1.VolumeSource{ | ||||||||||||||||||||||||||||||||||||||||||||||
| Secret: &corev1.SecretVolumeSource{ | ||||||||||||||||||||||||||||||||||||||||||||||
| SecretName: stripeSecret, | ||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| volumeMounts = append(volumeMounts, corev1.VolumeMount{ | ||||||||||||||||||||||||||||||||||||||||||||||
| Name: "stripe-config", | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+197
to
+206
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Because they need to match, they should reference the same variable. |
||||||||||||||||||||||||||||||||||||||||||||||
| MountPath: stripeMountPath, | ||||||||||||||||||||||||||||||||||||||||||||||
| ReadOnly: true, | ||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| return nil | ||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| _ = ctx.WithExperimental(func(cfg *experimental.Config) error { | ||||||||||||||||||||||||||||||||||||||||||||||
| if cfg.WebApp != nil && cfg.WebApp.Server != nil && cfg.WebApp.Server.GithubApp != nil { | ||||||||||||||||||||||||||||||||||||||||||||||
| volumes = append(volumes, | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.