Skip to content

Commit

Permalink
Merge pull request meshery#9771 from Yashsharma1911/yash/seedKeysForL…
Browse files Browse the repository at this point in the history
…ocalProvider

[Server] Seed keys for local provider
  • Loading branch information
Yashsharma1911 authored Jan 4, 2024
2 parents f615601 + c56cfc7 commit 0610645
Show file tree
Hide file tree
Showing 12 changed files with 1,081 additions and 8 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/generate_keys.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Import Keys
on:
workflow_dispatch:
inputs:
spreadsheet_uri:
description: Link of the spreadsheet containing keys.
type: string
jobs:
fetch-keys:
name: Fetch Keys
if: github.repository == 'meshery/meshery'
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
fetch-depth: 1
- name: Set spreadsheet_uri as environment variable
run: echo "spreadsheet_uri=" >> $GITHUB_ENV
if: inputs.spreadshet_uri != ''
echo "spreadsheet_uri=${{ inputs.spreadsheet_uri }}" >> $GITHUB_ENV

- name: Dump keys from the spreadsheet
run: |
curl -L "${{ env.spreadsheet_uri }}" -o "./keys.csv";
- name: Create permissions folder
run: |
[ ! -d "./permissions" ] && mkdir -p "./permissions";
mv keys.csv permissions/keys.csv;
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Added permissions keys.
branch: master
commit_options: '--signoff'
commit_user_name: l5io
commit_user_email: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>author of the commit that triggered the run
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ docker-local-cloud:
-e PROVIDER_BASE_URLS=$(REMOTE_PROVIDER_LOCAL) \
-e DEBUG=true \
-e ADAPTER_URLS=$(ADAPTER_URLS) \
-e KEYS_PATH=$(KEYS_PATH) \
-p 9081:8080 \
layer5/meshery ./meshery

Expand All @@ -53,6 +54,7 @@ docker-cloud:
-e PROVIDER_BASE_URLS=$(MESHERY_CLOUD_PROD) \
-e DEBUG=true \
-e ADAPTER_URLS=$(ADAPTER_URLS) \
-e KEYS_PATH=$(KEYS_PATH) \
-v meshery-config:/home/appuser/.meshery/config \
-v $(HOME)/.kube:/home/appuser/.kube:ro \
-p 9081:8080 \
Expand Down Expand Up @@ -84,6 +86,7 @@ server-local: dep-check
DEBUG=true \
ADAPTER_URLS=$(ADAPTER_URLS) \
APP_PATH=$(APPLICATIONCONFIGPATH) \
KEYS_PATH=$(KEYS_PATH) \
go run main.go error.go

## Build Meshery Server on your local machine.
Expand All @@ -95,6 +98,7 @@ build-server: dep-check
DEBUG=true \
ADAPTER_URLS=$(ADAPTER_URLS) \
APP_PATH=$(APPLICATIONCONFIGPATH) \
KEYS_PATH=$(KEYS_PATH) \
GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go build ./server/cmd/main.go ./server/cmd/error.go
chmod +x ./main

Expand All @@ -107,6 +111,7 @@ server: dep-check
DEBUG=true \
ADAPTER_URLS=$(ADAPTER_URLS) \
APP_PATH=$(APPLICATIONCONFIGPATH) \
KEYS_PATH=$(KEYS_PATH) \
go run main.go error.go;

## Build and run Meshery Server on your local machine.
Expand All @@ -120,6 +125,7 @@ server-without-operator: dep-check
DEBUG=true \
ADAPTER_URLS=$(ADAPTER_URLS) \
APP_PATH=$(APPLICATIONCONFIGPATH) \
KEYS_PATH=$(KEYS_PATH) \
go run main.go error.go;

## Build and run Meshery Server with no Kubernetes components on your local machine.
Expand All @@ -132,6 +138,7 @@ server-skip-compgen:
ADAPTER_URLS=$(ADAPTER_URLS) \
APP_PATH=$(APPLICATIONCONFIGPATH) \
SKIP_COMP_GEN=true \
KEYS_PATH=$(KEYS_PATH) \
go run main.go error.go;

## Build and run Meshery Server on your local machine.
Expand All @@ -145,6 +152,7 @@ server-without-k8s: dep-check
DEBUG=true \
ADAPTER_URLS=$(ADAPTER_URLS) \
APP_PATH=$(APPLICATIONCONFIGPATH) \
KEYS_PATH=$(KEYS_PATH) \
go run main.go error.go;

server-remote-provider: dep-check
Expand All @@ -156,6 +164,7 @@ server-remote-provider: dep-check
DEBUG=true \
ADAPTER_URLS=$(ADAPTER_URLS) \
APP_PATH=$(APPLICATIONCONFIGPATH) \
KEYS_PATH=$(KEYS_PATH) \
go run main.go error.go;

server-local-provider: dep-check
Expand All @@ -167,6 +176,7 @@ server-local-provider: dep-check
DEBUG=true \
ADAPTER_URLS=$(ADAPTER_URLS) \
APP_PATH=$(APPLICATIONCONFIGPATH) \
KEYS_PATH=$(KEYS_PATH) \
go run main.go error.go;

## Build and run Meshery Server with no seed content.
Expand All @@ -179,6 +189,7 @@ server-no-content:
ADAPTER_URLS=$(ADAPTER_URLS) \
APP_PATH=$(APPLICATIONCONFIGPATH) \
SKIP_DOWNLOAD_CONTENT=true \
KEYS_PATH=$(KEYS_PATH) \
go run main.go error.go;

server-playground: dep-check
Expand All @@ -191,6 +202,7 @@ server-playground: dep-check
ADAPTER_URLS=$(ADAPTER_URLS) \
APP_PATH=$(APPLICATIONCONFIGPATH) \
PLAYGROUND=true \
KEYS_PATH=$(KEYS_PATH) \
go run main.go error.go;

## Lint check Meshery Server.
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,7 @@ github.com/layer5io/meshery-operator v0.6.15/go.mod h1:+lRenXgniyFfe0gVUVbuA8p+C
github.com/layer5io/meshkit v0.2.7/go.mod h1:QvEKV8wIEOabiFlUgiu+s78GpJTsRpoRw5pgvEX077Y=
github.com/layer5io/meshkit v0.7.5 h1:uhiCWyveAuWhcah3s8Xo3G4Px1/3XPT8A204i/2wYw0=
github.com/layer5io/meshkit v0.7.5/go.mod h1:1CHphSZ9OSLl/hLnp0BnWbvgO86E7ceGH/bKZ3YYtMg=

github.com/layer5io/meshsync v0.6.24 h1:ui/u89NW2yHyCtdVaJuuzrag5a1CbhVB8Lp70/9Y+lw=
github.com/layer5io/meshsync v0.6.24/go.mod h1:0qI6ATBvkVx10C1ymH62NaGPy85ALFF3T9Dx/IEXfy0=
github.com/layer5io/nighthawk-go v1.0.3 h1:AGhip7TM8FjaDJ58jU/7BoPx+O45S7UNImfw7vC2Z0U=
Expand Down
1 change: 1 addition & 0 deletions install/Makefile.core.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ LOCAL_PROVIDER="None"
GOVERSION = 1.21
GOPATH = $(shell go env GOPATH)
GOBIN = $(GOPATH)/bin
KEYS_PATH="../../permissions/keys.csv"

SHELL :=/bin/bash -o pipefail

Expand Down
1 change: 1 addition & 0 deletions install/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ RUN update-ca-certificates
# apk add --no-cache libstdc++

COPY ./server/meshmodel /app/server/meshmodel
COPY ./permissions /app/permissions/
COPY --from=meshery-server /meshery /app/server/cmd/
COPY --from=meshery-server /etc/passwd /etc/passwd
COPY --from=meshery-server /github.com/meshery/meshery/server/helpers/swagger.yaml /app/server/helpers/swagger.yaml
Expand Down
Loading

0 comments on commit 0610645

Please sign in to comment.