mirror of
https://github.com/Corsinvest/cv4pve-pepper.git
synced 2025-02-12 10:01:53 +00:00
Support multiple host for HA
Check-Update and Upgrade application
This commit is contained in:
parent
d91ff4e64c
commit
a4e8d7ef9f
6 changed files with 785 additions and 762 deletions
7
.editorconfig
Normal file
7
.editorconfig
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# All files
|
||||||
|
[*]
|
||||||
|
guidelines = 80
|
||||||
|
|
||||||
|
# C# or VB files
|
||||||
|
[*.{cs,vb}]
|
||||||
|
guidelines = 80, 120
|
25
README.md
25
README.md
|
@ -15,12 +15,21 @@ Usage: cv4pve-pepper [options]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-?|-h|--help Show help information
|
-?|-h|--help Show help information
|
||||||
--host The host name host[:port]
|
--version Show version information
|
||||||
--username User name <username>@<realm>
|
--host The host name host[:port],host1[:port],host2[:port]
|
||||||
--password The password. Specify 'file:path_file' to store password in file.
|
--username User name <username>@<realm>
|
||||||
--version Show version information
|
--password The password. Specify 'file:path_file' to store password in file.
|
||||||
--vmid The id or name VM/CT
|
--vmid The id or name VM/CT
|
||||||
--viewer Executable SPICE client remote viewer```
|
--viewer Executable SPICE client remote viewer
|
||||||
|
|
||||||
|
Commands:
|
||||||
|
app-check-update Check update application
|
||||||
|
app-upgrade Upgrade application
|
||||||
|
|
||||||
|
Run 'cv4pve-pepper [command] --help' for more information about a command.
|
||||||
|
|
||||||
|
cv4pve-pepper is a part of suite cv4pve-tools.
|
||||||
|
For more information visit https://www.cv4pve-tools.com
|
||||||
```
|
```
|
||||||
|
|
||||||
## Copyright and License
|
## Copyright and License
|
||||||
|
@ -30,7 +39,7 @@ For licensing details please visit [LICENSE.md](LICENSE.md)
|
||||||
|
|
||||||
## Commercial Support
|
## Commercial Support
|
||||||
|
|
||||||
This software is part of a suite of tools called cv4pve-tools. If you want commercial support, visit the [site](https://www.corsinvest.it/cv4pve-tools)
|
This software is part of a suite of tools called cv4pve-tools. If you want commercial support, visit the [site](https://www.cv4pve-tools.com)
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
|
@ -52,6 +61,8 @@ this software aims to simplify run SPICE client from Proxmox VE using command li
|
||||||
* Not require installation in Proxmox VE
|
* Not require installation in Proxmox VE
|
||||||
* Execute out side Proxmox VE
|
* Execute out side Proxmox VE
|
||||||
* Not require Web login
|
* Not require Web login
|
||||||
|
* Support multiple host for HA in --host parameter es. host[:port],host1[:port],host2[:port]
|
||||||
|
* Check-Update and Upgrade application
|
||||||
|
|
||||||
## Configuration and use
|
## Configuration and use
|
||||||
|
|
||||||
|
|
1346
gpl-3.0.txt
1346
gpl-3.0.txt
File diff suppressed because it is too large
Load diff
|
@ -1,22 +1,24 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<Version>1.0.0</Version>
|
<Version>1.1.0</Version>
|
||||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<AssemblyName>cv4pve-pepper</AssemblyName>
|
<AssemblyName>cv4pve-pepper</AssemblyName>
|
||||||
<Company>Corsinvest Srl</Company>
|
<Company>Corsinvest Srl</Company>
|
||||||
<Authors>Daniele Corsini</Authors>
|
<Authors>Daniele Corsini</Authors>
|
||||||
<Copyright>Corsinvest Srl</Copyright>
|
<Copyright>Corsinvest Srl</Copyright>
|
||||||
<Product>Corsinvest Launching SPICE for Proxmox VE</Product>
|
<Product>Corsinvest Launching SPICE for Proxmox VE</Product>
|
||||||
<AssemblyTitle>Corsinvest Launching SPICE for Proxmox VE</AssemblyTitle>
|
<AssemblyTitle>Corsinvest Launching SPICE for Proxmox VE</AssemblyTitle>
|
||||||
<Description>Corsinvest Launching SPICE for Proxmox VE</Description>
|
<Description>Corsinvest Launching SPICE for Proxmox VE</Description>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!-- Fix RedHat, Centos,Fedora -->
|
<!-- Fix RedHat, Centos,Fedora -->
|
||||||
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
|
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
|
||||||
|
|
||||||
<!-- <ProjectReference Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Extension\Corsinvest.ProxmoxVE.Api.Extension.csproj" /> -->
|
<TrimmerRootAssembly Include="System.Net.WebClient" />
|
||||||
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Extension" Version="2.1.0" />
|
|
||||||
</ItemGroup>
|
<!-- <ProjectReference Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Shell\Corsinvest.ProxmoxVE.Api.Shell.csproj" /> -->
|
||||||
|
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="1.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -1,61 +1,61 @@
|
||||||
/*
|
/*
|
||||||
* This file is part of the cv4pve-pepper https://github.com/Corsinvest/cv4pve-pepper,
|
* This file is part of the cv4pve-pepper https://github.com/Corsinvest/cv4pve-pepper,
|
||||||
*
|
*
|
||||||
* This source file is available under two different licenses:
|
* This source file is available under two different licenses:
|
||||||
* - GNU General Public License version 3 (GPLv3)
|
* - GNU General Public License version 3 (GPLv3)
|
||||||
* - Corsinvest Enterprise License (CEL)
|
* - Corsinvest Enterprise License (CEL)
|
||||||
* Full copyright and license information is available in
|
* Full copyright and license information is available in
|
||||||
* LICENSE.md which is distributed with this source code.
|
* LICENSE.md which is distributed with this source code.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016 Corsinvest Srl GPLv3 and CEL
|
* Copyright (C) 2016 Corsinvest Srl GPLv3 and CEL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System.IO;
|
||||||
using System.IO;
|
using Corsinvest.ProxmoxVE.Api.Extension.Helpers;
|
||||||
using Corsinvest.ProxmoxVE.Api.Extension.Helpers;
|
using Corsinvest.ProxmoxVE.Api.Shell.Helpers;
|
||||||
using Corsinvest.ProxmoxVE.Api.Extension.Helpers.Shell;
|
using McMaster.Extensions.CommandLineUtils;
|
||||||
using McMaster.Extensions.CommandLineUtils;
|
|
||||||
|
namespace Corsinvest.ProxmoxVE.Pepper
|
||||||
namespace Corsinvest.ProxmoxVE.Pepper
|
{
|
||||||
{
|
class Program
|
||||||
class Program
|
{
|
||||||
{
|
static int Main(string[] args)
|
||||||
public static readonly string APP_NAME = "cv4pve-pepper";
|
{
|
||||||
static int Main(string[] args)
|
var app = ShellHelper.CreateConsoleApp("cv4pve-pepper",
|
||||||
{
|
"Launching SPICE on Proxmox VE");
|
||||||
var app = ShellHelper.CreateConsoleApp(APP_NAME, "Launching SPICE on Proxmox VE", true);
|
|
||||||
|
var optVmId = app.VmIdOrNameOption().DependOn(app, CommandOptionExtension.HOST_OPTION_NAME);
|
||||||
var optVmId = app.VmIdOrNameOption();
|
var optRemoteViewer = app.Option("--viewer",
|
||||||
var optRemoteViewer = app.Option("--viewer",
|
"Executable SPICE client remote viewer",
|
||||||
"Executable SPICE client remote viewer",
|
CommandOptionType.SingleValue)
|
||||||
CommandOptionType.SingleValue);
|
.DependOn(app, CommandOptionExtension.HOST_OPTION_NAME);
|
||||||
optRemoteViewer.Accepts().ExistingFile();
|
optRemoteViewer.Accepts().ExistingFile();
|
||||||
|
|
||||||
app.OnExecute(() =>
|
app.OnExecute(() =>
|
||||||
{
|
{
|
||||||
var fileName = Path.GetTempFileName().Replace(".tmp", ".vv");
|
var fileName = Path.GetTempFileName().Replace(".tmp", ".vv");
|
||||||
var ret = SpiceHelper.CreateFileSpaceClient(app.ClientTryLogin(),
|
var ret = SpiceHelper.CreateFileSpaceClient(app.ClientTryLogin(),
|
||||||
optVmId.Value(),
|
optVmId.Value(),
|
||||||
fileName);
|
fileName);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
var cmd = StringHelper.Quote(optRemoteViewer.Value()) +
|
var cmd = StringHelper.Quote(optRemoteViewer.Value()) +
|
||||||
" " +
|
" " +
|
||||||
StringHelper.Quote(fileName);
|
StringHelper.Quote(fileName);
|
||||||
|
|
||||||
ret = ShellHelper.Execute(cmd,
|
ret = ShellHelper.Execute(cmd,
|
||||||
true,
|
true,
|
||||||
null,
|
null,
|
||||||
Console.Out,
|
app.Out,
|
||||||
app.DryRunIsActive(),
|
app.DryRunIsActive(),
|
||||||
app.DebugIsActive()).ExitCode == 0;
|
app.DebugIsActive()).ExitCode == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret ? 0 : 1;
|
return ret ? 0 : 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
return app.ExecuteConsoleApp(Console.Out, args);
|
return app.ExecuteConsoleApp(args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
# This file is part of the cv4pve-pepper https://github.com/Corsinvest/cv4pve-pepper,
|
# This file is part of the cv4pve-autosnap https://github.com/Corsinvest/cv4pve-pepper,
|
||||||
#
|
#
|
||||||
# This source file is available under two different licenses:
|
# This source file is available under two different licenses:
|
||||||
# - GNU General Public License version 3 (GPLv3)
|
# - GNU General Public License version 3 (GPLv3)
|
||||||
|
@ -23,10 +23,13 @@ Write-Output "
|
||||||
== Build System
|
== Build System
|
||||||
========================================================="
|
========================================================="
|
||||||
|
|
||||||
|
Remove-Item -Path ".\Bin\Release\netcoreapp3.0\" -Recurse -Force
|
||||||
|
|
||||||
$rids = @("linux-x64", "linux-arm", "linux-arm64", "osx-x64", "win-x86", "win-x64", "win-arm", "win-arm64")
|
$rids = @("linux-x64", "linux-arm", "linux-arm64", "osx-x64", "win-x86", "win-x64", "win-arm", "win-arm64")
|
||||||
foreach ($rid in $rids) {
|
foreach ($rid in $rids) {
|
||||||
dotnet publish -r $rid -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true
|
dotnet publish -r $rid -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true
|
||||||
$path = "bin\Release\netcoreapp3.0\$rid\publish\"
|
$path = "bin\Release\netcoreapp3.0\$rid\publish\"
|
||||||
|
|
||||||
$fileName = Get-ChildItem $path -Exclude *.pdb -name
|
$fileName = Get-ChildItem $path -Exclude *.pdb -name
|
||||||
$fileDest = "bin\Release\netcoreapp3.0\$fileName-$rid.zip"
|
$fileDest = "bin\Release\netcoreapp3.0\$fileName-$rid.zip"
|
||||||
Remove-Item $fileDest -ErrorAction SilentlyContinue
|
Remove-Item $fileDest -ErrorAction SilentlyContinue
|
||||||
|
|
Loading…
Reference in a new issue