Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install shfmt
uses: mfinelli/setup-shfmt@v4
with:
shfmt-version: 'latest'
shfmt-version: "latest"

- name: Run shfmt
run: shfmt -d .
24 changes: 15 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-added-large-files
- id: check-executables-have-shebangs
- id: trailing-whitespace
- id: check-added-large-files
- id: check-executables-have-shebangs
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- repo: https://github.com/scop/pre-commit-shfmt
- id: end-of-file-fixer
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.13.1-1
hooks:
- id: shfmt-docker
- repo: https://github.com/koalaman/shellcheck-precommit
- id: shfmt-docker
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.11.0
hooks:
- id: shellcheck
- id: shellcheck
args: ["--severity=warning", "--color=always"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
types_or: [markdown, yaml]
args: ["--write"]
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
![Inline-Checksum Logo](logo.png)

# Inline-Checksum

A POSIX compliant rework of [inline-md5sum](https://github.com/cmonr/inline-md5sum), adding support for sha256 and sha512 checksums.

This script is designed to alleviate some of the security concerns of running `curl <url> | sh -` by validating its input against a checksum before passing it along.
It also serves as a convenience wrapper for validating the checksum of an already existing file.

# Installation
Clone the repository, put `inline-checksum` anywhere on your $PATH, make sure it's executable, and you're all set.

Clone the repository, put `inline-checksum` anywhere on your $PATH, make sure it's executable, and you're all set.

You can install tab completions for Bash and Zsh by sourcing the included `inline-checksum-completions` file in your corresponding shell rc file.


You can run the full test suite by running `make test` to ensure that all dependencies are met and that things are behaving as you'd expect.
After running the test suite, you can clean up the generated log files with `make clean`.

# Usage

Assuming a site provides it, a checksum can be used to verify a downloaded script before running it as follows:

```sh
curl -fsSL <url> | inline-checksum [--algorithm[=| ]<sha256|sha512|md5>] <checksum> | sh -
```

Alternatively, a local file can have its checksum validated as follows:

```sh
inline-checksum [--algorithm[=| ]<sha256|sha512|md5>] <checksum> <file>
```

# Origin

Inline-Checksum is adapted and updated from the following source:

- The work of Cruz Monrreal on [inline-md5sum](https://github.com/cmonr/inline-md5sum) under the terms of the MIT License.

# License

Inline-Checksum is licensed under the terms of the [MIT License](LICENSE).