diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml index 15c289e..b9453c1 100644 --- a/.github/workflows/format.yaml +++ b/.github/workflows/format.yaml @@ -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 . diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 887b8af..999396b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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"] diff --git a/README.md b/README.md index 9dfec22..308d0af 100644 --- a/README.md +++ b/README.md @@ -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 | 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 | inline-checksum [--algorithm[=| ]] | sh - ``` Alternatively, a local file can have its checksum validated as follows: + ```sh inline-checksum [--algorithm[=| ]] ``` # 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).