RSyncUsername

RSyncUsername

#Overview

name: RSyncUsername

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 9 C++ source files. Also referenced in 1 C# build file meaning it may affect the build system logic.

#Summary

#Usage in the C++ source code

The purpose of RSyncUsername is to specify the username on a remote server for remote builds using RSync in iOS development with Unreal Engine 5. This setting is primarily used for the iOS platform’s remote build system.

The Unreal Engine subsystems that rely on this setting variable are primarily within the iOS platform development modules, specifically:

  1. IOSPlatformEditor
  2. IOSTargetPlatform
  3. IOSRuntimeSettings

The value of this variable is set in the project’s configuration files, typically in the Engine.ini file under the “/Script/IOSRuntimeSettings.IOSRuntimeSettings” section. It can also be modified through the Unreal Engine editor’s project settings interface.

This variable interacts with several other settings, including:

  1. RemoteServerName
  2. SecondaryRemoteServerName
  3. SecondaryRSyncUsername
  4. bUseRSync

Developers must be aware of the following when using this variable:

  1. It is essential for setting up remote builds for iOS projects.
  2. It should match the SSH Private Key used for authentication on the remote server.
  3. It is used in conjunction with the RemoteServerName to locate and generate SSH keys.

Best practices when using this variable include:

  1. Ensure that the username is correctly set and matches the account on the remote build server.
  2. Keep the username consistent across different development machines to avoid authentication issues.
  3. Use this in combination with proper SSH key management for secure remote building.
  4. Regularly verify that the username is still valid and has the necessary permissions on the remote server.
  5. Consider using version control for the configuration files containing this setting, but be cautious about committing sensitive information.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:3014, section: [/Script/IOSRuntimeSettings.IOSRuntimeSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Developer/IOS/IOSPlatformEditor/Private/IOSTargetSettingsCustomization.cpp:963

Scope (from outer to inner):

file
function     void FIOSTargetSettingsCustomization::BuildRemoteBuildingSection

Source code excerpt:


	// Add RSync Username Property
	TSharedRef<IPropertyHandle> RSyncUsernamePropertyHandle = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UIOSRuntimeSettings, RSyncUsername));
	IDetailPropertyRow& RSyncUsernamePropertyRow = RemoteBuildingGroup.AddPropertyRow(RSyncUsernamePropertyHandle);
	RSyncUsernamePropertyRow
		.ToolTip(RSyncUsernamePropertyHandle->GetToolTipText())
		.CustomWidget()
		.NameContent()
		[

#Loc: <Workspace>/Engine/Source/Developer/IOS/IOSPlatformEditor/Private/IOSTargetSettingsCustomization.cpp:1604

Scope (from outer to inner):

file
function     FReply FIOSTargetSettingsCustomization::OnGenerateSSHKey

Source code excerpt:

	FString RemoteServerAddress;
	FString RemoteServerPort;
	FString RSyncUsername;
	int32	colonIndex;

	if (IsPrimary)
	{
		if (Settings.RemoteServerName.FindChar(':', colonIndex))
		{

#Loc: <Workspace>/Engine/Source/Developer/IOS/IOSPlatformEditor/Private/IOSTargetSettingsCustomization.cpp:1619

Scope (from outer to inner):

file
function     FReply FIOSTargetSettingsCustomization::OnGenerateSSHKey

Source code excerpt:

			RemoteServerPort = "22";
		}
		RSyncUsername = Settings.RSyncUsername;
	}
	else
	{
		if (Settings.SecondaryRemoteServerName.FindChar(':', colonIndex))
		{
			RemoteServerAddress = Settings.SecondaryRemoteServerName.Left(colonIndex);

#Loc: <Workspace>/Engine/Source/Developer/IOS/IOSPlatformEditor/Private/IOSTargetSettingsCustomization.cpp:1633

Scope (from outer to inner):

file
function     FReply FIOSTargetSettingsCustomization::OnGenerateSSHKey

Source code excerpt:

			RemoteServerPort = "22";
		}
		RSyncUsername = Settings.SecondaryRSyncUsername;
	}

	FString Path = FPlatformMisc::GetEnvironmentVariable(TEXT("APPDATA"));
	FString Destination = FString::Printf(TEXT("%s\\Unreal Engine\\UnrealBuildTool\\SSHKeys\\%s\\%s\\RemoteToolChainPrivate.key"), *Path, *RemoteServerAddress, *RSyncUsername);
	if (FPaths::FileExists(Destination))
	{
		FString MessagePrompt = FString::Printf(TEXT("An SSH Key already exists.  Do you want to replace this key?"));
		if (FPlatformMisc::MessageBoxExt(EAppMsgType::OkCancel, *MessagePrompt, TEXT("Key Exists")) == EAppReturnType::Cancel)
		{
			return FReply::Handled();

#Loc: <Workspace>/Engine/Source/Developer/IOS/IOSPlatformEditor/Private/IOSTargetSettingsCustomization.cpp:1666

Scope (from outer to inner):

file
function     FReply FIOSTargetSettingsCustomization::OnGenerateSSHKey

Source code excerpt:

		*RemoteServerPort,
		*CwRsyncPath,
		*(Settings.RSyncUsername),
		*RemoteServerAddress,
		*Path,
		*CygwinPath,
		*EnginePath);

	OutputMessage = TEXT("");

#Loc: <Workspace>/Engine/Source/Developer/IOS/IOSTargetPlatform/Private/IOSTargetPlatform.cpp:286

Scope (from outer to inner):

file
function     int32 FIOSTargetPlatform::CheckRequirements

Source code excerpt:

	FString RemoteServerName;
	FString SecondaryRemoteServerName;
	FString RSyncUsername;
	FString SecondaryRSyncUsername;
	GConfig->GetString(TEXT("/Script/IOSRuntimeSettings.IOSRuntimeSettings"), TEXT("RemoteServerName"), RemoteServerName, GEngineIni);
	GConfig->GetString(TEXT("/Script/IOSRuntimeSettings.IOSRuntimeSettings"), TEXT("RSyncUsername"), RSyncUsername, GEngineIni);
	GConfig->GetString(TEXT("/Script/IOSRuntimeSettings.IOSRuntimeSettings"), TEXT("SecondaryRemoteServerName"), SecondaryRemoteServerName, GEngineIni);
	GConfig->GetString(TEXT("/Script/IOSRuntimeSettings.IOSRuntimeSettings"), TEXT("SecondaryRSyncUsername"), SecondaryRSyncUsername, GEngineIni);
	if (RemoteServerName.Len() == 0 || RSyncUsername.Len() == 0)
	{
		bReadyToBuild |= ETargetPlatformReadyStatus::RemoveServerNameEmpty;
	}

#endif
	if (bIsTVOS)

#Loc: <Workspace>/Engine/Source/Runtime/IOS/IOSRuntimeSettings/Classes/IOSRuntimeSettings.h:292

Scope (from outer to inner):

file
class        class UIOSRuntimeSettings : public UObject

Source code excerpt:

    // The mac users name which matches the SSH Private Key, for remote builds using RSync.
    UPROPERTY(GlobalConfig, EditAnywhere, Category = "Remote Build", meta = (EditCondition = "bUseRSync", DisplayName = "Username on Remote Server", ConfigHierarchyEditable))
    FString RSyncUsername;

    // Optional path on the remote mac where the build files will be copied. If blank, ~/UE5/Builds will be used.
    UPROPERTY(GlobalConfig, EditAnywhere, Category = "Remote Build", meta = (ConfigHierarchyEditable))
    FString RemoteServerOverrideBuildPath;
    
    // The install directory of cwrsync.

#Loc: <Workspace>/Engine/Source/Runtime/IOS/IOSRuntimeSettings/Private/IOSRuntimeSettings.cpp:132

Scope (from outer to inner):

file
function     void UIOSRuntimeSettings::PostInitProperties

Source code excerpt:


	// We can have a look for potential keys
	if (!RemoteServerName.IsEmpty() && !RSyncUsername.IsEmpty())
	{
		SSHPrivateKeyLocation = TEXT("");

		FString RealRemoteServerName = RemoteServerName;
		if(RemoteServerName.Contains(TEXT(":")))
		{

#Loc: <Workspace>/Engine/Source/Runtime/IOS/IOSRuntimeSettings/Private/IOSRuntimeSettings.cpp:143

Scope (from outer to inner):

file
function     void UIOSRuntimeSettings::PostInitProperties

Source code excerpt:

		}
		const FString DefaultKeyFilename = TEXT("RemoteToolChainPrivate.key");
		const FString RelativeFilePathLocation = FPaths::Combine(TEXT("SSHKeys"), *RealRemoteServerName, *RSyncUsername, *DefaultKeyFilename);

		FString Path = FPlatformMisc::GetEnvironmentVariable(TEXT("APPDATA"));

		TArray<FString> PossibleKeyLocations;
		PossibleKeyLocations.Add(FPaths::Combine(*FPaths::ProjectDir(), TEXT("Restricted"), TEXT("NotForLicensees"), TEXT("Build"), *RelativeFilePathLocation));
		PossibleKeyLocations.Add(FPaths::Combine(*FPaths::ProjectDir(), TEXT("Restricted"), TEXT("NoRedist"), TEXT("Build"), *RelativeFilePathLocation));

#References in C# build files

This variable is referenced in the following C# build files:

Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/ToolChain/RemoteMac.cs:172

				// Parse the username
				string IniUserName;
				if ((bIsPrimary ? Ini.GetString("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "RSyncUsername", out IniUserName) : Ini.GetString("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "SecondaryRSyncUsername", out IniUserName)) && !String.IsNullOrEmpty(IniUserName))
				{
					UserName = IniUserName;
				}
			}

			// Split port out from the server name