diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..c9379c8d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: πŸ› General Bug Report +about: Report an issue to help improve the project. +title: '' +labels: 'kind/bug' +assignees: '' +--- +#### Current Behavior + + +#### Expected Behavior + + +#### Screenshots/Logs + + +#### Environment + +- **Host OS:** Mac Linux Windows +- **Platform:** Docker or Kubernetes +- **Meshery Server Version:** stable-v +- **Meshery Client Version:** stable-v + + + +--- +#### Contributor [Guides](https://docs.meshery.io/project/contributing) and Resources +- πŸ›  [Meshery Build & Release Strategy](https://docs.meshery.io/project/build-and-release) +- πŸ“š [Instructions for contributing to documentation](https://github.com/meshery/meshery/blob/master/CONTRIBUTING.md#documentation-contribution-flow) + - Meshery documentation [site](https://docs.meshery.io/) and [source](https://github.com/meshery/meshery/tree/master/docs) +- 🎨 Wireframes and [designs for Layer5 site](https://www.figma.com/file/5ZwEkSJwUPitURD59YHMEN/Layer5-Designs) in Figma [(open invite)](https://www.figma.com/team_invite/redeem/qJy1c95qirjgWQODApilR9) +- πŸ™‹πŸΎπŸ™‹πŸΌ Questions: [Layer5 Discussion Forum](https://discuss.layer5.io) and [Layer5 Community Slack](http://slack.layer5.io) diff --git a/.github/ISSUE_TEMPLATE/ci.md b/.github/ISSUE_TEMPLATE/ci.md new file mode 100644 index 00000000..97a5c3ae --- /dev/null +++ b/.github/ISSUE_TEMPLATE/ci.md @@ -0,0 +1,24 @@ +--- +name: πŸ›  Continuous Integration / DevOps +about: Improve or update workflows or other automation +title: '[CI]' +labels: 'area/ci' +assignees: '' +--- +#### Current Behavior + + +#### Desired Behavior + + +#### Implementation + + +#### Acceptance Tests + + +--- +#### Contributor [Guides](https://docs.meshery.io/project/contributing) and Resources +- πŸ›  [Meshery Build & Release Strategy](https://docs.meshery.io/project/build-and-release) +- 🎨 Wireframes and [designs for Layer5 site](https://www.figma.com/file/5ZwEkSJwUPitURD59YHMEN/Layer5-Designs) in Figma [(open invite)](https://www.figma.com/team_invite/redeem/qJy1c95qirjgWQODApilR9) +- πŸ™‹πŸΎπŸ™‹πŸΌ Questions: [Layer5 Discussion Forum](https://discuss.layer5.io) and [Layer5 Community Slack](http://slack.layer5.io) diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md new file mode 100644 index 00000000..e9a5c3c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.md @@ -0,0 +1,21 @@ +--- +name: πŸ“„ Documentation issue +about: Issues related to documentation. +title: '[Docs]' +labels: 'area/docs, framework/jekyll, language/markdown' +assignees: '' +--- +#### Current State + + +#### Desired State + + +--- + +#### [Contributor Guides](https://docs.meshery.io/project/contributing) and Resources +- πŸ“š [Instructions for contributing to documentation](https://docs.meshery.io/project/contributing/contributing-docs) + - Meshery documentation [site](https://docs.meshery.io/) and [source](https://github.com/meshery/meshery/tree/master/docs) +- πŸ›  [Meshery Build & Release Strategy](https://docs.meshery.io/project/build-and-release) +- 🎨 Wireframes and [designs for Layer5 site](https://www.figma.com/file/5ZwEkSJwUPitURD59YHMEN/Layer5-Designs) in Figma [(open invite)](https://www.figma.com/team_invite/redeem/qJy1c95qirjgWQODApilR9) +- πŸ™‹πŸΎπŸ™‹πŸΌ Questions: [Layer5 Discussion Forum](https://discuss.layer5.io) and [Layer5 Community Slack](http://slack.layer5.io) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..196f1c67 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,25 @@ +--- +name: πŸ’‘ Feature Request +about: Suggest an enhancement to Meshery. +title: '' +labels: 'kind/enhancement' +assignees: '' +--- +#### Current Behavior + + +#### Desired Behavior + + +#### Implementation + + +#### Acceptance Tests + + +#### Mockups + + +--- +**[Contributor Guide](https://docs.meshery.io/project/contributing)** +- 🎨 Wireframes and [designs for Layer5 site](https://www.figma.com/file/5ZwEkSJwUPitURD59YHMEN/Layer5-Designs) in Figma [(open invite)](https://www.figma.com/team_invite/redeem/qJy1c95qirjgWQODApilR9) \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 00000000..a882014c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,6 @@ +blank_issues_enabled: false +contact_links: +- name: πŸ™‹πŸΎπŸ™‹πŸΌβ€Question + url: https://github.com/layer5io/meshery/discussions/new + about: Submit your question using GitHub Discussions. +- 🎨 Wireframes and [designs for Layer5 site](https://www.figma.com/file/5ZwEkSJwUPitURD59YHMEN/Layer5-Designs) in Figma [(open invite)](https://www.figma.com/team_invite/redeem/qJy1c95qirjgWQODApilR9) \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..46e1f2ee --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,23 @@ +**Notes for Reviewers** + +This PR fixes # + + + + +**[Signed commits](../blob/master/CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin)** +- [ ] Yes, I signed my commits. + + + diff --git a/.github/config.yml b/.github/config.yml new file mode 100644 index 00000000..cab86704 --- /dev/null +++ b/.github/config.yml @@ -0,0 +1,47 @@ +#------------------------------------------------------------------------------- +# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome + # Comment to be posted to on first time issues +newIssueWelcomeComment: > + Thanks for opening this issue. A contributor will be by to give feedback soon. In the meantime, please review the [Layer5 Community Welcome Guide](https://docs.google.com/document/d/17OPtDE_rdnPQxmk2Kauhm3GwXF1R5dZ3Cj8qZLKdo5E/edit?usp=sharing) and sure to join the [community Slack](http://slack.layer5.io/). + # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome + # Comment to be posted to on PRs from first time contributors in your repository +newPRWelcomeComment: > + Yay, your first pull request! :thumbsup: A contributor will be by to give feedback soon. In the meantime, please review the [Layer5 Community Welcome Guide](https://docs.google.com/document/d/17OPtDE_rdnPQxmk2Kauhm3GwXF1R5dZ3Cj8qZLKdo5E/edit?usp=sharing) and sure to join the [community Slack](http://slack.layer5.io/). + + Be sure to double-check that you have signed your commits. Here are instructions for [making signing an implicit activity while peforming a commit](../CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin). + + +#------------------------------------------------------------------------------- +# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge +# Comment to be posted to on pull requests merged by a first time user +firstPRMergeComment: > +         Thank you for contributing to the Layer5 community! :tada: + \ + \ + ![Congrats!](https://github.com/layer5io/layer5/blob/master/.github/welcome/Layer5-celebration.png) + \ + \ +         :star: Please leave a [star on the project](../stargazers). :smile: + + +#------------------------------------------------------------------------------- +# Configuration for request-info - https://github.com/behaviorbot/request-info +# Comment to reply with +requestInfoReplyComment: > + Thanks for opening this issue. We welcome all input! If you could provide a little more information, this will greatly aide in its resolution. :thumbsup: +# *OPTIONAL* Add a list of people whose Issues/PRs will not be commented on +# keys must be GitHub usernames +#requestInfoUserstoExclude: +# - layer5io/maintainers + + +#------------------------------------------------------------------------------- +# Configuration for sentiment-bot - https://github.com/behaviorbot/sentiment-bot +# *Required* toxicity threshold between 0 and .99 with the higher numbers being the most toxic +# Anything higher than this threshold will be marked as toxic and commented on +sentimentBotToxicityThreshold: .9 + +# *Required* Comment to reply with +sentimentBotReplyComment: > + Please be sure to review the code of conduct and be respectful of other users. // @layer5io/maintainers + diff --git a/.github/readme/images/community.svg b/.github/readme/images/community.svg new file mode 100644 index 00000000..8ed454fc --- /dev/null +++ b/.github/readme/images/community.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/.github/readme/images/layer5-community-sign.png b/.github/readme/images/layer5-community-sign.png new file mode 100644 index 00000000..289ff0a4 Binary files /dev/null and b/.github/readme/images/layer5-community-sign.png differ diff --git a/.github/readme/images/slack-128.png b/.github/readme/images/slack-128.png new file mode 100644 index 00000000..e6cc7457 Binary files /dev/null and b/.github/readme/images/slack-128.png differ diff --git a/.github/readme/images/slack-dark-128.png b/.github/readme/images/slack-dark-128.png new file mode 100644 index 00000000..9011686e Binary files /dev/null and b/.github/readme/images/slack-dark-128.png differ diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..7342fcb1 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,25 @@ +name-template: 'v$NEXT_PATCH_VERSION' +tag-template: 'v$NEXT_PATCH_VERSION' +categories: + - title: 'πŸš€ Features' + labels: + - 'kind/feature' + - 'kind/enhancement' + - title: 'πŸ› Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'kind/bug' + - title: '🧰 Maintenance' + labels: + - 'kind/chore' + - 'chore' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +template: | + ## What's New + $CHANGES + + ## Contributors + + Thank you to our contributors for making this release possible: + $CONTRIBUTORS \ No newline at end of file diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 00000000..d47fe5be --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,18 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 45 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 10 +# Issues with these labels will never be considered stale +exemptLabels: + - issue/willfix +# Label to use when marking an issue as stale +staleLabel: issue/stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: > + This issue is being automatically closed due to inactivity. + However, you may choose to reopen this issue. diff --git a/.github/welcome/Layer5-celebration.png b/.github/welcome/Layer5-celebration.png new file mode 100644 index 00000000..b23a5f0f Binary files /dev/null and b/.github/welcome/Layer5-celebration.png differ diff --git a/.github/workflows/multi-platform.yml b/.github/workflows/multi-platform.yml new file mode 100644 index 00000000..f9861dbc --- /dev/null +++ b/.github/workflows/multi-platform.yml @@ -0,0 +1,120 @@ +name: Multi-Platform Build and Release +on: + release: + types: [published] + push: + tags: + - 'v*' + branches: + - 'master' + paths-ignore: + - 'docs/**' + # - '.github/**' + workflow_dispatch: + inputs: + release-ver: + description: 'Stable Release Version' + required: true + default: 'v' + stripped-release-ver: + description: 'Stripped Stable Release Version' + required: true + default: '' + release-channel: + description: 'Release Channel' + required: true + default: 'edge' + +env: + GIT_VERSION: ${{github.event.inputs.release-ver}} + GIT_STRIPPED_VERSION: ${{github.event.inputs.stripped-release-ver}} + RELEASE_CHANNEL: ${{github.event.inputs.release-channel}} + GIT_TAG: ${{ github.event.release.tag_name }} + +jobs: + print-inputs: + runs-on: ubuntu-latest + steps: + + - run: | + echo "Dispatched GIT_VERSION: ${{github.event.inputs.release-ver}}" + echo " Dispatched GIT_STRIPPED_VERSION: ${{github.event.inputs.stripped-release-ver}}" + echo "Env RELEASE_CHANNEL: ${{env.RELEASE_CHANNEL}}" + echo "Env GIT_VERSION: ${{env.GIT_VERSION}}" + echo "Env GIT_STRIPPED_VERSION: ${{env.GIT_STRIPPED_VERSION}}" + echo "Env GIT_TAG: ${{ github.event.release.tag_name }}" + + docker-build: + runs-on: ubuntu-latest + steps: + - + name: Checkout repo + uses: actions/checkout@v3 + - + name: Identify Release Values + if: "${{ github.event.inputs.release-ver}} != 'v' }}" + run: | + # GIT_REF=`git symbolic-ref HEAD` + if [[ $GIT_TAG = refs/tags* ]] + then + echo RELEASE_CHANNEL=stable >> $GITHUB_ENV + else + echo RELEASE_CHANNEL=edge >> $GITHUB_ENV + fi + echo "Release channel determined to be $RELEASE_CHANNEL" + LATEST_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g') >> $GITHUB_ENV + GIT_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g') >> $GITHUB_ENV + # GIT_VERSION=$(git describe --tags `git rev-list --tags --max-count=1` --always) + GIT_STRIPPED_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g' | cut -c2-) + echo "GIT_LATEST=$LATEST_VERSION" >> $GITHUB_ENV + echo "GIT_VERSION=$GIT_VERSION" >> $GITHUB_ENV + echo "GIT_STRIPPED_VERSION=$GIT_STRIPPED_VERSION" >> $GITHUB_ENV + shell: bash + + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Docker Meta + id: meta + uses: docker/metadata-action@v3 + with: + images: ${{ secrets.IMAGE_NAME }} + flavor: | + latest=false + tags: | + type=raw,value=${{env.RELEASE_CHANNEL}}-{{sha}} + type=semver,pattern={{version}},value=${{env.GIT_STRIPPED_VERSION}} + type=raw,pattern={{version}},value=${{env.RELEASE_CHANNEL}}-${{env.GIT_VERSION}} + type=raw,value=${{env.RELEASE_CHANNEL}}-{{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + type=raw,value=${{env.RELEASE_CHANNEL}}-latest + type=semver,pattern={{version}},value=${{env.RELEASE_CHANNEL}}-${{env.GIT_VERSION}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - + name: Build and Push + uses: docker/build-push-action@v2 + with: + context: "{{defaultContext}}" + push: true + build-args: | + GIT_STRIPPED_VERSION=${{env.GIT_STRIPPED_VERSION}} + GIT_VERSION=${{env.GIT_VERSION}} + RELEASE_CHANNEL=${{env.RELEASE_CHANNEL}} + tags: ${{ steps.meta.outputs.tags }} + platforms: linux/amd64,linux/arm64 + - + name: Docker Hub Description + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: meshery/meshery-docker-extension + readme-filepath: /install/docker-extension/README.md diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 00000000..a88e6d16 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,18 @@ +name: Release Drafter + +on: + push: + # our release branch + branches: + - master + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/slack.yml b/.github/workflows/slack.yml new file mode 100644 index 00000000..718690fa --- /dev/null +++ b/.github/workflows/slack.yml @@ -0,0 +1,31 @@ +name: Slack Notify +on: + watch: + issues: + types: [labeled] +jobs: + star-notify: + if: github.event_name == 'watch' + name: Notify Slack on star + runs-on: ubuntu-latest + steps: + - name: Get current star count + run: | + echo "STARS=$(curl --silent 'https://api.github.com/repos/${{github.repository}}' -H 'Accept: application/vnd.github.preview' | jq '.stargazers_count')" >> $GITHUB_ENV + - name: Notify slack + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + uses: pullreminders/slack-action@master + with: + args: '{\"channel\":\"CSK7N9TGX\",\"text\":\"${{ github.actor }} just starred ${{github.repository}}! (https://github.com/${{github.repository}}/stargazers) Total ⭐️: ${{env.STARS}}\"}' + good-first-issue-notify: + if: github.event_name == 'issues' && github.event.label.name == 'good first issue' || github.event.label.name == 'first-timers-only' + name: Notify Slack for new good-first-issue + runs-on: ubuntu-latest + steps: + - name: Notify slack + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + uses: pullreminders/slack-action@master + with: + args: '{\"channel\":\"C019426UBNY\",\"text\":\"A good first issue label was just added to ${{github.event.issue.html_url}}.\"}' diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..ffefa226 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +# IDEs +.vscode/* diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..5efdc654 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,150 @@ +linters-settings: + depguard: + list-type: blacklist + packages: + # logging is allowed only by logutils.Log, logrus + # is allowed to use only in logutils package + - github.com/sirupsen/logrus + packages-with-error-message: + - github.com/sirupsen/logrus: "logging is allowed only by logutils.Log" + dupl: + threshold: 100 + exhaustive: + default-signifies-exhaustive: false + funlen: + lines: 100 + statements: 50 + gci: + local-prefixes: github.com/golangci/golangci-lint + goconst: + min-len: 2 + min-occurrences: 2 + gocritic: + enabled-tags: + - diagnostic + - experimental + - opinionated + - performance + - style + disabled-checks: + - dupImport # https://github.com/go-critic/go-critic/issues/845 + - ifElseChain + - octalLiteral + - whyNoLint + - wrapperFunc + gocyclo: + min-complexity: 15 + goimports: + local-prefixes: github.com/golangci/golangci-lint + golint: + min-confidence: 0 + gomnd: + settings: + mnd: + # don't include the "operation" and "assign" + checks: argument,case,condition,return + gosec: + settings: + exclude: -G204 + govet: + check-shadowing: false + settings: + printf: + funcs: + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf + lll: + line-length: 950 + maligned: + suggest-new: true + misspell: + locale: US + nolintlint: + allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space) + allow-unused: false # report any unused nolint directives + require-explanation: false # don't require an explanation for nolint directives + require-specific: false # don't require nolint directives to be specific about which linter is being skipped + +linters: + # please, do not use `enable-all`: it's deprecated and will be removed soon. + # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint + disable-all: true + enable: + # todo[kushthedude]: commenting most of the checks as our code can't persist all of the changes, however we can plan further on code-quality after v1.0 release. + # - bodyclose + # - deadcode + - dogsled + - errcheck + # - exhaustive + # - funlen + # - goconst + # - gocritic + # - gocyclo + - gofmt + - goimports + - golint + # todo[kusthedude]: restore gosec check, once this issue is resolved https://github.com/golangci/golangci-lint/issues/177 + # - gosec + # - gomnd + # - goprintffuncname + # - gosimple + - govet + # - ineffassign + # - interfacer + - lll + - misspell + # - nakedret + # - nolintlint + # - rowserrcheck + # - scopelint + - staticcheck + # - structcheck + - stylecheck + - typecheck + # - unconvert + # - unparam + # - unused + # - varcheck + - whitespace + + # don't enable: + # - asciicheck + # - gochecknoglobals + # - gocognit + # - godot + # - godox + # - goerr113 + # - maligned + # - nestif + # - prealloc + # - testpackage + # - wsl + +issues: + # Excluding configuration per-path, per-linter, per-text and per-source + exclude-rules: + - path: _test\.go + linters: + - gomnd + + # https://github.com/go-critic/go-critic/issues/926 + - linters: + - gocritic + text: "unnecessaryDefer:" + +run: + skip-dirs: + - test/testdata_etc + - internal/cache + - internal/renameio + - internal/robustio + timeout: 5m + +# golangci.com configuration +# https://github.com/golangci/golangci/wiki/Configuration +service: + golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly + prepare: + - echo "here I can run custom commands, but no preparation needed for this repo" diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..123ff621 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,5 @@ +# Layer5 Community Code of Conduct + +The Layer5 community follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting community@layer5.io. diff --git a/CONTRIBUTING-gitflow.md b/CONTRIBUTING-gitflow.md new file mode 100644 index 00000000..35afde8c --- /dev/null +++ b/CONTRIBUTING-gitflow.md @@ -0,0 +1,95 @@ +# Working by Forking +Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or just head straight to the command line: + +## Clone your fork to your local machine +``` +git clone git@github.com:USERNAME/FORKED-PROJECT.git +``` +Keeping Your Fork Up to Date +While this isn't an absolutely necessary step, if you plan on doing anything more than just a tiny quick fix, you'll want to make sure you keep your fork up to date by tracking the original "upstream" repo that you forked. To do this, you'll need to add a remote: + +## Add 'upstream' repo to list of remotes +``` +git remote add upstream https://github.com/layer5io/meshery.git +``` +("meshery" is used as the example repo. Be sure to reference the _actual_ repo you're contributing to e.g. "meshery-linkerd"). + +## Verify the new remote named 'upstream' +``` +git remote -v +``` +Whenever you want to update your fork with the latest upstream changes, you'll need to first fetch the upstream repo's branches and latest commits to bring them into your repository: + +## Fetch from upstream remote +``` +git fetch upstream +``` + +## View all branches, including those from upstream +``` +git branch -va +``` +Now, checkout your own master branch and merge the upstream repo's master branch: + +## Checkout your master branch and merge upstream +``` +git checkout master +git merge upstream/master +``` +If there are no unique commits on the local master branch, git will simply perform a fast-forward. However, if you have been making changes on master (in the vast majority of cases you probably shouldn't be - see the next section, you may have to deal with conflicts. When doing so, be careful to respect the changes made upstream. + +Now, your local master branch is up-to-date with everything modified upstream. + +**Create a Branch** (doing your work) +Whenever you begin work on a new feature or bugfix, it's important that you create a new branch. Not only is it proper git workflow, but it also keeps your changes organized and separated from the master branch so that you can easily submit and manage multiple pull requests for every task you complete. + +To create a new branch and start working on it, peform the following flow. + +## Checkout the master branch - you want your new branch to come from master +``` +git checkout master +``` + +## Create a new branch (give your branch its own simple informative name) +For enhancements use `feature/your_username/issue#` or `feature/your_username/name_of_feature` + +For bugs use `bug/your_username/issue#` or `bug/your_username/name_of_bug` + +``` +git branch feature/jdoe/567 +``` + +## Switch to your new branch +``` +git checkout feature/jdoe/567 +``` +Now, go to town hacking away and making whatever changes you want to. + +## Submitting your changes (a Pull Request) +Prior to submitting your pull request, you might want to do a few things to clean up your branch and make it as simple as possible for the original repo's maintainer to test, accept, and merge your work. + +In the time that you've been working on your changes, if any commits have been made to the upstream master branch, you will need to rebase your development branch so that merging it will be a simple fast-forward that won't require any conflict resolution work. + +## Fetch upstream master and merge with your repo's master branch +``` +git fetch upstream +git checkout master +git merge upstream/master +``` + +## If there were any new commits, rebase your development branch +``` +git checkout feature/jdoe/567 +git rebase master +``` +Now, it may be desirable to squash some of your smaller commits down into a small number of larger more cohesive commits. You can do this with an interactive rebase: + +## Rebase all commits on your development branch +``` +git checkout +git rebase -i master +``` +This will open up a text editor where you can specify which commits to squash. + +## Submitting +Once you've committed and pushed all of your changes to GitHub, go to the page for your fork on GitHub, select your development branch, and click the pull request button. If you need to make any adjustments to your pull request, just push the updates to GitHub. Your pull request will automatically track the changes on your development branch and update. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..851f4ad4 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,104 @@ +# Contributing Overview +Please do! Thanks for your help improving the project! :balloon: + +All contributors are welcome. Please see the [newcomers welcome guide](https://docs.google.com/document/d/17OPtDE_rdnPQxmk2Kauhm3GwXF1R5dZ3Cj8qZLKdo5E/edit) for how, where and why to contribute. This project is community-built and welcomes collaboration. Contributors are expected to adhere to our [Code of Conduct](.CODE_OF_CONDUCT.md). + +Not sure where to start? First, see the [newcomers welcome guide](https://docs.google.com/document/d/17OPtDE_rdnPQxmk2Kauhm3GwXF1R5dZ3Cj8qZLKdo5E/edit). Grab an open issue with the [help-wanted label](../../labels/help%20wanted) and jump in. Join the [Slack account](http://slack.layer5.io) and engage in conversation. Create a [new issue](/../../issues/new/choose) if needed. All [pull requests](/../../pulls) should reference an open [issue](/../../issues). Include keywords in your pull request descriptions, as well as commit messages, to [automatically close issues in GitHub](https://help.github.com/en/github/managing-your-work-on-github/closing-issues-using-keywords). + +**Sections** +- General Contribution Flow + - Developer Certificate of Origin + +Relevant coding style guidelines are the Go Code Review Comments and the Formatting and style section of Peter Bourgon's Go: Best Practices for Production Environments. + +# General Contribution Flow + +In order to contribute to Meshery, please follow the fork-and-pull request workflow described [here](./CONTRIBUTING-gitflow.md). + +## Signing-off on Commits (Developer Certificate of Origin) + +To contribute to this project, you must agree to the Developer Certificate of +Origin (DCO) for each commit you make. The DCO is a simple statement that you, +as a contributor, have the legal right to make the contribution. + +See the [DCO](https://developercertificate.org) file for the full text of what you must agree to +and how it works [here](https://github.com/probot/dco#how-it-works). +To signify that you agree to the DCO for contributions, you simply add a line to each of your +git commit messages: + +``` +Signed-off-by: Jane Smith +``` + +In most cases, you can add this signoff to your commit automatically with the +`-s` or `--signoff` flag to `git commit`. You must use your real name and a reachable email +address (sorry, no pseudonyms or anonymous contributions). An example of signing off on a commit: +``` +$ commit -s -m β€œmy commit message w/signoff” +``` + +To ensure all your commits are signed, you may choose to add this alias to your global ```.gitconfig```: + +*~/.gitconfig* +``` +[alias] + amend = commit -s --amend + cm = commit -s -m + commit = commit -s +``` +Or you may configure your IDE, for example, Visual Studio Code to automatically sign-off commits for you: + + + +## Documentation Contribution Flow +Please contribute! Layer5 documentation uses Jekyll and GitHub Pages to host docs sites. Learn more about [Layer5's documentation framework](https://docs.google.com/document/d/17guuaxb0xsfutBCzyj2CT6OZiFnMu9w4PzoILXhRXSo/edit?usp=sharing). The process of contributing follows this flow: + +1. Create a fork, if you have not already, by following the steps described [here](./CONTRIBUTING-gitflow.md) +1. In the local copy of your fork, navigate to the docs folder. +`cd docs` +1. Create and checkout a new branch to make changes within +`git checkout -b ` +1. Edit/add documentation. +`vi .md` +1. Run site locally to preview changes. +`make site` +1. Commit, [sign-off](#commit-signing), and push changes to your remote branch. +`git push origin ` +1. Open a pull request (in your web browser) against the repo. + + +#### Tests +Users can now test their code on their local machine against the CI checks implemented using `make run-tests`. + +To test code changes on your local machine, run the following command: +``` +make run-tests +``` + +#### Building Docker image +To build a Docker image of the project, please ensure you have `Docker` installed to be able to build the image. Now, run the following command to build the Docker image: +```sh +make docker +``` + +### UI Lint Rules + +Layer5 uses ES-Lint to maintain code quality & consistency in our UI Code. + +# Reviews +All contributors are invited to review pull requests. See this short video on [how to review a pull request](https://www.youtube.com/watch?v=isLfo7jfE6g&feature=youtu.be). + +# New to Git? +Resources: https://lab.github.com and https://try.github.com/ + +### License + +This repository and site are available as open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0). + +### About Layer5 + +**Community First** +

The Layer5 community represents the largest collection of service mesh projects and their maintainers in the world.

+ +**Open Source First** +

Our projects establish industry standards and enable service developers, owners, and operators with repeatable patterns and best practices for managing all aspects of distributed services. Our shared commitment to the open source spirit push the Layer5 community and its projects forward.

diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..8b6dabe9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 Layer5, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..e6249697 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +check: + golangci-lint run + +check-clean-cache: + golangci-lint cache clean + +protoc-setup: + wget -P meshes https://raw.githubusercontent.com/layer5io/meshery/master/meshes/meshops.proto + +proto: + protoc -I meshes/ meshes/meshops.proto --go_out=plugins=grpc:./meshes/ + + + + + +site: + $(jekyll) serve --drafts --livereload + +build: + $(jekyll) build --drafts + +docker: + docker run --name site -d --rm -p 4000:4000 -v `pwd`:"/srv/jekyll" jekyll/jekyll:4.0.0 bash -c "bundle install; jekyll serve --drafts --livereload" diff --git a/README.md b/README.md new file mode 100644 index 00000000..a36db109 --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +# layer5-repo-template +This repository is used as the boilerplate for consistency across all Layer5 repos. + +
 
+ +## Join the Layer5 community! + + +Our projects are community-built and welcome collaboration. πŸ‘ Be sure to see the Layer5 Community Welcome Guide for a tour of resources available to you and jump into our Slack! + +

+MeshMates +

Find your MeshMate

+ +

MeshMates are experienced Layer5 community members, who will help you learn your way around, discover live projects and expand your community network. +Become a Meshtee today!

+ +Find out more on the Layer5 community.
+



+

+ +
 
+ + + + + + + Shows an illustrated light mode meshery logo in light color mode and a dark mode meshery logo dark color mode. + + + + +Layer5 Community + +

+βœ”οΈ Join any or all of the weekly meetings on community calendar.
+βœ”οΈ Watch community meeting recordings.
+βœ”οΈ Access the Community Drive by completing a community Member Form.
+βœ”οΈ Discuss in the Community Forum.
+βœ”οΈExplore more in the Community Handbook.
+

+

+Not sure where to start? Grab an open issue with the help-wanted label.

diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..ef1a94de --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,64 @@ +# Security Policy +We are very grateful to the security researchers and users that report +back Layer5 project security vulnerabilities. We investigate every report thoroughly. + +## Reporting a vulnerability +To make a report, send an email to the private +[security-vulns-reports@layer5.io](mailto:security-vulns-reports@layer5.io) +mailing list with the vulnerability details. For normal product bugs +unrelated to latent security vulnerabilities, please head to +the appropriate repository and submit a [new issue](../../issues/new/choose). + +### When to report a security vulnerability? + +Send us a report whenever you: + +- Think Layer5 projects have a potential security vulnerability. +- Are unsure whether or how a vulnerability affects Layer5 projects. +- Think a vulnerability is present in another project that Layer5 projects +depend on (Docker for example). + +### When not to report a security vulnerability? + +Don't send a vulnerability report if: + +- You need help tuning Layer5 project components for security. +- You need help applying security related updates. +- Your issue is not security related. + +## Evaluation + +The Layer5 team acknowledges and analyzes each vulnerability report within 10 working days. + +Any vulnerability information you share with the Layer5 team stays +within the Layer5 project. We don't disseminate the information to other +projects. We only share the information as needed to fix the issue. + +We keep the reporter updated as the status of the security issue is addressed. + +## Fixing the issue + +Once a security vulnerability has been fully characterized, a fix is developed by the Layer5 team. +The development and testing for the fix happens in a private GitHub repository in order to prevent +premature disclosure of the vulnerability. + +## Early disclosure + +The Layer5 team maintains a mailing list for private early disclosure of security vulnerabilities. +The list is used to provide actionable information to close Layer5 partners. The list is not intended +for individuals to find out about security issues. + +## Public disclosure + +On the day chosen for public disclosure, a sequence of activities takes place as quickly as possible: + +- Changes are merged from the private GitHub repository holding the fix into the appropriate set of public +branches. +- Layer5 team ensures all necessary binaries are promptly built and published. +- Once the binaries are available, an announcement is sent out on the following channels: + - The [Layer5 blog](https://layer5.io/blog/) + - The [Layer5 Twitter feed](https://twitter.com/layer5) + - The #announcements channel on Slack + +As much as possible this announcement will be actionable, and include any mitigating steps customers can take prior to +upgrading to a fixed version.