Skip to content

Commit dd36d5b

Browse files
authored
Added support for GitHub pages using docfx (#1358)
* Added support for GitHub pages using docfx * Fixed StyleCop warning. * Fixed other StyleCop warnings.
1 parent 4cab7e5 commit dd36d5b

File tree

17 files changed

+376
-1
lines changed

17 files changed

+376
-1
lines changed

.github/workflows/docs.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
deploy:
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Pages
28+
uses: actions/configure-pages@v4
29+
30+
- name: Setup .NET 8.0
31+
uses: actions/setup-dotnet@v4
32+
with:
33+
dotnet-version: 8.x
34+
35+
- name: Setup docfx
36+
run: dotnet tool update -g docfx
37+
38+
- name: Build documentation
39+
run: docfx ./docfx/docfx.json
40+
41+
- name: Upload documentation
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: './docfx/_site'
45+
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -485,3 +485,12 @@ $RECYCLE.BIN/
485485

486486
# Build outputs
487487
build/target/
488+
489+
# Docs
490+
docfx/_site/**
491+
docfx/net462/**
492+
docfx/netstandard2.0/**
493+
docfx/netstandard2.1/**
494+
docfx/net6.0/**
495+
docfx/net7.0/**
496+
docfx/net8.0/**

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ SSH.NET is a Secure Shell (SSH-2) library for .NET, optimized for parallelism.
77
[![Build status](https://ci.appveyor.com/api/projects/status/ih77qu6tap3o92gu/branch/develop?svg=true)](https://ci.appveyor.com/api/projects/status/ih77qu6tap3o92gu/branch/develop)
88

99
## Introduction
10+
1011
This project was inspired by **Sharp.SSH** library which was ported from java and it seems like was not supported
1112
for quite some time. This library is a complete rewrite, without any third party dependencies, using parallelism
1213
to achieve the best performance possible.
1314

1415
## Documentation
16+
1517
There is MSDN-style class documentation in a .chm file for each release, which you can find in the Assets section
1618
of the [latest release](https://github.com/sshnet/SSH.NET/releases/latest) page. Please note that you will need
1719
to [right-click and "unblock"](https://support.microsoft.com/en-us/help/2021383/some-chm-files-may-not-render-properly-on-windows-vista-and-windows-7)
@@ -26,6 +28,7 @@ invited to read the source, Luke, and highly encouraged to generate a pull reque
2628
the missing test once you figure things out. 🤓
2729

2830
## Features
31+
2932
* Execution of SSH command using both synchronous and asynchronous methods
3033
* Return command execution exit status and other information
3134
* Provide SFTP functionality for both synchronous and asynchronous operations
@@ -121,6 +124,7 @@ Private keys can be encrypted using one of the following cipher methods:
121124
* hmac-sha2-512-etm<span></span>@openssh.com
122125

123126
## Framework Support
127+
124128
**SSH.NET** supports the following target frameworks:
125129
* .NETFramework 4.6.2 (and higher)
126130
* .NET Standard 2.0 and 2.1

docfx/docfx.json

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
{
2+
"metadata": [
3+
{
4+
"src": [
5+
{
6+
"src": "../src",
7+
"files": [
8+
"**/*.csproj"
9+
]
10+
}
11+
],
12+
"outputFormat": "apiPage",
13+
"dest": "net462",
14+
"properties": {
15+
"TargetFramework": "net462"
16+
}
17+
},
18+
{
19+
"src": [
20+
{
21+
"src": "../src",
22+
"files": [
23+
"**/*.csproj"
24+
]
25+
}
26+
],
27+
"outputFormat": "apiPage",
28+
"dest": "netstandard2.0",
29+
"properties": {
30+
"TargetFramework": "netstandard2.0"
31+
}
32+
},
33+
{
34+
"src": [
35+
{
36+
"src": "../src",
37+
"files": [
38+
"**/*.csproj"
39+
]
40+
}
41+
],
42+
"outputFormat": "apiPage",
43+
"dest": "netstandard2.1",
44+
"properties": {
45+
"TargetFramework": "netstandard2.1"
46+
}
47+
},
48+
{
49+
"src": [
50+
{
51+
"src": "../src",
52+
"files": [
53+
"**/*.csproj"
54+
]
55+
}
56+
],
57+
"outputFormat": "apiPage",
58+
"dest": "net6.0",
59+
"properties": {
60+
"TargetFramework": "net6.0"
61+
}
62+
},
63+
{
64+
"src": [
65+
{
66+
"src": "../src",
67+
"files": [
68+
"**/*.csproj"
69+
]
70+
}
71+
],
72+
"outputFormat": "apiPage",
73+
"dest": "net7.0",
74+
"properties": {
75+
"TargetFramework": "net7.0"
76+
}
77+
},
78+
{
79+
"src": [
80+
{
81+
"src": "../src",
82+
"files": [
83+
"**/*.csproj"
84+
]
85+
}
86+
],
87+
"outputFormat": "apiPage",
88+
"dest": "net8.0",
89+
"properties": {
90+
"TargetFramework": "net8.0"
91+
}
92+
}
93+
],
94+
"build": {
95+
"content": [
96+
{
97+
"files": "**/*.{md,yml}",
98+
"exclude": [
99+
"_site/**"
100+
]
101+
}
102+
],
103+
"resource": [
104+
{
105+
"files": [
106+
"images/**"
107+
]
108+
}
109+
],
110+
"output": "_site",
111+
"template": [
112+
"default",
113+
"modern"
114+
],
115+
"globalMetadata": {
116+
"_appName": "SSH.NET",
117+
"_appTitle": "SSH.NET - A Secure Shell (SSH) library for .NET, optimized for parallelism",
118+
"_appLogoPath": "images/logo.png",
119+
"_appFaviconPath": "images/icon.png",
120+
"_appFooter": "Copyright (c) Renci, Oleg Kapeljushnik, Gert Driesen and contributors",
121+
"_enableSearch": true
122+
}
123+
}
124+
}

docfx/docs/features.md

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Features
2+
3+
* Execution of SSH command using both synchronous and asynchronous methods
4+
* Return command execution exit status and other information
5+
* Provide SFTP functionality for both synchronous and asynchronous operations
6+
* Provides SCP functionality
7+
* Provide status report for upload and download sftp operations to allow accurate progress bar implementation
8+
* Remote, dynamic and local port forwarding
9+
* Shell/Terminal implementation
10+
* Specify key file pass phrase
11+
* Use multiple key files to authenticate
12+
* Supports publickey, password and keyboard-interactive authentication methods
13+
* Supports two-factor or higher authentication
14+
* Supports SOCKS4, SOCKS5 and HTTP Proxy
15+
16+
## Encryption Method
17+
18+
**SSH.NET** supports the following encryption methods:
19+
* aes256-ctr
20+
* 3des-cbc
21+
* aes128-cbc
22+
* aes192-cbc
23+
* aes256-cbc
24+
* blowfish-cbc
25+
* twofish-cbc
26+
* twofish192-cbc
27+
* twofish128-cbc
28+
* twofish256-cbc
29+
* arcfour
30+
* arcfour128
31+
* arcfour256
32+
* cast128-cbc
33+
* aes128-ctr
34+
* aes192-ctr
35+
36+
## Key Exchange Method
37+
38+
**SSH.NET** supports the following key exchange methods:
39+
* curve25519-sha256
40+
* curve25519-sha256<span></span>@libssh.org
41+
* ecdh-sha2-nistp256
42+
* ecdh-sha2-nistp384
43+
* ecdh-sha2-nistp521
44+
* diffie-hellman-group-exchange-sha256
45+
* diffie-hellman-group-exchange-sha1
46+
* diffie-hellman-group16-sha512
47+
* diffie-hellman-group14-sha256
48+
* diffie-hellman-group14-sha1
49+
* diffie-hellman-group1-sha1
50+
51+
## Public Key Authentication
52+
53+
**SSH.NET** supports the following private key formats:
54+
* RSA in OpenSSL PEM and ssh.com format
55+
* DSA in OpenSSL PEM and ssh.com format
56+
* ECDSA 256/384/521 in OpenSSL PEM format
57+
* ECDSA 256/384/521, ED25519 and RSA in OpenSSH key format
58+
59+
Private keys can be encrypted using one of the following cipher methods:
60+
* DES-EDE3-CBC
61+
* DES-EDE3-CFB
62+
* DES-CBC
63+
* AES-128-CBC
64+
* AES-192-CBC
65+
* AES-256-CBC
66+
67+
## Host Key Algorithms
68+
69+
**SSH.NET** supports the following host key algorithms:
70+
* ssh-ed25519
71+
* ecdsa-sha2-nistp256
72+
* ecdsa-sha2-nistp384
73+
* ecdsa-sha2-nistp521
74+
* rsa-sha2-512
75+
* rsa-sha2-256
76+
* ssh-rsa
77+
* ssh-dss
78+
79+
## Message Authentication Code
80+
81+
**SSH.NET** supports the following MAC algorithms:
82+
* hmac-md5
83+
* hmac-md5-96
84+
* hmac-sha1
85+
* hmac-sha1-96
86+
* hmac-sha2-256
87+
* hmac-sha2-256-96
88+
* hmac-sha2-512
89+
* hmac-sha2-512-96
90+
* hmac-md5-etm<span></span>@openssh.com
91+
* hmac-md5-96-etm<span></span>@openssh.com
92+
* hmac-sha1-etm<span></span>@openssh.com
93+
* hmac-sha1-96-etm<span></span>@openssh.com
94+
* hmac-sha2-256-etm<span></span>@openssh.com
95+
* hmac-sha2-512-etm<span></span>@openssh.com
96+
97+
## Framework Support
98+
99+
**SSH.NET** supports the following target frameworks:
100+
* .NETFramework 4.6.2 (and higher)
101+
* .NET Standard 2.0 and 2.1
102+
* .NET 6 (and higher)

docfx/docs/foreword.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Foreword
2+
3+
There is MSDN-style class documentation in a .chm file for each release, which you can find in the Assets section
4+
of the [latest release](https://github.com/sshnet/SSH.NET/releases/latest) page. Please note that you will need
5+
to [right-click and "unblock"](https://support.microsoft.com/en-us/help/2021383/some-chm-files-may-not-render-properly-on-windows-vista-and-windows-7)
6+
the CHM file after you download it.
7+
8+
Currently (4/18/2020), the documentation is very sparse. Fortunately, there are a large number of tests in
9+
[Renci.SshNet.Tests](https://github.com/sshnet/SSH.NET/tree/develop/test/Renci.SshNet.Tests) that demonstrate
10+
usage with working code.
11+
12+
If the test for the functionality you would like to see documented is not complete, then you are cordially
13+
invited to read the source, Luke, and highly encouraged to generate a pull request for the implementation of
14+
the missing test once you figure things out. 🤓

docfx/docs/toc.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- name: Foreword
2+
href: foreword.md
3+
- name: Features
4+
href: features.md
5+
- name: Usage
6+
href: usage.md

docfx/docs/usage.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Usage
2+
3+
## Multi-factor authentication
4+
5+
Establish a SFTP connection using both password and public-key authentication:
6+
7+
```cs
8+
var connectionInfo = new ConnectionInfo("sftp.foo.com",
9+
"guest",
10+
new PasswordAuthenticationMethod("guest", "pwd"),
11+
new PrivateKeyAuthenticationMethod("rsa.key"));
12+
using (var client = new SftpClient(connectionInfo))
13+
{
14+
client.Connect();
15+
}
16+
17+
```
18+
19+
## Verify host identify
20+
21+
Establish a SSH connection using user name and password, and reject the connection if the fingerprint of the server does not match the expected fingerprint:
22+
23+
```cs
24+
string expectedFingerPrint = "LKOy5LvmtEe17S4lyxVXqvs7uPMy+yF79MQpHeCs/Qo";
25+
26+
using (var client = new SshClient("sftp.foo.com", "guest", "pwd"))
27+
{
28+
client.HostKeyReceived += (sender, e) =>
29+
{
30+
e.CanTrust = expectedFingerPrint.Equals(e.FingerPrintSHA256);
31+
};
32+
client.Connect();
33+
}
34+
```

docfx/images/icon.png

34.6 KB
Loading

docfx/images/logo.png

7.4 KB
Loading

docfx/index.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
_layout: landing
3+
---
4+
5+
SSH.NET is a Secure Shell (SSH-2) library for .NET, optimized for parallelism.
6+
7+
[![Version](https://img.shields.io/nuget/vpre/SSH.NET.svg)](https://www.nuget.org/packages/SSH.NET)
8+
[![NuGet download count](https://img.shields.io/nuget/dt/SSH.NET.svg)](https://www.nuget.org/packages/SSH.NET)
9+
[![Build status](https://ci.appveyor.com/api/projects/status/ih77qu6tap3o92gu/branch/develop?svg=true)](https://ci.appveyor.com/api/projects/status/ih77qu6tap3o92gu/branch/develop)
10+
11+
## Introduction
12+
13+
This project was inspired by **Sharp.SSH** library which was ported from java and it seems like was not supported
14+
for quite some time. This library is a complete rewrite, without any third party dependencies, using parallelism
15+
to achieve the best performance possible.
16+
17+
## Supporting SSH.NET
18+
19+
Do you or your company rely on **SSH.NET** in your projects? If you want to encourage us to keep on going and show us that you appreciate our work, please consider becoming a [sponsor](https://github.com/sponsors/sshnet) through GitHub Sponsors.

0 commit comments

Comments
 (0)