Skip to content

Commit

Permalink
Merge pull request #5 from tschaub/release-updates
Browse files Browse the repository at this point in the history
Doc and goreleaser config update
  • Loading branch information
tschaub authored Nov 8, 2024
2 parents cb4b1c0 + 3d73db3 commit 52a4ce7
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 10 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,19 @@ jobs:
with:
go-version: '1.22'
- run: go test -v ./...

release-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/[email protected]
with:
go-version: '1.22'
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: check
5 changes: 4 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
version: 2

before:
hooks:
- go mod tidy
Expand Down Expand Up @@ -27,7 +30,7 @@ dockers:
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
version_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
use: github-native
Expand Down
55 changes: 46 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,60 @@
## development notes
# Stash

Use mkcert for local certificate
A proxy that caches resources for offline use.

```shell
# install mkcert
Usage: stash --cert-file=STRING --key-file=STRING [flags]

Flags:
-h, --help Show context-sensitive help.
--port=9999 Listen on this port ($STASH_PORT).
--dir=".stash" Path to cache directory ($STASH_DIR)
--hosts=HOSTS,... Cache responses from these hosts ($STASH_HOSTS)
--cert-file=STRING Path to CA certificate file ($STASH_CERT_FILE)
--key-file=STRING Path to CA private key file ($STASH_KEY_FILE)
--[no-]cors Include CORS support (on by default).
--log-level="info" Log level ($STASH_LOG_LEVEL)
--log-format="text" Log format ($STASH_LOG_FORMAT)
```

## Installation

The `stash` program can be installed by downloading one of the archives from [the latest release](https://github.com/tschaub/stash/releases).

Extract the archive and place the `stash` executable somewhere on your path. See a list of available commands by running `stash` in your terminal.

Homebrew users can install the `stash` program with [`brew`](https://brew.sh/):

```shell
brew update
brew install tschaub/tap/stash
```

## Usage

In order to proxy https resources, you'll need to set up a locally trusted development certificate. Fortunately, this is easy with [`mkcert`](https://github.com/FiloSottile/mkcert/).

To install a locally trusted development certificate:

```shell
# install mkcert if you haven't already
brew install mkcert

# set up certificate
mkcert -install
```
Next, you'll need to determine the location of the certificate files.

# get location of files
mkcert -CAROOT
```shell
# get location of *.pem files
find "$(mkcert -CAROOT)" -name "*.pem"
```

Launch Chrome with proxy server set:
Make note of the location of the certificate `rootCA.pem` and key `rootCA-key.pem` files. You'll use the path to the `rootCA.pem` file in the `--cert-file` argument and the path to `rootCA-key.pem` in the `--key-file` argument to `stash`.

With `stash` running, you can configure your browser to use it as a proxy. For example, to launch Chrome using `stash` as a proxy do this:

```shell
# assuming Chrome is not already running
open -a "Google Chrome" --args --proxy-server="127.0.0.1:9999"
```

Ideas:
* maybe use symbolic link from extensionless file to file with extension to get content-type from the file server

0 comments on commit 52a4ce7

Please sign in to comment.