From 4cddd4ff71e9bab4ee98529079739e5c6f807dcc Mon Sep 17 00:00:00 2001 From: yusing Date: Mon, 16 Sep 2024 13:19:24 +0800 Subject: [PATCH] v0.5-rc1: schema fixes, provider file example update --- .github/workflows/docker-image.yml | 11 +++++++++-- providers.example.yml | 27 +++++++++++---------------- schema/providers.schema.json | 7 +++++-- version.txt | 2 +- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 56048fb..f78300d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -8,7 +8,14 @@ jobs: build_and_push: runs-on: ubuntu-latest steps: - - name: Build and Push Container to ghcr.io + - name: Set up Docker Build and Push + id: docker_build_push uses: GlueOps/github-actions-build-push-containers@v0.3.7 with: - tags: latest,${{ github.ref_name }} \ No newline at end of file + tags: ${{ github.ref_name }} + + - name: Tag as latest + if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-') + run: | + docker tag ghcr.io/${{ github.repository }}:${{ github.ref_name }} ghcr.io/${{ github.repository }}:latest + docker push ghcr.io/${{ github.repository }}:latest diff --git a/providers.example.yml b/providers.example.yml index 8ef1f10..daaec91 100644 --- a/providers.example.yml +++ b/providers.example.yml @@ -1,25 +1,20 @@ example: # matching `app.y.z` - # optional, defaults to http - scheme: http - # required, proxy target + scheme: https host: 10.0.0.1 - # optional, defaults to 80 for http, 443 for https - port: "80" - # optional, defaults to empty - path: - # optional (scheme=https only) - # no_tls_verify: false - # optional headers to set / override (http(s) only) + port: 80 + path_patterns: # Check https://pkg.go.dev/net/http#hdr-Patterns-ServeMux for syntax + - GET / # accept any GET request + - POST /auth # for /auth and /auth/* accept only POST + - GET /home/{$} + - /b/{bucket}/o/{any} + no_tls_verify: false set_headers: - HEADER_A: - - VALUE_1 - - VALUE_2 - HEADER_B: [VALUE_3] - # optional headers to hide (http(s) only) + HEADER_A: VALUE_A, VALUE_B + HEADER_B: VALUE_C hide_headers: - HEADER_C - HEADER_D -app1: # matching `app1.y.z` -> http://some_host +app1: host: some_host app2: scheme: tcp diff --git a/schema/providers.schema.json b/schema/providers.schema.json index 438690f..32d6f93 100644 --- a/schema/providers.schema.json +++ b/schema/providers.schema.json @@ -108,7 +108,7 @@ "markdownDescription": "A list of [path patterns](https://pkg.go.dev/net/http#hdr-Patterns-ServeMux)", "items": { "type": "string", - "pattern": "^((GET|POST|DELETE|PUT|PATCH|HEAD|OPTIONS|CONNECT)\\s)?(/\\w*)+/?$", + "pattern": "^((GET|POST|DELETE|PUT|PATCH|HEAD|OPTIONS|CONNECT)\\s)?(/(\\w*|{\\w*}|{\\$}))+/?$", "patternErrorMessage": "invalid path pattern" } }, @@ -123,7 +123,10 @@ "description": "Proxy headers to set", "additionalProperties": { "items": { - "type": "string" + "type": "object", + "additionalProperties": { + "type": "string" + } } } }, diff --git a/version.txt b/version.txt index cfd6941..0a6a402 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.5.0-beta4 \ No newline at end of file +0.5.0-rc1 \ No newline at end of file