This commit is contained in:
nito9999
2026-06-12 15:35:10 -04:00
parent f5716c7160
commit 6706b6f478
60 changed files with 48656 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
namespace FemRec2023
{
public class Cloudflare
{
public static void StartCloudflared()
{
try
{
string cf = "/home/container/cloudflared";
if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
{
Process.Start("chmod", $"+x {cf}").WaitForExit();
}
ProcessStartInfo startInfo = new ProcessStartInfo
{
FileName = cf,
Arguments = "tunnel --config /home/container/.cloudflared/config.yml run",
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true
};
Process process = new Process { StartInfo = startInfo };
process.Start();
Console.WriteLine("[Cloudflared] Tunnel started.");
}
catch (Exception e)
{
Console.WriteLine($"[Cloudflared] Failed to start: {e.Message}");
}
}
}
}