Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit f381389
Author: Antonio Mika <[email protected]>
Date:   Tue Apr 30 16:52:08 2024 -0400

    Update deps (antoniomika#302)

    * Update deps

    * Use bufio reader

    * Revert "Use bufio reader"

    This reverts commit c8003d4.

    * Print peeked info

    * Revert "Revert "Use bufio reader""

    This reverts commit ff656b0.

    * Fixed sni reading

    * Handle sni based unix conn better

commit 81e4350
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 19 09:36:38 2024 -0400

    Bump golang.org/x/net from 0.22.0 to 0.23.0 (antoniomika#301)

    Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0.
    - [Commits](golang/net@v0.22.0...v0.23.0)

    ---
    updated-dependencies:
    - dependency-name: golang.org/x/net
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 7ad6956
Author: Antonio Mika <[email protected]>
Date:   Fri Mar 8 08:56:04 2024 -0500

    Enable the use of environment vars (antoniomika#300)

commit 9f3f566
Author: Antonio Mika <[email protected]>
Date:   Thu Mar 7 18:33:15 2024 -0500

    Update to go 1.22 and use multilistener (antoniomika#298)

    * Update to go 1.22 and use multilistener

    * Update

    * Updates

    * Set ports for tcp addresses properly

    * Fix address separator

    * Fixes

    * Update multilistener

    * Cleanup rogue log

commit d0511c4
Author: Eric Bower <[email protected]>
Date:   Thu Mar 7 09:13:34 2024 -0500

    chore: update pdocs to latest (antoniomika#295)

    * chore: update pdocs to latest

    * design: sidebar

commit 3ad5105
Author: Eric Bower <[email protected]>
Date:   Tue Feb 13 10:24:03 2024 -0500

    feat(docs): sitemap with links for headers (antoniomika#292)

commit c64d009
Author: Dominik Konik <[email protected]>
Date:   Mon Feb 12 23:08:27 2024 -0500

    Fix typo in comment (antoniomika#294)

commit e8c56f6
Author: Antonio Mika <[email protected]>
Date:   Mon Jan 29 10:30:04 2024 -0500

    Fix docs build

commit 97edc2e
Author: Antonio Mika <[email protected]>
Date:   Mon Jan 29 10:26:41 2024 -0500

    Run go mod tidy

commit 0c4f193
Author: Eric Bower <[email protected]>
Date:   Mon Jan 29 10:17:13 2024 -0500

    feat: docs site (antoniomika#286)

    * feat: docs site

    * docs: copy

    * chore(docs): update cli post

    * revert

    * chore: go.mod

commit 6892112
Author: Antonio Mika <[email protected]>
Date:   Tue Jan 23 11:32:29 2024 -0500

    Initial work on private aliases (antoniomika#291)

    * Initial work on private aliases

    * Ensure the current user is allowed to access the alias

    * Print the self ssh fingerprint

    * Add pubkeyfingerprint to alias log line

    * Start conn with self allowed for tcp aliases

    * Cleanup

commit 4ed4208
Author: Antonio Mika <[email protected]>
Date:   Thu Oct 12 16:20:01 2023 -0400

    Pin golang to major.minor.patch (antoniomika#284)

    * Pin golang to major.minor.patch

    * Update package deps

commit 7ca0808
Author: Antonio Mika <[email protected]>
Date:   Wed Oct 11 19:49:44 2023 -0400

    Update golang versions. Supersedes up antoniomika#282 (antoniomika#283)

commit b89a463
Author: Antonio Mika <[email protected]>
Date:   Mon Oct 9 14:48:00 2023 -0400

    Set conn deadline to both reads and writes (antoniomika#281)

commit 56816e6
Author: Antonio Mika <[email protected]>
Date:   Sat Oct 7 20:14:32 2023 -0400

    Updated go deps and general package work (antoniomika#279)

    * Updated go deps and general package work

    * Update used go version to 1.21

    * feat: wildcard support

    * Fixed lint

    * feat: auto redirect to https

    * Use proper hostname in redirect

    * Add wildcards to sni proxy

    * Ensure wildcard isn't too greedy and fix sni on https port

    * Code cleanup

    ---------

    Co-authored-by: Son Nguyen <[email protected]>

commit 62dec83
Author: Antonio Mika <[email protected]>
Date:   Tue Dec 20 13:31:17 2022 -0500

    Use original address for forwarded channel. Fix antoniomika#237

commit c54d681
Author: Antonio Mika <[email protected]>
Date:   Mon Dec 12 12:04:17 2022 -0500

    Force lower case aliases and subdomains

commit 4b5c2db
Author: Antonio Mika <[email protected]>
Date:   Mon Dec 12 10:56:14 2022 -0500

    Update ci/cd and deps (antoniomika#262)

    * Update ci/cd and deps

    * Fix build args

commit a8236e5
Author: Antonio Mika <[email protected]>
Date:   Tue Oct 25 10:20:34 2022 -0400

    Fixed http override port (antoniomika#256)

    * Fixed http override port

    * Cleanup references used for establishing tunnels

    * Removed short flag from authentication-key-request-url

commit fe2b1c2
Author: Roshan Jobanputra <[email protected]>
Date:   Fri Oct 21 12:04:10 2022 -0400

    Add authentication-key-request-url option  (antoniomika#247)

    * Add authentication-key-request-url option to allow validation of ssh public key auth via an http POST request to a separate application

    * Switch to using JSON body in request and include username & remote address of client.

commit bcd6911
Author: Sabri Eyuboglu <[email protected]>
Date:   Fri Oct 21 09:02:58 2022 -0700

    Add a check to the gcloud DNS record instructions (antoniomika#251)

    Add commands for checking that the DNS records were set up correctly. Inspired by the issue antoniomika#250

commit 9696686
Author: Antonio Mika <[email protected]>
Date:   Fri Oct 21 11:44:48 2022 -0400

    Added streaming for httpmuxer (antoniomika#255)

    * Added streaming for httpmuxer

    * Fix gzip response checking

commit 890c931
Author: Antonio Mika <[email protected]>
Date:   Mon Oct 17 12:17:52 2022 -0400

    Added full route identifiers

commit 7aecd2d
Author: Artem Ivanov <[email protected]>
Date:   Sun Sep 11 18:56:59 2022 +0200

    fix ondemand cert issuing (antoniomika#243)

commit c49a1ca
Author: Antonio Mika <[email protected]>
Date:   Sun Sep 11 12:55:54 2022 -0400

    Fixed acme tls-alpn challenges (antoniomika#244)

    * Fixed acme tls-alpn challenges

    * Return connection to default handler if unable to read hello

    * Fix peek check

    * Simplify dockerfile and update dependencies

    * Cleanup build cache requirements

commit b8ab4cf
Merge: 8f44621 3768d42
Author: Antonio Mika <[email protected]>
Date:   Wed Aug 24 11:41:25 2022 -0400

    Merge pull request antoniomika#241 from antoniomika/am/upgrade-go-1-19

    Updated sish to go 1.19

commit 3768d42
Author: Antonio Mika <[email protected]>
Date:   Wed Aug 24 11:26:25 2022 -0400

    Update dependencies

commit 58df1cd
Author: Antonio Mika <[email protected]>
Date:   Wed Aug 24 11:13:16 2022 -0400

    Updated sish to go 1.19

commit 8f44621
Author: Tim Krins <[email protected]>
Date:   Wed Aug 24 16:10:36 2022 +0100

    Expanded debug logging, fix deprecations (antoniomika#240)

    * Add debug messages for aborted requests

    * Don't use %s for Println

    * Fix deprecated ioutil calls

    * Fix incorrect leading spaces for comment

    * Add debug-interval option

    * Align debug logging syntax with existing error logging

    * Fix linting errors, fix status logging

    * Ensure debug-interval is not zero

commit 4a28b9e
Author: Antonio Mika <[email protected]>
Date:   Fri Aug 5 22:22:38 2022 -0400

    Update gcloud.md

    Closes antoniomika#238
  • Loading branch information
widhaprasa committed May 27, 2024
1 parent ea794bb commit f4aaa89
Show file tree
Hide file tree
Showing 59 changed files with 5,050 additions and 1,379 deletions.
7 changes: 7 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Automatically sets up your devbox environment whenever you cd into this
# directory via our direnv integration:

eval "$(devbox generate direnv --print-envrc --env-file .env.devbox)"

# check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/
# for more details
118 changes: 118 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Test and Build

on:
workflow_dispatch:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main

env:
PLATFORMS: |
linux/arm/v7
linux/arm64
linux/amd64
TAGS: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha,prefix=,suffix=,format=long
jobs:
test:
runs-on: ubuntu-22.04
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.22
- name: Checkout repo
uses: actions/checkout@v3
- name: Lint the codebase
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: -E goimports -E godot
- name: Run tests
run: |
go test -v ./... -cover -race -coverprofile=coverage.out
go tool cover -func=coverage.out -o=coverage.out
build:
runs-on: ubuntu-22.04
needs: test
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: latest
- name: Login to Docker Hub
if: ${{ github.actor == github.repository_owner }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Collect image metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ github.repository }}
tags: ${{ env.TAGS }}
- name: Collect build image metadata
id: buildmeta
uses: docker/metadata-action@v4
with:
images: ${{ github.repository }}-build-image
tags: ${{ env.TAGS }}
- name: Build and push release
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.actor == github.repository_owner }}
load: ${{ github.actor != github.repository_owner }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: release
cache-from: |
${{ github.repository }}-cache
cache-to: |
type=registry,ref=${{ github.repository }}-cache,mode=max
platforms: ${{ env.PLATFORMS }}
build-args: |
DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
COMMIT=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
REPOSITORY=${{ github.repository }}
- name: Build and push build image
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.actor == github.repository_owner }}
load: ${{ github.actor != github.repository_owner }}
tags: ${{ steps.buildmeta.outputs.tags }}
labels: ${{ steps.buildmeta.outputs.labels }}
target: build-image
cache-from: |
${{ github.repository }}-cache
cache-to: |
type=registry,ref=${{ github.repository }}-cache,mode=max
platforms: ${{ env.PLATFORMS }}
build-args: |
DATE=${{ fromJSON(steps.buildmeta.outputs.json).labels['org.opencontainers.image.created'] }}
VERSION=${{ fromJSON(steps.buildmeta.outputs.json).labels['org.opencontainers.image.version'] }}
COMMIT=${{ fromJSON(steps.buildmeta.outputs.json).labels['org.opencontainers.image.revision'] }}
REPOSITORY=${{ github.repository }}
- name: Get version info
run: |
docker run --rm ${{ github.repository }}:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }} -v
136 changes: 0 additions & 136 deletions .github/workflows/docker.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: docs
on:
push:
branches:
- main
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: build docs site
run: make ssg
- name: publish to pgs
uses: picosh/pgs-action@v3
with:
user: hey
key: ${{ secrets.PRIVATE_KEY }}
src: './docs/public/'
project: "sish-${{ steps.vars.outputs.sha_short }}"
promote: "sish-prod"
retain: "sish-"
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.22
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ deploy/
dist/
sish
__debug_bin
docs/public/*
!docs/public/.gitkeep
5 changes: 4 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@
"--proxy-protocol-version=userdefined",
"--log-to-client=true",
"--admin-console=true",
"--admin-console-token=true",
"--service-console=true",
"--verify-ssl=false",
"--http-load-balancer=true",
"--tcp-load-balancer=true",
"--alias-load-balancer=true",
"--sni-load-balancer=true"
"--sni-load-balancer=true",
"--force-https",
"--bind-wildcards"
]
}
]
Expand Down
20 changes: 5 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# syntax = docker/dockerfile:experimental
FROM --platform=$BUILDPLATFORM golang:1.18-alpine as builder
FROM --platform=$BUILDPLATFORM golang:1.22-alpine as builder
LABEL maintainer="Antonio Mika <[email protected]>"

ENV CGO_ENABLED 0
Expand All @@ -9,23 +8,14 @@ WORKDIR /app
RUN mkdir -p /emptydir
RUN apk add --no-cache git ca-certificates

RUN --mount=type=bind,target=/cache,from=antoniomika/sish-build-cache \
mkdir -p /go/pkg/ && cp -R /cache/mod/ /go/pkg/ || true && \
mkdir -p /root/.cache/ && cp -R /cache/go-build/ /root/.cache/ || true
COPY go.* ./

COPY . .

RUN go generate ./...
RUN go test ./...

FROM scratch as build-cache
LABEL maintainer="Antonio Mika <[email protected]>"

COPY --from=builder /go/pkg/mod /mod
COPY --from=builder /root/.cache/go-build /go-build
RUN go mod download

FROM builder as build-image

COPY . .

ARG VERSION=dev
ARG COMMIT=none
ARG DATE=unknown
Expand Down
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
clean:
rm -rf ./docs/public/*
echo "" > ./docs/public/.gitkeep
.PHONY: clean

ssg:
go run ./docs/cmd
cp ./docs/static/* ./docs/public
.PHONY: ssg

docs: ssg
rsync -vr ./docs/public/ [email protected]:/sish-local
.PHONY: docs

docs-prod: ssg
rsync -vr ./docs/public/ [email protected]:/sish-prod
.PHONY: docs-prod

dev:
go run main.go --http-address localhost:3000 --domain testing.ssi.sh
.PHONY: dev
Loading

0 comments on commit f4aaa89

Please sign in to comment.