Skip to content

Commit

Permalink
tweak README [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Nov 10, 2018
1 parent 472a014 commit b179163
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ GitHub and replaces itself.
- Many archive and compression formats are supported (zip, tar, gzip, xzip)
- Support private repositories
- Support [GitHub Enterprise][]
- Support hash, signature validation
- Support hash, signature validation (thanks to [@tobiaskohlbau](https://github.com/tobiaskohlbau))

And small wrapper CLIs are provided:

Expand All @@ -41,6 +41,8 @@ And small wrapper CLIs are provided:
[go-github-selfupdate]: https://github.com/rhysd/go-github-selfupdate
[GitHub Releases API]: https://developer.github.com/v3/repos/releases/



## Try Out Example

Example to understand what this library does is prepared as [CLI](./cmd/selfupdate-example/main.go).
Expand Down Expand Up @@ -81,6 +83,8 @@ Following tools are using this library.
- [akashic](https://github.com/cowlick/akashic)
- [butler](https://github.com/netzkern/butler)



## Usage

### Code Usage
Expand Down Expand Up @@ -225,6 +229,7 @@ API does not work without authentication.
If your GitHub Enterprise instance's upload URL is different from the base URL, please also set `EnterpriseUploadURL`
field


### Naming Rules of Released Binaries

go-github-selfupdate assumes that released binaries are put for each combination of platforms and archs.
Expand Down Expand Up @@ -299,6 +304,7 @@ In summary, structure of releases on GitHub looks like:
Tags which don't contain a version number are ignored (i.e. `nightly`). And releases marked
as `pre-release` are also ignored.


### Hash or Signature Validation

go-github-selfupdate supports hash or signature validatiom of the downloaded files. It comes
Expand All @@ -317,7 +323,7 @@ type Validator interface {
}
```

## SHA256
#### SHA256

To verify the integrity by SHA256 generate a hash sum and save it within a file which has the
same naming as original file with the suffix `.sha256`.
Expand All @@ -326,7 +332,7 @@ For e.g. use sha256sum, the file `selfupdate/testdata/foo.zip.sha256` is generat
sha256sum foo.zip > foo.zip.sha256
```

## ECDSA
#### ECDSA
To verify the signature by ECDSA generate a signature and save it within a file which has the
same naming as original file with the suffix `.sig`.
For e.g. use openssl, the file `selfupdate/testdata/foo.zip.sig` is generated with:
Expand All @@ -337,9 +343,11 @@ openssl dgst -sha256 -sign Test.pem -out foo.zip.sig foo.zip
go-github-selfupdate makes use of go internal crypto package. Therefore the used private key
has to be compatbile with FIPS 186-3.

### Development

#### Running tests

## Development

### Running tests

All library sources are put in `/selfupdate` directory. So you can run tests as following
at the top of the repository:
Expand All @@ -360,7 +368,8 @@ Above command run almost all tests and it's enough to check the behavior before
Some tests are still not tested because they depend on my personal API access token, though; for repositories
on GitHub Enterprise or private repositories on GitHub.

#### Debugging

### Debugging

This library can output logs for debugging. By default, logger is disabled.
You can enable the logger by following and can know the details of the self update.
Expand All @@ -369,12 +378,15 @@ You can enable the logger by following and can know the details of the self upda
selfupdate.EnableLog()
```

#### CI

### CI

Tests run on CIs (Travis CI, Appveyor) are run with the token I generated. However, because of security
reason, it is not used for the tests for pull requests. In the tests, a GitHub API token is not set and
API rate limit is often exceeding. So please ignore the test failures on creating a pull request.



## Dependencies

This library utilizes
Expand All @@ -396,6 +408,8 @@ This library utilizes
[semver]: https://github.com/blang/semver
[xz]: https://github.com/ulikunitz/xz



## What is different from [tj/go-update][]?

This library goal is the same as tj/go-update, but it's different in following points.
Expand All @@ -410,6 +424,8 @@ tj/go-update:

[tj/go-update]: https://github.com/tj/go-update



## License

Distributed under the [MIT License](LICENSE)
Expand Down
2 changes: 1 addition & 1 deletion selfupdate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type ECDSAValidator struct {
}

// Validate validates the ECDSA signature the release against the signature
// contained in an addtional asset file.
// contained in an additional asset file.
// additional asset file.
func (v *ECDSAValidator) Validate(input, signature []byte) error {
h := sha256.New()
Expand Down

0 comments on commit b179163

Please sign in to comment.