Skip to content

Commit

Permalink
Improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
franklupo committed Feb 29, 2024
1 parent 85f2dd6 commit f4326d1
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 83 deletions.
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ ClientBin/
*.publishsettings
orleans.codegen.cs

# Including strong name files can present a security risk
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk

Expand Down Expand Up @@ -317,7 +317,7 @@ __pycache__/
# OpenCover UI analysis results
OpenCover/

# Azure Stream Analytics local run output
# Azure Stream Analytics local run output
ASALocalRun/

# MSBuild Binary and Structured Log
Expand All @@ -326,5 +326,7 @@ ASALocalRun/
# NVidia Nsight GPU debugger configuration file
*.nvuser

# MFractors (Xamarin productivity tool) working folder
# MFractors (Xamarin productivity tool) working folder
.mfractor/

*.Parm
14 changes: 4 additions & 10 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/src/Corsinvest.ProxmoxVE.NodeProtect/bin/Debug/netcoreapp3.1/cv4pve-node-protect.dll",
"program": "${workspaceFolder}/src/Corsinvest.ProxmoxVE.NodeProtect/bin/Debug/net8.0/cv4pve-node-protect.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Corsinvest.ProxmoxVE.NodeProtect",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
"request": "attach"
}
]
}
13 changes: 6 additions & 7 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/Corsinvest.ProxmoxVE.NodeProtect/Corsinvest.ProxmoxVE.NodeProtect.csproj",
"${workspaceFolder}/Corsinvest.ProxmoxVE.NodeProtect.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
Expand All @@ -19,9 +19,9 @@
"type": "process",
"args": [
"publish",
"${workspaceFolder}/src/Corsinvest.ProxmoxVE.NodeProtect/Corsinvest.ProxmoxVE.NodeProtect.csproj",
"${workspaceFolder}/Corsinvest.ProxmoxVE.NodeProtect.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
Expand All @@ -32,9 +32,8 @@
"args": [
"watch",
"run",
"${workspaceFolder}/src/Corsinvest.ProxmoxVE.NodeProtect/Corsinvest.ProxmoxVE.NodeProtect.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
"--project",
"${workspaceFolder}/Corsinvest.ProxmoxVE.NodeProtect.sln"
],
"problemMatcher": "$msCompile"
}
Expand Down
39 changes: 17 additions & 22 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,28 @@
[![License](https://img.shields.io/github/license/Corsinvest/cv4pve-node-protect.svg)](LICENSE.md)

```text
______ _ __
/ ____/___ __________(_)___ _ _____ _____/ /_
/ / / __ \/ ___/ ___/ / __ \ | / / _ \/ ___/ __/
/ /___/ /_/ / / (__ ) / / / / |/ / __(__ ) /_
\____/\____/_/ /____/_/_/ /_/|___/\___/____/\__/
______ _ __
/ ____/___ __________(_)___ _ _____ _____/ /_
/ / / __ \/ ___/ ___/ / __ \ | / / _ \/ ___/ __/
/ /___/ /_/ / / (__ ) / / / / |/ / __(__ ) /_
\____/\____/_/ /____/_/_/ /_/|___/\___/____/\__/
Node protect for Proxmox VE (Made in Italy)
cv4pve-node-protect is a part of suite cv4pve.
For more information visit https://www.corsinvest.it/cv4pve
Usage: cv4pve-node-protect [options]
Usage:
cv4pve-node-protect [command] [options]
Options:
-?|-h|--help Show help information
--version Show version information
--host The host name host[:port],host1[:port],host2[:port]
--username User name
--password The password
--username <username> User name
--password <password> The Password
--host <host> (REQUIRED) The host name host[:port],host1[:port],host2[:port]
--version Show version information
-?, -h, --help Show help and usage information
Commands:
app-check-update Check update application
app-upgrade Upgrade application
backup Backup configuration form nodes using ssh
upload Upload configuration tar.gz to node
Run 'cv4pve-node-protect [command] --help' for more information about a command.
cv4pve-node-protect is a part of suite cv4pve-tools.
For more information visit https://www.cv4pve-tools.com
backup Backup configuration form nodes using ssh
upload Upload configuration tar.gz to node
```

## Copyright and License
Expand All @@ -39,7 +34,7 @@ For licensing details please visit [LICENSE.md](LICENSE.md)

## Commercial Support

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)
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)

## Introduction

Expand Down
11 changes: 0 additions & 11 deletions appveyor.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFramework>net8.0</TargetFramework>

<Version>1.5.0</Version>
<Version>1.6.0</Version>
<Company>Corsinvest Srl</Company>
<Authors>Daniele Corsini</Authors>
<Copyright>Corsinvest Srl</Copyright>
Expand All @@ -13,13 +12,20 @@

<PackageProjectUrl>https://github.com/Corsinvest/cv4pve-node-protect</PackageProjectUrl>
<PackageTags>ProxmoxVE;Api,Client;Rest;Corsinvest;Node;Protect</PackageTags>
<PackageIcon>icon.png</PackageIcon>
<PackageReleaseNotes></PackageReleaseNotes>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<RepositoryUrl>https://github.com/Corsinvest/cv4pve-node-protect</RepositoryUrl>

<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
<PackageOutputPath>..\..\..\.nupkgs\</PackageOutputPath>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RepositoryType>Github</RepositoryType>
<RepositoryUrl>https://github.com/Corsinvest/cv4pve-node-protect</RepositoryUrl>

<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<!-- Include symbol files (*.pdb) in the built .nupkg -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>
$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>

<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand All @@ -33,8 +39,8 @@

<ItemGroup>
<!-- <ProjectReference Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Extension\Corsinvest.ProxmoxVE.Api.Extension.csproj" /> -->
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Extension" Version="7.3.6" />
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Extension" Version="8.1.3" />

<PackageReference Include="SSH.NET" Version="2020.0.2" />
<PackageReference Include="SSH.NET" Version="2024.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<Version>1.2.1</Version>
<TargetFramework>net6.0</TargetFramework>
<Version>1.4.0</Version>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>cv4pve-node-protect</AssemblyName>
<Company>Corsinvest Srl</Company>
<Authors>Daniele Corsini</Authors>
Expand All @@ -16,9 +16,9 @@

<ItemGroup>
<!-- <ProjectReference Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Shell\Corsinvest.ProxmoxVE.Api.Shell.csproj" /> -->
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="7.3.6" />
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="8.1.3" />

<!-- <ProjectReference Include="..\Corsinvest.ProxmoxVE.NodeProtect.Api\Corsinvest.ProxmoxVE.NodeProtect.Api.csproj" /> -->
<PackageReference Include="Corsinvest.ProxmoxVE.NodeProtect.Api" Version="1.5.0" />
<ProjectReference Include="..\Corsinvest.ProxmoxVE.NodeProtect.Api\Corsinvest.ProxmoxVE.NodeProtect.Api.csproj" />
<!-- <PackageReference Include="Corsinvest.ProxmoxVE.NodeProtect.Api" Version="1.5.0" /> -->
</ItemGroup>
</Project>
16 changes: 4 additions & 12 deletions src/Corsinvest.ProxmoxVE.NodeProtect/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,9 @@
* SPDX-FileCopyrightText: 2019 Copyright Corsinvest Srl
*/

using System.Threading.Tasks;
using Corsinvest.ProxmoxVE.Api.Shell.Helpers;
using Corsinvest.ProxmoxVE.NodeProtect;

namespace Corsinvest.ProxmoxVE.NodeProtect;

class Program
{
static async Task<int> Main(string[] args)
{
var app = ConsoleHelper.CreateApp("cv4pve-node-protect", "Node protect for Proxmox VE");
_ = new Commands(app);
return await app.ExecuteApp(args);
}
}
var app = ConsoleHelper.CreateApp("cv4pve-node-protect", "Node protect for Proxmox VE");
_ = new Commands(app);
return await app.ExecuteApp(args);
13 changes: 9 additions & 4 deletions src/Corsinvest.ProxmoxVE.NodeProtect/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@ Write-Output "
== Build System
========================================================="

$pathNet = "Bin\Release\net6.0"
$pathNet = "Bin\Release\net8.0"

Remove-Item -Path ".\$pathNet" -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","osx-arm64", "win-x86", "win-x64", "win-arm64")
foreach ($rid in $rids) {
dotnet publish -r $rid -c Release /p:PublishSingleFile=true --self-contained #/p:EnableCompressionInSingleFile=true
$path = "$pathNet\$rid\publish\"

$fileName = Get-ChildItem $path -Exclude *.pdb -name
$fileName = Get-ChildItem $path -Exclude *.pdb, *.xml -name
$fileDest = "$pathNet\$fileName-$rid.zip"
Remove-Item $fileDest -ErrorAction SilentlyContinue
Compress-Archive $path\$fileName $fileDest
}

Remove-Item "$pathNet\$rid" -Recurse -Force
}

Remove-Item "bin\debug" -Recurse -Force
Remove-Item "obj" -Recurse -Force

0 comments on commit f4326d1

Please sign in to comment.