Implemented more life cycle handling. Added support for rootless environments

This commit is contained in:
2024-12-27 20:08:05 +01:00
parent 039db22207
commit 92e9f42fbc
21 changed files with 738 additions and 20 deletions

View File

@@ -0,0 +1,20 @@
using MoonlightServers.Daemon.Models;
using MoonlightServers.DaemonShared.Enums;
namespace MoonlightServers.Daemon.Extensions.ServerExtensions;
public static class ServerStorageExtensions
{
public static async Task EnsureRuntimeStorage(this Server server)
{
// TODO: Add virtual disk
await server.NotifyTask(ServerTask.CreatingStorage);
// Create volume if missing
if (!Directory.Exists(server.RuntimeVolumePath))
Directory.CreateDirectory(server.RuntimeVolumePath);
// TODO: Chown
//Syscall.chown()
}
}