Skip to content

Commit 1de33c4

Browse files
authored
Documentation updates (#1395)
- Update README to point to https://sshnet.github.io/SSH.NET rather than the CHM file - Add a CONTRIBUTING.md with some how-tos For https://sshnet.github.io/SSH.NET: - Use the repo README as the landing page to keep them in sync - Combine the API-per-TFM pages to just one "API" page - Add a couple more examples - Add a GitHub link in the header.
1 parent 0cfeb6b commit 1de33c4

File tree

13 files changed

+181
-302
lines changed

13 files changed

+181
-302
lines changed

.gitignore

+2-7
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,5 @@ $RECYCLE.BIN/
487487
build/target/
488488

489489
# 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/**
490+
docfx/_site/
491+
docfx/api/

CONTRIBUTING.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Contributions in the form of issues, pull requests (PRs) and discussions are welcome to this repository. Please consider that the library is currently maintained as a hobby by a small number of individuals. As such, depending on the weather, work, private lives etc., your PR may wait an indeterminate amount of time before being addressed. Generally speaking, the more targeted and better tested the change, the quicker it can be merged.
2+
3+
## Building
4+
5+
The library has no special requirements to build, other than an up-to-date .NET SDK, and can be built from within the IDE or with `dotnet build` at the command line.
6+
7+
This repository also hosts the source for https://sshnet.github.io/SSH.NET/, which is built using [docfx](https://dotnet.github.io/docfx/index.html) and whose source files are in the `docfx/` directory. In order to build the site, install the docfx dotnet tool with `dotnet tool update -g docfx` and then run `docfx docfx/docfx.json --serve` from the root of the repository. When it completes, you should see e.g.
8+
9+
```
10+
Serving "E:\github\SSH.NET\docfx\_site" on http://localhost:8080. Press Ctrl+C to shut down.
11+
```
12+
13+
from which you can view the local version of the site. When making iterative changes, run `docfx docfx/docfx.json` from a separate command line and refresh the browser.
14+
15+
## Testing
16+
17+
The library has a test project for unit tests and a test project for integration tests. The latter uses [Testcontainers](https://dotnet.testcontainers.org/) which has a dependency on Docker. Practically, on Windows, an installation of Docker Desktop is all that is required, without any additional configuration. With Docker Desktop running, the integration tests can run like normal tests from within the IDE or with `dotnet test` at the command line.
18+
19+
Code coverage information can be generated for all test projects at once or for individual test projects. From the root of the repository or from the individual test project directory, run `dotnet test --collect:"XPlat Code Coverage"`.
20+
21+
The coverage information can be visualised using e.g. [ReportGenerator](https://reportgenerator.io/). Install the ReportGenerator dotnet tool with `dotnet tool update -g dotnet-reportgenerator-globaltool` and then run
22+
23+
```
24+
reportgenerator -reports:**/coverage.cobertura.xml -targetdir:TestResults/CoverageReport -assemblyfilters:+Renci.SshNet
25+
```
26+
27+
View the report by opening TestResults/CoverageReport/index.html in the browser.
28+
29+
Before subsequent coverage collections, delete the previous collections with `git clean -fX test/` to prevent previous coverage files from being included in the subsequent generated report.
30+
31+
## CI
32+
33+
The repository makes use of continuous integration (CI) on [AppVeyor](https://ci.appveyor.com/project/drieseng/ssh-net/history) to validate builds and tests on PR branches and non-PR branches. At the time of writing, some tests can occasionally fail in CI due to a dependency on timing or a dependency on networking/socket code. If you see an existing test which is unrelated to your changes occasionally failing in CI but passing locally, you probably don't need to worry about it. If you see one of your newly-added tests failing, it is probably worth investigating why and whether it can be made more stable.
34+
35+
## Good to know
36+
37+
### TraceSource logging
38+
39+
The Debug build of SSH.NET contains rudimentary logging functionality via `System.Diagnostics.TraceSource`. See `Renci.SshNet.Abstractions.DiagnosticAbstraction` for usage examples.
40+
41+
### Wireshark
42+
43+
Wireshark is able to dissect initial connection packets, such as key exchange, before encryption happens. Enter "ssh" as the display filter. See https://wiki.wireshark.org/SSH.md for more information.

README.md

+24-28
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,8 @@ to achieve the best performance possible.
1414

1515
## Documentation
1616

17-
There is MSDN-style class documentation in a .chm file for each release, which you can find in the Assets section
18-
of the [latest release](https://github.com/sshnet/SSH.NET/releases/latest) page. Please note that you will need
19-
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)
20-
the CHM file after you download it.
21-
22-
Currently (4/18/2020), the documentation is very sparse. Fortunately, there are a large number of tests in
23-
[Renci.SshNet.Tests](https://github.com/sshnet/SSH.NET/tree/develop/test/Renci.SshNet.Tests) that demonstrate
24-
usage with working code.
25-
17+
Documentation is hosted at https://sshnet.github.io/SSH.NET/. Currently (4/18/2020), the documentation is very sparse.
18+
Fortunately, there are a large number of [tests](https://github.com/sshnet/SSH.NET/tree/develop/test/) that demonstrate usage with working code.
2619
If the test for the functionality you would like to see documented is not complete, then you are cordially
2720
invited to read the source, Luke, and highly encouraged to generate a pull request for the implementation of
2821
the missing test once you figure things out. 🤓
@@ -45,13 +38,15 @@ the missing test once you figure things out. 🤓
4538
## Encryption Method
4639

4740
**SSH.NET** supports the following encryption methods:
41+
* aes128-ctr
42+
* aes192-ctr
4843
* aes256-ctr
49-
* 3des-cbc
44+
* aes128-gcm<span></span>@openssh.com (.NET 6 and higher)
45+
* aes256-gcm<span></span>@openssh.com (.NET 6 and higher)
5046
* aes128-cbc
5147
* aes192-cbc
5248
* aes256-cbc
53-
* aes128-gcm<span></span>@openssh.com (.NET 6 and higher)
54-
* aes256-gcm<span></span>@openssh.com (.NET 6 and higher)
49+
* 3des-cbc
5550
* blowfish-cbc
5651
* twofish-cbc
5752
* twofish192-cbc
@@ -61,8 +56,6 @@ the missing test once you figure things out. 🤓
6156
* arcfour128
6257
* arcfour256
6358
* cast128-cbc
64-
* aes128-ctr
65-
* aes192-ctr
6659

6760
## Key Exchange Method
6861

@@ -82,10 +75,10 @@ the missing test once you figure things out. 🤓
8275
## Public Key Authentication
8376

8477
**SSH.NET** supports the following private key formats:
85-
* RSA in OpenSSL PEM and ssh.com format
86-
* DSA in OpenSSL PEM and ssh.com format
87-
* ECDSA 256/384/521 in OpenSSL PEM format
88-
* ECDSA 256/384/521, ED25519 and RSA in OpenSSH key format
78+
* RSA in OpenSSL PEM ("BEGIN RSA PRIVATE KEY") and ssh.com ("BEGIN SSH2 ENCRYPTED PRIVATE KEY") format
79+
* DSA in OpenSSL PEM ("BEGIN DSA PRIVATE KEY") and ssh.com ("BEGIN SSH2 ENCRYPTED PRIVATE KEY") format
80+
* ECDSA 256/384/521 in OpenSSL PEM format ("BEGIN EC PRIVATE KEY")
81+
* ECDSA 256/384/521, ED25519 and RSA in OpenSSH key format ("BEGIN OPENSSH PRIVATE KEY")
8982

9083
Private keys can be encrypted using one of the following cipher methods:
9184
* DES-EDE3-CBC
@@ -110,21 +103,20 @@ Private keys can be encrypted using one of the following cipher methods:
110103
## Message Authentication Code
111104

112105
**SSH.NET** supports the following MAC algorithms:
113-
* hmac-md5
114-
* hmac-md5-96
115-
* hmac-sha1
116-
* hmac-sha1-96
117106
* hmac-sha2-256
118-
* hmac-sha2-256-96
119107
* hmac-sha2-512
120108
* hmac-sha2-512-96
121-
* hmac-md5-etm<span></span>@openssh.com
122-
* hmac-md5-96-etm<span></span>@openssh.com
123-
* hmac-sha1-etm<span></span>@openssh.com
124-
* hmac-sha1-96-etm<span></span>@openssh.com
109+
* hmac-sha2-256-96
110+
* hmac-sha1
111+
* hmac-sha1-96
112+
* hmac-md5
113+
* hmac-md5-96
125114
* hmac-sha2-256-etm<span></span>@openssh.com
126115
* hmac-sha2-512-etm<span></span>@openssh.com
127-
116+
* hmac-sha1-etm<span></span>@openssh.com
117+
* hmac-sha1-96-etm<span></span>@openssh.com
118+
* hmac-md5-etm<span></span>@openssh.com
119+
* hmac-md5-96-etm<span></span>@openssh.com
128120

129121
## Compression
130122

@@ -174,6 +166,10 @@ using (var client = new SshClient("sftp.foo.com", "guest", "pwd"))
174166
}
175167
```
176168

169+
## Building the library
170+
171+
The library has no special requirements to build, other than an up-to-date .NET SDK. See also [CONTRIBUTING.md](https://github.com/sshnet/SSH.NET/blob/develop/CONTRIBUTING.md).
172+
177173
## Supporting SSH.NET
178174

179175
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.

docfx/docfx.json

+4-80
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json",
23
"metadata": [
34
{
45
"src": [
@@ -10,85 +11,7 @@
1011
}
1112
],
1213
"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-
}
14+
"output": "api"
9215
}
9316
],
9417
"build": {
@@ -110,7 +33,8 @@
11033
"output": "_site",
11134
"template": [
11235
"default",
113-
"modern"
36+
"modern",
37+
"template"
11438
],
11539
"globalMetadata": {
11640
"_appName": "SSH.NET",

docfx/docs/features.md

-102
This file was deleted.

docfx/docs/foreword.md

-14
This file was deleted.

docfx/docs/toc.yml

-6
This file was deleted.

0 commit comments

Comments
 (0)