Skip to content
Distr

Configure Application Links

Distr allows you to define dynamic application links that automatically resolve to the correct URL after deployment. This enables users to quickly access their deployed applications directly from the Distr interface.

In this guide, you’ll learn how to configure application links using Go template syntax with deployment-specific values.

Application links are templated URLs that point to your deployed application. Instead of hardcoding a URL, you can use template variables that get replaced with actual values from the deployment’s environment variables and configuration.

For example, if your application’s URL depends on a custom hostname configured during deployment, you can create a template like:

https://{{ .Env.HOSTNAME }}

When the deployment is created with HOSTNAME=app.example.com, the link automatically becomes https://app.example.com.

Application links are configured when creating or editing an application version in Distr.

  1. Navigate to the Applications section in the Distr web interface
  2. Select your application or create a new one
  3. When creating or editing a version, enter the Application Link in the designated field
  4. Use Go template syntax with available template variables

The link will be displayed in the deployment card with an “Open” button when the link is non-empty.

Application links support two categories of template variables:

Access environment variables defined in the deployment’s .env file:

{{ .Env.VARIABLE_NAME }}

Example: If your .env file contains APP_HOST=myapp.example.com, you can use:

https://{{ .Env.APP_HOST }}

For Kubernetes deployments, access values from the Helm values YAML:

{{ .Values.path.to.value }}

Example: If your values.yaml contains:

ingress:
enabled: true
host: myapp.example.com

You can use:

https://{{ .Values.ingress.host }}

Application links use Go’s text/template syntax, which supports various operations:

https://{{ .Env.HOST }}:{{ .Env.PORT }}

With .env:

HOST=localhost
PORT=8080

Result: https://localhost:8080

For accessing nested YAML structures, use dot notation for nested objects, and use the index function when you need to access array elements by position. For example, to access the first host entry, use:

https://{{ index .Values.app.ingress.hosts 0 "host" }}

With values.yaml:

app:
ingress:
hosts:
- host: myapp.example.com

Result: https://myapp.example.com

Use if statements to handle optional configurations:

https://{{ if .Values.ingress.enabled }}{{ .Values.ingress.host }}{{ else }}localhost{{ end }}

With values.yaml:

ingress:
enabled: true
host: production.example.com

Result: https://production.example.com

If ingress.enabled is false, it would use https://localhost.

  1. Use descriptive variable names: Make it clear what each variable represents in your environment template
  2. Test your templates: Deploy the application to verify the link resolves correctly
  3. Provide defaults: Use conditionals to provide sensible defaults when optional values are missing
  4. Document requirements: In your application description, document which environment variables or Helm values are required for the link to work
  5. Handle protocols: Include the protocol (http/https) in the template or as a variable

If a template fails to parse or execute, Distr will:

  • Log the error for debugging
  • Keep the original template string as the link
  • Continue processing other deployments

Missing or undefined variables will render as <no value> in the final URL.

When you update an application link in an application version:

  • The change applies to new deployments of that version
  • Existing deployments are not automatically updated
  • Users can redeploy to pick up the updated link template

To update links for existing deployments, users need to trigger a redeployment of the application.