Skip to content
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

add ability to support free entry of environment variables for nango-server #10

Merged

Conversation

colinbjohnson
Copy link
Contributor

@colinbjohnson colinbjohnson commented Jan 17, 2025

This PR addresses Allow Arbitrary Environment Variables to be set for nango-server. I've attached a screenshot of a basicauth login below:

nango-basicauth-login

Note that there are a number of ways to support environment variables within helm charts - two options which I tested/considered are below:

  1. Free-entry configuration - where a user would only provide an env value that renders valid YAML. This is rendered utilizing the following:
{{- if .Values.server.env }}
{{- toYaml .Values.server.env | nindent 12 }}
{{- end }}
  1. Iterative configuration (which is what I've seen used more frequently) - where a user provides a list composed of name and value or valueFrom fields which (I thought) offered a greater deal of validation (see "A Note on Iterative Configuration" below).

A Note on Iterative Configuration

I was open to utilizing this as it was/is common within the kubernetes/helm community and a popular suggestion on AI sites. What I discovered was this was worse than simply accepting "free entry" as it modified the YAML but did not reject it - an example is below:

{{- range .Values.server.env }}
- name: {{ .name }}
  {{- if .value }}
  value: {{ .value | quote }}
  {{- else if .valueFrom }}
  valueFrom: {{ toYaml .valueFrom | nindent 16 }}
  {{- end }}
{{- end }}

When given:

env:
  - namea: FLAG_AUTH_ENABLED
    value: "false"
  - name: NANGO_DASHBOARD_USERNAME
    value: nango
  - name: NANGO_DASHBOARD_PASSWORD
    valueFroma:
      secretKeyRef:
        name: nango-secrets
        key: nango-dashboard-password

Would render:

- name: 
  value: "false"
- name: NANGO_DASHBOARD_USERNAME
  value: "nango"
- name: NANGO_DASHBOARD_PASSWORD

@colinbjohnson colinbjohnson changed the title add ability to support any environment variables add ability to support any environment variables for nango-server Jan 17, 2025
@colinbjohnson colinbjohnson changed the title add ability to support any environment variables for nango-server add ability to support free entry of environment variables for nango-server Jan 17, 2025
Copy link
Member

@khaliqgant khaliqgant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bodinsamuel bodinsamuel merged commit afb6d4b into NangoHQ:main Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants