Skip to content

Commit df0ee6d

Browse files
feat(agent-installer): gateway URL override field in dialog
1 parent 91a30e4 commit df0ee6d

6 files changed

Lines changed: 57 additions & 1 deletion

File tree

package/AgentWindowsManaged/Actions/CustomActions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ public static ActionResult EnrollAgentTunnel(Session session)
325325
string enrollmentString = session.Property(AgentProperties.AgentTunnelEnrollmentString)?.Trim() ?? string.Empty;
326326
string subnetsArg = session.Property(AgentProperties.AgentTunnelAdvertiseSubnets)?.Trim() ?? string.Empty;
327327
string domainsArg = session.Property(AgentProperties.AgentTunnelAdvertiseDomains)?.Trim() ?? string.Empty;
328+
string gatewayUrlArg = session.Property(AgentProperties.AgentTunnelGatewayUrl)?.Trim() ?? string.Empty;
328329

329330
if (enrollmentString.Length == 0)
330331
{
@@ -342,6 +343,7 @@ public static ActionResult EnrollAgentTunnel(Session session)
342343
string exePath = Path.Combine(installDir, Includes.EXECUTABLE_NAME);
343344

344345
string arguments = $"up --enrollment-string \"{enrollmentString}\"";
346+
if (gatewayUrlArg.Length != 0) arguments += $" --gateway \"{gatewayUrlArg}\"";
345347
if (subnetsArg.Length != 0) arguments += $" --advertise-subnets \"{subnetsArg}\"";
346348

347349
string Redact(string s) => s.Replace(enrollmentString, "***");

package/AgentWindowsManaged/Dialogs/AgentTunnelDialog.Designer.cs

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package/AgentWindowsManaged/Dialogs/AgentTunnelDialog.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public override bool ToProperties()
2424
Runtime.Session[AgentProperties.AgentTunnelEnrollmentString] = enrollmentString.Text.Trim();
2525
Runtime.Session[AgentProperties.AgentTunnelAdvertiseSubnets] = advertiseSubnets.Text.Trim();
2626
Runtime.Session[AgentProperties.AgentTunnelAdvertiseDomains] = advertiseDomains.Text.Trim();
27+
Runtime.Session[AgentProperties.AgentTunnelGatewayUrl] = gatewayUrl.Text.Trim();
2728

2829
return true;
2930
}
@@ -35,6 +36,7 @@ public override void OnLoad(object sender, EventArgs e)
3536
enrollmentString.Text = Runtime.Session.Property(AgentProperties.AgentTunnelEnrollmentString);
3637
advertiseSubnets.Text = Runtime.Session.Property(AgentProperties.AgentTunnelAdvertiseSubnets);
3738
advertiseDomains.Text = Runtime.Session.Property(AgentProperties.AgentTunnelAdvertiseDomains);
39+
gatewayUrl.Text = Runtime.Session.Property(AgentProperties.AgentTunnelGatewayUrl);
3840

3941
base.OnLoad(sender, e);
4042
}

package/AgentWindowsManaged/Properties/AgentProperties.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal partial class AgentProperties
1717
public static string InstallDir = "INSTALLDIR";
1818

1919
/// <summary>
20-
/// Agent tunnel enrollment string (dgw-enroll:v1:...)
20+
/// Agent tunnel enrollment string (DVLS-signed JWT verbatim)
2121
/// </summary>
2222
public static string AgentTunnelEnrollmentString = "AGENT_TUNNEL_ENROLLMENT_STRING";
2323

@@ -31,6 +31,13 @@ internal partial class AgentProperties
3131
/// </summary>
3232
public static string AgentTunnelAdvertiseDomains = "AGENT_TUNNEL_ADVERTISE_DOMAINS";
3333

34+
/// <summary>
35+
/// Optional gateway URL override. When set, the agent uses this URL instead of the JWT's
36+
/// jet_gw_url claim. Useful when the JWT was minted with a URL that isn't reachable from
37+
/// the agent's network (e.g. DVLS embedded "localhost" but the agent is remote).
38+
/// </summary>
39+
public static string AgentTunnelGatewayUrl = "AGENT_TUNNEL_GATEWAY_URL";
40+
3441
public AgentProperties(ISession runtimeSession)
3542
{
3643
this.runtimeSession = runtimeSession;

package/AgentWindowsManaged/Resources/DevolutionsAgent_en-us.wxl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,6 @@ If it appears minimized then active it from the taskbar.</String>
6767
<String Id="AgentTunnelDlgSubnetsHint">Comma-separated CIDR notation, e.g. 10.10.0.0/24, 192.168.1.0/24. Leave blank for auto-detection.</String>
6868
<String Id="AgentTunnelDlgDomainsLabel">Advertise Domains:</String>
6969
<String Id="AgentTunnelDlgDomainsHint">Comma-separated DNS suffixes the agent can resolve, e.g. corp.example.com, lab.example.com. Leave blank to skip.</String>
70+
<String Id="AgentTunnelDlgGatewayUrlLabel">Gateway URL (advanced, optional):</String>
71+
<String Id="AgentTunnelDlgGatewayUrlHint">Override the URL embedded in the enrollment JWT. Leave blank to use the JWT's value.</String>
7072
</WixLocalization>

package/AgentWindowsManaged/Resources/DevolutionsAgent_fr-fr.wxl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<String Id="AgentTunnelDlgSubnetsHint">Notation CIDR séparée par des virgules, p. ex. 10.10.0.0/24, 192.168.1.0/24. Laissez vide pour la détection automatique.</String>
1313
<String Id="AgentTunnelDlgDomainsLabel">Domaines annoncés :</String>
1414
<String Id="AgentTunnelDlgDomainsHint">Suffixes DNS séparés par des virgules que l'agent peut résoudre, p. ex. corp.example.com, lab.example.com. Laissez vide pour ignorer.</String>
15+
<String Id="AgentTunnelDlgGatewayUrlLabel">URL de la passerelle (avancé, facultatif) :</String>
16+
<String Id="AgentTunnelDlgGatewayUrlHint">Remplace l'URL incluse dans le JWT d'enrôlement. Laissez vide pour utiliser la valeur du JWT.</String>
1517
<String Id="Language">1036</String>
1618
<String Id="ProductDescription">Service à l’échelle du système pour étendre les fonctionnalités de Devolutions Gateway.</String>
1719
<String Id="VendorFullName">Devolutions Inc.</String>

0 commit comments

Comments
 (0)