diff --git a/Moonlight/Core/Configuration/CoreConfiguration.cs b/Moonlight/Core/Configuration/CoreConfiguration.cs index 01772aaf..a457a4a4 100644 --- a/Moonlight/Core/Configuration/CoreConfiguration.cs +++ b/Moonlight/Core/Configuration/CoreConfiguration.cs @@ -6,6 +6,9 @@ namespace Moonlight.Core.Configuration; public class CoreConfiguration { + [JsonProperty("AppUrl")] + [Description("This defines the public url of moonlight. This will be used by the nodes to communicate with moonlight")] + public string AppUrl { get; set; } = ""; [JsonProperty("Database")] public DatabaseData Database { get; set; } = new(); [JsonProperty("Features")] public FeaturesData Features { get; set; } = new(); [JsonProperty("Authentication")] public AuthenticationData Authentication { get; set; } = new(); diff --git a/Moonlight/Features/Servers/UI/NodeComponents/NodeSetup.razor b/Moonlight/Features/Servers/UI/NodeComponents/NodeSetup.razor index b843c46c..d7554b24 100644 --- a/Moonlight/Features/Servers/UI/NodeComponents/NodeSetup.razor +++ b/Moonlight/Features/Servers/UI/NodeComponents/NodeSetup.razor @@ -1,4 +1,8 @@ @using Moonlight.Features.Servers.Entities +@using MoonCore.Services +@using Moonlight.Core.Configuration + +@inject ConfigService ConfigService
In order to setup this node, make sure you have a clean linux (tested with ubuntu 22.04) server with the capabilities to run docker. @@ -15,8 +19,12 @@ { [Parameter] public ServerNode Node { get; set; } + private string Channel = "custom"; + private string GenerateSetupCommand() { - return $"echo Do somthing smart here with {Node.Name}"; + var appUrl = ConfigService.Get().AppUrl; + + return $"curl https://get-moonlight.app/install.sh | bash; mlcli daemon install {Channel} {appUrl} {Node.Token} {Node.HttpPort} {Node.Fqdn} {Node.Ssl.ToString().ToLower()}"; } } diff --git a/Moonlight/Features/Servers/UI/Views/Admin/Nodes/Index.razor b/Moonlight/Features/Servers/UI/Views/Admin/Nodes/Index.razor index 72d2d811..9c42966d 100644 --- a/Moonlight/Features/Servers/UI/Views/Admin/Nodes/Index.razor +++ b/Moonlight/Features/Servers/UI/Views/Admin/Nodes/Index.razor @@ -34,7 +34,7 @@