├── .DS_Store
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── documentation.md
│ ├── feature_request.md
│ └── question.md
├── PULL_REQUEST_TEMPLATE.md
├── config.yml
├── label-commenter-config.yml
├── release-drafter.yml
├── stale.yml
├── welcome
│ └── Layer5-celebration.png
└── workflows
│ ├── ci.yml
│ ├── label-commenter.yml
│ ├── release-drafter.yml
│ └── slack.yml
├── .gitignore
├── LICENSE
├── Makefile
├── README.md
├── api
├── Dockerfile
├── go.mod
└── main.go
├── config
├── consul-values.yaml
└── image-hub.yaml
├── deployment.yaml
├── docker-compose.yaml
├── docs
└── assets
│ └── img
│ └── readme
│ └── docker-con-2020.png
├── envoy.Dockerfile
├── envoy.yaml
├── gateway.yaml
├── img
└── readme
│ ├── community.svg
│ ├── image-hub-on-consul-with-wasm-and-meshery.png
│ ├── layer5-image-hub.svg
│ ├── service-mesh-architecture-consul.png
│ ├── slack-128.png
│ └── slack-dark-128.png
├── rate-limit-filter
├── .dockerignore
├── Cargo.toml
├── Dockerfile
├── README.md
├── envoy
├── pkg
│ └── rate_limit_filter_bg.wasm
└── src
│ ├── json_parse
│ ├── mod.rs
│ └── rules.rs
│ ├── lib.rs
│ └── rate_limiter
│ ├── mod.rs
│ └── rate_limiter.rs
└── web
├── .gitignore
├── Dockerfile
├── README.md
├── babel.config.js
├── package.json
├── public
├── favicon.ico
└── index.html
├── src
├── App.vue
├── assets
│ ├── layer5-image-hub-white.ai
│ ├── layer5-image-hub-white.svg
│ ├── layer5-image-hub.ai
│ └── layer5-image-hub.svg
├── main.js
├── plugins
│ └── vuetify.js
├── router
│ └── index.js
└── views
│ ├── Auth.vue
│ ├── Hello.vue
│ ├── Signup.vue
│ └── Upgrade.vue
├── vue.config.js
└── yarn.lock
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/layer5io/image-hub/626ca0c1782cdb9cd5c07ba2cfe7af33da668812/.DS_Store
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug/issue report
3 | about: Report an issue to help improve the project.
4 | title: ''
5 | labels: 'bug'
6 | assignees: ''
7 | ---
8 | **Description**
9 |
10 |
11 | **Expected Behavior**
12 |
13 |
14 | **Screenshots**
15 |
16 |
17 | **Environment:**
18 | - OS: [e.g. Ubuntu]
19 | - Browser: [e.g. Chrome, Safari]
20 | - Version: [e.g. 22]
21 | - Device: [e.g. laptop, iPhone 8]
22 |
23 | ---
24 | [Optional] **To Reproduce**
25 | Steps to reproduce the behavior:
26 | 1. Go to '...'
27 | 2. Click on '....'
28 | 3. Scroll down to '....'
29 | 4. See error
30 |
31 | [Optional] **Additional Context**
32 |
33 | - 🎨 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)
34 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/documentation.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Documentation issue
3 | about: Issues related to documentation.
4 | title: '[Docs]'
5 | labels: 'docs'
6 | assignees: ''
7 | ---
8 | **Current State:**
9 |
10 |
11 | **Desired State:**
12 |
13 |
14 | ---
15 | **Contributor Resources**
16 | - [Meshery documentation site](https://meshery.layer5.io/docs/)
17 | - [Meshery documentation source](https://github.com/layer5io/meshery/tree/master/docs)
18 | - [Instructions for contributing to documentation](https://github.com/layer5io/meshery/blob/master/CONTRIBUTING.md#documentation-contribution-flow)
19 | - 🎨 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)
20 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: Suggest an enhancement to this project.
4 | title: ''
5 | labels: 'enhancement'
6 | assignees: ''
7 | ---
8 |
9 | **Current Behavior**
10 |
11 |
12 |
13 | **Desired Behavior**
14 |
15 |
16 |
17 | ---
18 | **Resources**
19 |
20 | - 🎨 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)
21 |
22 | **Alternatives / Additional Context**
23 |
24 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: General question
3 | about: Request information about the project; clarify behavior of the software
4 | title: '[Question]'
5 | labels: 'question'
6 | assignees: ''
7 | ---
8 |
9 | **How can we help?**
10 |
11 | **Resources**
12 | - 🎨 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)
13 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
30 | **Description**
31 |
32 |
33 | This PR fixes #
34 |
35 | **Notes to reviewers**
36 |
37 | #### Checklist
38 |
39 | - [] [Signed commits](https://github.com/layer5io/meshery/blob/master/CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin).
40 | - [] PR title includes `[]:`
41 |
--------------------------------------------------------------------------------
/.github/config.yml:
--------------------------------------------------------------------------------
1 | ---
2 | #-------------------------------------------------------------------------------
3 | # Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
4 | # Comment to be posted to on first time issues
5 | newIssueWelcomeComment: >
6 | Thanks for opening this issue. A contributor will be by to give feedback soon. In the meantime, please review the [Layer5 Contributors' Welcome Guide](https://docs.google.com/document/d/17OPtDE_rdnPQxmk2Kauhm3GwXF1R5dZ3Cj8qZLKdo5E/edit?usp=sharing) and sure to join the [community Slack](http://slack.layer5.io/).
7 | # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
8 | # Comment to be posted to on PRs from first time contributors in your repository
9 | newPRWelcomeComment: >
10 | Yay, your first pull request! :thumbsup: A contributor will be by to give feedback soon. In the meantime, please review the [Layer5 Contributors' Welcome Guide](https://docs.google.com/document/d/17OPtDE_rdnPQxmk2Kauhm3GwXF1R5dZ3Cj8qZLKdo5E/edit?usp=sharing) and sure to join the [community Slack](http://slack.layer5.io/).
11 |
12 | Be sure to double-check that you have signed your commits. Here are instructions for [making signing an implicit activity while peforming a commit](https://github.com/layer5io/meshery/blob/master/CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin).
13 |
14 | #-------------------------------------------------------------------------------
15 | # Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
16 | # Comment to be posted to on pull requests merged by a first time user
17 | firstPRMergeComment: >
18 | Thanks for your contribution to the Layer5 community! :tada:
19 |
20 | 
21 |
22 | :star: Please [star the project](../stargazers) if you are yet to do so.
23 | #-------------------------------------------------------------------------------
24 | # Configuration for request-info - https://github.com/behaviorbot/request-info
25 | # Comment to reply with
26 | requestInfoReplyComment: >
27 | 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:
28 | # *OPTIONAL* Add a list of people whose Issues/PRs will not be commented on
29 | # keys must be GitHub usernames
30 | #requestInfoUserstoExclude:
31 | # - layer5io/maintainers
32 |
33 | #-------------------------------------------------------------------------------
34 | # Configuration for sentiment-bot - https://github.com/behaviorbot/sentiment-bot
35 | # *Required* toxicity threshold between 0 and .99 with the higher numbers being the most toxic
36 | # Anything higher than this threshold will be marked as toxic and commented on
37 | sentimentBotToxicityThreshold: .9
38 |
39 | # *Required* Comment to reply with
40 | sentimentBotReplyComment: >
41 | Please be sure to review the code of conduct and be respectful of other users. // @layer5io/maintainers
42 |
43 | #------------------------------------------------------------------------------------
44 | # *Required* Star the project
45 | # Staring the project is as important as contributing to it.
46 |
47 |
--------------------------------------------------------------------------------
/.github/label-commenter-config.yml:
--------------------------------------------------------------------------------
1 | comment:
2 | footer: "\
3 | ---\n\n
4 | > Be sure to [join the community](http://slack.layer5.io), if you haven't yet and please leave a :star: [star on the project](../stargazers) :smile: on the project.
5 | "
6 |
7 | labels:
8 | - name: issue/design required
9 | labeled:
10 | issue:
11 | body: This issue has been labeled with 'design-required'. Note that prior to commencing on implementation, a design specification needs to be created and reviewed for approval. See [Creating a Functional Specification](https://docs.google.com/document/d/1RP3IWLc-MiQS-QYasqCoVuCH7--G87p5ezE5f_nOzB8/edit?usp=sharing) to create a design spec.
12 | action: open
13 | - name: issue/remind
14 | labeled:
15 | issue:
16 | body: Checking in... it has been awhile since we've heard from you on this issue. Are you still working on it? Please let us know and please don't hesitate to contact a [MeshMate](https://layer5.io/community/meshmates/) or any other [community member](https://layer5.io/community/members) for assistance.
17 | action: open
18 | pr:
19 | body: Checking in... it has been awhile since we've heard from you on this issue. Are you still working on it? Please let us know and please don't hesitate to contact a [MeshMate](https://layer5.io/community/meshmates/) or any other [community member](https://layer5.io/community/members) for assistance.
20 | action: open
21 | - name: issue/dco
22 | labeled:
23 | pr:
24 | body: "🚨 Alert! Git Police! We couldn’t help but notice that one or more of your commits is missing a sign-off. _A what?_ A commit sign-off (your email address).\n\n
25 | To amend the commits in this PR with your signoff using the instructions provided in the DCO check above. \n\n
26 | To configure your dev environment to automatically signoff on your commits in the future, see [these instructions](https://github.com/meshery/meshery/blob/master/CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin)."
27 | action: open
--------------------------------------------------------------------------------
/.github/release-drafter.yml:
--------------------------------------------------------------------------------
1 | name-template: 'v$NEXT_PATCH_VERSION'
2 | tag-template: 'v$NEXT_PATCH_VERSION'
3 | categories:
4 | - title: '🚀 Features'
5 | labels:
6 | - 'kind/feature'
7 | - 'kind/enhancement'
8 | - title: '🐛 Bug Fixes'
9 | labels:
10 | - 'kind/fix'
11 | - 'kind/bugfix'
12 | - 'kind/bug'
13 | - title: '🧰 Maintenance'
14 | labels:
15 | - 'kind/chore'
16 | - 'area/ci'
17 | - 'area/tests'
18 | - title: 📖 Documentation
19 | label: area/docs
20 | change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
21 | template: |
22 | ## What's new ?
23 | $CHANGES
24 |
25 | ## Contributors
26 |
27 | Thanks a lot to our contributors for making this release possible:
28 | $CONTRIBUTORS
29 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Number of days of inactivity before an issue becomes stale
2 | daysUntilStale: 30
3 | # Number of days of inactivity before a stale issue is closed
4 | daysUntilClose: 14
5 | # Issues with these labels will never be considered stale
6 | exemptLabels:
7 | - lifecycle/frozen
8 | # Label to use when marking an issue as stale
9 | staleLabel: lifecycle/stale
10 | # Comment to post when marking an issue as stale. Set to `false` to disable
11 | markComment: >
12 | This issue has been automatically marked as stale because it has not had
13 | recent activity. It will be closed if no further activity occurs. Thank you
14 | for your contributions.
15 | # Comment to post when closing a stale issue. Set to `false` to disable
16 | closeComment: >
17 | This issue is being automatically closed due to inactivity.
--------------------------------------------------------------------------------
/.github/welcome/Layer5-celebration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/layer5io/image-hub/626ca0c1782cdb9cd5c07ba2cfe7af33da668812/.github/welcome/Layer5-celebration.png
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: Image Hub
2 | on:
3 | push:
4 | branches:
5 | - '*'
6 | tags:
7 | - 'v*'
8 | pull_request:
9 | branches:
10 | - master
11 |
12 | jobs:
13 | docker:
14 | name: Docker build and push
15 | runs-on: ubuntu-latest
16 | steps:
17 | - name: Check out code
18 | if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success()
19 | uses: actions/checkout@master
20 | with:
21 | fetch-depth: 1
22 | - name: Docker login
23 | if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success()
24 | uses: azure/docker-login@v1
25 | with:
26 | username: ${{ secrets.DOCKER_USERNAME }}
27 | password: ${{ secrets.DOCKER_PASSWORD }}
28 | - name: Docker build & push - envoy
29 | if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success()
30 | run: |
31 | cd rate-limit-filter && DOCKER_BUILDKIT=1 docker build --no-cache -t layer5/image-hub-envoy .
32 | docker tag layer5/image-hub-envoy:latest layer5/image-hub-envoy:${GITHUB_SHA::8}
33 | docker push layer5/image-hub-envoy:${GITHUB_SHA::8}
34 | docker push layer5/image-hub-envoy:latest
35 | - name: Docker build & push - api
36 | if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success()
37 | run: |
38 | cd api && DOCKER_BUILDKIT=1 docker build --no-cache -t layer5/image-hub-api .
39 | docker tag layer5/image-hub-api:latest layer5/image-hub-api:${GITHUB_SHA::8}
40 | docker push layer5/image-hub-api:${GITHUB_SHA::8}
41 | docker push layer5/image-hub-api:latest
42 | - name: Docker build & push - web
43 | if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success()
44 | run: |
45 | cd web && DOCKER_BUILDKIT=1 docker build --no-cache -t layer5/image-hub-web .
46 | docker tag layer5/image-hub-web:latest layer5/image-hub-web:${GITHUB_SHA::8}
47 | docker push layer5/image-hub-web:${GITHUB_SHA::8}
48 | docker push layer5/image-hub-web:latest
--------------------------------------------------------------------------------
/.github/workflows/label-commenter.yml:
--------------------------------------------------------------------------------
1 | name: Label Commenter
2 |
3 | on:
4 | issues:
5 | types:
6 | - labeled
7 |
8 | pull_request_target:
9 | types:
10 | - labeled
11 |
12 | permissions:
13 | contents: read
14 | issues: write
15 | pull-requests: write
16 |
17 | jobs:
18 | comment:
19 | runs-on: ubuntu-18.04
20 | steps:
21 | - uses: actions/checkout@v2
22 | with:
23 | ref: main # Set your default branch
24 |
25 | - name: Label Commenter
26 | uses: peaceiris/actions-label-commenter@v1.10.0
--------------------------------------------------------------------------------
/.github/workflows/release-drafter.yml:
--------------------------------------------------------------------------------
1 | name: Release Drafter
2 |
3 | on:
4 | push:
5 | # our release branch
6 | branches:
7 | - master
8 |
9 | jobs:
10 | update_release_draft:
11 | runs-on: ubuntu-latest
12 | steps:
13 | # Drafts your next Release notes as Pull Requests are merged into "master"
14 | - uses: release-drafter/release-drafter@v5
15 | with:
16 | config-name: release-drafter.yml
17 | env:
18 | GITHUB_TOKEN: ${{ secrets.RELEASEDRAFTER_PAT }}
19 |
--------------------------------------------------------------------------------
/.github/workflows/slack.yml:
--------------------------------------------------------------------------------
1 | name: Slack Notify on Star
2 | on: watch
3 | jobs:
4 | star-notify:
5 | name: Notify Slack on star
6 | runs-on: ubuntu-latest
7 | steps:
8 | - name: Get current star count
9 | run: |
10 | echo "STARS=$(curl --silent 'https://api.github.com/repos/layer5io/image-hub' -H 'Accept: application/vnd.github.preview' | jq '.stargazers_count')" >> $GITHUB_ENV
11 | - name: Notify slack
12 | env:
13 | SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
14 | uses: pullreminders/slack-action@master
15 | with:
16 | args: '{\"channel\":\"CSK7N9TGX\",\"text\":\"${{ github.actor }} just starred Image Hub! (https://github.com/layer5io/image-hub/stargazers) Total ⭐️: ${{env.STARS}}\"}'
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 | Cargo.lock
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright 2020 Layer5, Inc.
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | VER=$(shell git rev-parse --short HEAD)
2 |
3 | build:
4 | cd rate-limit-filter && cargo +nightly build --target=wasm32-unknown-unknown --release
5 |
6 | deploy:
7 | docker-compose up --build --remove-orphans
8 |
9 | # shows only the logs related to WASM filter/singleton
10 | deploy-filtered:
11 | docker-compose up --build --remove-orphans | grep "\[wasm\]\|Starting"
12 |
13 | run: build deploy
14 |
15 | run-filtered: build deploy-filtered
16 |
17 | clean:
18 | cargo clean
19 |
20 | build-web:
21 | cd web && docker build -t layer5/image-hub-web:latest -t layer5/image-hub-web:$(VER) .
22 |
23 | build-api:
24 | cd api && docker build -t layer5/image-hub-api:latest -t layer5/image-hub-api:$(VER) .
25 |
26 | build-envoy:
27 | cd rate-limit-filter && docker build -t layer5/image-hub-envoy:latest -t layer5/image-hub-envoy:$(VER) .
28 |
29 | dev-run-api: build-api deploy
30 |
31 | dev-run-web:
32 | cd web && yarn serve
33 |
34 | image-push-latest:
35 | docker push layer5/image-hub-web:latest
36 | docker push layer5/image-hub-api:latest
37 | docker push layer5/image-hub-envoy:latest
38 |
39 | image-push-version:
40 | docker push layer5/image-hub-web:$(VER)
41 | docker push layer5/image-hub-api:$(VER)
42 | docker push layer5/image-hub-envoy:$(VER)
43 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
If you’re using the Image Hub or if you like other Layer5 projects, please ★ star this repository to show your support! 🤩
12 |
13 | ## Image Hub
14 | Image Hub is a sample application written to run on [Consul](https://meshery.layer5.io/docs/service-meshes/adapters/consul) for exploring WebAssembly modules used as Envoy filters. This demo application has been enabled by experimental works of [Nic Jackson](https://twitter.com/sheriffjackson) of HashiCorp, and [Kanishkar J](https://twitter.com/_kanishkarj_), [Lee Calcote](https://twitter.com/lcalcote), and other contributors of Layer5.
15 |
16 |
17 | ## Deployment Instructions
18 |
19 | Image Hub supports Envoy-based data planes. Deployment instructions for each supported service mesh are below.
20 |
21 | ### Using Istio (pending [PR #196](https://github.com/layer5io/meshery-istio/pull/196)+release; clone and do make run for now):
22 | 1) Use [Meshery](https://github.com/layer5io/meshery) to deploy [istio](https://github.com/layer5io/advanced-istio-service-mesh-workshop/blob/master/lab-1/README.md) and the Image Hub sample application (Management > Istio > Manage Sample Application Lifecycle > Image-Hub ) onto the Istio service mesh.
23 | 2) To map `imagehub.meshery.io` to the appropriate IP, run the following command to add the appropriate entry in the `"\etc\hosts"` file:
24 |
25 | ```
26 | echo $(kubectl get nodes --selector=kubernetes.io/role!=master -o jsonpath={.items[0].status.addresses[?\(@.type==\"InternalIP\"\)].address})' 'imagehub.meshery.io | sudo tee -a /etc/hosts
27 | ```
28 | 3) To get the environment port, run the following command:
29 | ```
30 | echo $(kubectl get svc istio-ingressgateway -n istio-system -o jsonpath='{.spec.ports[1].nodePort}')
31 | ```
32 | 4) Access the web UI using:
33 | ```
34 | http://imagehub.meshery.io:
35 | ```
36 |
37 |
38 | ### Using Consul:
39 |
40 | 1) Deploy the latest Consul:
41 |
42 | ```bash
43 | helm repo add hashicorp https://helm.releases.hashicorp.com # Adds helm hashicorp repo
44 | helm install consul hashicorp/consul -f config/consul-values.yaml # Setup custom Consul with support for WASM
45 | ```
46 |
47 | 2) Use [Meshery](https://github.com/layer5io/meshery) to deploy the Image Hub sample application onto the Consul service mesh.
48 |
49 | 3) Find the port assigned to the `ingess` service:
50 |
51 | ```
52 | kubectl get svc ingess
53 | NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
54 | ingess NodePort 10.97.34.25 80:31118/TCP 27m
55 | ```
56 |
57 | 4) Open http://localhost:31118 (where 31118 is your environment's port number).
58 |
59 | ## Use Image Hub
60 |
61 | 1. Upon visiting the image-hub homepage, we would need to signup for an account! Go ahead and click the "Sign Up" button in the top right.
62 | 1. Enter the login details, and select a plan; Personal gives you 10 pulls per minute, Team gives you 100 pulls per minute, and Enterprise will give you 1000 pulls per minute.
63 | 1. After signing up, you should be redirected to the login page, where you can log in and start using the sample app.
64 | 1. On the main page, open up the network tab, and reload the page. This will allow you to see the request-response of the app.
65 | 1. Go ahead and click the download button a couple of times. You'll notice that there is nothing actually limiting you from crossing the number of pulls according to the plan you chose!
66 | 1. Alternatively, you could test the above by navigating to http://imagehub.meshery.io:/pull and then looking at the request-responses.
67 |
68 | ## Deploying the Rate Limiter WASM Filter for Envoy
69 |
70 | 1. Go back to Management > Istio and under "Apply Service Mesh Configuration" make sure to apply "Automatic Sidecar Injection"
71 | 1. Open up a terminal, and run `kubectl get pods` to get a list of running pods. You should be able to see 2 pods, `web` and `api`. Now run
72 | the command `kubectl delete pods `. This will cause kubernetes to respawn them with the updated configuration.
73 | 1. Go back to Management > Istio and under "Apply Service Mesh Configuration", select the `Envoy Filter for Image Hub` option, and wait for a few seconds.
74 |
75 | ## Use Image hub with a WASM filter
76 |
77 | 1. Test your ability to "pull" an image (images are not in fact pulled, but an HTTP request is sent to the backend `api`). You would not be able to pull an image, and the response would say "unauthorized".
78 | 1. Sign up a new user and select a subscription plan.
79 | 1. Log in as that user.
80 | 1. Test your ability to "pull" an image. You should be able to pull an image.
81 | 1. Open Meshery's performance management page (http://localhost:9081/performance)
82 | 1. Configure a performance test against http://x.x.x.x:31118/api/pull (where x.x.x.x is your machine's host IP address, not "localhost")
83 | 1. Enter `{ "authorization" : "" }`
84 | 1. Run the performance test. See that your subscription plan limit is enforced accordingly.
85 | 1. Change your subscription plan and retest.
86 |
87 | ## Architecture
88 |
89 | ### Consul Service Mesh Architecture w/WebAssembly
90 | 
91 |
92 | ### Image Hub deployed on Consul
93 | 
94 |
95 | ## Presentations
96 |
97 |
98 |
99 | - [DockerCon 2020](https://docker.events.cube365.net/docker/dockercon/content/Videos/63TCCNpzDC7Xxnm8b) | [deck](https://calcotestudios.com/talks/decks/slides-dockercon-2020-service-meshing-with-docker-desktop-and-webassembly.html) | ([video](https://www.youtube.com/watch?v=5BrbbKZOctw&list=PL3A-A6hPO2IN_HSU0pSfijBboiHggs5mC&index=4&t=0s)
100 |
101 |