made python s3cmd the standart across all os

This commit is contained in:
Kim 2023-03-16 12:49:54 +01:00
parent 083c412177
commit b1c6aeb9ab
1 changed files with 2 additions and 18 deletions

View File

@ -17,22 +17,7 @@ public static class InstallationMethods
//secret 55MAqyO_FqUmh7O64VIO0egq50ERn_WIAWuc2QC44QU //secret 55MAqyO_FqUmh7O64VIO0egq50ERn_WIAWuc2QC44QU
const String apiKey = "EXO44d2979c8e570eae81ead564"; const String apiKey = "EXO44d2979c8e570eae81ead564";
const String salt = "3e5b3069-214a-43ee-8d85-57d72000c19d"; const String salt = "3e5b3069-214a-43ee-8d85-57d72000c19d";
if (Environment.OSVersion.Platform != PlatformID.Unix) var cmd = Cli
{
var cmd = Cli
.Wrap("s3cmd")
.WithArguments(new[]
{
"signurl", $"s3://{installation.Id}-{salt}", validity.TotalSeconds.ToString(), "--access_key",
apiKey
});
var x = await cmd.ExecuteBufferedAsync();
installation.S3Url = x.StandardOutput.Replace("\n", "").Replace(" ", "");
}
else
{
var cmd = Cli
.Wrap("python3") .Wrap("python3")
.WithArguments(new[] .WithArguments(new[]
{ {
@ -41,9 +26,8 @@ public static class InstallationMethods
}); });
var x = await cmd.ExecuteBufferedAsync(); var x = await cmd.ExecuteBufferedAsync();
installation.S3Url = x.StandardOutput.Replace("\n", "").Replace(" ", ""); installation.S3Url = x.StandardOutput.Replace("\n", "").Replace(" ", "");
}
Console.WriteLine(installation.S3Url); Console.WriteLine(installation.S3Url);
Db.Update(installation); Db.Update(installation);
} }