diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index e7dc557..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,13 +0,0 @@ -# These are supported funding model platforms - -#github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -#patreon: # Replace with a single Patreon username -#open_collective: # Replace with a single Open Collective username -ko_fi: volkanozcelik -#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -#liberapay: # Replace with a single Liberapay username -#issuehunt: # Replace with a single IssueHunt username -#otechie: # Replace with a single Otechie username -#lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.gitignore b/.gitignore index 5c742a8..4384329 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,18 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# Docs +docs/_site +docs/.jekyll-cache + +.DS_Store # Binaries for programs and plugins *.exe @@ -30,15 +38,15 @@ vendor # Binaries -/aegis-safe -/aegis-init-container -/aegis-sentinel -/aegis-sidecar +/vsecm-safe +/vsecm-init-container +/vsecm-sentinel +/vsecm-sidecar /example-using-init-container /example-using-sidecar /example-using-sdk /example-multiple-secrets -/aegis-ist-init-container -/aegis-ist-safe -/aegis-ist-sentinel -/aegis-ist-sidecar +/vsecm-ist-init-container +/vsecm-ist-safe +/vsecm-ist-sentinel +/vsecm-ist-sidecar diff --git a/AegisInitContainer.mk b/AegisInitContainer.mk deleted file mode 100644 index 27c756b..0000000 --- a/AegisInitContainer.mk +++ /dev/null @@ -1,66 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# Packages the “Aegis Init Container” binary into a container image. -init-container-bundle-ist: - ./hack/bundle.sh "aegis-ist-init-container" \ - $(VERSION) "dockerfiles/aegis-ist/init-container.Dockerfile" - -# Packages the “Aegis Init Container” binary into a container image for FIPS. -init-container-bundle-ist-fips: - ./hack/bundle.sh "aegis-ist-fips-init-container" \ - $(VERSION) "dockerfiles/aegis-ist-fips/init-container.Dockerfile" - -# Packages the “Aegis Init Container” binary into a container image for Photon OS. -init-container-bundle-photon: - ./hack/bundle.sh "aegis-photon-init-container" \ - $(VERSION) "dockerfiles/aegis-photon/init-container.Dockerfile" - -# Packages the “Aegis Init Container” binary into a container image for Photon OS and FIPS. -init-container-bundle-photon-fips: - ./hack/bundle.sh "aegis-photon-fips-init-container" \ - $(VERSION) "dockerfiles/aegis-photon-fips/init-container.Dockerfile" - -# Pushes the “Aegis Init Container” container image to the public registry. -init-container-push-ist: - ./hack/push.sh "aegis-ist-init-container" \ - $(VERSION) "aegishub/aegis-ist-init-container" - -# Pushes the “Aegis Init Container” (FIPS) container image to the public registry. -init-container-push-ist-fips: - ./hack/push.sh "aegis-ist-fips-init-container" \ - $(VERSION) "aegishub/aegis-ist-fips-init-container" - -# Pushes the “Aegis Init Container” (Photon OS) container image to the public registry. -init-container-push-photon: - ./hack/push.sh "aegis-photon-init-container" \ - $(VERSION) "aegishub/aegis-photon-init-container" - -# Pushes the “Aegis Init Container” (Photon OS and FIPS) container image to the public registry. -init-container-push-photon-fips: - ./hack/push.sh "aegis-photon-fips-init-container" \ - $(VERSION) "aegishub/aegis-photon-fips-init-container" - -# Pushes the “Aegis Init Container” container image to the local registry. -init-container-push-ist-local: - ./hack/push.sh "aegis-ist-init-container" $(VERSION) \ - "localhost:5000/aegis-ist-init-container" - -init-container-push-ist-fips-local: - ./hack/push.sh "aegis-ist-fips-init-container" $(VERSION) \ - "localhost:5000/aegis-ist-fips-init-container" - -# Pushes the “Aegis Init Container” (Photon OS) container image to the local registry. -init-container-push-photon-local: - ./hack/push.sh "aegis-photon-init-container" $(VERSION) \ - "localhost:5000/aegis-photon-init-container" - -# Pushes the “Aegis Init Container” (Photon OS and FIPS) container image to the local registry. -init-container-push-photon-fips-local: - ./hack/push.sh "aegis-photon-fips-init-container" $(VERSION) \ - "localhost:5000/aegis-photon-fips-init-container" diff --git a/AegisMacOs.mk b/AegisMacOs.mk deleted file mode 100644 index fb18394..0000000 --- a/AegisMacOs.mk +++ /dev/null @@ -1,12 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# Create a proxy from user’s localhost to Docker for Mac’s docker -# registry’s API port. -mac-tunnel: - ./hack/mac-registry-tunnel.sh \ No newline at end of file diff --git a/AegisSafe.mk b/AegisSafe.mk deleted file mode 100644 index f5ef05e..0000000 --- a/AegisSafe.mk +++ /dev/null @@ -1,65 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# Packages the “Aegis Safe” into a container image. -safe-bundle-ist: - ./hack/bundle.sh "aegis-ist-safe" \ - $(VERSION) "dockerfiles/aegis-ist/safe.Dockerfile" - -# Packages the “Aegis Safe” into a container image for FIPS. -safe-bundle-ist-fips: - ./hack/bundle.sh "aegis-ist-fips-safe" \ - $(VERSION) "dockerfiles/aegis-ist-fips/safe.Dockerfile" - -# Packages the “Aegis Safe” into a container image for Photon OS. -safe-bundle-photon: - ./hack/bundle.sh "aegis-photon-safe" \ - $(VERSION) "dockerfiles/aegis-photon/safe.Dockerfile" - -# Packages the “Aegis Safe” into a container image for Photon OS and FIPS. -safe-bundle-photon-fips: - ./hack/bundle.sh "aegis-photon-fips-safe" \ - $(VERSION) "dockerfiles/aegis-photon-fips/safe.Dockerfile" - -# Pushes the “Aegis Safe” container to the public registry. -safe-push-ist: - ./hack/push.sh "aegis-ist-safe" $(VERSION) "aegishub/aegis-ist-safe" - -# Pushes the “Aegis Safe” container to the public registry. -safe-push-ist-fips: - ./hack/push.sh "aegis-ist-fips-safe" \ - $(VERSION) "aegishub/aegis-ist-fips-safe" - -# Pushes the “Aegis Safe” (Photon OS) container to the public registry. -safe-push-photon: - ./hack/push.sh "aegis-photon-safe" \ - $(VERSION) "aegishub/aegis-photon-safe" - -# Pushes the “Aegis Safe” (Photon OS) container to the public registry. -safe-push-photon-fips: - ./hack/push.sh "aegis-photon-fips-safe" \ - $(VERSION) "aegishub/aegis-photon-fips-safe" - -# Pushes the “Aegis Safe” container image to the local registry. -safe-push-ist-local: - ./hack/push.sh "aegis-ist-safe" $(VERSION) "localhost:5000/aegis-ist-safe" - -# Pushes the “Aegis Safe” container image to the local registry. -safe-push-ist-fips-local: - ./hack/push.sh "aegis-ist-fips-safe" \ - $(VERSION) "localhost:5000/aegis-ist-fips-safe" - -# Pushes the “Aegis Safe” (Photon OS) container image to the local registry. -safe-push-photon-local: - ./hack/push.sh "aegis-photon-safe" \ - $(VERSION) "localhost:5000/aegis-photon-safe" - -# Pushes the “Aegis Safe” (Photon OS) container image to the local registry. -safe-push-photon-fips-local: - ./hack/push.sh "aegis-photon-fips-safe" \ - $(VERSION) "localhost:5000/aegis-photon-fips-safe" diff --git a/AegisSentinel.mk b/AegisSentinel.mk deleted file mode 100644 index 71b2518..0000000 --- a/AegisSentinel.mk +++ /dev/null @@ -1,67 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# Packages the “Aegis Sentinel” binary into a container image. -sentinel-bundle-ist: - ./hack/bundle.sh "aegis-ist-sentinel" \ - $(VERSION) "dockerfiles/aegis-ist/sentinel.Dockerfile" - -# Packages the “Aegis Sentinel” binary into a container image for FIPS. -sentinel-bundle-ist-fips: - ./hack/bundle.sh "aegis-ist-fips-sentinel" \ - $(VERSION) "dockerfiles/aegis-ist-fips/sentinel.Dockerfile" - -# Packages the “Aegis Sentinel” binary into a container image for Photon OS. -sentinel-bundle-photon: - ./hack/bundle.sh "aegis-photon-sentinel" \ - $(VERSION) "dockerfiles/aegis-photon/sentinel.Dockerfile" - -# Packages the “Aegis Sentinel” binary into a container image for Photon OS and FIPS. -sentinel-bundle-photon-fips: - ./hack/bundle.sh "aegis-photon-fips-sentinel" \ - $(VERSION) "dockerfiles/aegis-photon-fips/sentinel.Dockerfile" - -# Pushes the “Aegis Sentinel” container image the the public registry. -sentinel-push-ist: - ./hack/push.sh "aegis-ist-sentinel" \ - $(VERSION) "aegishub/aegis-ist-sentinel" - -# Pushes the “Aegis Sentinel” (Photon OS) container image to the public registry. -sentinel-push-ist-fips: - ./hack/push.sh "aegis-ist-fips-sentinel" \ - $(VERSION) "aegishub/aegis-ist-fips-sentinel" - -# Pushes the “Aegis Sentinel” (Photon OS) container image to the public registry. -sentinel-push-photon: - ./hack/push.sh "aegis-photon-sentinel" \ - $(VERSION) "aegishub/aegis-photon-sentinel" - -# Pushes the “Aegis Sentinel” (Photon OS) container image to the public registry. -sentinel-push-photon-fips: - ./hack/push.sh "aegis-photon-fips-sentinel" \ - $(VERSION) "aegishub/aegis-photon-fips-sentinel" - -# Pushes the “Aegis Sentinel” container image to the local registry. -sentinel-push-ist-local: - ./hack/push.sh "aegis-ist-sentinel" \ - $(VERSION) "localhost:5000/aegis-ist-sentinel" - -# Pushes the “Aegis Sentinel” (Photon OS) container image to the local registry. -sentinel-push-ist-fips-local: - ./hack/push.sh "aegis-ist-fips-sentinel" \ - $(VERSION) "localhost:5000/aegis-ist-fips-sentinel" - -# Pushes the “Aegis Sentinel” (Photon OS) container image to the local registry. -sentinel-push-photon-local: - ./hack/push.sh "aegis-photon-sentinel" \ - $(VERSION) "localhost:5000/aegis-photon-sentinel" - -# Pushes the “Aegis Sentinel” (Photon OS) container image to the local registry. -sentinel-push-photon-fips-local: - ./hack/push.sh "aegis-photon-fips-sentinel" \ - $(VERSION) "localhost:5000/aegis-photon-fips-sentinel" diff --git a/AegisSidecar.mk b/AegisSidecar.mk deleted file mode 100644 index b62b245..0000000 --- a/AegisSidecar.mk +++ /dev/null @@ -1,67 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# Packages the “Aegis Sidecar” binary into a container image. -sidecar-bundle-ist: - ./hack/bundle.sh "aegis-ist-sidecar" \ - $(VERSION) "dockerfiles/aegis-ist/sidecar.Dockerfile" - -# Packages the “Aegis Sidecar” binary into a container image for FIPS. -sidecar-bundle-ist-fips: - ./hack/bundle.sh "aegis-ist-fips-sidecar" \ - $(VERSION) "dockerfiles/aegis-ist-fips/sidecar.Dockerfile" - -# Packages the “Aegis Sidecar” binary into a container image for Photon OS. -sidecar-bundle-photon: - ./hack/bundle.sh "aegis-photon-sidecar" \ - $(VERSION) "dockerfiles/aegis-photon/sidecar.Dockerfile" - -# Packages the “Aegis Sidecar” binary into a container image for Photon OS and FIPS. -sidecar-bundle-photon-fips: - ./hack/bundle.sh "aegis-photon-fips-sidecar" \ - $(VERSION) "dockerfiles/aegis-photon-fips/sidecar.Dockerfile" - -# Pushes the “Aegis Sidecar” container image to the public registry. -sidecar-push-ist: - ./hack/push.sh "aegis-ist-sidecar" \ - $(VERSION) "aegishub/aegis-ist-sidecar" - -# Pushes the “Aegis Sidecar” (FIPS) container image to the public registry. -sidecar-push-ist-fips: - ./hack/push.sh "aegis-ist-fips-sidecar" \ - $(VERSION) "aegishub/aegis-ist-fips-sidecar" - -# Pushes the “Aegis Sidecar” (Photon OS) container image to the public registry. -sidecar-push-photon: - ./hack/push.sh "aegis-photon-sidecar" \ - $(VERSION) "aegishub/aegis-photon-sidecar" - -# Pushes the “Aegis Sidecar” (Photon OS and FIPS) container image to the public registry. -sidecar-push-photon-fips: - ./hack/push.sh "aegis-photon-fips-sidecar" \ - $(VERSION) "aegishub/aegis-photon-fips-sidecar" - -# Pushes the “Aegis Sidecar” container image to the local registry. -sidecar-push-ist-local: - ./hack/push.sh "aegis-ist-sidecar" \ - $(VERSION) "localhost:5000/aegis-ist-sidecar" - -# Pushes the “Aegis Sidecar” (FIPS) container image to the local registry. -sidecar-push-ist-fips-local: - ./hack/push.sh "aegis-ist-fips-sidecar" \ - $(VERSION) "localhost:5000/aegis-ist-fips-sidecar" - -# Pushes the “Aegis Sidecar” (Photon OS) container image to the local registry. -sidecar-push-photon-local: - ./hack/push.sh "aegis-photon-sidecar" \ - $(VERSION) "localhost:5000/aegis-photon-sidecar" - -# Pushes the “Aegis Sidecar” (Photon OS and FIPS) container image to the local registry. -sidecar-push-photon-fips-local: - ./hack/push.sh "aegis-photon-fips-sidecar" \ - $(VERSION) "localhost:5000/aegis-photon-fips-sidecar" diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..93fc098 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,16 @@ +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret + +# Lines starting with '#' are comments. +# Each line is a file pattern followed by one or more owners. +# More details are here: https://help.github.com/articles/about-codeowners/ + +## Code Owners (in no particular order) ## + +* @v0lkan # Volkan Özçelik +* @abhishek44sharma # Abhishek Sharma +* @st96d045 # Esteban Serrano +* @ats0stv # Arun Thundyill Saseendran +* @RamXX # Ramiro Salas diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 1b29462..5bda532 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,8 +1,13 @@ -![Aegis](assets/aegis-banner.png "Aegis") +```text +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +``` -# Contributor Covenant Code of Conduct +## Contributor Covenant Code of Conduct -## Our Pledge +### Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body @@ -14,7 +19,7 @@ identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. -## Our Standards +### Our Standards Examples of behavior that contributes to a positive environment for our community include: @@ -38,7 +43,7 @@ Examples of unacceptable behavior include: * Other conduct which could reasonably be considered inappropriate in a professional setting -## Enforcement Responsibilities +### Enforcement Responsibilities Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in @@ -50,7 +55,7 @@ comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. -## Scope +### Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. @@ -58,11 +63,11 @@ Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. -## Enforcement +### Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement by sending an -email to [aegis-abuse@volkan.io](mailto:aegis-abuse@volkan.io). +email to [vsecm-abuse@volkan.io](mailto:vsecm-abuse@volkan.io). All complaints will be reviewed and investigated promptly and fairly. @@ -74,7 +79,7 @@ reporter of any incident. Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: -### 1. Correction +#### 1. Correction **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. @@ -83,7 +88,7 @@ unprofessional or unwelcome in the community. clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. -### 2. Warning +#### 2. Warning **Community Impact**: A violation through a single incident or series of actions. @@ -95,7 +100,7 @@ includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. -### 3. Temporary Ban +#### 3. Temporary Ban **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. @@ -106,7 +111,7 @@ private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. -### 4. Permanent Ban +#### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an @@ -115,7 +120,7 @@ individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within the community. -## Attribution +### Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 13af37c..5c7146f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,14 +1,19 @@ -![Aegis](assets/aegis-banner.png "Aegis") +```text +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +``` -# Contributing +## Contributing -Thank you for your interest in contributing to **Aegis**! +Thank you for your interest in contributing to **VMware Secrets Manager**! We appreciate any help, be it in the form of code, documentation, design, or even bug reports and feature requests. -When contributing to this repository, please first discuss the change you wish to make -via an issue, email, or any other method before making a change. +When contributing to this repository, please first discuss the change you wish +to make via an issue, email, or any other method before making a change. This way, we can avoid misunderstandings and wasted effort. Please note that [we have a code of conduct](CODE_OF_CONDUCT.md). We expect all @@ -16,7 +21,8 @@ contributors to adhere to it in all interactions with the project. ## Pull Request Process -1. Ensure all components build and function properly on a local Kubernetes cluster (*such as minikube*). +1. Ensure all components build and function properly on a local + Kubernetes cluster (*such as minikube*). 2. Adhere to the code standards described below. 3. Update necessary `README.md` and other documents to reflect your changes. 4. Keep pull requests as granular as possible. Reviewing large amounts of code @@ -25,9 +31,10 @@ contributors to adhere to it in all interactions with the project. ### Code Standards -In **Aegis**, we aim for a unified and clean codebase. When contributing, please try to match -the style of the code that you see in the file you're working on. The file should look as -if it was authored by a single person after your changes. +In **VMware Secrets Manager**, we aim for a unified and clean codebase. +When contributing, please try to match the style of the code that you see in +the file you're working on. The file should look as if it was authored by a +single person after your changes. For Go files, we require that you run `gofmt` before submitting your pull request to ensure consistent formatting. @@ -37,11 +44,13 @@ request to ensure consistent formatting. Before submitting your pull request, make sure your changes pass all the existing tests, and add new ones if necessary. -## Building Aegis for Development +## Building VMware Secrets Manager for Development -To build **Aegis** from source code and develop locally, [follow the contributing guidelines here][contributing]. +To build **VMware Secrets Manager** from source code and develop locally, +[follow the contributing guidelines here][contributing]. -If you are a maintainer, and you are preparing a release, [follow the release guidelines here][release]. +If you are a maintainer, and you are preparing a release, +[follow the release guidelines here][release]. -[contributing]: https://aegis.ist/docs/contributing/ -[release]: https://aegis.ist/release/ +[contributing]: https://vsecm.com/contributing/ +[release]: https://vsecm.com/release/ diff --git a/LICENSE b/LICENSE index e7ef35d..e4b50a6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,25 @@ -MIT License +The 2-Clause BSD License +SPDX short identifier: BSD-2-Clause -Copyright © Volkan Özçelik and Contributors. +Copyright 2023–present VMware, Inc. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the “Software”), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Makefile b/Makefile index a77bfa4..d587699 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,34 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ # The common version tag assigned to all the things. -VERSION=0.18.1 +VERSION=0.20.0 # Utils -include ./AegisMacOs.mk -include ./AegisDeploy.mk -## Aegis -include ./AegisSafe.mk -include ./AegisSentinel.mk -include ./AegisInitContainer.mk -include ./AegisSidecar.mk +include ./makefiles/VSecMMacOs.mk +include ./makefiles/VSecMDeploy.mk + +## VMware Secrets Manager +include ./makefiles/VSecMSafe.mk +include ./makefiles/VSecMSentinel.mk +include ./makefiles/VSecMInitContainer.mk +include ./makefiles/VSecMSidecar.mk + ## Examples -include ./AegisExampleSidecar.mk -include ./AegisExampleSdk.mk -include ./AegisExampleMultipleSecrets.mk -include ./AegisExampleInitContainer.mk +include ./makefiles/VSecMExampleSidecar.mk +include ./makefiles/VSecMExampleSdk.mk +include ./makefiles/VSecMExampleMultipleSecrets.mk +include ./makefiles/VSecMExampleInitContainer.mk ## Build -include ./AegisBuild.mk +include ./makefiles/VSecMBuild.mk ## Help -include ./AegisHelp.mk +include ./makefiles/VSecMHelp.mk diff --git a/README.md b/README.md index 83d59df..3d15608 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,44 @@ -# Aegis - -![Aegis](assets/aegis-git-banner.png "Aegis") +```go +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +``` [spire]: https://spiffe.io/ "SPIFFE: Secure Production Identity Framework for Everyone" -[![Go Report Card](https://goreportcard.com/badge/github.com/shieldworks/aegis)](https://goreportcard.com/report/github.com/shieldworks/aegis) +[![Go Report Card](https://goreportcard.com/badge/github.com/vmware-tanzu/secrets-manager)](https://goreportcard.com/report/github.com/vmware-tanzu/secrets-manager) ## The Elevator Pitch -[**Aegis**](https://aegis.ist) is a delightfully-secure Kubernetes-native -secrets store. +[**VMware Secrets Manager for Cloud-Native Apps**](https://vsecm.com) (*VSecM*) +is a delightfully-secure Kubernetes-native secrets store. -**Aegis** keeps your secrets secret. +**VMware Secrets Manager** keeps your secrets secret. -With **Aegis**, you can rest assured that your +With **VMware Secrets Manager**, you can rest assured that your sensitive data is always **secure** and **protected**. -**Aegis** is perfect for securely storing arbitrary configuration information at -a central location and securely dispatching it to workloads. +**VMware Secrets Manager** is perfect for securely storing arbitrary configuration +information at a central location and securely dispatching it to workloads. ## Tell Me More -**Aegis** is a cloud-native secure store for secrets management. +**VMware Secrets Manager** is a cloud-native secure store for secrets management. It provides a minimal and intuitive API, ensuring practical security without compromising user experience. -Aegis is **resilient** and **secure** by default, storing sensitive data in memory -and encrypting any data saved to disk. +**VMare Secrets Manager** is resilient and **secure by default**, storing +sensitive data in memory and encrypting any data saved to disk. -Endorsed by industry experts, **Aegis** is a ground-up re-imagination of -secrets management, leveraging SPIFFE for authentication and providing -a cloud-native way to manage secrets end-to-end. +[Endorsed by industry experts](https://vsecm.com/endorsements), +**VMware Secrets Manager** is a ground-up re-imagination of secrets management, +leveraging [**SPIFFE**](https://spiffe.io) for authentication and providing a +cloud-native way to manage secrets end-to-end. ## Getting Your Hands Dirty -Before trying **Aegis**, you might want to learn about its +Before trying **VMware Secrets Manager**, you might want to learn about its [architecture][architecture] and [design goals][design]. Once you are ready to get started, [see the Quickstart guide][quickstart]. @@ -42,162 +46,163 @@ Once you are ready to get started, [see the Quickstart guide][quickstart]. Or, if you one of those who “*learn by doing*”, you might want to dig into the implementation details later. If that’s the case, you can directly jump to the fun part and [follow the steps here][installation] to install -**Aegis** to your Kubernetes cluster. +**VMware Secrets Manager** to your Kubernetes cluster. ## Dive Into Example Use Cases -There are several examples demonstrating **Aegis** sample use cases -[inside the `./examples/` folder](./examples). +There are several examples demonstrating **VMware Secrets Manager** sample use +cases [inside the `./examples/` folder](./examples). ## Container Images -Pre-built container images of **Aegis** components can be found at: -. +Pre-built container images of **VMware Secrets Manager** components can be found +at: . -## Build Aegis From the Source +## Build VMware Secrets Manager From the Source -[You can also build **Aegis** from the source][build]. +[You can also build **VMware Secrets Manager** from the source][build]. ## The Roadmap -[We publicly track all **Aegis** plans on a GitHub project][roadmap]. You can -check it out to get a glimpse of the current planned features, and how the -future of **Aegis** looks like. +[We publicly track all **VMware Secrets Manager** plans on this roadmap page][roadmap]. + +You can check it out to get a glimpse of the current planned features, and how +the future of **VMware Secrets Manager** looks like. -[roadmap]:https://github.com/orgs/shieldworks/projects/1 "The Roadmap" -[installation]: https://aegis.ist/docs/#installation "Install Aegis" -[build]: https://aegis.ist/docs/contributing/#building-deploying-and-testing -[architecture]: https://aegis.ist/docs/architecture/ "Aegis Deep Dive" -[design]: https://aegis.ist/docs/philosophy/ "Aegis Philosphy" -[quickstart]: https://aegis.ist/docs/ +[roadmap]: https://vsecm.com/roadmap "The Roadmap" +[installation]: https://vsecm.com/installation "Install VMware Secrets Manager" +[build]: https://vsecm.com/use-the-source "Building, Deploying, and Testing" +[architecture]: https://vsecm.com/architecture/ "VMware Secrets Manager Architecture" +[design]: https://vsecm.com/philosophy/ "VMware Secrets Manager Design Philosphy" +[quickstart]: https://vsecm.com/quickstart "Quickstart" ## Status of This Software -**Aegis**, is under dynamic and progressive development. +**VMware Secrets Manager** is under dynamic and progressive development. The code that we’ve officially signed and released maintains a high standard of stability and dependability. However, we do encourage it be used in a production environment (*at your own risk—[see LICENSE](LICENSE)*). -It’s important to note that, technically speaking, **Aegis** currently holds the -status of an alpha software. This simply means that as we journey towards our milestone of -`v1.0.0`, it's possible for changes to occur—both major and minor. While this might mean -some aspects are not backward compatible, it's a testament to our unwavering commitment -to refining and enhancing **Aegis**. +It’s important to note that, technically speaking, **VMware Secrets Manager** +currently holds the status of an *alpha software*. This simply means that as we +journey towards our milestone of `v1.0.0`, it's possible for changes to +occur—both major and minor. While this might mean some aspects are not backward +compatible, it's a testament to our unwavering commitment to refining and +enhancing **VMware Secrets Manager**. In a nutshell, we are ceaselessly pushing the boundaries of what’s possible, while ensuring our software stays as dependable and effective for production use. ## 🦆🦆🦆 (*Docs*) -[Official documentation available on **aegis.ist**](https://aegis.ist). +[Official documentation available on **vsecm.com**](https://vsecm.com). ## A Note on Security -We take **Aegis**’ security seriously. If you believe you have found a vulnerability, -please responsibly disclose by contacting [security@aegis.ist](mailto:security@aegis.ist). +We take **VMware Secrets Manager**’s security seriously. If you believe you have +found a vulnerability, please responsibly disclose by contacting +[security@vsecm.com](mailto:security@vsecm.com). -## A Tour Of Aegis +## A Tour Of VMware Secrets Manager -[Check out this quickstart guide][quickstart] for an overview of **Aegis**. +[Check out this quickstart guide][quickstart] for an overview of +**VMware Secrets Manager**. -[quickstart]: https://aegis.ist/docs/ +[quickstart]: https://vsecm.com/quickstart ## Community Open Source is better together. -If you are a security enthusiast, [**join Aegis’ Slack Workspace**][slack-invite] +If you are a security enthusiast, +[**join VMware Secrets Manager’s Slack Workspace**][slack-invite] and let us change the world together 🤘. ## Links ### General Links -* **Homepage**: -* **Documentation**: -* **Changelog**: -* **Community**: [Join **Aegis**’ Slack Workspace][slack-invite] -* **Contact**: -* **Media Kit**: -* **Changelog**: +* **Homepage and Docs**: +* **Changelog**: +* **Community**: [Join **VSecM**’s Slack Workspace][slack-invite] +* **Contact**: +* **Media Kit**: +* **Changelog**: ### Guides and Tutorials -* **Installation and Quickstart**: -* **Local Development Instructions**: -* **Aegis Go SDK**: -* **Aegis CLI**: -* **Architectural Deep Dive**: -* **Configuration**: -* **Design Philosophy**: -* **Production Deployment Tips**: +* **Installation and Quickstart**: +* **Local Development Instructions**: +* **Developer SDK**: +* **CLI**: +* **Architecture**: +* **Configuration**: +* **Design Philosophy**: +* **Production Deployment Tips**: ## Installation -[Check out this quickstart guide][quickstart] for an overview of **Aegis**, +[Check out this quickstart guide][quickstart] for an overview of **VMware Secrets Manager**, which also covers **installation** and **uninstallation** instructions. -[quickstart]: https://aegis.ist/docs/ +[quickstart]: https://vsecm.com/docs/ You need a **Kubernetes** cluster and sufficient admin rights on that cluster to -install **Aegis**. +install **VMware Secrets Manager**. ## Usage -[This tutorial about “**Registering Secrets Using Aegis**”][register] covers +[This tutorial about “**Registering Secrets Using VMware Secrets Manager**”][register] covers several usage scenarios. -[register]: https://aegis.ist/docs/register/ +[register]: https://vsecm.com/quickstart/ ## Architecture Details -[Check out this **Aegis Deep Dive**][deep-dive] article for an overview -of **Aegis** system design and how each component fits together. +[Check out this **VMware Secrets Manager Deep Dive**][deep-dive] article for an overview +of **VMware Secrets Manager** system design and how each component fits together. -[deep-dive]: https://aegis.ist/docs/architecture/ +[deep-dive]: https://vsecm.com/architecture/ ## Folder Structure +> *VSecM* == “VMware Secrets Manager for Cloud-Native Apps” + Here are the important folders and files in this repository: -* `./app`: Contains core **Aegis** components’ source code. - * `./app/init-container`: Contains the source code for the **Aegis Init Container**. - * `./app/safe`: Contains the source code for the **Aegis Safe**. - * `./app/sentinel`: Contains the source code for the **Aegis Sentinel**. - * `./app/sidecar`: Contains the source code for the **Aegis Sidecar**. -* `./core`: Contains core modules that are shared across **Aegis** components. +* `./app`: Contains core **VSecM** components’ source code. + * `./app/init-container`: Contains the source code for the **VSecM Init Container**. + * `./app/safe`: Contains the source code for the **VSecM Safe**. + * `./app/sentinel`: Contains the source code for the **VSecM Sentinel**. + * `./app/sidecar`: Contains the source code for the **VSecM Sidecar**. +* `./helm-charts`: Contains **VSecM** helm charts. +* `./core`: Contains core modules that are shared across **VSecM** components. * `./examples`: Contains the source code of example use cases. * `./hack`: Contains scripts that are used for building, publishing, development and testing. -* `./k8s`: Contains Kubernetes manifests that are used to deploy **Aegis** and +* `./k8s`: Contains Kubernetes manifests that are used to deploy **VSecM** and its use cases. -* `./sdk`: Contains the source code of the **Aegis SDK**. -* `./CODE_OF_CONDUCT.md`: Contains **Aegis** Code of Conduct. -* `./SECURITY.md`: Contains **Aegis** Security Policy. -* `./LICENSE`: Contains **Aegis** License. -* `./Makefile`: Contains **Aegis** Makefile that is used for building, +* `./sdk`: Contains the source code of the **VSecM Developer SDK**. +* `./CODE_OF_CONDUCT.md`: Contains **VSecM** Code of Conduct. +* `./SECURITY.md`: Contains **VSecM** Security Policy. +* `./LICENSE`: Contains **VSecM** License. +* `./Makefile`: Contains the `Makefile` that is used for building, publishing, deploying, and testing the project. -## One More Thing… How Do I Pronounce “Aegis”? - -[We have an article for that too 🙂][pronounce]. - -[pronounce]: https://aegis.ist/pronunciation/ - ## Changelog You can find the changelog, and migration/upgrade instructions (*if any*) -on [**Aegis**’ Changelog Page](https://aegis.ist/changelog/). +on [**VMware Secrets Manager**’s Changelog Page](https://vsecm.com/changelog/). ## What’s Coming Up Next? -You can see the project’s progress [in these **Aegis** boards][mdp]. +You can see the project’s progress [in this **VMware Secrets Manager** roadmap][mdp]. The board outlines what are the current outstanding work items, and what is currently being worked on. -[mdp]: https://github.com/orgs/shieldworks/projects/1/views/2 +[mdp]: https://vsecm.com/roadmap ## Code Of Conduct @@ -205,7 +210,7 @@ currently being worked on. ## Contributing -To contribute to **Aegis**, [follow the contributing guidelines](CONTRIBUTING.md) +To contribute to **VMware Secrets Manager**, [follow the contributing guidelines](CONTRIBUTING.md) to get started. Use GitHub issues to request features or file bugs. @@ -213,24 +218,20 @@ Use GitHub issues to request features or file bugs. ## Communications * [**Slack** is where the community hangs out][slack-invite]. -* [Send comments and suggestions to **feedback@aegis.ist**](mailto:feedback@aegis.ist). +* [Send comments and suggestions to **feedback@vsecm.com**](mailto:feedback@vsecm.com). ## Maintainers -As of now, I, [Volkan Özçelik][me], am the sole maintainer of **Aegis**. - -[me]: https://github.com/v0lkan "Volkan Özçelik" +Check out the [CODEOWNERS](CODEOWNERS) for a list of maintainers of +**VMware Secrets Manager**. Please send your feedback, suggestions, recommendations, and comments to -[feedback@aegis.ist](mailto:feedback@aegis.ist). +[feedback@vsecm.com](mailto:feedback@vsecm.com). We’d love to have them. ## License -[MIT License](LICENSE). +[BSD-2 Clause License](LICENSE). -[slack-invite]: https://join.slack.com/t/aegis-6n41813/shared_invite/zt-1myzqdi6t-jTvuRd1zDLbHX0gN8VkCqg "Join aegis.slack.com" -[aegis-web]: https://aegis.ist/ -[aegis-projects]: https://aegis.ist/docs/architecture/#projects -[aegis-repo]: https://github.com/shieldworks/aegis +[slack-invite]: https://join.slack.com/t/a-101-103-105-s/shared_invite/zt-1zrr2yepf-2P3EJhfoGNn05l5_4jvYSA "Join VSecM Slack" diff --git a/SECURITY.md b/SECURITY.md index bd40160..e4c97e9 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,20 +1,30 @@ -# Security Policy +```text +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +``` + +## About + +This document outlines the security policy and procedures for reporting +security vulnerabilities in **VMware Secrets Manager**, along with the version support policy. ## Supported Versions -Only the most recent version of **Aegis** +Only the most recent version of **VMware Secrets Manager** is currently being supported with security updates. -Note that **Aegis** consists of more than a single project, +Note that **VMware Secrets Manager** consists of more than a single project, and during a release cut, all projects are signed and tagged with the same version. -After **Aegis** hits a major 1.0.0. version, this will change, +After **VMware Secrets Manager** hits a major 1.0.0. version, this will change, and we will also have a support plan various major versions. ## Reporting a Vulnerability -Send your vulnerability reports to [security@aegis.ist](mailto:security@aegis.ist). +Send your vulnerability reports to [security@vsecm.com](mailto:security@vsecm.com). We don’t have an official turnover time, but if nobody gets back to you within a week please send another email. diff --git a/app/init-container/README.md b/app/init-container/README.md index a5dceee..4650c11 100644 --- a/app/init-container/README.md +++ b/app/init-container/README.md @@ -1,11 +1,14 @@ -# Aegis +```text +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +``` -![Aegis](../../assets/aegis-icon.png "Aegis") +## VMware Secrets Manager (*VSecM*) Init Container -keep your secrets… secret +**VSecM Init Container** is a Kubernetes init container that +waits for a secret that is assigned to the workload to be available before +starting the main container. -## Aegis Init Container - -**Aegis Init Container** is a Kubernetes init container that waits for a -secret that is assigned to the workload to be available before starting the -main container. \ No newline at end of file +Check out more details in the [official documentation](https://vsecm.com/). diff --git a/app/init-container/cmd/main.go b/app/init-container/cmd/main.go index 808886c..29f4bc2 100644 --- a/app/init-container/cmd/main.go +++ b/app/init-container/cmd/main.go @@ -1,23 +1,25 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package main import ( - "github.com/shieldworks/aegis/core/log" - "github.com/shieldworks/aegis/core/system" - "github.com/shieldworks/aegis/sdk/startup" + "github.com/vmware-tanzu/secrets-manager/core/log" + "github.com/vmware-tanzu/secrets-manager/core/system" + "github.com/vmware-tanzu/secrets-manager/sdk/startup" ) func main() { id := "AEGIICNT" - log.InfoLn(&id, "Starting Aegis Init Container") + log.InfoLn(&id, "Starting VMware Secrets Manager Init Container") go startup.Watch() // Block the process from exiting, but also be graceful and honor the diff --git a/app/safe/README.md b/app/safe/README.md index 1a99005..d0206f0 100644 --- a/app/safe/README.md +++ b/app/safe/README.md @@ -1,9 +1,12 @@ -# Aegis +```text +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +``` -![Aegis](../../assets/aegis-icon.png "Aegis") +## VMware Secrets Manager (VSecM) Safe -keep your secrets… secret +**VSecM Safe** is the store that keeps your secrets secret. -## Aegis Safe - -**Aegis Safe** is the store that keeps your secrets secret. +Check out more details in the [official documentation](https://vsecm.com/). diff --git a/app/safe/cmd/main.go b/app/safe/cmd/main.go index eefd944..3d1201e 100644 --- a/app/safe/cmd/main.go +++ b/app/safe/cmd/main.go @@ -1,23 +1,25 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package main import ( "context" - "github.com/shieldworks/aegis/app/safe/internal/bootstrap" - "github.com/shieldworks/aegis/app/safe/internal/server" - "github.com/shieldworks/aegis/core/log" - "github.com/shieldworks/aegis/core/probe" + "github.com/vmware-tanzu/secrets-manager/app/safe/internal/bootstrap" + "github.com/vmware-tanzu/secrets-manager/app/safe/internal/server" + "github.com/vmware-tanzu/secrets-manager/core/log" + "github.com/vmware-tanzu/secrets-manager/core/probe" ) func main() { - id := "AEGISAFE" + id := "VSECMSAFE" log.InfoLn(&id, "Acquiring identity…") diff --git a/app/safe/internal/bootstrap/bootstrap.go b/app/safe/internal/bootstrap/bootstrap.go index 73bf41b..9755a5f 100644 --- a/app/safe/internal/bootstrap/bootstrap.go +++ b/app/safe/internal/bootstrap/bootstrap.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package bootstrap @@ -14,12 +16,12 @@ import ( "encoding/hex" "filippo.io/age" "github.com/pkg/errors" - "github.com/shieldworks/aegis/app/safe/internal/state" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/log" - "github.com/shieldworks/aegis/core/probe" - "github.com/shieldworks/aegis/core/validation" "github.com/spiffe/go-spiffe/v2/workloadapi" + "github.com/vmware-tanzu/secrets-manager/app/safe/internal/state" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/log" + "github.com/vmware-tanzu/secrets-manager/core/probe" + "github.com/vmware-tanzu/secrets-manager/core/validation" "os" "time" ) diff --git a/app/safe/internal/bootstrap/k8s.go b/app/safe/internal/bootstrap/k8s.go index 4b915df..6e38215 100644 --- a/app/safe/internal/bootstrap/k8s.go +++ b/app/safe/internal/bootstrap/k8s.go @@ -1,18 +1,20 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package bootstrap import ( "context" "github.com/pkg/errors" - "github.com/shieldworks/aegis/app/safe/internal/state" - "github.com/shieldworks/aegis/core/env" + "github.com/vmware-tanzu/secrets-manager/app/safe/internal/state" + "github.com/vmware-tanzu/secrets-manager/core/env" v1 "k8s.io/api/core/v1" metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" @@ -35,7 +37,7 @@ func persistKeys(privateKey, publicKey, aesSeed string) error { data["KEY_TXT"] = ([]byte)(keysCombined) // Update the Secret in the cluster - _, err = k8sApi.CoreV1().Secrets("aegis-system").Update( + _, err = k8sApi.CoreV1().Secrets("vsecm-system").Update( context.Background(), &v1.Secret{ TypeMeta: metaV1.TypeMeta{ @@ -44,7 +46,7 @@ func persistKeys(privateKey, publicKey, aesSeed string) error { }, ObjectMeta: metaV1.ObjectMeta{ Name: env.SafeAgeKeySecretName(), - Namespace: "aegis-system", + Namespace: "vsecm-system", }, Data: data, }, diff --git a/app/safe/internal/server/handle/handle.go b/app/safe/internal/server/handle/handle.go index c5d0a97..f0d5537 100644 --- a/app/safe/internal/server/handle/handle.go +++ b/app/safe/internal/server/handle/handle.go @@ -1,17 +1,19 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package handle import ( - "github.com/shieldworks/aegis/app/safe/internal/server/route" - "github.com/shieldworks/aegis/core/crypto" - "github.com/shieldworks/aegis/core/log" + "github.com/vmware-tanzu/secrets-manager/app/safe/internal/server/route" + "github.com/vmware-tanzu/secrets-manager/core/crypto" + "github.com/vmware-tanzu/secrets-manager/core/log" "io" "net/http" ) @@ -20,7 +22,7 @@ func InitializeRoutes() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { cid, _ := crypto.RandomString(8) if cid == "" { - cid = "AEGISFHN" + cid = "VSECMFHN" } id, err := spiffeIdFromRequest(r) @@ -41,7 +43,7 @@ func InitializeRoutes() { log.DebugLn(&cid, "Handler: got svid:", sid, "path", p, "method", r.Method) // Route to list secrets. - // Only Aegis Sentinel is allowed to call this API endpoint. + // Only VMware Secrets Manager Sentinel is allowed to call this API endpoint. // Calling it from anywhere else will error out. if r.Method == http.MethodGet && p == "/sentinel/v1/secrets" { log.DebugLn(&cid, "Handler: will list") @@ -49,10 +51,10 @@ func InitializeRoutes() { return } - // Route to define the master key when AEGIS_SAFE_MANUAL_KEY_INPUT is set. - // Only Aegis Sentinel is allowed to call this API endpoint. + // Route to define the master key when VSECM_SAFE_MANUAL_KEY_INPUT is set. + // Only VMware Secrets Manager Sentinel is allowed to call this API endpoint. // This method works only once. Once a key is set, there is no way to - // update it. You will have to kill the Aegis Sentinel pod and restart it + // update it. You will have to kill the VMware Secrets Manager Sentinel pod and restart it // to be able to set a new key. if r.Method == http.MethodPost && p == "/sentinel/v1/keys" { log.DebugLn(&cid, "Handler: will receive keys") @@ -60,8 +62,8 @@ func InitializeRoutes() { return } - // Route to add secrets to Aegis Safe. - // Only Aegis Sentinel is allowed to call this API endpoint. + // Route to add secrets to VMware Secrets Manager Safe. + // Only VMware Secrets Manager Sentinel is allowed to call this API endpoint. // Calling it from anywhere else will error out. if r.Method == http.MethodPost && p == "/sentinel/v1/secrets" { log.DebugLn(&cid, "Handler:/sentinel/v1/secrets will secret") @@ -69,8 +71,8 @@ func InitializeRoutes() { return } - // Route to delete secrets from Aegis Safe. - // Only Aegis Sentinel is allowed to call this API endpoint. + // Route to delete secrets from VMware Secrets Manager Safe. + // Only VMware Secrets Manager Sentinel is allowed to call this API endpoint. // Calling it from anywhere else will error out. if r.Method == http.MethodDelete && p == "/sentinel/v1/secrets" { log.DebugLn(&cid, "Handler:/sentinel/v1/secrets will delete") @@ -79,7 +81,7 @@ func InitializeRoutes() { } // Route to fetch secrets. - // Only an Aegis-nominated workload is allowed to + // Only a VSecM-nominated workload is allowed to // call this API endpoint. Calling it from anywhere else will // error out. if r.Method == http.MethodGet && p == "/workload/v1/secrets" { diff --git a/app/safe/internal/server/handle/spiffe.go b/app/safe/internal/server/handle/spiffe.go index 39a4f14..103392e 100644 --- a/app/safe/internal/server/handle/spiffe.go +++ b/app/safe/internal/server/handle/spiffe.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package handle diff --git a/app/safe/internal/server/route/delete.go b/app/safe/internal/server/route/delete.go index 6306b64..c0a4860 100644 --- a/app/safe/internal/server/route/delete.go +++ b/app/safe/internal/server/route/delete.go @@ -1,22 +1,24 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package route import ( "encoding/json" - "github.com/shieldworks/aegis/app/safe/internal/state" - "github.com/shieldworks/aegis/core/audit" - entity "github.com/shieldworks/aegis/core/entity/data/v1" - reqres "github.com/shieldworks/aegis/core/entity/reqres/safe/v1" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/log" - "github.com/shieldworks/aegis/core/validation" + "github.com/vmware-tanzu/secrets-manager/app/safe/internal/state" + "github.com/vmware-tanzu/secrets-manager/core/audit" + entity "github.com/vmware-tanzu/secrets-manager/core/entity/data/v1" + reqres "github.com/vmware-tanzu/secrets-manager/core/entity/reqres/safe/v1" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/log" + "github.com/vmware-tanzu/secrets-manager/core/validation" "io" "net/http" ) diff --git a/app/safe/internal/server/route/fetch.go b/app/safe/internal/server/route/fetch.go index 7ad2428..6c4af81 100644 --- a/app/safe/internal/server/route/fetch.go +++ b/app/safe/internal/server/route/fetch.go @@ -1,22 +1,24 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package route import ( "encoding/json" "fmt" - "github.com/shieldworks/aegis/app/safe/internal/state" - "github.com/shieldworks/aegis/core/audit" - reqres "github.com/shieldworks/aegis/core/entity/reqres/safe/v1" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/log" - "github.com/shieldworks/aegis/core/validation" + "github.com/vmware-tanzu/secrets-manager/app/safe/internal/state" + "github.com/vmware-tanzu/secrets-manager/core/audit" + reqres "github.com/vmware-tanzu/secrets-manager/core/entity/reqres/safe/v1" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/log" + "github.com/vmware-tanzu/secrets-manager/core/validation" "io" "net/http" "strings" diff --git a/app/safe/internal/server/route/list.go b/app/safe/internal/server/route/list.go index 914ea8a..0a5c13b 100644 --- a/app/safe/internal/server/route/list.go +++ b/app/safe/internal/server/route/list.go @@ -1,20 +1,22 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package route import ( "encoding/json" - "github.com/shieldworks/aegis/app/safe/internal/state" - "github.com/shieldworks/aegis/core/audit" - reqres "github.com/shieldworks/aegis/core/entity/reqres/safe/v1" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/log" + "github.com/vmware-tanzu/secrets-manager/app/safe/internal/state" + "github.com/vmware-tanzu/secrets-manager/core/audit" + reqres "github.com/vmware-tanzu/secrets-manager/core/entity/reqres/safe/v1" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/log" "io" "net/http" "strings" diff --git a/app/safe/internal/server/route/receive.go b/app/safe/internal/server/route/receive.go index f464c22..99285f8 100644 --- a/app/safe/internal/server/route/receive.go +++ b/app/safe/internal/server/route/receive.go @@ -1,18 +1,20 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package route import ( - "github.com/shieldworks/aegis/app/safe/internal/state" - "github.com/shieldworks/aegis/core/audit" - reqres "github.com/shieldworks/aegis/core/entity/reqres/safe/v1" - "github.com/shieldworks/aegis/core/log" + "github.com/vmware-tanzu/secrets-manager/app/safe/internal/state" + "github.com/vmware-tanzu/secrets-manager/core/audit" + reqres "github.com/vmware-tanzu/secrets-manager/core/entity/reqres/safe/v1" + "github.com/vmware-tanzu/secrets-manager/core/log" "io" "net/http" "strings" diff --git a/app/safe/internal/server/route/secret.go b/app/safe/internal/server/route/secret.go index 325a0a3..ff1fbff 100644 --- a/app/safe/internal/server/route/secret.go +++ b/app/safe/internal/server/route/secret.go @@ -1,21 +1,23 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package route import ( "encoding/json" - "github.com/shieldworks/aegis/app/safe/internal/state" - "github.com/shieldworks/aegis/core/audit" - entity "github.com/shieldworks/aegis/core/entity/data/v1" - reqres "github.com/shieldworks/aegis/core/entity/reqres/safe/v1" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/log" + "github.com/vmware-tanzu/secrets-manager/app/safe/internal/state" + "github.com/vmware-tanzu/secrets-manager/core/audit" + entity "github.com/vmware-tanzu/secrets-manager/core/entity/data/v1" + reqres "github.com/vmware-tanzu/secrets-manager/core/entity/reqres/safe/v1" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/log" "io" "net/http" ) diff --git a/app/safe/internal/server/server.go b/app/safe/internal/server/server.go index 2748bb7..ccbffd0 100644 --- a/app/safe/internal/server/server.go +++ b/app/safe/internal/server/server.go @@ -1,21 +1,23 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package server import ( "github.com/pkg/errors" - "github.com/shieldworks/aegis/app/safe/internal/server/handle" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/validation" "github.com/spiffe/go-spiffe/v2/spiffeid" "github.com/spiffe/go-spiffe/v2/spiffetls/tlsconfig" "github.com/spiffe/go-spiffe/v2/workloadapi" + "github.com/vmware-tanzu/secrets-manager/app/safe/internal/server/handle" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/validation" "net/http" ) diff --git a/app/safe/internal/state/internal.go b/app/safe/internal/state/internal.go index 3fb0c3f..4184d9a 100644 --- a/app/safe/internal/state/internal.go +++ b/app/safe/internal/state/internal.go @@ -1,23 +1,25 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package state import "encoding/json" -const selfName = "aegis-safe" +const selfName = "vsecm-safe" -type AegisInternalCommand struct { +type VSecMInternalCommand struct { LogLevel int `json:"logLevel"` } -func evaluate(data string) *AegisInternalCommand { - var command AegisInternalCommand +func evaluate(data string) *VSecMInternalCommand { + var command VSecMInternalCommand err := json.Unmarshal([]byte(data), &command) if err != nil { return nil diff --git a/app/safe/internal/state/io-age.go b/app/safe/internal/state/io-age.go index d03ce5b..5330ad1 100644 --- a/app/safe/internal/state/io-age.go +++ b/app/safe/internal/state/io-age.go @@ -1,12 +1,14 @@ -package state - /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ + +package state import "strings" diff --git a/app/safe/internal/state/io-decrypt.go b/app/safe/internal/state/io-decrypt.go index c8aa790..fce051f 100644 --- a/app/safe/internal/state/io-decrypt.go +++ b/app/safe/internal/state/io-decrypt.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package state @@ -15,7 +17,7 @@ import ( "encoding/hex" "filippo.io/age" "github.com/pkg/errors" - "github.com/shieldworks/aegis/core/env" + "github.com/vmware-tanzu/secrets-manager/core/env" "io" "os" "path" diff --git a/app/safe/internal/state/io-encrypt.go b/app/safe/internal/state/io-encrypt.go index 4288827..c851533 100644 --- a/app/safe/internal/state/io-encrypt.go +++ b/app/safe/internal/state/io-encrypt.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package state @@ -15,7 +17,7 @@ import ( "encoding/hex" "filippo.io/age" "github.com/pkg/errors" - "github.com/shieldworks/aegis/core/log" + "github.com/vmware-tanzu/secrets-manager/core/log" "io" ) diff --git a/app/safe/internal/state/io-persist-k8s.go b/app/safe/internal/state/io-persist-k8s.go index 5a18cea..0058560 100644 --- a/app/safe/internal/state/io-persist-k8s.go +++ b/app/safe/internal/state/io-persist-k8s.go @@ -1,19 +1,21 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package state import ( "context" "github.com/pkg/errors" - entity "github.com/shieldworks/aegis/core/entity/data/v1" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/log" + entity "github.com/vmware-tanzu/secrets-manager/core/entity/data/v1" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/log" apiV1 "k8s.io/api/core/v1" metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" diff --git a/app/safe/internal/state/io-persist.go b/app/safe/internal/state/io-persist.go index f0c0259..789c016 100644 --- a/app/safe/internal/state/io-persist.go +++ b/app/safe/internal/state/io-persist.go @@ -1,19 +1,21 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package state import ( "encoding/json" "github.com/pkg/errors" - entity "github.com/shieldworks/aegis/core/entity/data/v1" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/log" + entity "github.com/vmware-tanzu/secrets-manager/core/entity/data/v1" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/log" "math" "os" "path" diff --git a/app/safe/internal/state/io-read.go b/app/safe/internal/state/io-read.go index 4e481fc..cb7976b 100644 --- a/app/safe/internal/state/io-read.go +++ b/app/safe/internal/state/io-read.go @@ -1,17 +1,19 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package state import ( "encoding/json" "github.com/pkg/errors" - entity "github.com/shieldworks/aegis/core/entity/data/v1" + entity "github.com/vmware-tanzu/secrets-manager/core/entity/data/v1" ) // readFromDisk returns a pointer to a secret. diff --git a/app/safe/internal/state/secret-populate.go b/app/safe/internal/state/secret-populate.go index 96c7cce..b7dd5e1 100644 --- a/app/safe/internal/state/secret-populate.go +++ b/app/safe/internal/state/secret-populate.go @@ -1,17 +1,19 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package state import ( "github.com/pkg/errors" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/log" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/log" "os" "strings" "sync" diff --git a/app/safe/internal/state/secret-queue-delete.go b/app/safe/internal/state/secret-queue-delete.go index 4a8b2fd..afdf072 100644 --- a/app/safe/internal/state/secret-queue-delete.go +++ b/app/safe/internal/state/secret-queue-delete.go @@ -1,17 +1,19 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package state import ( - entity "github.com/shieldworks/aegis/core/entity/data/v1" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/log" + entity "github.com/vmware-tanzu/secrets-manager/core/entity/data/v1" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/log" "os" "path" ) diff --git a/app/safe/internal/state/secret-queue-k8s-delete.go b/app/safe/internal/state/secret-queue-k8s-delete.go index b7bc4a2..9e44a0d 100644 --- a/app/safe/internal/state/secret-queue-k8s-delete.go +++ b/app/safe/internal/state/secret-queue-k8s-delete.go @@ -1,16 +1,18 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package state import ( - entity "github.com/shieldworks/aegis/core/entity/data/v1" - "github.com/shieldworks/aegis/core/env" + entity "github.com/vmware-tanzu/secrets-manager/core/entity/data/v1" + "github.com/vmware-tanzu/secrets-manager/core/env" ) // The secrets put here are synced with their Kubernetes Secret counterparts. @@ -22,5 +24,5 @@ func processK8sSecretDeleteQueue() { // No need to implement this; but we’ll keep the placeholder here, in case // we find a need for it in the future. // - // @see https://github.com/shieldworks/aegis/issues/268 + // @see https://github.com/vmware-tanzu/secrets-manager/issues/268 } diff --git a/app/safe/internal/state/secret-queue-k8s.go b/app/safe/internal/state/secret-queue-k8s.go index 6b11ff8..056a934 100644 --- a/app/safe/internal/state/secret-queue-k8s.go +++ b/app/safe/internal/state/secret-queue-k8s.go @@ -1,17 +1,19 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package state import ( - entity "github.com/shieldworks/aegis/core/entity/data/v1" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/log" + entity "github.com/vmware-tanzu/secrets-manager/core/entity/data/v1" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/log" ) // The secrets put here are synced with their Kubernetes Secret counterparts. diff --git a/app/safe/internal/state/secret-queue.go b/app/safe/internal/state/secret-queue.go index ab4796e..1439ff6 100644 --- a/app/safe/internal/state/secret-queue.go +++ b/app/safe/internal/state/secret-queue.go @@ -1,17 +1,19 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package state import ( - entity "github.com/shieldworks/aegis/core/entity/data/v1" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/log" + entity "github.com/vmware-tanzu/secrets-manager/core/entity/data/v1" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/log" ) // These are persisted to files. They are buffered, so that they can diff --git a/app/safe/internal/state/state.go b/app/safe/internal/state/state.go index 9e312d5..6f00908 100644 --- a/app/safe/internal/state/state.go +++ b/app/safe/internal/state/state.go @@ -1,19 +1,21 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package state import ( "bytes" "encoding/base64" - entity "github.com/shieldworks/aegis/core/entity/data/v1" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/log" + entity "github.com/vmware-tanzu/secrets-manager/core/entity/data/v1" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/log" "sync" "time" ) @@ -116,7 +118,7 @@ func AllSecrets(cid string) []entity.Secret { var result []entity.Secret // Check existing stored secrets files. - // If Aegis pod is evicted and revived, it will not have knowledge about + // If VSecM pod is evicted and revived, it will not have knowledge about // the secret it has. This loop helps it re-populate its cache. if !secretsPopulated { err := populateSecrets(cid) diff --git a/app/safe/internal/state/stats.go b/app/safe/internal/state/stats.go index 7563325..7e8143a 100644 --- a/app/safe/internal/state/stats.go +++ b/app/safe/internal/state/stats.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package state diff --git a/app/sentinel/README.md b/app/sentinel/README.md index e418441..6a98d6b 100644 --- a/app/sentinel/README.md +++ b/app/sentinel/README.md @@ -1,12 +1,16 @@ -# Aegis +```text +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +``` -![Aegis](../../assets/aegis-icon.png "Aegis") +## VMware Secrets Manager Sentinel -keep your secrets… secret - -## Aegis Sentinel - -**Aegis Sentinel** is the **only** place one (*a person, or a process*) can -**register** (*but not read back, for security reasons*) secrets to **Aegis Safe**. +**VMware Secrets Manager** *Sentinel* is the **only** place one (*a person, or +a process*) can **register** (*but not read back, for security reasons*) secrets +to **VMware Secrets Manager Safe**. You can think of it as your *bastion host*. + +Check out more details in the [official documentation](https://vsecm.com/). \ No newline at end of file diff --git a/app/sentinel/busywait/main.go b/app/sentinel/busywait/main.go index f5e9b13..962907c 100644 --- a/app/sentinel/busywait/main.go +++ b/app/sentinel/busywait/main.go @@ -1,16 +1,18 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package main import ( - "github.com/shieldworks/aegis/core/probe" - "github.com/shieldworks/aegis/core/system" + "github.com/vmware-tanzu/secrets-manager/core/probe" + "github.com/vmware-tanzu/secrets-manager/core/system" ) func main() { diff --git a/app/sentinel/cmd/main.go b/app/sentinel/cmd/main.go index 8c1e12d..1848887 100644 --- a/app/sentinel/cmd/main.go +++ b/app/sentinel/cmd/main.go @@ -1,17 +1,19 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package main import ( "fmt" "github.com/akamensky/argparse" - "github.com/shieldworks/aegis/app/sentinel/internal/safe" + "github.com/vmware-tanzu/secrets-manager/app/sentinel/internal/safe" "os" ) @@ -25,7 +27,7 @@ func parseUseKubernetes(parser *argparse.Parser) *bool { return parser.Flag("k", "use-k8s", &argparse.Options{ Required: false, Default: false, Help: "update an associated Kubernetes secret upon save. " + - "Overrides AEGIS_SAFE_USE_KUBERNETES_SECRETS.", + "Overrides VSECM_SAFE_USE_KUBERNETES_SECRETS.", }) } @@ -62,7 +64,7 @@ func parseBackingStore(parser *argparse.Parser) *string { return parser.String("b", "store", &argparse.Options{ Required: false, Help: "backing store type (file|memory) (default: file). " + - "Overrides AEGIS_SAFE_BACKING_STORE.", + "Overrides VSECM_SAFE_BACKING_STORE.", }) } @@ -107,20 +109,20 @@ func parseEncrypt(parser *argparse.Parser) *bool { } func printUsage(parser *argparse.Parser) { - fmt.Print(parser.Usage("aegis")) + fmt.Print(parser.Usage("safe")) } func printWorkloadNameNeeded() { fmt.Println("Please provide a workload name.") fmt.Println("") - fmt.Println("type `aegis -h` (without backticks) and press return for help.") + fmt.Println("type `safe -h` (without backticks) and press return for help.") fmt.Println("") } func printSecretNeeded() { fmt.Println("Please provide a secret.") fmt.Println("") - fmt.Println("type `aegis -h` (without backticks) and press return for help.") + fmt.Println("type `safe -h` (without backticks) and press return for help.") fmt.Println("") } @@ -190,7 +192,7 @@ func doPost(workload *string, secret *string, namespace *string, } func main() { - parser := argparse.NewParser("aegis", "Assigns secrets to workloads.") + parser := argparse.NewParser("safe", "Assigns secrets to workloads.") list := parseList(parser) useKubernetes := parseUseKubernetes(parser) diff --git a/app/sentinel/internal/safe/get.go b/app/sentinel/internal/safe/get.go index 8a0aa1e..0bf12ea 100644 --- a/app/sentinel/internal/safe/get.go +++ b/app/sentinel/internal/safe/get.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package safe @@ -12,11 +14,11 @@ import ( "context" "errors" "fmt" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/validation" "github.com/spiffe/go-spiffe/v2/spiffeid" "github.com/spiffe/go-spiffe/v2/spiffetls/tlsconfig" "github.com/spiffe/go-spiffe/v2/workloadapi" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/validation" "io" "log" "net/http" @@ -45,7 +47,7 @@ func acquireSource(ctx context.Context) (*workloadapi.X509Source, bool) { // Make sure that the binary is enclosed in a Pod that we trust. if !validation.IsSentinel(svid.ID.String()) { fmt.Println("I don’t know you, and it’s crazy: '" + svid.ID.String() + "'") - fmt.Println("`aegis` can only run from within the Sentinel container.") + fmt.Println("`safe` can only run from within the Sentinel container.") fmt.Println("") return source, false } @@ -81,7 +83,7 @@ func Get() { p, err := url.JoinPath(env.SafeEndpointUrl(), "/sentinel/v1/secrets") if err != nil { - fmt.Println("I am having problem generating Aegis Safe secrets api endpoint URL.") + fmt.Println("I am having problem generating VMware Secrets Manager Safe secrets api endpoint URL.") fmt.Println("") return } @@ -95,7 +97,7 @@ func Get() { r, err := client.Get(p) if err != nil { - fmt.Println("Get: Problem connecting to Aegis Safe API endpoint URL.", err.Error()) + fmt.Println("Get: Problem connecting to VMware Secrets Manager Safe API endpoint URL.", err.Error()) fmt.Println("") return } @@ -112,7 +114,7 @@ func Get() { body, err := io.ReadAll(r.Body) if err != nil { - fmt.Println("Get: Unable to read the response body from Aegis Safe.") + fmt.Println("Get: Unable to read the response body from VMware Secrets Manager Safe.") fmt.Println("") return } diff --git a/app/sentinel/internal/safe/post.go b/app/sentinel/internal/safe/post.go index ef07130..1283e79 100644 --- a/app/sentinel/internal/safe/post.go +++ b/app/sentinel/internal/safe/post.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package safe @@ -14,12 +16,12 @@ import ( "encoding/json" "errors" "fmt" - data "github.com/shieldworks/aegis/core/entity/data/v1" - reqres "github.com/shieldworks/aegis/core/entity/reqres/safe/v1" - "github.com/shieldworks/aegis/core/env" - "github.com/shieldworks/aegis/core/validation" "github.com/spiffe/go-spiffe/v2/spiffeid" "github.com/spiffe/go-spiffe/v2/spiffetls/tlsconfig" + data "github.com/vmware-tanzu/secrets-manager/core/entity/data/v1" + reqres "github.com/vmware-tanzu/secrets-manager/core/entity/reqres/safe/v1" + "github.com/vmware-tanzu/secrets-manager/core/env" + "github.com/vmware-tanzu/secrets-manager/core/validation" "io" "log" "net/http" @@ -106,7 +108,7 @@ func respond(r *http.Response) { body, err := io.ReadAll(r.Body) if err != nil { - fmt.Println("Post: Unable to read the response body from Aegis Safe.", err.Error()) + fmt.Println("Post: Unable to read the response body from VMware Secrets Manager Safe.", err.Error()) fmt.Println("") return } @@ -117,7 +119,7 @@ func respond(r *http.Response) { } func printEndpointError(err error) { - fmt.Println("Post: I am having problem generating Aegis Safe "+ + fmt.Println("Post: I am having problem generating VMware Secrets Manager Safe "+ "secrets api endpoint URL.", err.Error()) fmt.Println("") } @@ -130,14 +132,14 @@ func printPayloadError(err error) { func doDelete(client *http.Client, p string, md []byte) { req, err := http.NewRequest(http.MethodDelete, p, bytes.NewBuffer(md)) if err != nil { - fmt.Println("Post:Delete: Problem connecting to Aegis Safe API endpoint URL.", err.Error()) + fmt.Println("Post:Delete: Problem connecting to VMware Secrets Manager Safe API endpoint URL.", err.Error()) fmt.Println("") return } req.Header.Set("Content-Type", "application/json") r, err := client.Do(req) if err != nil { - fmt.Println("Post:Delete: Problem connecting to Aegis Safe API endpoint URL.", err.Error()) + fmt.Println("Post:Delete: Problem connecting to VMware Secrets Manager Safe API endpoint URL.", err.Error()) fmt.Println("") return } @@ -147,7 +149,7 @@ func doDelete(client *http.Client, p string, md []byte) { func doPost(client *http.Client, p string, md []byte) { r, err := client.Post(p, "application/json", bytes.NewBuffer(md)) if err != nil { - fmt.Println("Post: Problem connecting to Aegis Safe API endpoint URL.", err.Error()) + fmt.Println("Post: Problem connecting to VMware Secrets Manager Safe API endpoint URL.", err.Error()) fmt.Println("") return } diff --git a/app/sidecar/README.md b/app/sidecar/README.md index fe6f1fe..63a4428 100644 --- a/app/sidecar/README.md +++ b/app/sidecar/README.md @@ -1,10 +1,12 @@ -# Aegis - -![Aegis](../../assets/aegis-icon.png "Aegis") - -keep your secrets… secret - -## Aegis Sidecar - -**Aegis Sidecar** is a Kubernetes sidecar that periodically checks **Aegis Safe** -and updates the secret that is bound to the workload. +```text +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +``` + +## VMware Secrets Manager (*VSecM*) Sidecar + +**VSecM Sidecar** is a Kubernetes sidecar that periodically +checks **VSecM Safe** and updates the secret that is bound +to the workload. diff --git a/app/sidecar/cmd/main.go b/app/sidecar/cmd/main.go index 156619e..dd066b5 100644 --- a/app/sidecar/cmd/main.go +++ b/app/sidecar/cmd/main.go @@ -1,22 +1,24 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package main import ( - "github.com/shieldworks/aegis/core/log" - "github.com/shieldworks/aegis/core/system" - "github.com/shieldworks/aegis/sdk/sentry" + "github.com/vmware-tanzu/secrets-manager/core/log" + "github.com/vmware-tanzu/secrets-manager/core/system" + "github.com/vmware-tanzu/secrets-manager/sdk/sentry" ) func main() { id := "AEGSSDCR" - log.InfoLn(&id, "Starting Aegis Sidecar") + log.InfoLn(&id, "Starting VMware Secrets Manager Sidecar") go sentry.Watch() // Keep the main routine alive: system.KeepAlive() diff --git a/assets/aegis-banner.png b/assets/aegis-banner.png deleted file mode 100644 index f39645d..0000000 Binary files a/assets/aegis-banner.png and /dev/null differ diff --git a/assets/aegis-create-secrets.png b/assets/aegis-create-secrets.png deleted file mode 100644 index fbcd18c..0000000 Binary files a/assets/aegis-create-secrets.png and /dev/null differ diff --git a/assets/aegis-git-banner.png b/assets/aegis-git-banner.png deleted file mode 100644 index 40c6a77..0000000 Binary files a/assets/aegis-git-banner.png and /dev/null differ diff --git a/assets/aegis-hla.png b/assets/aegis-hla.png deleted file mode 100644 index 8e63138..0000000 Binary files a/assets/aegis-hla.png and /dev/null differ diff --git a/assets/aegis-icon.png b/assets/aegis-icon.png deleted file mode 100644 index b651941..0000000 Binary files a/assets/aegis-icon.png and /dev/null differ diff --git a/assets/aegis-logo.png b/assets/aegis-logo.png deleted file mode 100644 index 2956dad..0000000 Binary files a/assets/aegis-logo.png and /dev/null differ diff --git a/assets/aegis-shield.jpg b/assets/aegis-shield.jpg deleted file mode 100644 index 803256a..0000000 Binary files a/assets/aegis-shield.jpg and /dev/null differ diff --git a/assets/capture.png b/assets/capture.png deleted file mode 100644 index 284694a..0000000 Binary files a/assets/capture.png and /dev/null differ diff --git a/assets/frontmatter.txt b/assets/frontmatter.txt new file mode 100644 index 0000000..05fe55b --- /dev/null +++ b/assets/frontmatter.txt @@ -0,0 +1,14 @@ +--- +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +title: $title +layout: $layout +--- \ No newline at end of file diff --git a/assets/markdown-header.txt b/assets/markdown-header.txt new file mode 100644 index 0000000..c16298c --- /dev/null +++ b/assets/markdown-header.txt @@ -0,0 +1,11 @@ +```go +/* +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ +``` \ No newline at end of file diff --git a/assets/sourcecode-header.txt b/assets/sourcecode-header.txt new file mode 100644 index 0000000..3217fa6 --- /dev/null +++ b/assets/sourcecode-header.txt @@ -0,0 +1,9 @@ +/* +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ \ No newline at end of file diff --git a/core/audit/audit.go b/core/audit/audit.go index 806eefa..8235b76 100644 --- a/core/audit/audit.go +++ b/core/audit/audit.go @@ -1,32 +1,34 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package audit import ( - reqres "github.com/shieldworks/aegis/core/entity/reqres/safe/v1" - "github.com/shieldworks/aegis/core/log" + reqres "github.com/vmware-tanzu/secrets-manager/core/entity/reqres/safe/v1" + "github.com/vmware-tanzu/secrets-manager/core/log" ) type Event string -const EventEnter Event = "aegis-enter" -const EventBadSvid Event = "aegis-bad-svid" -const EventBrokenBody Event = "aegis-broken-body" -const EventRequestTypeMismatch Event = "aegis-request-type-mismatch" -const EventBadPeerSvid Event = "aegis-bad-peer-svid" -const EventNoSecret Event = "aegis-no-secret" -const EventOk Event = "aegis-ok" -const EventNoWorkloadId Event = "aegis-no-wl-id" -const EventNoValue Event = "aegis-no-value" -const EventEncryptionFailed Event = "aegis-encryption-failed" -const EventDecryptionFailed Event = "aegis-decryption-failed" -const EventBadPayload Event = "aegis-bad-payload" +const EventEnter Event = "vsecm-enter" +const EventBadSvid Event = "vsecm-bad-svid" +const EventBrokenBody Event = "vsecm-broken-body" +const EventRequestTypeMismatch Event = "vsecm-request-type-mismatch" +const EventBadPeerSvid Event = "vsecm-bad-peer-svid" +const EventNoSecret Event = "vsecm-no-secret" +const EventOk Event = "vsecm-ok" +const EventNoWorkloadId Event = "vsecm-no-wl-id" +const EventNoValue Event = "vsecm-no-value" +const EventEncryptionFailed Event = "vsecm-encryption-failed" +const EventDecryptionFailed Event = "vsecm-decryption-failed" +const EventBadPayload Event = "vsecm-bad-payload" type JournalEntry struct { CorrelationId string diff --git a/core/crypto/crypto.go b/core/crypto/crypto.go index c73ed06..537845f 100644 --- a/core/crypto/crypto.go +++ b/core/crypto/crypto.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package crypto diff --git a/core/entity/data/v1/v1.go b/core/entity/data/v1/v1.go index 4a39e97..c6d753e 100644 --- a/core/entity/data/v1/v1.go +++ b/core/entity/data/v1/v1.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package v1 @@ -12,7 +14,7 @@ import ( "bytes" "encoding/json" "fmt" - tpl "github.com/shieldworks/aegis/core/template" + tpl "github.com/vmware-tanzu/secrets-manager/core/template" "strings" "text/template" "time" @@ -50,7 +52,7 @@ type SecretMeta struct { Namespace string `json:"namespace"` // Go template used to transform the secret. // Sample secret: - // '{"username":"admin","password":"AegisRocks"}' + // '{"username":"admin","password":"VSecMRocks"}' // Sample template: // '{"USER":"{{.username}}", "PASS":"{{.password}}"}" Template string `json:"template"` diff --git a/core/entity/reqres/safe/v1/v1.go b/core/entity/reqres/safe/v1/v1.go index 9784adb..b1d58e1 100644 --- a/core/entity/reqres/safe/v1/v1.go +++ b/core/entity/reqres/safe/v1/v1.go @@ -1,15 +1,17 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package v1 import ( - data "github.com/shieldworks/aegis/core/entity/data/v1" + data "github.com/vmware-tanzu/secrets-manager/core/entity/data/v1" ) type SecretUpsertRequest struct { diff --git a/core/env/endpoint.go b/core/env/endpoint.go index 94eaa5c..345d39f 100644 --- a/core/env/endpoint.go +++ b/core/env/endpoint.go @@ -1,22 +1,25 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package env import "os" -// SafeEndpointUrl returns the URL for the Aegis Safe endpoint used in the Aegis system. -// The URL is obtained from the environment variable AEGIS_SAFE_ENDPOINT_URL. +// SafeEndpointUrl returns the URL for the VMware Secrets Manager Safe endpoint +// used in the VMware Secres Manager system. +// The URL is obtained from the environment variable VSECM_SAFE_ENDPOINT_URL. // If the variable is not set, the default URL is used. func SafeEndpointUrl() string { - u := os.Getenv("AEGIS_SAFE_ENDPOINT_URL") + u := os.Getenv("VSECM_SAFE_ENDPOINT_URL") if u == "" { - u = "https://aegis-safe.aegis-system.svc.cluster.local:8443/" + u = "https://vsecm-safe.vsecm-system.svc.cluster.local:8443/" } return u } diff --git a/core/env/init.go b/core/env/init.go index c36660d..2edcfb2 100644 --- a/core/env/init.go +++ b/core/env/init.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package env @@ -16,11 +18,11 @@ import ( // InitContainerPollInterval returns the time interval between each poll in the // Watch function. The interval is specified in milliseconds as the -// AEGIS_INIT_CONTAINER_POLL_INTERVAL environment variable. If the environment +// VSECM_INIT_CONTAINER_POLL_INTERVAL environment variable. If the environment // variable is not set or is not a valid integer value, the function returns the // default interval of 5000 milliseconds. func InitContainerPollInterval() time.Duration { - p := os.Getenv("AEGIS_INIT_CONTAINER_POLL_INTERVAL") + p := os.Getenv("VSECM_INIT_CONTAINER_POLL_INTERVAL") if p == "" { p = "5000" } diff --git a/core/env/logging.go b/core/env/logging.go index 30ee353..a5add87 100644 --- a/core/env/logging.go +++ b/core/env/logging.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package env @@ -13,13 +15,13 @@ import ( "strconv" ) -// LogLevel returns the value set by AEGIS_LOG_LEVEL environment +// LogLevel returns the value set by VSECM_LOG_LEVEL environment // variable, or a default level. // -// AEGIS_LOG_LEVEL determines the verbosity of the logs. +// VSECM_LOG_LEVEL determines the verbosity of the logs. // 0: logs are off, 7: highest verbosity (TRACE). func LogLevel() int { - p := os.Getenv("AEGIS_LOG_LEVEL") + p := os.Getenv("VSECM_LOG_LEVEL") if p == "" { return 3 // WARN } diff --git a/core/env/poll.go b/core/env/poll.go index 3beeb4d..5c2a014 100644 --- a/core/env/poll.go +++ b/core/env/poll.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package env @@ -16,9 +18,9 @@ import ( // SidecarMaxPollInterval returns the maximum interval for polling by the // sidecar process. The value is read from the environment variable -// `AEGIS_SIDECAR_MAX_POLL_INTERVAL` or returns 300000 milliseconds as default. +// `VSECM_SIDECAR_MAX_POLL_INTERVAL` or returns 300000 milliseconds as default. func SidecarMaxPollInterval() time.Duration { - p := os.Getenv("AEGIS_SIDECAR_MAX_POLL_INTERVAL") + p := os.Getenv("VSECM_SIDECAR_MAX_POLL_INTERVAL") if p == "" { p = "300000" } @@ -32,9 +34,9 @@ func SidecarMaxPollInterval() time.Duration { // SidecarExponentialBackoffMultiplier returns the multiplier for exponential // backoff by the sidecar process. // The value is read from the environment variable -// `AEGIS_SIDECAR_EXPONENTIAL_BACKOFF_MULTIPLIER` or returns 2 as default. +// `VSECM_SIDECAR_EXPONENTIAL_BACKOFF_MULTIPLIER` or returns 2 as default. func SidecarExponentialBackoffMultiplier() int64 { - p := os.Getenv("AEGIS_SIDECAR_EXPONENTIAL_BACKOFF_MULTIPLIER") + p := os.Getenv("VSECM_SIDECAR_EXPONENTIAL_BACKOFF_MULTIPLIER") if p == "" { p = "2" } @@ -47,9 +49,9 @@ func SidecarExponentialBackoffMultiplier() int64 { // SidecarSuccessThreshold returns the number of consecutive successful // polls before reducing the interval. The value is read from the environment -// variable `AEGIS_SIDECAR_SUCCESS_THRESHOLD` or returns 3 as default. +// variable `VSECM_SIDECAR_SUCCESS_THRESHOLD` or returns 3 as default. func SidecarSuccessThreshold() int64 { - p := os.Getenv("AEGIS_SIDECAR_SUCCESS_THRESHOLD") + p := os.Getenv("VSECM_SIDECAR_SUCCESS_THRESHOLD") if p == "" { p = "3" } @@ -62,9 +64,9 @@ func SidecarSuccessThreshold() int64 { // SidecarErrorThreshold returns the number of consecutive failed polls // before increasing the interval. The value is read from the environment -// variable `AEGIS_SIDECAR_ERROR_THRESHOLD` or returns 2 as default. +// variable `VSECM_SIDECAR_ERROR_THRESHOLD` or returns 2 as default. func SidecarErrorThreshold() int64 { - p := os.Getenv("AEGIS_SIDECAR_ERROR_THRESHOLD") + p := os.Getenv("VSECM_SIDECAR_ERROR_THRESHOLD") if p == "" { p = "2" } @@ -76,11 +78,11 @@ func SidecarErrorThreshold() int64 { } // SidecarPollInterval returns the polling interval for sentry in time.Duration -// The interval is determined by the AEGIS_SIDECAR_POLL_INTERVAL environment +// The interval is determined by the VSECM_SIDECAR_POLL_INTERVAL environment // variable, with a default value of 20000 milliseconds if the variable is not // set or if there is an error in parsing the value. func SidecarPollInterval() time.Duration { - p := os.Getenv("AEGIS_SIDECAR_POLL_INTERVAL") + p := os.Getenv("VSECM_SIDECAR_POLL_INTERVAL") if p == "" { p = "20000" } diff --git a/core/env/probe.go b/core/env/probe.go index 8baac65..4ce678d 100644 --- a/core/env/probe.go +++ b/core/env/probe.go @@ -1,20 +1,22 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package env import "os" // ProbeLivenessPort returns the port for liveness probe. -// It first checks the environment variable AEGIS_PROBE_LIVENESS_PORT. +// It first checks the environment variable VSECM_PROBE_LIVENESS_PORT. // If the variable is not set, it returns the default value ":8081". func ProbeLivenessPort() string { - u := os.Getenv("AEGIS_PROBE_LIVENESS_PORT") + u := os.Getenv("VSECM_PROBE_LIVENESS_PORT") if u == "" { u = ":8081" } @@ -22,10 +24,10 @@ func ProbeLivenessPort() string { } // ProbeReadinessPort returns the port for readiness probe. -// It first checks the environment variable AEGIS_PROBE_READINESS_PORT. +// It first checks the environment variable VSECM_PROBE_READINESS_PORT. // If the variable is not set, it returns the default value ":8082". func ProbeReadinessPort() string { - u := os.Getenv("AEGIS_PROBE_READINESS_PORT") + u := os.Getenv("VSECM_PROBE_READINESS_PORT") if u == "" { u = ":8082" } diff --git a/core/env/safe.go b/core/env/safe.go index 5a833f6..660411f 100644 --- a/core/env/safe.go +++ b/core/env/safe.go @@ -1,25 +1,27 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package env import ( - data "github.com/shieldworks/aegis/core/entity/data/v1" + data "github.com/vmware-tanzu/secrets-manager/core/entity/data/v1" "os" "strconv" "strings" "time" ) -// SafeSecretBufferSize returns the buffer size for the Aegis Safe secret queue. +// SafeSecretBufferSize returns the buffer size for the VMware Secrets Manager Safe secret queue. // // The buffer size is determined by the environment variable -// AEGIS_SAFE_SECRET_BUFFER_SIZE. +// VSECM_SAFE_SECRET_BUFFER_SIZE. // // If the environment variable is not set, the default buffer size is 10. // If the environment variable is set and can be parsed as an integer, @@ -27,7 +29,7 @@ import ( // If the environment variable is set but cannot be parsed as an integer, // the default buffer size is used. func SafeSecretBufferSize() int { - p := os.Getenv("AEGIS_SAFE_SECRET_BUFFER_SIZE") + p := os.Getenv("VSECM_SAFE_SECRET_BUFFER_SIZE") if p == "" { return 10 } @@ -38,11 +40,11 @@ func SafeSecretBufferSize() int { return l } -// SafeK8sSecretBufferSize returns the buffer size for the Aegis Safe Kubernetes +// SafeK8sSecretBufferSize returns the buffer size for the VMware Secrets Manager Safe Kubernetes // secret queue. // // The buffer size is determined by the environment variable -// AEGIS_SAFE_K8S_SECRET_BUFFER_SIZE. +// VSECM_SAFE_K8S_SECRET_BUFFER_SIZE. // // If the environment variable is not set, the default buffer size is 10. // If the environment variable is set and can be parsed as an integer, @@ -50,7 +52,7 @@ func SafeSecretBufferSize() int { // If the environment variable is set but cannot be parsed as an integer, // the default buffer size is used. func SafeK8sSecretBufferSize() int { - p := os.Getenv("AEGIS_SAFE_K8S_SECRET_BUFFER_SIZE") + p := os.Getenv("VSECM_SAFE_K8S_SECRET_BUFFER_SIZE") if p == "" { return 10 } @@ -61,11 +63,11 @@ func SafeK8sSecretBufferSize() int { return l } -// SafeSecretDeleteBufferSize returns the buffer size for the Aegis Safe secret +// SafeSecretDeleteBufferSize returns the buffer size for the VMware Secrets Manager Safe secret // deletion queue. // // The buffer size is determined by the environment variable -// AEGIS_SAFE_SECRET_DELETE_BUFFER_SIZE. +// VSECM_SAFE_SECRET_DELETE_BUFFER_SIZE. // // If the environment variable is not set, the default buffer size is 10. // If the environment variable is set and can be parsed as an integer, @@ -73,7 +75,7 @@ func SafeK8sSecretBufferSize() int { // If the environment variable is set but cannot be parsed as an integer, // the default buffer size is used. func SafeSecretDeleteBufferSize() int { - p := os.Getenv("AEGIS_SAFE_SECRET_DELETE_BUFFER_SIZE") + p := os.Getenv("VSECM_SAFE_SECRET_DELETE_BUFFER_SIZE") if p == "" { return 10 } @@ -84,11 +86,11 @@ func SafeSecretDeleteBufferSize() int { return l } -// SafeK8sSecretDeleteBufferSize returns the buffer size for the Aegis Safe +// SafeK8sSecretDeleteBufferSize returns the buffer size for the VMware Secrets Manager Safe // Kubernetes secret deletion queue. // // The buffer size is determined by the environment variable -// AEGIS_SAFE_K8S_SECRET_DELETE_BUFFER_SIZE. +// VSECM_SAFE_K8S_SECRET_DELETE_BUFFER_SIZE. // // If the environment variable is not set, the default buffer size is 10. // If the environment variable is set and can be parsed as an integer, @@ -96,7 +98,7 @@ func SafeSecretDeleteBufferSize() int { // If the environment variable is set but cannot be parsed as an integer, // the default buffer size is used. func SafeK8sSecretDeleteBufferSize() int { - p := os.Getenv("AEGIS_SAFE_K8S_SECRET_DELETE_BUFFER_SIZE") + p := os.Getenv("VSECM_SAFE_K8S_SECRET_DELETE_BUFFER_SIZE") if p == "" { return 10 } @@ -107,14 +109,14 @@ func SafeK8sSecretDeleteBufferSize() int { return l } -// SafeFipsCompliant returns a boolean indicating whether Aegis Safe should run in -// FIPS compliant mode. Note that this is not a guarantee that Aegis Safe will +// SafeFipsCompliant returns a boolean indicating whether VMware Secrets Manager Safe should run in +// FIPS compliant mode. Note that this is not a guarantee that VMware Secrets Manager Safe will // run in FIPS compliant mode, as it depends on the underlying base image. -// If you are using one of the official FIPS-complaint Aegis Docker images, -// then it will be FIPS-compliant. Check https://aegis.ist/docs/configuration/ +// If you are using one of the official FIPS-complaint VMware Secrets Manager Docker images, +// then it will be FIPS-compliant. Check https://vsecm.com/configuration/ // for more details. func SafeFipsCompliant() bool { - p := strings.ToLower(os.Getenv("AEGIS_SAFE_FIPS_COMPLIANT")) + p := strings.ToLower(os.Getenv("VSECM_SAFE_FIPS_COMPLIANT")) if p == "" { return false } @@ -123,12 +125,12 @@ func SafeFipsCompliant() bool { } // SafeBackingStore returns the storage type for the data, -// as specified in the AEGIS_SAFE_BACKING_STORE environment variable. +// as specified in the VSECM_SAFE_BACKING_STORE environment variable. // If the environment variable is not set, it defaults to "file". -// Any value that is not "file" will mean Aegis Safe will store +// Any value that is not "file" will mean VMware Secrets Manager Safe will store // its state in-memory func SafeBackingStore() data.BackingStore { - s := os.Getenv("AEGIS_SAFE_BACKING_STORE") + s := os.Getenv("VSECM_SAFE_BACKING_STORE") if s == "" { return data.File } @@ -159,7 +161,7 @@ func SafeBackingStore() data.BackingStore { // If the environment variable is not set or its value is not "true", // the function returns false. Otherwise, the function returns true. func SafeUseKubernetesSecrets() bool { - p := os.Getenv("AEGIS_SAFE_USE_KUBERNETES_SECRETS") + p := os.Getenv("VSECM_SAFE_USE_KUBERNETES_SECRETS") if p == "" { return false } @@ -169,11 +171,11 @@ func SafeUseKubernetesSecrets() bool { return false } -// SafeSecretBackupCount retrieves the number of backups to keep for Aegis Safe -// secrets. If the environment variable AEGIS_SAFE_SECRET_BACKUP_COUNT is not +// SafeSecretBackupCount retrieves the number of backups to keep for VMware Secrets Manager Safe +// secrets. If the environment variable VSECM_SAFE_SECRET_BACKUP_COUNT is not // set or is not a valid integer, the default value of 3 will be returned. func SafeSecretBackupCount() int { - p := os.Getenv("AEGIS_SAFE_SECRET_BACKUP_COUNT") + p := os.Getenv("VSECM_SAFE_SECRET_BACKUP_COUNT") if p == "" { return 3 } @@ -185,11 +187,11 @@ func SafeSecretBackupCount() int { } // SafeManualKeyInput returns a boolean indicating whether to use manual -// cryptographic key input for Aegis Safe, instead of letting it bootstrap +// cryptographic key input for VMware Secrets Manager Safe, instead of letting it bootstrap // automatically. If the environment variable is not set or its value is // not "true", the function returns false. Otherwise, the function returns true. func SafeManualKeyInput() bool { - p := os.Getenv("AEGIS_SAFE_MANUAL_KEY_INPUT") + p := os.Getenv("VSECM_SAFE_MANUAL_KEY_INPUT") if p == "" { return false } @@ -200,10 +202,10 @@ func SafeManualKeyInput() bool { } // SafeDataPath returns the path to the safe data directory. -// The path is determined by the AEGIS_SAFE_DATA_PATH environment variable. +// The path is determined by the VSECM_SAFE_DATA_PATH environment variable. // If the environment variable is not set, the default path "/data" is returned. func SafeDataPath() string { - p := os.Getenv("AEGIS_SAFE_DATA_PATH") + p := os.Getenv("VSECM_SAFE_DATA_PATH") if p == "" { p = "/data" } @@ -211,24 +213,24 @@ func SafeDataPath() string { } // SafeAgeKeyPath returns the path to the safe age key directory. -// The path is determined by the AEGIS_CRYPTO_KEY_PATH environment variable. +// The path is determined by the VSECM_CRYPTO_KEY_PATH environment variable. // If the environment variable is not set, the default path "/key/key.txt" // is returned. func SafeAgeKeyPath() string { - p := os.Getenv("AEGIS_CRYPTO_KEY_PATH") + p := os.Getenv("VSECM_CRYPTO_KEY_PATH") if p == "" { p = "/key/key.txt" } return p } -// SafeBootstrapTimeout returns the allowed time for Aegis Safe to wait +// SafeBootstrapTimeout returns the allowed time for VMware Secrets Manager Safe to wait // before killing the pod to retrieve an SVID, in time.Duration. -// The interval is determined by the AEGIS_SAFE_BOOTSTRAP_TIMEOUT environment +// The interval is determined by the VSECM_SAFE_BOOTSTRAP_TIMEOUT environment // variable, with a default value of 30000 milliseconds if the variable is not // set or if there is an error in parsing the value. func SafeBootstrapTimeout() time.Duration { - p := os.Getenv("AEGIS_SAFE_BOOTSTRAP_TIMEOUT") + p := os.Getenv("VSECM_SAFE_BOOTSTRAP_TIMEOUT") if p == "" { p = "30000" } @@ -240,28 +242,28 @@ func SafeBootstrapTimeout() time.Duration { } // SafeAgeKeySecretName returns the name of the environment variable that holds -// the Aegis Safe age key. The value is retrieved using the -// "AEGIS_CRYPTO_KEY_NAME" environment variable. If this variable is -// not set or is empty, the default value "aegis-safe-age-key" is returned. +// the VMware Secrets Manager Safe age key. The value is retrieved using the +// "VSECM_CRYPTO_KEY_NAME" environment variable. If this variable is +// not set or is empty, the default value "vsecm-safe-age-key" is returned. func SafeAgeKeySecretName() string { - p := os.Getenv("AEGIS_CRYPTO_KEY_NAME") + p := os.Getenv("VSECM_CRYPTO_KEY_NAME") if p == "" { - p = "aegis-safe-age-key" + p = "vsecm-safe-age-key" } return p } // SafeSecretNamePrefix returns the prefix to be used for the names of secrets that -// Aegis Safe stores, when it is configured to persist the secret in the Kubernetes +// VMware Secrets Manager Safe stores, when it is configured to persist the secret in the Kubernetes // cluster as Kubernetes `Secret` objects. // -// The prefix is retrieved using the "AEGIS_SAFE_SECRET_NAME_PREFIX" +// The prefix is retrieved using the "VSECM_SAFE_SECRET_NAME_PREFIX" // environment variable. If this variable is not set or is empty, the default -// value "aegis-secret-" is returned. +// value "vsecm-secret-" is returned. func SafeSecretNamePrefix() string { - p := os.Getenv("AEGIS_SAFE_SECRET_NAME_PREFIX") + p := os.Getenv("VSECM_SAFE_SECRET_NAME_PREFIX") if p == "" { - p = "aegis-secret-" + p = "vsecm-secret-" } return p } diff --git a/core/env/sidecar.go b/core/env/sidecar.go index 50b0b13..5df6df3 100644 --- a/core/env/sidecar.go +++ b/core/env/sidecar.go @@ -1,22 +1,24 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package env import "os" // SidecarSecretsPath returns the path to the secrets file used by the sidecar. -// The path is determined by the AEGIS_SIDECAR_SECRETS_PATH environment variable, -// with a default value of "/opt/aegis/secrets.json" if the variable is not set. +// The path is determined by the VSECM_SIDECAR_SECRETS_PATH environment variable, +// with a default value of "/opt/vsecm/secrets.json" if the variable is not set. func SidecarSecretsPath() string { - p := os.Getenv("AEGIS_SIDECAR_SECRETS_PATH") + p := os.Getenv("VSECM_SIDECAR_SECRETS_PATH") if p == "" { - p = "/opt/aegis/secrets.json" + p = "/opt/vsecm/secrets.json" } return p } diff --git a/core/env/spiffe.go b/core/env/spiffe.go index 97dd043..0be6c34 100644 --- a/core/env/spiffe.go +++ b/core/env/spiffe.go @@ -1,17 +1,19 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package env import "os" // SpiffeSocketUrl returns the URL for the SPIFFE endpoint socket used in the -// Aegis system. The URL is obtained from the environment variable +// VMware Secrets Manager system. The URL is obtained from the environment variable // SPIFFE_ENDPOINT_SOCKET. If the variable is not set, the default URL is used. func SpiffeSocketUrl() string { p := os.Getenv("SPIFFE_ENDPOINT_SOCKET") diff --git a/core/env/svid.go b/core/env/svid.go index c619784..8e06b44 100644 --- a/core/env/svid.go +++ b/core/env/svid.go @@ -1,64 +1,66 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package env import "os" // SentinelSvidPrefix returns the prefix for the Safe -// SVID (Short-lived Verifiable Identity Document) used in the Aegis system. +// SVID (Short-lived Verifiable Identity Document) used in the VSecM system. // The prefix is obtained from the environment variable -// AEGIS_SENTINEL_SVID_PREFIX. If the variable is not set, the default prefix is +// VSECM_SENTINEL_SVID_PREFIX. If the variable is not set, the default prefix is // used. func SentinelSvidPrefix() string { - p := os.Getenv("AEGIS_SENTINEL_SVID_PREFIX") + p := os.Getenv("VSECM_SENTINEL_SVID_PREFIX") if p == "" { - p = "spiffe://aegis.ist/workload/aegis-sentinel/ns/aegis-system/sa/aegis-sentinel/n/" + p = "spiffe://vsecm.com/workload/vsecm-sentinel/ns/vsecm-system/sa/vsecm-sentinel/n/" } return p } // SafeSvidPrefix returns the prefix for the Safe -// SVID (Short-lived Verifiable Identity Document) used in the Aegis system. +// SVID (Short-lived Verifiable Identity Document) used in the VSecM system. // The prefix is obtained from the environment variable -// AEGIS_SAFE_SVID_PREFIX. If the variable is not set, the default prefix is +// VSECM_SAFE_SVID_PREFIX. If the variable is not set, the default prefix is // used. func SafeSvidPrefix() string { - p := os.Getenv("AEGIS_SAFE_SVID_PREFIX") + p := os.Getenv("VSECM_SAFE_SVID_PREFIX") if p == "" { - p = "spiffe://aegis.ist/workload/aegis-safe/ns/aegis-system/sa/aegis-safe/n/" + p = "spiffe://vsecm.com/workload/vsecm-safe/ns/vsecm-system/sa/vsecm-safe/n/" } return p } -// NotarySvidPrefix returns the prefix for the Aegis Notary SVID -// (SPIFFE Verifiable Identity Document) used in the Aegis system. -// The prefix is obtained from the environment variable AEGIS_NOTARY_SVID_PREFIX. +// NotarySvidPrefix returns the prefix for the VSecM Notary SVID +// (SPIFFE Verifiable Identity Document) used in the VSecM system. +// The prefix is obtained from the environment variable VSECM_NOTARY_SVID_PREFIX. // If the variable is not set, the default prefix is used. // // THIS IS NOT USED AT THE MOMENT. // IT IS EXPERIMENTAL. func NotarySvidPrefix() string { - p := os.Getenv("AEGIS_NOTARY_SVID_PREFIX") + p := os.Getenv("VSECM_NOTARY_SVID_PREFIX") if p == "" { - p = "spiffe://aegis.ist/workload/aegis-notary/ns/aegis-system/sa/aegis-notary/n/" + p = "spiffe://vsecm.com/workload/vsecm-notary/ns/vsecm-system/sa/vsecm-notary/n/" } return p } // WorkloadSvidPrefix returns the prefix for the Workload SVID -// (SPIFFE Verifiable Identity Document) used in the Aegis system. -// The prefix is obtained from the environment variable AEGIS_WORKLOAD_SVID_PREFIX. +// (SPIFFE Verifiable Identity Document) used in the VSecM system. +// The prefix is obtained from the environment variable VSECM_WORKLOAD_SVID_PREFIX. // If the variable is not set, the default prefix is used. func WorkloadSvidPrefix() string { - p := os.Getenv("AEGIS_WORKLOAD_SVID_PREFIX") + p := os.Getenv("VSECM_WORKLOAD_SVID_PREFIX") if p == "" { - p = "spiffe://aegis.ist/workload/" + p = "spiffe://vsecm.com/workload/" } return p } diff --git a/core/env/tls.go b/core/env/tls.go index 5e3a499..2df00a8 100644 --- a/core/env/tls.go +++ b/core/env/tls.go @@ -1,20 +1,22 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package env import "os" -// TlsPort returns the secure port for Aegis Safe to listen on. -// It checks the AEGIS_SAFE_TLS_PORT environment variable. If the variable +// TlsPort returns the secure port for VMware Secrets Manager Safe to listen on. +// It checks the VSECM_SAFE_TLS_PORT environment variable. If the variable // is not set, it defaults to ":8443". func TlsPort() string { - p := os.Getenv("AEGIS_SAFE_TLS_PORT") + p := os.Getenv("VSECM_SAFE_TLS_PORT") if p == "" { p = ":8443" } diff --git a/core/log/log.go b/core/log/log.go index 56d455d..2af76c4 100644 --- a/core/log/log.go +++ b/core/log/log.go @@ -1,17 +1,19 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ // Package log provides a simple and flexible logging library with various // log levels. package log import ( - "github.com/shieldworks/aegis/core/env" + "github.com/vmware-tanzu/secrets-manager/core/env" "log" "sync" ) diff --git a/core/probe/privates.go b/core/probe/privates.go index f63e3b7..be65633 100644 --- a/core/probe/privates.go +++ b/core/probe/privates.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package probe diff --git a/core/probe/probe.go b/core/probe/probe.go index cd321cf..53aa53a 100644 --- a/core/probe/probe.go +++ b/core/probe/probe.go @@ -1,15 +1,17 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package probe import ( - "github.com/shieldworks/aegis/core/env" + "github.com/vmware-tanzu/secrets-manager/core/env" "log" "net/http" ) diff --git a/core/system/wait.go b/core/system/wait.go index 3740d2e..8469179 100644 --- a/core/system/wait.go +++ b/core/system/wait.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package system diff --git a/core/template/template.go b/core/template/template.go index 20dff00..e1087de 100644 --- a/core/template/template.go +++ b/core/template/template.go @@ -1,10 +1,12 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package template diff --git a/core/validation/validation.go b/core/validation/validation.go index e594bc8..dbb6727 100644 --- a/core/validation/validation.go +++ b/core/validation/validation.go @@ -1,15 +1,17 @@ /* - * .-'_.---._'-. - * ||####|(__)|| Protect your secrets, protect your business. - * \\()|##// Secure your sensitive data with Aegis. - * \\ |#// - * .\_/. - */ +| Protect your secrets, protect your sensitive data. +: Explore VMware Secrets Manager docs at https://vsecm.com/ +/ keep your secrets… secret +>/ +<>/' Copyright 2023–present VMware, Inc. +>/' SPDX-License-Identifier: BSD-2-Clause +*/ package validation import ( - "github.com/shieldworks/aegis/core/env" + "github.com/vmware-tanzu/secrets-manager/core/env" "strings" ) @@ -28,7 +30,7 @@ func IsSafe(svid string) bool { } // IsNotary returns true if the given SVID (SPIFFE Verifiable Identity Document) -// is an Aegis Notary SVID. +// is a VSecM Notary SVID. // It does this by checking if the SVID has the notarySvidPrefix as its prefix. func IsNotary(svid string) bool { return strings.HasPrefix(svid, env.NotarySvidPrefix()) diff --git a/dockerfiles/aegis-ist-fips/init-container.Dockerfile b/dockerfiles/aegis-ist-fips/init-container.Dockerfile deleted file mode 100644 index 5790f09..0000000 --- a/dockerfiles/aegis-ist-fips/init-container.Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder - -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY sdk /build/sdk -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build - -# GOEXPERIMENT=boringcrypto is required for FIPS compliance. -RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o aegis-init-container \ - ./app/init-container/cmd/main.go - -# generate clean, final image for end users -FROM gcr.io/distroless/static-debian11 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -COPY --from=builder /build/aegis-init-container . - -# executable -ENTRYPOINT [ "./aegis-init-container" ] -CMD [ "" ] diff --git a/dockerfiles/aegis-ist-fips/safe.Dockerfile b/dockerfiles/aegis-ist-fips/safe.Dockerfile deleted file mode 100644 index 833f5a1..0000000 --- a/dockerfiles/aegis-ist-fips/safe.Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder - -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build - -# GOEXPERIMENT=boringcrypto is required for FIPS compliance. -RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o aegis-safe ./app/safe/cmd/main.go - -# generate clean, final image for end users -FROM gcr.io/distroless/static-debian11 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis-safe" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -COPY --from=builder /build/aegis-safe . - -# executable -ENTRYPOINT [ "./aegis-safe" ] -CMD [ "" ] diff --git a/dockerfiles/aegis-ist-fips/sentinel.Dockerfile b/dockerfiles/aegis-ist-fips/sentinel.Dockerfile deleted file mode 100644 index 1fdabce..0000000 --- a/dockerfiles/aegis-ist-fips/sentinel.Dockerfile +++ /dev/null @@ -1,46 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build - -# GOEXPERIMENT=boringcrypto is required for FIPS compliance. -RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o aegis ./app/sentinel/cmd/main.go -RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o sloth ./app/sentinel/busywait/main.go - -# generate clean, final image for end users -FROM gcr.io/distroless/static-debian11 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis-sentinel" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -# Copy the required binaries -COPY --from=builder /build/aegis /bin/aegis -COPY --from=builder /build/sloth /bin/sloth - -ENV HOSTNAME sentinel - -# Prevent root access. -ENV USER nobody -USER nobody - -# Keep the container alive. -ENTRYPOINT ["/bin/sloth"] -CMD [""] diff --git a/dockerfiles/aegis-ist-fips/sidecar.Dockerfile b/dockerfiles/aegis-ist-fips/sidecar.Dockerfile deleted file mode 100644 index be7eb8f..0000000 --- a/dockerfiles/aegis-ist-fips/sidecar.Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ - -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY sdk /build/sdk -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build - -# GOEXPERIMENT=boringcrypto is required for FIPS compliance. -RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o aegis-sidecar ./app/sidecar/cmd/main.go - -# generate clean, final image for end users -FROM gcr.io/distroless/static-debian11 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -COPY --from=builder /build/aegis-sidecar . - -# executable -ENTRYPOINT [ "./aegis-sidecar" ] -CMD [ "" ] diff --git a/dockerfiles/aegis-ist/init-container.Dockerfile b/dockerfiles/aegis-ist/init-container.Dockerfile deleted file mode 100644 index be0c0f2..0000000 --- a/dockerfiles/aegis-ist/init-container.Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder - -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY sdk /build/sdk -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build -RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o aegis-init-container \ - ./app/init-container/cmd/main.go - -# generate clean, final image for end users -FROM gcr.io/distroless/static-debian11 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -COPY --from=builder /build/aegis-init-container . - -# executable -ENTRYPOINT [ "./aegis-init-container" ] -CMD [ "" ] diff --git a/dockerfiles/aegis-ist/safe.Dockerfile b/dockerfiles/aegis-ist/safe.Dockerfile deleted file mode 100644 index bc61c98..0000000 --- a/dockerfiles/aegis-ist/safe.Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder - -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build -RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o aegis-safe ./app/safe/cmd/main.go - -# generate clean, final image for end users -FROM gcr.io/distroless/static-debian11 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis-safe" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -COPY --from=builder /build/aegis-safe . - -# executable -ENTRYPOINT [ "./aegis-safe" ] -CMD [ "" ] diff --git a/dockerfiles/aegis-ist/sentinel.Dockerfile b/dockerfiles/aegis-ist/sentinel.Dockerfile deleted file mode 100644 index 20e143f..0000000 --- a/dockerfiles/aegis-ist/sentinel.Dockerfile +++ /dev/null @@ -1,44 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build -RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o aegis ./app/sentinel/cmd/main.go -RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o sloth ./app/sentinel/busywait/main.go - -# generate clean, final image for end users -FROM gcr.io/distroless/static-debian11 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis-sentinel" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -# Copy the required binaries -COPY --from=builder /build/aegis /bin/aegis -COPY --from=builder /build/sloth /bin/sloth - -ENV HOSTNAME sentinel - -# Prevent root access. -ENV USER nobody -USER nobody - -# Keep the container alive. -ENTRYPOINT ["/bin/sloth"] -CMD [""] diff --git a/dockerfiles/aegis-ist/sidecar.Dockerfile b/dockerfiles/aegis-ist/sidecar.Dockerfile deleted file mode 100644 index 4326e37..0000000 --- a/dockerfiles/aegis-ist/sidecar.Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY sdk /build/sdk -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build -RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o aegis-sidecar ./app/sidecar/cmd/main.go - -# generate clean, final image for end users -FROM gcr.io/distroless/static-debian11 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -COPY --from=builder /build/aegis-sidecar . - -# executable -ENTRYPOINT [ "./aegis-sidecar" ] -CMD [ "" ] diff --git a/dockerfiles/aegis-photon-fips/init-container.Dockerfile b/dockerfiles/aegis-photon-fips/init-container.Dockerfile deleted file mode 100644 index 35c0508..0000000 --- a/dockerfiles/aegis-photon-fips/init-container.Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder - -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY sdk /build/sdk -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build - -# GOEXPERIMENT=boringcrypto is required for FIPS compliance. -RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o aegis-init-container \ - ./app/init-container/cmd/main.go - -# generate clean, final image for end users -FROM photon:5.0 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -COPY --from=builder /build/aegis-init-container . - -# executable -ENTRYPOINT [ "./aegis-init-container" ] -CMD [ "" ] diff --git a/dockerfiles/aegis-photon-fips/safe.Dockerfile b/dockerfiles/aegis-photon-fips/safe.Dockerfile deleted file mode 100644 index 3b08487..0000000 --- a/dockerfiles/aegis-photon-fips/safe.Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder - -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build - -# GOEXPERIMENT=boringcrypto is required for FIPS compliance. -RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o aegis-safe ./app/safe/cmd/main.go - -# generate clean, final image for end users -FROM photon:5.0 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis-safe" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -COPY --from=builder /build/aegis-safe . - -# executable -ENTRYPOINT [ "./aegis-safe" ] -CMD [ "" ] diff --git a/dockerfiles/aegis-photon-fips/sentinel.Dockerfile b/dockerfiles/aegis-photon-fips/sentinel.Dockerfile deleted file mode 100644 index 56d6eec..0000000 --- a/dockerfiles/aegis-photon-fips/sentinel.Dockerfile +++ /dev/null @@ -1,46 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build - -# GOEXPERIMENT=boringcrypto is required for FIPS compliance. -RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o aegis ./app/sentinel/cmd/main.go -RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o sloth ./app/sentinel/busywait/main.go - -# generate clean, final image for end users -FROM photon:5.0 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis-sentinel" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -# Copy the required binaries -COPY --from=builder /build/aegis /bin/aegis -COPY --from=builder /build/sloth /bin/sloth - -ENV HOSTNAME sentinel - -# Prevent root access. -ENV USER nobody -USER nobody - -# Keep the container alive. -ENTRYPOINT ["/bin/sloth"] -CMD [""] diff --git a/dockerfiles/aegis-photon-fips/sidecar.Dockerfile b/dockerfiles/aegis-photon-fips/sidecar.Dockerfile deleted file mode 100644 index 71fd0c0..0000000 --- a/dockerfiles/aegis-photon-fips/sidecar.Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ - -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY sdk /build/sdk -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build - -# GOEXPERIMENT=boringcrypto is required for FIPS compliance. -RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o aegis-sidecar ./app/sidecar/cmd/main.go - -# generate clean, final image for end users -FROM photon:5.0 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -COPY --from=builder /build/aegis-sidecar . - -# executable -ENTRYPOINT [ "./aegis-sidecar" ] -CMD [ "" ] diff --git a/dockerfiles/aegis-photon/init-container.Dockerfile b/dockerfiles/aegis-photon/init-container.Dockerfile deleted file mode 100644 index 212ab30..0000000 --- a/dockerfiles/aegis-photon/init-container.Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder - -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY sdk /build/sdk -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build -RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o aegis-init-container \ - ./app/init-container/cmd/main.go - -# generate clean, final image for end users -FROM photon:5.0 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -COPY --from=builder /build/aegis-init-container . - -# executable -ENTRYPOINT [ "./aegis-init-container" ] -CMD [ "" ] diff --git a/dockerfiles/aegis-photon/safe.Dockerfile b/dockerfiles/aegis-photon/safe.Dockerfile deleted file mode 100644 index 526dce1..0000000 --- a/dockerfiles/aegis-photon/safe.Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder - -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build -RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o aegis-safe ./app/safe/cmd/main.go - -# generate clean, final image for end users -FROM photon:5.0 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis-safe" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -COPY --from=builder /build/aegis-safe . - -# executable -ENTRYPOINT [ "./aegis-safe" ] -CMD [ "" ] diff --git a/dockerfiles/aegis-photon/sentinel.Dockerfile b/dockerfiles/aegis-photon/sentinel.Dockerfile deleted file mode 100644 index c0d5ac1..0000000 --- a/dockerfiles/aegis-photon/sentinel.Dockerfile +++ /dev/null @@ -1,44 +0,0 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build -RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o aegis ./app/sentinel/cmd/main.go -RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o sloth ./app/sentinel/busywait/main.go - -# generate clean, final image for end users -FROM photon:5.0 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis-sentinel" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -# Copy the required binaries -COPY --from=builder /build/aegis /bin/aegis -COPY --from=builder /build/sloth /bin/sloth - -ENV HOSTNAME sentinel - -# Prevent root access. -ENV USER nobody -USER nobody - -# Keep the container alive. -ENTRYPOINT ["/bin/sloth"] -CMD [""] diff --git a/dockerfiles/aegis-photon/sidecar.Dockerfile b/dockerfiles/aegis-photon/sidecar.Dockerfile deleted file mode 100644 index ef86e8e..0000000 --- a/dockerfiles/aegis-photon/sidecar.Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ - -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# - -# builder image -FROM golang:1.20.1-alpine3.17 as builder -RUN mkdir /build -COPY app /build/app -COPY core /build/core -COPY sdk /build/sdk -COPY vendor /build/vendor -COPY go.mod /build/go.mod -WORKDIR /build -RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o aegis-sidecar ./app/sidecar/cmd/main.go - -# generate clean, final image for end users -FROM photon:5.0 - -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" - -COPY --from=builder /build/aegis-sidecar . - -# executable -ENTRYPOINT [ "./aegis-sidecar" ] -CMD [ "" ] diff --git a/dockerfiles/example/init-container.Dockerfile b/dockerfiles/example/init-container.Dockerfile index a193015..5b8447b 100644 --- a/dockerfiles/example/init-container.Dockerfile +++ b/dockerfiles/example/init-container.Dockerfile @@ -1,10 +1,12 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ # builder image FROM golang:1.20.1-alpine3.17 as builder @@ -20,14 +22,14 @@ RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o example \ # generate clean, final image for end users FROM gcr.io/distroless/static-debian11 -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" COPY --from=builder /build/example . diff --git a/dockerfiles/example/multiple-secrets.Dockerfile b/dockerfiles/example/multiple-secrets.Dockerfile index 5c59054..e8f3208 100644 --- a/dockerfiles/example/multiple-secrets.Dockerfile +++ b/dockerfiles/example/multiple-secrets.Dockerfile @@ -1,10 +1,12 @@ - -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ # builder image FROM golang:1.20.1-alpine3.17 as builder @@ -23,14 +25,14 @@ RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o sloth \ # generate clean, final image for end users FROM gcr.io/distroless/static-debian11 -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" COPY --from=builder /build/env . COPY --from=builder /build/sloth . diff --git a/dockerfiles/example/sdk.Dockerfile b/dockerfiles/example/sdk.Dockerfile index 7510984..b77d143 100644 --- a/dockerfiles/example/sdk.Dockerfile +++ b/dockerfiles/example/sdk.Dockerfile @@ -1,10 +1,12 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ # builder image FROM golang:1.20.1-alpine3.17 as builder @@ -23,14 +25,14 @@ RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o env \ # generate clean, final image for end users FROM gcr.io/distroless/static-debian11 -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" COPY --from=builder /build/example . COPY --from=builder /build/env . diff --git a/dockerfiles/example/sidecar.Dockerfile b/dockerfiles/example/sidecar.Dockerfile index 326f37d..e4f9f25 100644 --- a/dockerfiles/example/sidecar.Dockerfile +++ b/dockerfiles/example/sidecar.Dockerfile @@ -1,10 +1,12 @@ -# -# .-'_.---._'-. -# ||####|(__)|| Protect your secrets, protect your business. -# \\()|##// Secure your sensitive data with Aegis. -# \\ |#// -# .\_/. -# +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ # builder image FROM golang:1.20.1-alpine3.17 as builder @@ -22,14 +24,14 @@ RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o env \ # generate clean, final image for end users FROM gcr.io/distroless/static-debian11 -LABEL "maintainers"="Volkan Özçelik " -LABEL "version"="0.18.1" -LABEL "website"="https://aegis.ist/" -LABEL "repo"="https://github.com/shieldworks/aegis" -LABEL "documentation"="https://aegis.ist/docs/" -LABEL "contact"="https://aegis.ist/contact/" -LABEL "community"="https://aegis.ist/contact/#community" -LABEL "changelog"="https://aegis.ist/changelog" +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" COPY --from=builder /build/example . COPY --from=builder /build/env . diff --git a/dockerfiles/vsecm-ist-fips/init-container.Dockerfile b/dockerfiles/vsecm-ist-fips/init-container.Dockerfile new file mode 100644 index 0000000..6aa18fa --- /dev/null +++ b/dockerfiles/vsecm-ist-fips/init-container.Dockerfile @@ -0,0 +1,42 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder + +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY sdk /build/sdk +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build + +# GOEXPERIMENT=boringcrypto is required for FIPS compliance. +RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o vsecm-init-container \ + ./app/init-container/cmd/main.go + +# generate clean, final image for end users +FROM gcr.io/distroless/static-debian11 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +COPY --from=builder /build/vsecm-init-container . + +# executable +ENTRYPOINT [ "./vsecm-init-container" ] +CMD [ "" ] diff --git a/dockerfiles/vsecm-ist-fips/safe.Dockerfile b/dockerfiles/vsecm-ist-fips/safe.Dockerfile new file mode 100644 index 0000000..e8aeb3f --- /dev/null +++ b/dockerfiles/vsecm-ist-fips/safe.Dockerfile @@ -0,0 +1,40 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder + +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build + +# GOEXPERIMENT=boringcrypto is required for FIPS compliance. +RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o vsecm-safe ./app/safe/cmd/main.go + +# generate clean, final image for end users +FROM gcr.io/distroless/static-debian11 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager-safe" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +COPY --from=builder /build/vsecm-safe . + +# executable +ENTRYPOINT [ "./vsecm-safe" ] +CMD [ "" ] diff --git a/dockerfiles/vsecm-ist-fips/sentinel.Dockerfile b/dockerfiles/vsecm-ist-fips/sentinel.Dockerfile new file mode 100644 index 0000000..0fb2fcd --- /dev/null +++ b/dockerfiles/vsecm-ist-fips/sentinel.Dockerfile @@ -0,0 +1,48 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build + +# GOEXPERIMENT=boringcrypto is required for FIPS compliance. +RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o safe ./app/sentinel/cmd/main.go +RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o sloth ./app/sentinel/busywait/main.go + +# generate clean, final image for end users +FROM gcr.io/distroless/static-debian11 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager-sentinel" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +# Copy the required binaries +COPY --from=builder /build/safe /bin/safe +COPY --from=builder /build/sloth /bin/sloth + +ENV HOSTNAME sentinel + +# Prevent root access. +ENV USER nobody +USER nobody + +# Keep the container alive. +ENTRYPOINT ["/bin/sloth"] +CMD [""] diff --git a/dockerfiles/vsecm-ist-fips/sidecar.Dockerfile b/dockerfiles/vsecm-ist-fips/sidecar.Dockerfile new file mode 100644 index 0000000..04326cc --- /dev/null +++ b/dockerfiles/vsecm-ist-fips/sidecar.Dockerfile @@ -0,0 +1,41 @@ + +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY sdk /build/sdk +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build + +# GOEXPERIMENT=boringcrypto is required for FIPS compliance. +RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o vsecm-sidecar ./app/sidecar/cmd/main.go + +# generate clean, final image for end users +FROM gcr.io/distroless/static-debian11 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +COPY --from=builder /build/vsecm-sidecar . + +# executable +ENTRYPOINT [ "./vsecm-sidecar" ] +CMD [ "" ] diff --git a/dockerfiles/vsecm-ist/init-container.Dockerfile b/dockerfiles/vsecm-ist/init-container.Dockerfile new file mode 100644 index 0000000..792ba19 --- /dev/null +++ b/dockerfiles/vsecm-ist/init-container.Dockerfile @@ -0,0 +1,40 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder + +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY sdk /build/sdk +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build +RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o vsecm-init-container \ + ./app/init-container/cmd/main.go + +# generate clean, final image for end users +FROM gcr.io/distroless/static-debian11 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +COPY --from=builder /build/vsecm-init-container . + +# executable +ENTRYPOINT [ "./vsecm-init-container" ] +CMD [ "" ] diff --git a/dockerfiles/vsecm-ist/safe.Dockerfile b/dockerfiles/vsecm-ist/safe.Dockerfile new file mode 100644 index 0000000..6c9567e --- /dev/null +++ b/dockerfiles/vsecm-ist/safe.Dockerfile @@ -0,0 +1,38 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder + +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build +RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o vsecm-safe ./app/safe/cmd/main.go + +# generate clean, final image for end users +FROM gcr.io/distroless/static-debian11 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager-safe" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +COPY --from=builder /build/vsecm-safe . + +# executable +ENTRYPOINT [ "./vsecm-safe" ] +CMD [ "" ] diff --git a/dockerfiles/vsecm-ist/sentinel.Dockerfile b/dockerfiles/vsecm-ist/sentinel.Dockerfile new file mode 100644 index 0000000..e5e64bf --- /dev/null +++ b/dockerfiles/vsecm-ist/sentinel.Dockerfile @@ -0,0 +1,46 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build +RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o safe ./app/sentinel/cmd/main.go +RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o sloth ./app/sentinel/busywait/main.go + +# generate clean, final image for end users +FROM gcr.io/distroless/static-debian11 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager-sentinel" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +# Copy the required binaries +COPY --from=builder /build/safe /bin/safe +COPY --from=builder /build/sloth /bin/sloth + +ENV HOSTNAME sentinel + +# Prevent root access. +ENV USER nobody +USER nobody + +# Keep the container alive. +ENTRYPOINT ["/bin/sloth"] +CMD [""] diff --git a/dockerfiles/vsecm-ist/sidecar.Dockerfile b/dockerfiles/vsecm-ist/sidecar.Dockerfile new file mode 100644 index 0000000..8b724aa --- /dev/null +++ b/dockerfiles/vsecm-ist/sidecar.Dockerfile @@ -0,0 +1,38 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY sdk /build/sdk +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build +RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o vsecm-sidecar ./app/sidecar/cmd/main.go + +# generate clean, final image for end users +FROM gcr.io/distroless/static-debian11 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +COPY --from=builder /build/vsecm-sidecar . + +# executable +ENTRYPOINT [ "./vsecm-sidecar" ] +CMD [ "" ] diff --git a/dockerfiles/vsecm-photon-fips/init-container.Dockerfile b/dockerfiles/vsecm-photon-fips/init-container.Dockerfile new file mode 100644 index 0000000..42a88b0 --- /dev/null +++ b/dockerfiles/vsecm-photon-fips/init-container.Dockerfile @@ -0,0 +1,42 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder + +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY sdk /build/sdk +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build + +# GOEXPERIMENT=boringcrypto is required for FIPS compliance. +RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o vsecm-init-container \ + ./app/init-container/cmd/main.go + +# generate clean, final image for end users +FROM photon:5.0 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +COPY --from=builder /build/vsecm-init-container . + +# executable +ENTRYPOINT [ "./vsecm-init-container" ] +CMD [ "" ] diff --git a/dockerfiles/vsecm-photon-fips/safe.Dockerfile b/dockerfiles/vsecm-photon-fips/safe.Dockerfile new file mode 100644 index 0000000..aced642 --- /dev/null +++ b/dockerfiles/vsecm-photon-fips/safe.Dockerfile @@ -0,0 +1,40 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder + +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build + +# GOEXPERIMENT=boringcrypto is required for FIPS compliance. +RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o vsecm-safe ./app/safe/cmd/main.go + +# generate clean, final image for end users +FROM photon:5.0 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager-safe" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +COPY --from=builder /build/vsecm-safe . + +# executable +ENTRYPOINT [ "./vsecm-safe" ] +CMD [ "" ] diff --git a/dockerfiles/vsecm-photon-fips/sentinel.Dockerfile b/dockerfiles/vsecm-photon-fips/sentinel.Dockerfile new file mode 100644 index 0000000..3f0e5e6 --- /dev/null +++ b/dockerfiles/vsecm-photon-fips/sentinel.Dockerfile @@ -0,0 +1,48 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build + +# GOEXPERIMENT=boringcrypto is required for FIPS compliance. +RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o safe ./app/sentinel/cmd/main.go +RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o sloth ./app/sentinel/busywait/main.go + +# generate clean, final image for end users +FROM photon:5.0 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager-sentinel" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +# Copy the required binaries +COPY --from=builder /build/safe /bin/safe +COPY --from=builder /build/sloth /bin/sloth + +ENV HOSTNAME sentinel + +# Prevent root access. +ENV USER nobody +USER nobody + +# Keep the container alive. +ENTRYPOINT ["/bin/sloth"] +CMD [""] diff --git a/dockerfiles/vsecm-photon-fips/sidecar.Dockerfile b/dockerfiles/vsecm-photon-fips/sidecar.Dockerfile new file mode 100644 index 0000000..5e5d9ba --- /dev/null +++ b/dockerfiles/vsecm-photon-fips/sidecar.Dockerfile @@ -0,0 +1,40 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY sdk /build/sdk +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build + +# GOEXPERIMENT=boringcrypto is required for FIPS compliance. +RUN CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=linux go build -mod vendor -a -o vsecm-sidecar ./app/sidecar/cmd/main.go + +# generate clean, final image for end users +FROM photon:5.0 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +COPY --from=builder /build/vsecm-sidecar . + +# executable +ENTRYPOINT [ "./vsecm-sidecar" ] +CMD [ "" ] diff --git a/dockerfiles/vsecm-photon/init-container.Dockerfile b/dockerfiles/vsecm-photon/init-container.Dockerfile new file mode 100644 index 0000000..684a376 --- /dev/null +++ b/dockerfiles/vsecm-photon/init-container.Dockerfile @@ -0,0 +1,40 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder + +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY sdk /build/sdk +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build +RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o vsecm-init-container \ + ./app/init-container/cmd/main.go + +# generate clean, final image for end users +FROM photon:5.0 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +COPY --from=builder /build/vsecm-init-container . + +# executable +ENTRYPOINT [ "./vsecm-init-container" ] +CMD [ "" ] diff --git a/dockerfiles/vsecm-photon/safe.Dockerfile b/dockerfiles/vsecm-photon/safe.Dockerfile new file mode 100644 index 0000000..699f33e --- /dev/null +++ b/dockerfiles/vsecm-photon/safe.Dockerfile @@ -0,0 +1,38 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder + +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build +RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o vsecm-safe ./app/safe/cmd/main.go + +# generate clean, final image for end users +FROM photon:5.0 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager-safe" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +COPY --from=builder /build/vsecm-safe . + +# executable +ENTRYPOINT [ "./vsecm-safe" ] +CMD [ "" ] diff --git a/dockerfiles/vsecm-photon/sentinel.Dockerfile b/dockerfiles/vsecm-photon/sentinel.Dockerfile new file mode 100644 index 0000000..4e01422 --- /dev/null +++ b/dockerfiles/vsecm-photon/sentinel.Dockerfile @@ -0,0 +1,46 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build +RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o safe ./app/sentinel/cmd/main.go +RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o sloth ./app/sentinel/busywait/main.go + +# generate clean, final image for end users +FROM photon:5.0 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager-sentinel" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +# Copy the required binaries +COPY --from=builder /build/safe /bin/safe +COPY --from=builder /build/sloth /bin/sloth + +ENV HOSTNAME sentinel + +# Prevent root access. +ENV USER nobody +USER nobody + +# Keep the container alive. +ENTRYPOINT ["/bin/sloth"] +CMD [""] diff --git a/dockerfiles/vsecm-photon/sidecar.Dockerfile b/dockerfiles/vsecm-photon/sidecar.Dockerfile new file mode 100644 index 0000000..9533e9b --- /dev/null +++ b/dockerfiles/vsecm-photon/sidecar.Dockerfile @@ -0,0 +1,38 @@ +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +# builder image +FROM golang:1.20.1-alpine3.17 as builder +RUN mkdir /build +COPY app /build/app +COPY core /build/core +COPY sdk /build/sdk +COPY vendor /build/vendor +COPY go.mod /build/go.mod +WORKDIR /build +RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o vsecm-sidecar ./app/sidecar/cmd/main.go + +# generate clean, final image for end users +FROM photon:5.0 + +LABEL "maintainers"="Volkan Özçelik " +LABEL "version"="0.20.0" +LABEL "website"="https://vsecm.com/" +LABEL "repo"="https://github.com/vmware-tanzu/secrets-manager" +LABEL "documentation"="https://vsecm.com/" +LABEL "contact"="https://vsecm.com/contact/" +LABEL "community"="https://vsecm.com/community" +LABEL "changelog"="https://vsecm.com/changelog" + +COPY --from=builder /build/vsecm-sidecar . + +# executable +ENTRYPOINT [ "./vsecm-sidecar" ] +CMD [ "" ] diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..3ec73b3 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,24 @@ +--- +layout: home +--- + + + +
+

404

+ +

Page not found :(

+

The requested page could not be found.

+
diff --git a/docs/Gemfile b/docs/Gemfile new file mode 100644 index 0000000..d563868 --- /dev/null +++ b/docs/Gemfile @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } +gem "jekyll" +gem 'jekyll-feed' +gem 'jekyll-readme-index' +gem 'jemoji' +gem 'webrick' + +# gem "rails" diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock new file mode 100644 index 0000000..f3346be --- /dev/null +++ b/docs/Gemfile.lock @@ -0,0 +1,97 @@ +GEM + remote: https://rubygems.org/ + specs: + activesupport (7.0.6) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + addressable (2.8.4) + public_suffix (>= 2.0.2, < 6.0) + colorator (1.1.0) + concurrent-ruby (1.2.2) + em-websocket (0.5.3) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0) + eventmachine (1.2.7) + ffi (1.15.5) + forwardable-extended (2.6.0) + gemoji (4.1.0) + google-protobuf (3.23.4-x86_64-darwin) + html-pipeline (2.14.3) + activesupport (>= 2) + nokogiri (>= 1.4) + http_parser.rb (0.8.0) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + jekyll (4.3.2) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 1.0) + jekyll-sass-converter (>= 2.0, < 4.0) + jekyll-watch (~> 2.0) + kramdown (~> 2.3, >= 2.3.1) + kramdown-parser-gfm (~> 1.0) + liquid (~> 4.0) + mercenary (>= 0.3.6, < 0.5) + pathutil (~> 0.9) + rouge (>= 3.0, < 5.0) + safe_yaml (~> 1.0) + terminal-table (>= 1.8, < 4.0) + webrick (~> 1.7) + jekyll-feed (0.17.0) + jekyll (>= 3.7, < 5.0) + jekyll-readme-index (0.3.0) + jekyll (>= 3.0, < 5.0) + jekyll-sass-converter (3.0.0) + sass-embedded (~> 1.54) + jekyll-watch (2.2.1) + listen (~> 3.0) + jemoji (0.13.0) + gemoji (>= 3, < 5) + html-pipeline (~> 2.2) + jekyll (>= 3.0, < 5.0) + kramdown (2.4.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.4) + listen (3.8.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.4.0) + minitest (5.18.1) + nokogiri (1.15.3-x86_64-darwin) + racc (~> 1.4) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (5.0.3) + racc (1.7.1) + rb-fsevent (0.11.2) + rb-inotify (0.10.1) + ffi (~> 1.0) + rexml (3.2.5) + rouge (4.1.2) + safe_yaml (1.0.5) + sass-embedded (1.63.6-x86_64-darwin) + google-protobuf (~> 3.23) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.4.2) + webrick (1.8.1) + +PLATFORMS + x86_64-darwin-22 + +DEPENDENCIES + jekyll + jekyll-feed + jekyll-readme-index + jemoji + webrick + +BUNDLED WITH + 2.4.10 diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..42bfa8d --- /dev/null +++ b/docs/README.md @@ -0,0 +1,80 @@ +--- +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +title: VMWare Secrets Manager for Cloud Native Apps +layout: home +permalink: / +--- + +**VMware Secrets Manager** is a cloud-native secure store +for secrets management. It provides a minimal and intuitive API, ensuring +practical security without compromising user experience. + +[Endorsed by industry experts][endorsements], **VMware Secrets Manager** is a +ground-up re-imagination of secrets management, leveraging SPIRE for authentication +and providing a cloud-native way to manage secrets end-to-end. + +**VMware Secrets Manager** is resilient and secure by default, storing sensitive +data in memory and encrypting any data saved to disk. + +With **VMware Secrets Manager**, you can rest assured that your sensitive data is +always secure and protected. + + +```markdown +* TODO: archive the current version before changing this landing page. +* TODO: add some introductory text. + +[contributing]: https://vsecm.com/contributing/ +[release]: https://vsecm.com/release/ + +[Endorsed by industry experts](https://vsecm.com/endorsements), + +[roadmap]: https://vsecm.com/roadmap "The Roadmap" +[installation]: https://vsecm.com/installation "Install Aegis" +[build]: https://vsecm.com/use-the-source "Building, Deploying, and Testing" +[architecture]: https://vsecm.com/architecture/ "VMware Secrets Manager Architecture" +[design]: https://vsecm.com/philosophy/ "VMware Secrets Manager Design Philosphy" +[quickstart]: https://vsecm.com/quickstart "Quickstart" + +* **Homepage and Docs**: +* **Changelog**: +* **Community**: +* **Community**: [Join **VSecM**’s Slack Workspace][slack-invite] +* **Contact**: +* **Media Kit**: +* **Changelog**: + +* **Installation and Quickstart**: +* **Local Development Instructions**: +* **VSecM Developer SDK**: +* **VSecM CLI**: +* **VSecM Architecture**: +* **Configuring VSecM**: +* **Design Philosophy**: +* **Production Deployment Tips**: + +Add to docs that during the docs and source code you can see VSecM as an acronym for +VMware Secrets Manager for Cloud-Native Apps + +Add your VMware user name to the list of accounts that can sign-off the commit. +You need to sign off changes with that one. + +Test this on the build server before merging. + +Also add a notification to the README about the changes; and point to the +latest release that has Aegis in it. + +Also clean up the website template; there is a lot of junk I inherited due +to copy/paste +``` + +[endorsements]: https://vsecm.com/endorsements/ "Endorsements" \ No newline at end of file diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 0000000..da6bb56 --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1,72 @@ +# Configurations +title: VMware Secrets Manager +longtitle: VMWare Secrets Manger For Cloud-Native Apps +author: Volkan Özçelik and Contributors +email: ovolkan@vmware.com +description: > + VMware Secrets Manager for Cloud-Native Apps is a cloud-native secure store + for secrets management. It provides a minimal and intuitive API, ensuring + practical security without compromising user experience. + + Endorsed by industry experts, VMware Secrets Manager is a ground-up re-imagination + of secrets management, leveraging SPIRE for authentication and providing a + cloud-native way to manage secrets end-to-end. + + VMware Secrets Manager is resilient and secure by default, storing sensitive + data in memory and encrypting any data saved to disk. + + With VMware Secrets Manager, you can rest assured that your sensitive data is + always secure and protected. + +version: 0.5.0 +gitbook_version: 3.2.3 + +url: 'https://vsecm.com' +baseurl: '' +rss: RSS + +toc: + enabled: true + h_min: 1 + h_max: 3 + +# customize the link favicon in header, will be {{site.baseurl}}/{{site.favicon_path}} +favicon_path: /assets/gitbook/images/favicon.ico + +# markdown render engine. +markdown: kramdown +kramdown: + auto_ids: true + input: GFM + math_engine: mathjax + smart_quotes: lsquo,rsquo,ldquo,rdquo + toc_levels: 1..6 + syntax_highlighter: rouge + syntax_highlighter_opts: + guess_lang: true + +syntax_highlighter_style: colorful + +markdown_ext: markdown,mkdown,mkdn,mkd,md + +# Permalinks +permalink: /:categories/:year-:month-:day-:title:output_ext + +exclude: + - _drafts + +collections: + pages: + output: true + permalink: /:collection/:path/ + +page_width: 800px + +destination: ./_site +incremental: false +regenerate: true + +plugins: + - jekyll-feed + - jekyll-readme-index + - jemoji diff --git a/docs/_includes/application-insights.html b/docs/_includes/application-insights.html new file mode 100644 index 0000000..93b1d6b --- /dev/null +++ b/docs/_includes/application-insights.html @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/docs/_includes/body.html b/docs/_includes/body.html new file mode 100644 index 0000000..07368f7 --- /dev/null +++ b/docs/_includes/body.html @@ -0,0 +1,34 @@ +
+ {% if page.cover %} + {{ page.title | escape }} + {% endif %} + +
+
+
+
+ {% if page.title %} +

{{ page.title | escape }}

+ {% else %} +

{{ site.title | escape }}

+ {% endif %} + + {{ content }} + + {%- if jekyll.environment != 'dev' and site.disqushandler -%} + {%- include disqus.html -%} + {%- endif -%} +
+
+ + {%- include search.html -%} +
+
+
+ +{% include mathjax.html %} diff --git a/docs/_includes/cnzz.html b/docs/_includes/cnzz.html new file mode 100644 index 0000000..f418a4f --- /dev/null +++ b/docs/_includes/cnzz.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html new file mode 100644 index 0000000..efcd58e --- /dev/null +++ b/docs/_includes/footer.html @@ -0,0 +1,33 @@ + + + + + + + + + + + +{% if site.extra_footer_js %} + {%- for extra_js in site.extra_header_js -%} + {%- assign starts_with = extra_js | slice: 0,4 -%} + {% if starts_with == "http" %} + + {%- else -%} + + {%- endif -%} + {%- endfor -%} +{% endif %} + +{%- if site.tracker -%} + + {%- if site.tracker.google_analytics -%} + + {%- include google-analytics.html -%} + {%- endif -%} + {%- if site.tracker.cnzz -%} + + {%- include cnzz.html -%} + {%- endif -%} +{%- endif -%} diff --git a/docs/_includes/gitbook-sharing.json.tpl b/docs/_includes/gitbook-sharing.json.tpl new file mode 100644 index 0000000..f571e15 --- /dev/null +++ b/docs/_includes/gitbook-sharing.json.tpl @@ -0,0 +1,13 @@ + "sharing": { + "all": ["facebook", "google", "twitter", "weibo", "instapaper", "github", "telegram"], + "facebook": true, + "google": false, + "github": true, + "github_link": "https://github.com", + "telegram": false, + "telegram_link": "https://t.me", + "instapaper": false, + "twitter": true, + "vk": false, + "weibo": false + }, diff --git a/docs/_includes/google-analytics.html b/docs/_includes/google-analytics.html new file mode 100644 index 0000000..623ed00 --- /dev/null +++ b/docs/_includes/google-analytics.html @@ -0,0 +1,9 @@ + + + diff --git a/docs/_includes/head.html b/docs/_includes/head.html new file mode 100644 index 0000000..462f9e6 --- /dev/null +++ b/docs/_includes/head.html @@ -0,0 +1,73 @@ + + + +{%- if page.title -%} + {{ page.title | escape }} · {{ site.title | escape }} +{%- else -%} + {{ site.title | escape }} +{%- endif -%} + + + + +{%- if site.gitbook_version -%} + +{%- else -%} + +{%- endif -%} + +{%- if site.author -%} + +{%- endif -%} + + + + + + + + + + + + + + + + + + + + + +{% if site.extra_css %} + {%- for extra_css in site.extra_css -%} + {%- assign starts_with = extra_css | slice: 0,4 -%} + {% if starts_with == "http" %} + + {%- else -%} + + {%- endif -%} + {%- endfor -%} +{% endif %} + +{% if site.extra_header_js %} + {%- for extra_js in site.extra_header_js -%} + {%- assign starts_with = extra_js | slice: 0,4 -%} + {% if starts_with == "http" %} + + {%- else -%} + + {%- endif -%} + {%- endfor -%} +{% endif %} + +{%- if site.tracker -%} + + + {%- if site.tracker.application_insights -%} + + {%- include application-insights.html -%} + {%- endif -%} + +{%- endif -%} diff --git a/docs/_includes/mathjax.html b/docs/_includes/mathjax.html new file mode 100644 index 0000000..e3011d5 --- /dev/null +++ b/docs/_includes/mathjax.html @@ -0,0 +1,14 @@ + + \ No newline at end of file diff --git a/docs/_includes/metadata-home.json.tpl b/docs/_includes/metadata-home.json.tpl new file mode 100644 index 0000000..f08ac0d --- /dev/null +++ b/docs/_includes/metadata-home.json.tpl @@ -0,0 +1,22 @@ +{ + "page": { + "title": "Introduction", + "level": "1.1", + "depth": 1, + {% assign reversed_posts = site.posts | reverse %} + + {% if reversed_posts %} + "next": { + "title": "{{reversed_posts.first.title}}", + "level": "1.2", + "depth": 1, + "path": "{{reversed_posts.first.path}}", + "ref": "{{reversed_posts.first.path}}", + "articles": [] + }, + {% endif %} + "dir": "ltr" + }, + + {%- include metadata.json.tpl -%} +} \ No newline at end of file diff --git a/docs/_includes/metadata-post.json.tpl b/docs/_includes/metadata-post.json.tpl new file mode 100644 index 0000000..6da551d --- /dev/null +++ b/docs/_includes/metadata-post.json.tpl @@ -0,0 +1,20 @@ +{ + "page": { + "title": "Introduction", + "level": "1.1", + "depth": 1, + {% if page.next %} + "next": { + "title": "{{page.next.title}}", + "level": "1.2", + "depth": 1, + "path": "{{page.next.path}}", + "ref": "{{page.next.path}}", + "articles": [] + }, + {% endif %} + "dir": "ltr" + }, + + {%- include metadata.json.tpl -%} +} \ No newline at end of file diff --git a/docs/_includes/metadata.json.tpl b/docs/_includes/metadata.json.tpl new file mode 100644 index 0000000..476877f --- /dev/null +++ b/docs/_includes/metadata.json.tpl @@ -0,0 +1,76 @@ + "config": { + "plugins": ["fontsettings", "highlight", "livereload", "lunr", "search", "sharing", "theme-default", "livereload"], + "styles": { + "ebook": "styles/ebook.css", + "epub": "styles/epub.css", + "mobi": "styles/mobi.css", + "pdf": "styles/pdf.css", + "print": "styles/print.css", + "website": "styles/website.css" + }, + "pluginsConfig": { + "fontsettings": { + "family": "sans", + "size": 2, + "theme": "white" + }, + "highlight": {}, + "livereload": {}, + "lunr": { + "ignoreSpecialCharacters": false, + "maxIndexSize": 1000000 + }, + "search": {}, + + {%- include gitbook-sharing.json.tpl -%} + + "theme-default": { + "showLevel": false, + "styles": { + "ebook": "styles/ebook.css", + "epub": "styles/epub.css", + "mobi": "styles/mobi.css", + "pdf": "styles/pdf.css", + "print": "styles/print.css", + "website": "styles/website.css" + } + } + }, + "theme": "default", + "author": "Tao He", + "pdf": { + "pageNumbers": true, + "fontSize": 12, + "fontFamily": "Arial", + "paperSize": "a4", + "chapterMark": "pagebreak", + "pageBreaksBefore": "/", + "margin": { + "right": 62, + "left": 62, + "top": 56, + "bottom": 56 + } + }, + "structure": { + "langs": "LANGS.md", + "readme": "README.md", + }, + "variables": {}, + "title": "{{site.title}}", + "language": "en", + "gitbook": "*" + }, + "file": { + "path": "{{ page.path }}", + "mtime": "{{ page.date }}", + "type": "markdown" + }, + "gitbook": { + "version": "{{site.gitbook_version}}", + "time": "{{site.time}}" + }, + "basePath": "{{site.baseurl}}", + "book": { + "language": "" + } diff --git a/docs/_includes/search.html b/docs/_includes/search.html new file mode 100644 index 0000000..d236201 --- /dev/null +++ b/docs/_includes/search.html @@ -0,0 +1,9 @@ +
+
+

results matching ""

+
    +
    +
    +

    No results matching ""

    +
    +
    \ No newline at end of file diff --git a/docs/_includes/toc-date.html b/docs/_includes/toc-date.html new file mode 100644 index 0000000..d80b7c5 --- /dev/null +++ b/docs/_includes/toc-date.html @@ -0,0 +1,55 @@ +
    + +
    diff --git a/docs/_includes/toc.html b/docs/_includes/toc.html new file mode 100644 index 0000000..8c71007 --- /dev/null +++ b/docs/_includes/toc.html @@ -0,0 +1,182 @@ +{% capture tocWorkspace %} + {% comment %} + Copyright (c) 2017 Vladimir "allejo" Jimenez + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + {% endcomment %} + {% comment %} + Version 1.1.0 + https://github.com/allejo/jekyll-toc + + "...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe + + Usage: + {% include toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %} + + Parameters: + * html (string) - the HTML of compiled markdown generated by kramdown in Jekyll + + Optional Parameters: + * sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC + * class (string) : '' - a CSS class assigned to the TOC + * id (string) : '' - an ID to assigned to the TOC + * h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored + * h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored + * ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list + * item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level + * submenu_class (string) : '' - add custom class(es) for each child group of headings; has support for '%level%' placeholder which is the current "submenu" heading level + * base_url (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content + * anchor_class (string) : '' - add custom class(es) for each anchor element + * skip_no_ids (bool) : false - skip headers that do not have an `id` attribute + + Output: + An ordered or unordered list representing the table of contents of a markdown block. This snippet will only + generate the table of contents and will NOT output the markdown given to it + {% endcomment %} + + {% capture newline %} + {% endcapture %} + {% assign newline = newline | rstrip %} + + {% capture deprecation_warnings %}{% endcapture %} + + {% if include.baseurl %} + {% capture deprecation_warnings %}{{ deprecation_warnings }}{{ newline }}{% endcapture %} + {% endif %} + + {% if include.skipNoIDs %} + {% capture deprecation_warnings %}{{ deprecation_warnings }}{{ newline }}{% endcapture %} + {% endif %} + + {% capture jekyll_toc %}{% endcapture %} + {% assign orderedList = include.ordered | default: false %} + {% assign baseURL = include.base_url | default: include.baseurl | default: '' %} + {% assign skipNoIDs = include.skip_no_ids | default: include.skipNoIDs | default: false %} + {% assign minHeader = include.h_min | default: 1 %} + {% assign maxHeader = include.h_max | default: 6 %} + {% assign nodes = include.html | strip | split: ' maxHeader %} + {% continue %} + {% endif %} + + {% assign _workspace = node | split: '' | first }}>{% endcapture %} + {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %} + + {% if include.item_class and include.item_class != blank %} + {% capture listItemClass %} class="{{ include.item_class | replace: '%level%', currLevel | split: '.' | join: ' ' }}"{% endcapture %} + {% endif %} + + {% if include.submenu_class and include.submenu_class != blank %} + {% assign subMenuLevel = currLevel | minus: 1 %} + {% capture subMenuClass %} class="{{ include.submenu_class | replace: '%level%', subMenuLevel | split: '.' | join: ' ' }}"{% endcapture %} + {% endif %} + + {% capture anchorBody %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %} + + {% if htmlID %} + {% capture anchorAttributes %} href="{% if baseURL %}{{ baseURL }}{% endif %}#{{ htmlID }}"{% endcapture %} + + {% if include.anchor_class %} + {% capture anchorAttributes %}{{ anchorAttributes }} class="{{ include.anchor_class | split: '.' | join: ' ' }}"{% endcapture %} + {% endif %} + + {% capture listItem %}{{ anchorBody }}{% endcapture %} + {% elsif skipNoIDs == true %} + {% continue %} + {% else %} + {% capture listItem %}{{ anchorBody }}{% endcapture %} + {% endif %} + + {% if currLevel > lastLevel %} + {% capture jekyll_toc %}{{ jekyll_toc }}<{{ listModifier }}{{ subMenuClass }}>{% endcapture %} + {% elsif currLevel < lastLevel %} + {% assign repeatCount = lastLevel | minus: currLevel %} + + {% for i in (1..repeatCount) %} + {% capture jekyll_toc %}{{ jekyll_toc }}{% endcapture %} + {% endfor %} + + {% capture jekyll_toc %}{{ jekyll_toc }}{% endcapture %} + {% else %} + {% capture jekyll_toc %}{{ jekyll_toc }}{% endcapture %} + {% endif %} + + {% capture jekyll_toc %}{{ jekyll_toc }}{{ listItem }}{% endcapture %} + + {% assign lastLevel = currLevel %} + {% assign firstHeader = false %} + {% endfor %} + + {% assign repeatCount = minHeader | minus: 1 %} + {% assign repeatCount = lastLevel | minus: repeatCount %} + {% for i in (1..repeatCount) %} + {% capture jekyll_toc %}{{ jekyll_toc }}{% endcapture %} + {% endfor %} + + {% if jekyll_toc != '' %} + {% assign rootAttributes = '' %} + {% if include.class and include.class != blank %} + {% capture rootAttributes %} class="{{ include.class | split: '.' | join: ' ' }}"{% endcapture %} + {% endif %} + + {% if include.id and include.id != blank %} + {% capture rootAttributes %}{{ rootAttributes }} id="{{ include.id }}"{% endcapture %} + {% endif %} + + {% if rootAttributes %} + {% assign nodes = jekyll_toc | split: '>' %} + {% capture jekyll_toc %}<{{ listModifier }}{{ rootAttributes }}>{{ nodes | shift | join: '>' }}>{% endcapture %} + {% endif %} + {% endif %} +{% endcapture %}{% assign tocWorkspace = '' %}{{ deprecation_warnings }}{{ jekyll_toc }} diff --git a/docs/_layouts/home.html b/docs/_layouts/home.html new file mode 100644 index 0000000..8906a59 --- /dev/null +++ b/docs/_layouts/home.html @@ -0,0 +1,53 @@ + + + + + {%- include head.html -%} + + {% assign reversed_posts = site.posts | reverse %} + + {% if reversed_posts %} + + {% endif %} + + +
    + + {%- include toc-date.html -%} + +
    + + +
    + {%- include body.html -%} + + {% if reversed_posts %} + + + + {% endif %} +
    +
    + + +
    + + {%- include footer.html -%} + + + \ No newline at end of file diff --git a/docs/_layouts/post.html b/docs/_layouts/post.html new file mode 100644 index 0000000..df395a9 --- /dev/null +++ b/docs/_layouts/post.html @@ -0,0 +1,67 @@ + + + + + {%- include head.html -%} + + {% if page.previous %} + + {% else %} + + {% endif %} + + {% if page.next %} + + {% endif %} + + +
    + + {%- include toc-date.html -%} + +
    + + +
    + {%- include body.html -%} + + {% if page.previous %} + + + + {% else %} + + + + {% endif %} + + {% if page.next %} + + + + {% endif %} +
    +
    + + +
    + + {%- include footer.html -%} + + + \ No newline at end of file diff --git a/docs/_layouts/search-base.html b/docs/_layouts/search-base.html new file mode 100644 index 0000000..926a42d --- /dev/null +++ b/docs/_layouts/search-base.html @@ -0,0 +1,70 @@ + + + + + + {%- include head.html -%} + + {% assign reversed_posts = site.posts | reverse %} + + {% if reversed_posts %} + + {% endif %} + + +
    + + {%- include toc-date.html -%} + +
    + + +
    +
    +
    +
    + {% if page.title %} +

    {{ page.title | escape }}

    + {% else %} +

    {{ site.title | escape }}

    + {% endif %} + +
    +
    + + {{ content }} + +
    +
    + +
    + + {%- include search.html -%} +
    +
    +
    +
    +
    + + +
    + + {%- include footer.html -%} + + + diff --git a/docs/_pages/about.md b/docs/_pages/about.md new file mode 100644 index 0000000..4b05a53 --- /dev/null +++ b/docs/_pages/about.md @@ -0,0 +1,28 @@ +--- +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +title: About +layout: post +--- + +*VMware Secrets Manager for Cloud-Native Apps is a cloud-native secure store +for secrets management. It provides a minimal and intuitive API, ensuring +practical security without compromising user experience.* + +Endorsed by **industry experts**, VMware Secrets Manager is a ground-up re-imagination +of secrets management, leveraging SPIRE for authentication and providing a cloud-native +way to manage secrets end-to-end. + +VMware Secrets Manager is resilient and secure by default, storing sensitive +data in memory and encrypting any data saved to disk. + +With VMware Secrets Manager, you can rest assured that your sensitive data is +always secure and protected. diff --git a/docs/_pages/architecture.md b/docs/_pages/architecture.md new file mode 100644 index 0000000..c518302 --- /dev/null +++ b/docs/_pages/architecture.md @@ -0,0 +1,17 @@ +--- +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +title: Architecture +layout: post +--- + +## VMware Secrets Manager for Cloud Native Apps + diff --git a/docs/_pages/contact.md b/docs/_pages/contact.md new file mode 100644 index 0000000..b7216b3 --- /dev/null +++ b/docs/_pages/contact.md @@ -0,0 +1,16 @@ +--- +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +title: Contact +layout: post +--- + +This is a contact page. diff --git a/docs/_pages/installation.md b/docs/_pages/installation.md new file mode 100644 index 0000000..e3af095 --- /dev/null +++ b/docs/_pages/installation.md @@ -0,0 +1,17 @@ +--- +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +title: Installation +layout: post +--- + +## VMware Secrets Manager for Cloud Native Apps + diff --git a/docs/_pages/philosophy.md b/docs/_pages/philosophy.md new file mode 100644 index 0000000..df9df65 --- /dev/null +++ b/docs/_pages/philosophy.md @@ -0,0 +1,17 @@ +--- +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +title: Design Philosophy +layout: post +--- + +## VMware Secrets Manager for Cloud Native Apps + diff --git a/docs/_pages/quickstart.md b/docs/_pages/quickstart.md new file mode 100644 index 0000000..fa319cf --- /dev/null +++ b/docs/_pages/quickstart.md @@ -0,0 +1,17 @@ +--- +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +title: Quickstart +layout: post +--- + +## VMware Secrets Manager for Cloud Native Apps + diff --git a/docs/_pages/roadmap.md b/docs/_pages/roadmap.md new file mode 100644 index 0000000..d1c1594 --- /dev/null +++ b/docs/_pages/roadmap.md @@ -0,0 +1,17 @@ +--- +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +title: Roadmap +layout: post +--- + +## VMware Secrets Manager for Cloud Native Apps + diff --git a/docs/_pages/use-the-source.md b/docs/_pages/use-the-source.md new file mode 100644 index 0000000..d396087 --- /dev/null +++ b/docs/_pages/use-the-source.md @@ -0,0 +1,17 @@ +--- +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +title: Build From Source +layout: post +--- + +## VMware Secrets Manager for Cloud Native Apps + diff --git a/docs/_posts/2023-07-18-index.md b/docs/_posts/2023-07-18-index.md new file mode 100644 index 0000000..7fb46bc --- /dev/null +++ b/docs/_posts/2023-07-18-index.md @@ -0,0 +1,17 @@ +--- +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +title: Index +layout: post +--- + +## VMware Secrets Manager for Cloud Native Apps + diff --git a/docs/_posts/2023-07-18-start-here.md b/docs/_posts/2023-07-18-start-here.md new file mode 100644 index 0000000..78e6217 --- /dev/null +++ b/docs/_posts/2023-07-18-start-here.md @@ -0,0 +1,17 @@ +--- +# /* +# | Protect your secrets, protect your sensitive data. +# : Explore VMware Secrets Manager docs at https://vsecm.com/ +# / keep your secrets… secret +# >/ +# <>/' Copyright 2023–present VMware, Inc. +# >/' SPDX-License-Identifier: BSD-2-Clause +# */ + +title: Start Here +layout: post +--- + +## VMware Secrets Manager for Cloud Native Apps + diff --git a/docs/archive/2019-04-27-why.md b/docs/archive/2019-04-27-why.md new file mode 100644 index 0000000..81af6b7 --- /dev/null +++ b/docs/archive/2019-04-27-why.md @@ -0,0 +1,20 @@ +--- +title: Why Jekyll with GitBook +author: Tao He +date: 2019-04-27 +category: Jekyll +layout: post +--- + +GitBook is an amazing frontend style to present and organize contents (such as book chapters +and blogs) on Web. The typical to deploy GitBook at [Github Pages][1] +is building HTML files locally and then push to Github repository, usually to the `gh-pages` +branch. However, it's quite annoying to repeat such workload and make it hard for people do +version control via git for when there are generated HTML files to be staged in and out. + +This theme takes style definition out of generated GitBook site and provided the template +for Jekyll to rendering markdown documents to HTML, thus the whole site can be deployed +to [Github Pages][1] without generating and uploading HTML bundle every time when there are +changes to the original repository. + +[1]: https://pages.github.com \ No newline at end of file diff --git a/docs/archive/2019-04-28-howto.md b/docs/archive/2019-04-28-howto.md new file mode 100644 index 0000000..d1e9750 --- /dev/null +++ b/docs/archive/2019-04-28-howto.md @@ -0,0 +1,38 @@ +--- +title: How to Get Started +author: Tao He +date: 2019-04-28 +category: Jekyll +layout: post +--- + +The jekyll-gitbook theme can be used just as other [Jekyll themes][3] and +support [remote theme][2] on [Github Pages][1], see [the official guide][4] +as well. + +You can introduce this jekyll theme into your own site by either + +- [Fork][5] this repository and add your markdown posts to the `_posts` folder, then + push to your own Github repository. +- Use as a remote theme in your [`_config.yml`][6](just like what we do for this + site itself), + +```yaml +# Configurations +title: Jekyll Gitbook +longtitle: Jekyll Gitbook + +remote_theme: sighingnow/jekyll-gitbook +``` + +> ##### TIP +> +> No need to push generated HTML bundle. +{: .block-tip } + +[1]: https://pages.github.com +[2]: https://github.com/sighingnow/jekyll-gitbook/fork +[3]: https://pages.github.com/themes +[4]: https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/adding-a-theme-to-your-github-pages-site-using-jekyll +[5]: https://github.com/sighingnow/jekyll-gitbook/fork +[6]: https://github.com/sighingnow/jekyll-gitbook/blob/master/_config.yml diff --git a/docs/archive/2019-04-29-license.md b/docs/archive/2019-04-29-license.md new file mode 100644 index 0000000..793e52a --- /dev/null +++ b/docs/archive/2019-04-29-license.md @@ -0,0 +1,12 @@ +--- +title: License +author: Tao He +date: 2019-04-29 +category: Jekyll +layout: post +--- + +This work is open sourced under the Apache License, Version 2.0, using the +same license as the original [GitBook](https://github.com/GitbookIO/gitbook) repository. + +Copyright 2019 Tao He. diff --git a/docs/archive/2021-08-10-toc.md b/docs/archive/2021-08-10-toc.md new file mode 100644 index 0000000..31e072e --- /dev/null +++ b/docs/archive/2021-08-10-toc.md @@ -0,0 +1,170 @@ +--- +title: How to Generate TOC +author: Tao He +date: 2021-08-10 +category: Jekyll +layout: post +--- + +The jekyll-gitbook theme leverages [jekyll-toc][1] to generate the *Contents* for the page. +The TOC feature is not enabled by default. To use the TOC feature, modify the TOC +configuration in `_config.yml`: + +```yaml +toc: + enabled: true +``` + +Why this repo +------------- + +long contents ..... + +1. a +2. b +3. c +4. d + +Why this repo +------------- + +long contents ..... + ++ 1 ++ 2 ++ 3 ++ 4 + +Why this repo +------------- + +long contents ..... + +1. e +2. f +3. g +4. h + +Why this repo +------------- + ++ 5 ++ 6 ++ 7 ++ 8 + +Why this repo +------------- + +long contents ..... + +1. a +2. b +3. c +4. d + +Why this repo +------------- + +long contents ..... + ++ 1 ++ 2 ++ 3 ++ 4 + +Why this repo +------------- + +long contents ..... + +1. e +2. f +3. g +4. h + +Why this repo +------------- + ++ 5 ++ 6 ++ 7 ++ 8 + +Why this repo +------------- + +long contents ..... + +1. a +2. b +3. c +4. d + +Why this repo +------------- + +long contents ..... + ++ 1 ++ 2 ++ 3 ++ 4 + +Why this repo +------------- + +long contents ..... + +1. e +2. f +3. g +4. h + +Why this repo +------------- + ++ 5 ++ 6 ++ 7 ++ 8 + +Why this repo +------------- + +long contents ..... + +1. a +2. b +3. c +4. d + +Why this repo +------------- + +long contents ..... + ++ 1 ++ 2 ++ 3 ++ 4 + +Why this repo +------------- + +long contents ..... + +1. e +2. f +3. g +4. h + +Why this repo +------------- + ++ 5 ++ 6 ++ 7 ++ 8 + +[1]: https://github.com/allejo/jekyll-toc diff --git a/docs/archive/2022-05-24-page_cover.md b/docs/archive/2022-05-24-page_cover.md new file mode 100644 index 0000000..44a57e2 --- /dev/null +++ b/docs/archive/2022-05-24-page_cover.md @@ -0,0 +1,22 @@ +--- +title: Page with cover image +author: Tao He +date: 2022-05-24 +category: Jekyll +layout: post +cover: https://sighingnow.github.io/jekyll-gitbook/assets/dinosaur.gif +--- + +The jekyll-gitbook theme supports adding a cover image to a specific page by adding +a `cover` field to the page metadata: + +```diff + --- + title: Page with cover image + author: Tao He + date: 2022-05-24 + category: Jekyll + layout: post ++ cover: /assets/jekyll-gitbook/dinosaur.gif + --- +``` diff --git a/docs/archive/2022-06-26-wide_tables.md b/docs/archive/2022-06-26-wide_tables.md new file mode 100644 index 0000000..9693b16 --- /dev/null +++ b/docs/archive/2022-06-26-wide_tables.md @@ -0,0 +1,36 @@ +--- +title: Wide tables +author: Tao He +date: 2022-06-26 +category: Jekyll +layout: post +--- + +A wide tables needs to be wrapped into a `div` with class `table-wrapper` +to make sure it displayed as expected on mobile devices. For example, + +```markdown +
    + +|title1|title2|title3|title4|title5|title6|title7|title8| +|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:| +|1|2|3|4|5|6|7|8| +|1|2|3|4|5|6|7|8| +|1|2|3|4|5|6|7|8| +|1|2|3|4|5|6|7|8| + +
    +``` + +Will be rendered as + +
    + +|title1|title2|title3|title4|title5|title6|title7|title8| +|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:| +|1|2|3|4|5|6|7|8| +|1|2|3|4|5|6|7|8| +|1|2|3|4|5|6|7|8| +|1|2|3|4|5|6|7|8| + +
    diff --git a/docs/archive/2022-06-30-tips_warnings_dangers.md b/docs/archive/2022-06-30-tips_warnings_dangers.md new file mode 100644 index 0000000..42944a9 --- /dev/null +++ b/docs/archive/2022-06-30-tips_warnings_dangers.md @@ -0,0 +1,67 @@ +--- +title: Tips, Warnings, and Dangers +author: Tao He +date: 2022-06-30 +category: Jekyll +layout: post +--- + +The jekyll-theme supports tips, warnings, and dangers blocks and the style is referred +from [the discord.js website][1]. + +You could have the following [markdown attributes (supported by kramdown)][2]: + +### Tips + +Using a `{: .block-tip}` attribute: + +```markdown +> ##### TIP +> +> This guide is last tested with @napi-rs/canvas^0.1.20, so make sure you have +> this or a similar version after installation. +{: .block-tip } +``` + +> ##### TIP +> +> This guide is last tested with @napi-rs/canvas^0.1.20, so make sure you have +> this or a similar version after installation. +{: .block-tip } + +### Warnings + +Using a `{: .block-warning}` attribute: + +```markdown +> ##### WARNING +> +> Be sure that you're familiar with things like async/await and object destructuring +> before continuing, as we'll be making use of features like these. +{: .block-warning } +``` + +> ##### WARNING +> +> Be sure that you're familiar with things like async/await and object destructuring +> before continuing, as we'll be making use of features like these. +{: .block-warning } + +### Dangers + +Using a `{: .block-danger}` attribute: + +```markdown +> ##### DANGER +> +> You cannot delete an ephemeral message. +{: .block-danger } +``` + +> ##### DANGER +> +> You cannot delete an ephemeral message. +{: .block-danger } + +[1]: https://discordjs.guide/popular-topics/canvas.html#setting-up-napi-rs-canvas +[2]: https://kramdown.gettalong.org/quickref.html#block-attributes diff --git a/docs/archive/design/draft.md b/docs/archive/design/draft.md new file mode 100644 index 0000000..141e942 --- /dev/null +++ b/docs/archive/design/draft.md @@ -0,0 +1,9 @@ +--- +title: Design Draft +author: Tao He +date: 2022-02-06 +category: Jekyll +layout: post +--- + +This is an draft page. diff --git a/docs/assets/dinosaur.gif b/docs/assets/dinosaur.gif new file mode 100644 index 0000000..b09e731 Binary files /dev/null and b/docs/assets/dinosaur.gif differ diff --git a/docs/assets/gitbook/custom.css b/docs/assets/gitbook/custom.css new file mode 100644 index 0000000..7f2eef0 --- /dev/null +++ b/docs/assets/gitbook/custom.css @@ -0,0 +1,278 @@ +--- +--- + +.book-body { + overflow-y: scroll; +} + +.book-body .book-header { + position: fixed; + width: 100%; +} + +.book.with-summary .book-body .book-header { + position: fixed; + width: calc(100% - 300px); + overflow-x: hidden; + overflow-y: hidden; +} + +.book-body .body-inner { + /* position: absolute; */ + margin-top: 50px; + min-height: calc(100% - 50px); +} + +@media (max-width: 1240px) { + .book-body .body-inner { + position: absolute; + margin-top: 50px; + min-height: calc(100% - 50px) + } +} + +.book-body .body-inner .page-wrapper { + min-height: calc(100% - 46px); +} + +.book-body .body-inner .page-wrapper .page-inner { + padding-bottom: 20px; +} + +@media (max-width: 1240px) { + .book-body .body-inner .navigation { + max-width: calc(50% - 3px); + width: calc(50% - 3px); + } +} + +.book .book-body .book-header { + background: #ffffff; +} + +.book.color-theme-1 .book-body .book-header { + background: #f3eacb; +} + +.book.color-theme-2 .book-body .book-header { + background: #1c1f2b; +} + +.page-inner { + max-width: {{ site.page_width | default: '800px' }}; +} + +.back-to-top { + right: calc((100% - 300px - min(100% - 300px, {{ site.page_width | default: '800px' }})) / 2 + 25px); +} + +/* scrollbar */ +::-webkit-scrollbar { + width: 5px; + height: 5px; +} + +::-webkit-scrollbar-track-piece { + /* background-color: rgba(125, 125, 125, 0.2); */ + -webkit-border-radius: 6px; +} + +::-webkit-scrollbar-thumb:vertical { + height: 5px; + background-color: rgba(7, 17, 27, .2); + -webkit-border-radius: 6px; +} + +::-webkit-scrollbar-thumb:horizontal { + width: 5px; + background-color: rgba(125, 125, 125, 0.2); + -webkit-border-radius: 6px; +} + +/* Style for search page on mobile screens */ + +#book-search-input-link { + padding: 6px; + transition: top .5s ease; + border-bottom: 1px solid rgba(0,0,0,.07); + border-top: 1px solid rgba(0,0,0,.07); + margin-bottom: 10px; + margin-top: -1px; + background: #ffffff; +} + +#book-search-input-link a { + width: 100%; + background: 0 0; + border: 1px solid transparent; + box-shadow: none; + outline: 0; + line-height: 38px; + padding: 7px 7px; + color: #757575; +} + +#book-search-input { + display: block; +} +#book-search-input-link { + display: none; +} + +@media (max-width: 1240px) { + #book-search-input { + display: none; + } + #book-search-input-link { + display: block; + } +} + +#book-search-input-inside { + padding: 6px; + background: 0 0; + transition: top .5s ease; + background: #fff; + border-bottom: 1px solid rgba(0,0,0,.07); + border-top: 1px solid rgba(0,0,0,.07); + margin-bottom: 10px; + margin-top: -1px; +} + +#book-search-input-inside input { + width: 100%; + background: 0 0; + border: 1px solid transparent; + box-shadow: none; + outline: 0; + line-height: 22px; + padding: 7px 7px; + color: inherit; +} + + +/* Custom font settings */ + +.book.font-family-0 { + xfont-family: Georgia, serif; +} +.book.font-family-1 { + xfont-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +/* Render wide tables */ + +.table-wrapper { + overflow-x: scroll; +} + +/* Tips, warnings, and dangers */ + +.markdown-section blockquote.block-tip { + border-color: var(--c-tip); + background-color: var(--c-tip-bg); + color: var(--c-tip-text); + font-family: var(--font-family); +} + +.markdown-section blockquote.block-tip h1 { + color: var(--c-tip-title); +} + +.markdown-section blockquote.block-tip h2 { + color: var(--c-tip-title); +} + +.markdown-section blockquote.block-tip h3 { + color: var(--c-tip-title); +} + +.markdown-section blockquote.block-tip h4 { + color: var(--c-tip-title); +} + +.markdown-section blockquote.block-tip h5 { + color: var(--c-tip-title); +} + +.markdown-section blockquote.block-tip h6 { + color: var(--c-tip-title); +} + +.markdown-section blockquote.block-warning { + border-color: var(--c-warning); + background-color: var(--c-warning-bg); + color: var(--c-warning-text); + font-family: var(--font-family); +} + +.markdown-section blockquote.block-warning h1 { + color: var(--c-warning-title); +} + +.markdown-section blockquote.block-warning h2 { + color: var(--c-warning-title); +} + +.markdown-section blockquote.block-warning h3 { + color: var(--c-warning-title); +} + +.markdown-section blockquote.block-warning h4 { + color: var(--c-warning-title); +} + +.markdown-section blockquote.block-warning h5 { + color: var(--c-warning-title); +} + +.markdown-section blockquote.block-warning h6 { + color: var(--c-warning-title); +} + +.markdown-section blockquote.block-danger { + border-color: var(--c-danger); + background-color: var(--c-danger-bg); + color: var(--c-danger-text); + font-family: var(--font-family); +} + +.markdown-section blockquote.block-danger h1 { + color: var(--c-danger-title); +} + +.markdown-section blockquote.block-danger h2 { + color: var(--c-danger-title); +} + +.markdown-section blockquote.block-danger h3 { + color: var(--c-danger-title); +} + +.markdown-section blockquote.block-danger h4 { + color: var(--c-danger-title); +} + +.markdown-section blockquote.block-danger h5 { + color: var(--c-danger-title); +} + +.markdown-section blockquote.block-danger h6 { + color: var(--c-danger-title); +} + +:root { + --c-tip: #42b983; + --c-tip-bg: #e2f5ec; + --c-tip-text: #215d42; + --c-tip-title: #359469; + --c-warning: #e7c000; + --c-warning-bg: rgba(255, 229, 100, .25); + --c-warning-text: #6b5900; + --c-warning-title: #b29400; + --c-danger: #c00; + --c-danger-bg: #ffe0e0; + --c-danger-text: #600; + --c-danger-title: #c00; + --font-family: "aglet-mono", mono, "divenire-mono", serif, "auger-mono", monospace, "lexia-mono-variable", sans-serif, "moby", sans-serif, "paradroid-mono-soft", sans-serif, "logic-monospace", mono, john-doe, sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; +} diff --git a/docs/assets/gitbook/fonts/fontawesome/FontAwesome.otf b/docs/assets/gitbook/fonts/fontawesome/FontAwesome.otf new file mode 100644 index 0000000..d4de13e Binary files /dev/null and b/docs/assets/gitbook/fonts/fontawesome/FontAwesome.otf differ diff --git a/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.eot b/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.eot new file mode 100644 index 0000000..c7b00d2 Binary files /dev/null and b/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.eot differ diff --git a/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.svg b/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.svg new file mode 100644 index 0000000..8b66187 --- /dev/null +++ b/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.svg @@ -0,0 +1,685 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.ttf b/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.ttf new file mode 100644 index 0000000..f221e50 Binary files /dev/null and b/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.ttf differ diff --git a/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.woff b/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.woff new file mode 100644 index 0000000..6e7483c Binary files /dev/null and b/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.woff differ diff --git a/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.woff2 b/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.woff2 new file mode 100644 index 0000000..7eb74fd Binary files /dev/null and b/docs/assets/gitbook/fonts/fontawesome/fontawesome-webfont.woff2 differ diff --git a/docs/assets/gitbook/gitbook-plugin-back-to-top-button/plugin.css b/docs/assets/gitbook/gitbook-plugin-back-to-top-button/plugin.css new file mode 100644 index 0000000..7b00e36 --- /dev/null +++ b/docs/assets/gitbook/gitbook-plugin-back-to-top-button/plugin.css @@ -0,0 +1,55 @@ +.back-to-top { + position: fixed; + bottom: 25px; + right: calc((100% - 300px - min(100% - 300px, 800px)) / 2 + 25px); + background: rgba(0, 0, 0, 0.5); + width: 50px; + height: 50px; + display: block; + text-decoration: none; + -webkit-border-radius: 35px; + -moz-border-radius: 35px; + border-radius: 35px; + display: none; +} +.back-to-top i { + color: #fff; + margin: 0; + position: relative; + left: 15px; + top: 14px; + font-size: 22px; +} +.back-to-top:hover { + background: rgba(0, 0, 0, 0.9); + cursor: pointer; +} +.book.color-theme-1 .back-to-top { + background: rgba(112, 66, 20, 0.5); +} +.book.color-theme-1 .back-to-top i { + color: #f3eacb; +} +.book.color-theme-1 .back-to-top:hover { + background: rgba(112, 66, 20, 0.9); +} +.book.color-theme-2 .back-to-top { + background: rgba(189, 202, 219, 0.5); +} +.book.color-theme-2 .back-to-top i { + color: #1C1F2B; +} +.book.color-theme-2 .back-to-top:hover { + background: rgba(189, 202, 219, 0.9); +} + +@media only screen + and (min-device-width: 320px) + and (max-device-width: 480px) + and (-webkit-min-device-pixel-ratio: 2) + and (orientation: portrait) { + .back-to-top { + bottom: 10px; + right: 10px; + } +} diff --git a/docs/assets/gitbook/gitbook-plugin-back-to-top-button/plugin.js b/docs/assets/gitbook/gitbook-plugin-back-to-top-button/plugin.js new file mode 100644 index 0000000..e3b80da --- /dev/null +++ b/docs/assets/gitbook/gitbook-plugin-back-to-top-button/plugin.js @@ -0,0 +1,32 @@ +require([ + 'gitbook', + 'jquery' +], function(gitbook, $) { + gitbook.events.on('page.change', function() { + var back_to_top_button = ['
    '].join(""); + $(".page-wrapper").append(back_to_top_button) + + $(".back-to-top").hide(); + + $(".back-to-top").hover(function() { + $(this).css('cursor', 'pointer').attr('title', 'Back to top'); + }, function() { + $(this).css('cursor', 'auto'); + }); + + $('.book-body,.body-inner,.page-wrapper').on('scroll', function () { + if ($(this).scrollTop() > 100) { + $('.back-to-top').fadeIn(); + } else { + $('.back-to-top').fadeOut(); + } + }); + + $('.back-to-top').on('click', function () { + $('.book-body,.body-inner').animate({ + scrollTop: 0 + }, 800); + return false; + }); + }); +}); diff --git a/docs/assets/gitbook/gitbook-plugin-chapter-fold/chapter-fold.css b/docs/assets/gitbook/gitbook-plugin-chapter-fold/chapter-fold.css new file mode 100644 index 0000000..d3945cf --- /dev/null +++ b/docs/assets/gitbook/gitbook-plugin-chapter-fold/chapter-fold.css @@ -0,0 +1,28 @@ +.book .book-summary .chapter > .articles { + overflow: hidden; + max-height: 0px; +} + +.book .book-summary .chapter.expanded > .articles { + max-height: 9999px; +} + +.book .book-summary .exc-trigger { + position: absolute; + left: 12px; + top: 12px; +} + +.book .book-summary ul.summary li a, +.book .book-summary ul.summary li span { + padding-left: 30px; +} + +.book .book-summary .exc-trigger:before { + content: "\f105"; +} + +.book .book-summary .expanded > a .exc-trigger:before, +.book .book-summary .expanded > span .exc-trigger:before { + content: "\f107"; +} diff --git a/docs/assets/gitbook/gitbook-plugin-chapter-fold/chapter-fold.js b/docs/assets/gitbook/gitbook-plugin-chapter-fold/chapter-fold.js new file mode 100644 index 0000000..a80a921 --- /dev/null +++ b/docs/assets/gitbook/gitbook-plugin-chapter-fold/chapter-fold.js @@ -0,0 +1,67 @@ +require(['gitbook', 'jQuery'], function(gitbook, $) { + var TOGGLE_CLASSNAME = 'expanded', + CHAPTER = '.chapter', + ARTICLES = '.articles', + TRIGGER_TEMPLATE = '', + LS_NAMESPACE = 'expChapters'; + var init = function () { + // adding the trigger element to each ARTICLES parent and binding the event + var chapterLink = $(ARTICLES).parent(CHAPTER).children('a'); + chapterLink.append($(TRIGGER_TEMPLATE)); + chapterLink.on('click', function (e) { + e.preventDefault(); + //e.stopPropagation(); + toggle($(e.target).closest(CHAPTER)); + }); + + expand(lsItem()); + //expand current selected chapter with it's parents + collapse($(CHAPTER)); + var activeChapter = $(CHAPTER + '.active'); + expand(activeChapter); + expand(activeChapter.parents(CHAPTER)); + } + //on page.change will happend the function. + + var toggle = function ($chapter) { + if ($chapter.hasClass('expanded')) { + collapse($chapter); + } else { + expand($chapter); + //$chapter.addClass('active').siblings().removeClass('active'); + } + } + var collapse = function ($chapter) { + if ($chapter.length && $chapter.hasClass(TOGGLE_CLASSNAME)) { + $chapter.removeClass(TOGGLE_CLASSNAME); + lsItem($chapter); + } + } + var expand = function ($chapter) { + if ($chapter.length && !$chapter.hasClass(TOGGLE_CLASSNAME)) { + $chapter.addClass(TOGGLE_CLASSNAME); + lsItem($chapter); + } + } + var lsItem = function () { + var map = JSON.parse(localStorage.getItem(LS_NAMESPACE)) || {} + if (arguments.length) { + var $chapters = arguments[0]; + $chapters.each(function (index, element) { + var level = $(this).data('level'); + var value = $(this).hasClass(TOGGLE_CLASSNAME); + map[level] = value; + }) + localStorage.setItem(LS_NAMESPACE, JSON.stringify(map)); + } else { + return $(CHAPTER).map(function(index, element){ + if (map[$(this).data('level')]) { + return this; + } + }) + } + } + gitbook.events.bind('page.change', function() { + init() + }); +}); diff --git a/docs/assets/gitbook/gitbook-plugin-copy-code-button/toggle.js b/docs/assets/gitbook/gitbook-plugin-copy-code-button/toggle.js new file mode 100644 index 0000000..6d6c3fc --- /dev/null +++ b/docs/assets/gitbook/gitbook-plugin-copy-code-button/toggle.js @@ -0,0 +1,86 @@ +require(["gitbook", "jquery"], function (gitbook, $) { + function selectElementText(el) { + var range = document.createRange(); + range.selectNodeContents(el); + var selection = window.getSelection(); + selection.removeAllRanges(); + selection.addRange(range); + } + + function getSelectedText() { + var t = ''; + if (window.getSelection) { + t = window.getSelection(); + } else if (document.getSelection) { + t = document.getSelection(); + } else if (document.selection) { + t = document.selection.createRange().text; + } + return t; + } + + function copyToClipboard(text) { + if (window.clipboardData && window.clipboardData.setData) { + // IE specific code path to prevent textarea being shown while dialog is visible. + return clipboardData.setData("Text", text); + + } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { + var textarea = document.createElement("textarea"); + textarea.textContent = text; + textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in MS Edge. + document.body.appendChild(textarea); + textarea.select(); + try { + return document.execCommand("copy"); // Security exception may be thrown by some browsers. + } catch (ex) { + console.warn("Copy to clipboard failed.", ex); + return false; + } finally { + document.body.removeChild(textarea); + } + } + } + + function expand(chapter) { + chapter.show(); + if (chapter.parent().attr('class') != 'summary' + && chapter.parent().attr('class') != 'book-summary' + && chapter.length != 0 + ) { + expand(chapter.parent()); + } + } + + gitbook.events.bind("page.change", function () { + $("pre").each(function () { + $(this).css("position", "relative"); + + var $copyCodeButton = $(""); + $copyCodeButton.css({ "position": "absolute", "top": "5px", "right": "5px", "padding": "3px", "background-color": "#313E4E", "color": "white", "border-radius": "5px", "-moz-border-radius": "5px", "-webkit-border-radius": "5px", "border": "2px solid #CCCCCC" }); + $copyCodeButton.click(function () { + var $codeContainer = $(this).siblings("code"); + if ($codeContainer) { + selectElementText($codeContainer.get(0)); + var selectedText = getSelectedText(); + + var buttonNewText = ""; + if (copyToClipboard(selectedText) == true) { + buttonNewText = "Copied"; + selectElementText($codeContainer.get(0)); + } else { + buttonNewText = "Unable to copy"; + selectElementText($codeContainer.get(0)); + } + + $(this).text(buttonNewText); + var that = this; + setTimeout(function () { + $(that).text("Copy"); + }, 2000); + } + }); + + $(this).append($copyCodeButton); + }); + }); +}); diff --git a/docs/assets/gitbook/gitbook-plugin-fontsettings/fontsettings.js b/docs/assets/gitbook/gitbook-plugin-fontsettings/fontsettings.js new file mode 100644 index 0000000..cd04fa7 --- /dev/null +++ b/docs/assets/gitbook/gitbook-plugin-fontsettings/fontsettings.js @@ -0,0 +1,249 @@ +require(['gitbook', 'jquery'], function(gitbook, $) { + // Configuration + var MAX_SIZE = 4, + MIN_SIZE = 0, + BUTTON_ID; + + // Current fontsettings state + var fontState; + + // Default themes + var THEMES = [ + { + config: 'white', + text: 'White', + id: 0 + }, + { + config: 'sepia', + text: 'Sepia', + id: 1 + }, + { + config: 'night', + text: 'Night', + id: 2 + } + ]; + + // Default font families + var FAMILIES = [ + { + config: 'serif', + text: 'Serif', + id: 0 + }, + { + config: 'sans', + text: 'Sans', + id: 1 + } + ]; + + // Return configured themes + function getThemes() { + return THEMES; + } + + // Modify configured themes + function setThemes(themes) { + THEMES = themes; + updateButtons(); + } + + // Return configured font families + function getFamilies() { + return FAMILIES; + } + + // Modify configured font families + function setFamilies(families) { + FAMILIES = families; + updateButtons(); + } + + // Save current font settings + function saveFontSettings() { + gitbook.storage.set('fontState', fontState); + update(); + } + + // Increase font size + function enlargeFontSize(e) { + e.preventDefault(); + if (fontState.size >= MAX_SIZE) return; + + fontState.size++; + saveFontSettings(); + } + + // Decrease font size + function reduceFontSize(e) { + e.preventDefault(); + if (fontState.size <= MIN_SIZE) return; + + fontState.size--; + saveFontSettings(); + } + + // Change font family + function changeFontFamily(configName, e) { + if (e && e instanceof Event) { + e.preventDefault(); + } + + var familyId = getFontFamilyId(configName); + fontState.family = familyId; + saveFontSettings(); + } + + // Change type of color theme + function changeColorTheme(configName, e) { + if (e && e instanceof Event) { + e.preventDefault(); + } + + var $book = gitbook.state.$book; + var $header = $('.book-body > .book-header'); + + // Remove currently applied color theme + if (fontState.theme !== 0) { + $book.removeClass('color-theme-'+fontState.theme); + if ($header.length !== 0) { + $header.removeClass('color-theme-'+fontState.theme); + } + } + + // Set new color theme + var themeId = getThemeId(configName); + fontState.theme = themeId; + if (fontState.theme !== 0) { + $book.addClass('color-theme-'+fontState.theme); + if ($header.length !== 0) { + $header.addClass('color-theme-'+fontState.theme); + } + } + + saveFontSettings(); + } + + // Return the correct id for a font-family config key + // Default to first font-family + function getFontFamilyId(configName) { + // Search for plugin configured font family + var configFamily = $.grep(FAMILIES, function(family) { + return family.config == configName; + })[0]; + // Fallback to default font family + return (!!configFamily)? configFamily.id : 0; + } + + // Return the correct id for a theme config key + // Default to first theme + function getThemeId(configName) { + // Search for plugin configured theme + var configTheme = $.grep(THEMES, function(theme) { + return theme.config == configName; + })[0]; + // Fallback to default theme + return (!!configTheme)? configTheme.id : 0; + } + + function update() { + var $book = gitbook.state.$book; + + $('.font-settings .font-family-list li').removeClass('active'); + $('.font-settings .font-family-list li:nth-child('+(fontState.family+1)+')').addClass('active'); + + $book[0].className = $book[0].className.replace(/\bfont-\S+/g, ''); + $book.addClass('font-size-'+fontState.size); + $book.addClass('font-family-'+fontState.family); + + if(fontState.theme !== 0) { + $book[0].className = $book[0].className.replace(/\bcolor-theme-\S+/g, ''); + $book.addClass('color-theme-'+fontState.theme); + } + } + + function init(config) { + // Search for plugin configured font family + var configFamily = getFontFamilyId(config.family), + configTheme = getThemeId(config.theme); + + // Instantiate font state object + fontState = gitbook.storage.get('fontState', { + size: config.size || 2, + family: configFamily, + theme: configTheme + }); + + update(); + } + + function updateButtons() { + // Remove existing fontsettings buttons + if (!!BUTTON_ID) { + gitbook.toolbar.removeButton(BUTTON_ID); + } + + // Create buttons in toolbar + // BUTTON_ID = gitbook.toolbar.createButton({ + // icon: 'fa fa-font', + // label: 'Font Settings', + // className: 'font-settings', + // dropdown: [ + // [ + // { + // text: 'A', + // className: 'font-reduce', + // onClick: reduceFontSize + // }, + // { + // text: 'A', + // className: 'font-enlarge', + // onClick: enlargeFontSize + // } + // ], + // $.map(FAMILIES, function(family) { + // family.onClick = function(e) { + // return changeFontFamily(family.config, e); + // }; + // + // return family; + // }), + // $.map(THEMES, function(theme) { + // theme.onClick = function(e) { + // return changeColorTheme(theme.config, e); + // }; + // + // return theme; + // }) + // ] + // }); + } + + // Init configuration at start + gitbook.events.bind('start', function(e, config) { + var opts = config.fontsettings; + + // Generate buttons at start + updateButtons(); + + // Init current settings + init(opts); + }); + + // Expose API + gitbook.fontsettings = { + enlargeFontSize: enlargeFontSize, + reduceFontSize: reduceFontSize, + setTheme: changeColorTheme, + setFamily: changeFontFamily, + getThemes: getThemes, + setThemes: setThemes, + getFamilies: getFamilies, + setFamilies: setFamilies + }; +}); + + diff --git a/docs/assets/gitbook/gitbook-plugin-fontsettings/website.css b/docs/assets/gitbook/gitbook-plugin-fontsettings/website.css new file mode 100644 index 0000000..bdefdc3 --- /dev/null +++ b/docs/assets/gitbook/gitbook-plugin-fontsettings/website.css @@ -0,0 +1,291 @@ +/* + * Theme 1 + */ +.color-theme-1 .dropdown-menu { + background-color: #111111; + border-color: #7e888b; +} +.color-theme-1 .dropdown-menu .dropdown-caret .caret-inner { + border-bottom: 9px solid #111111; +} +.color-theme-1 .dropdown-menu .buttons { + border-color: #7e888b; +} +.color-theme-1 .dropdown-menu .button { + color: #afa790; +} +.color-theme-1 .dropdown-menu .button:hover { + color: #73553c; +} +/* + * Theme 2 + */ +.color-theme-2 .dropdown-menu { + background-color: #2d3143; + border-color: #272a3a; +} +.color-theme-2 .dropdown-menu .dropdown-caret .caret-inner { + border-bottom: 9px solid #2d3143; +} +.color-theme-2 .dropdown-menu .buttons { + border-color: #272a3a; +} +.color-theme-2 .dropdown-menu .button { + color: #62677f; +} +.color-theme-2 .dropdown-menu .button:hover { + color: #f4f4f5; +} +.book .book-header .font-settings .font-enlarge { + line-height: 30px; + font-size: 1.4em; +} +.book .book-header .font-settings .font-reduce { + line-height: 30px; + font-size: 1em; +} +.book.color-theme-1 .book-body { + color: #704214; + background: #f3eacb; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section { + background: #f3eacb; +} +.book.color-theme-2 .book-body { + color: #bdcadb; + background: #1c1f2b; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section { + background: #1c1f2b; +} +.book.font-size-0 .book-body .page-inner section { + xfont-size: 1.2rem; +} +.book.font-size-1 .book-body .page-inner section { + xfont-size: 1.4rem; +} +.book.font-size-2 .book-body .page-inner section { + xfont-size: 1.6rem; +} +.book.font-size-3 .book-body .page-inner section { + font-size: 2.2rem; +} +.book.font-size-4 .book-body .page-inner section { + font-size: 4rem; +} +.book.font-family-0 { + xfont-family: Georgia, serif; +} +.book.font-family-1 { + xfont-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal { + color: #704214; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal a { + color: inherit; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h3, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h4, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h5, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 { + color: inherit; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2 { + border-color: inherit; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 { + color: inherit; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal hr { + background-color: inherit; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal blockquote { + border-color: inherit; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code { + background: #fdf6e3; + color: #657b83; + border-color: #f8df9c; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal .highlight { + background-color: inherit; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table th, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table td { + border-color: #f5d06c; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr { + color: inherit; + background-color: #fdf6e3; + border-color: #444444; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { + background-color: #fbeecb; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal { + color: #bdcadb; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal a { + color: #3eb1d0; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h3, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h4, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h5, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 { + color: #fffffa; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2 { + border-color: #373b4e; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 { + color: #373b4e; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal hr { + background-color: #373b4e; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal blockquote { + border-color: #373b4e; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code { + color: #9dbed8; + background: #2d3143; + border-color: #2d3143; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal .highlight { + background-color: #282a39; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table th, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table td { + border-color: #3b3f54; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr { + color: #b6c2d2; + background-color: #2d3143; + border-color: #3b3f54; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { + background-color: #35394b; +} +.book.color-theme-1 .book-header { + color: #afa790; + background: transparent; +} +.book.color-theme-1 .book-header .btn { + color: #afa790; +} +.book.color-theme-1 .book-header .btn:hover { + color: #73553c; + background: none; +} +.book.color-theme-1 .book-header h1 { + color: #704214; +} +.book.color-theme-2 .book-header { + color: #7e888b; + background: transparent; +} +.book.color-theme-2 .book-header .btn { + color: #3b3f54; +} +.book.color-theme-2 .book-header .btn:hover { + color: #fffff5; + background: none; +} +.book.color-theme-2 .book-header h1 { + color: #bdcadb; +} +.book.color-theme-1 .book-body .navigation { + color: #afa790; +} +.book.color-theme-1 .book-body .navigation:hover { + color: #73553c; +} +.book.color-theme-2 .book-body .navigation { + color: #383f52; +} +.book.color-theme-2 .book-body .navigation:hover { + color: #fffff5; +} +/* + * Theme 1 + */ +.book.color-theme-1 .book-summary { + color: #afa790; + background: #111111; + border-right: 1px solid rgba(0, 0, 0, 0.07); +} +.book.color-theme-1 .book-summary .book-search { + background: transparent; +} +.book.color-theme-1 .book-summary .book-search input, +.book.color-theme-1 .book-summary .book-search input:focus { + border: 1px solid transparent; +} +.book.color-theme-1 .book-summary ul.summary li.divider { + background: #7e888b; + box-shadow: none; +} +.book.color-theme-1 .book-summary ul.summary li i.fa-check { + color: #33cc33; +} +.book.color-theme-1 .book-summary ul.summary li.done > a { + color: #877f6a; +} +.book.color-theme-1 .book-summary ul.summary li a, +.book.color-theme-1 .book-summary ul.summary li span { + color: #877f6a; + background: transparent; + font-weight: normal; +} +.book.color-theme-1 .book-summary ul.summary li.active > a, +.book.color-theme-1 .book-summary ul.summary li a:hover { + color: #704214; + background: transparent; + font-weight: normal; +} +/* + * Theme 2 + */ +.book.color-theme-2 .book-summary { + color: #bcc1d2; + background: #2d3143; + border-right: none; +} +.book.color-theme-2 .book-summary .book-search { + background: transparent; +} +.book.color-theme-2 .book-summary .book-search input, +.book.color-theme-2 .book-summary .book-search input:focus { + border: 1px solid transparent; +} +.book.color-theme-2 .book-summary ul.summary li.divider { + background: #272a3a; + box-shadow: none; +} +.book.color-theme-2 .book-summary ul.summary li i.fa-check { + color: #33cc33; +} +.book.color-theme-2 .book-summary ul.summary li.done > a { + color: #62687f; +} +.book.color-theme-2 .book-summary ul.summary li a, +.book.color-theme-2 .book-summary ul.summary li span { + color: #c1c6d7; + background: transparent; + font-weight: 600; +} +.book.color-theme-2 .book-summary ul.summary li.active > a, +.book.color-theme-2 .book-summary ul.summary li a:hover { + color: #f4f4f5; + background: #252737; + font-weight: 600; +} diff --git a/docs/assets/gitbook/gitbook-plugin-lunr/lunr.min.js b/docs/assets/gitbook/gitbook-plugin-lunr/lunr.min.js new file mode 100644 index 0000000..6aa6bc7 --- /dev/null +++ b/docs/assets/gitbook/gitbook-plugin-lunr/lunr.min.js @@ -0,0 +1,7 @@ +/** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.5.12 + * Copyright (C) 2015 Oliver Nightingale + * MIT Licensed + * @license + */ +!function(){var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.5.12",t.utils={},t.utils.warn=function(t){return function(e){t.console&&console.warn&&console.warn(e)}}(this),t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=t;if("function"!=typeof e)throw new TypeError("last argument must be a function");n.forEach(function(t){this.hasHandler(t)||(this.events[t]=[]),this.events[t].push(e)},this)},t.EventEmitter.prototype.removeListener=function(t,e){if(this.hasHandler(t)){var n=this.events[t].indexOf(e);this.events[t].splice(n,1),this.events[t].length||delete this.events[t]}},t.EventEmitter.prototype.emit=function(t){if(this.hasHandler(t)){var e=Array.prototype.slice.call(arguments,1);this.events[t].forEach(function(t){t.apply(void 0,e)})}},t.EventEmitter.prototype.hasHandler=function(t){return t in this.events},t.tokenizer=function(t){return arguments.length&&null!=t&&void 0!=t?Array.isArray(t)?t.map(function(t){return t.toLowerCase()}):t.toString().trim().toLowerCase().split(/[\s\-]+/):[]},t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.registeredFunctions[e];if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(e);if(-1==i)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(e);if(-1==i)throw new Error("Cannot find existingFn");this._stack.splice(i,0,n)},t.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);-1!=e&&this._stack.splice(e,1)},t.Pipeline.prototype.run=function(t){for(var e=[],n=t.length,i=this._stack.length,o=0;n>o;o++){for(var r=t[o],s=0;i>s&&(r=this._stack[s](r,o,t),void 0!==r);s++);void 0!==r&&e.push(r)}return e},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},t.Vector.Node=function(t,e,n){this.idx=t,this.val=e,this.next=n},t.Vector.prototype.insert=function(e,n){this._magnitude=void 0;var i=this.list;if(!i)return this.list=new t.Vector.Node(e,n,i),this.length++;if(en.idx?n=n.next:(i+=e.val*n.val,e=e.next,n=n.next);return i},t.Vector.prototype.similarity=function(t){return this.dot(t)/(this.magnitude()*t.magnitude())},t.SortedSet=function(){this.length=0,this.elements=[]},t.SortedSet.load=function(t){var e=new this;return e.elements=t,e.length=t.length,e},t.SortedSet.prototype.add=function(){var t,e;for(t=0;t1;){if(r===t)return o;t>r&&(e=o),r>t&&(n=o),i=n-e,o=e+Math.floor(i/2),r=this.elements[o]}return r===t?o:-1},t.SortedSet.prototype.locationFor=function(t){for(var e=0,n=this.elements.length,i=n-e,o=e+Math.floor(i/2),r=this.elements[o];i>1;)t>r&&(e=o),r>t&&(n=o),i=n-e,o=e+Math.floor(i/2),r=this.elements[o];return r>t?o:t>r?o+1:void 0},t.SortedSet.prototype.intersect=function(e){for(var n=new t.SortedSet,i=0,o=0,r=this.length,s=e.length,a=this.elements,h=e.elements;;){if(i>r-1||o>s-1)break;a[i]!==h[o]?a[i]h[o]&&o++:(n.add(a[i]),i++,o++)}return n},t.SortedSet.prototype.clone=function(){var e=new t.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},t.SortedSet.prototype.union=function(t){var e,n,i;return this.length>=t.length?(e=this,n=t):(e=t,n=this),i=e.clone(),i.add.apply(i,n.toArray()),i},t.SortedSet.prototype.toJSON=function(){return this.toArray()},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.Store,this.tokenStore=new t.TokenStore,this.corpusTokens=new t.SortedSet,this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var t=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,t)},t.Index.prototype.off=function(t,e){return this.eventEmitter.removeListener(t,e)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;return n._fields=e.fields,n._ref=e.ref,n.documentStore=t.Store.load(e.documentStore),n.tokenStore=t.TokenStore.load(e.tokenStore),n.corpusTokens=t.SortedSet.load(e.corpusTokens),n.pipeline=t.Pipeline.load(e.pipeline),n},t.Index.prototype.field=function(t,e){var e=e||{},n={name:t,boost:e.boost||1};return this._fields.push(n),this},t.Index.prototype.ref=function(t){return this._ref=t,this},t.Index.prototype.add=function(e,n){var i={},o=new t.SortedSet,r=e[this._ref],n=void 0===n?!0:n;this._fields.forEach(function(n){var r=this.pipeline.run(t.tokenizer(e[n.name]));i[n.name]=r,t.SortedSet.prototype.add.apply(o,r)},this),this.documentStore.set(r,o),t.SortedSet.prototype.add.apply(this.corpusTokens,o.toArray());for(var s=0;s0&&(i=1+Math.log(this.documentStore.length/n)),this._idfCache[e]=i},t.Index.prototype.search=function(e){var n=this.pipeline.run(t.tokenizer(e)),i=new t.Vector,o=[],r=this._fields.reduce(function(t,e){return t+e.boost},0),s=n.some(function(t){return this.tokenStore.has(t)},this);if(!s)return[];n.forEach(function(e,n,s){var a=1/s.length*this._fields.length*r,h=this,l=this.tokenStore.expand(e).reduce(function(n,o){var r=h.corpusTokens.indexOf(o),s=h.idf(o),l=1,u=new t.SortedSet;if(o!==e){var c=Math.max(3,o.length-e.length);l=1/Math.log(c)}return r>-1&&i.insert(r,a*s*l),Object.keys(h.tokenStore.get(o)).forEach(function(t){u.add(t)}),n.union(u)},new t.SortedSet);o.push(l)},this);var a=o.reduce(function(t,e){return t.intersect(e)});return a.map(function(t){return{ref:t,score:i.similarity(this.documentVector(t))}},this).sort(function(t,e){return e.score-t.score})},t.Index.prototype.documentVector=function(e){for(var n=this.documentStore.get(e),i=n.length,o=new t.Vector,r=0;i>r;r++){var s=n.elements[r],a=this.tokenStore.get(s)[e].tf,h=this.idf(s);o.insert(this.corpusTokens.indexOf(s),a*h)}return o},t.Index.prototype.toJSON=function(){return{version:t.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},t.Index.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},t.Store=function(){this.store={},this.length=0},t.Store.load=function(e){var n=new this;return n.length=e.length,n.store=Object.keys(e.store).reduce(function(n,i){return n[i]=t.SortedSet.load(e.store[i]),n},{}),n},t.Store.prototype.set=function(t,e){this.has(t)||this.length++,this.store[t]=e},t.Store.prototype.get=function(t){return this.store[t]},t.Store.prototype.has=function(t){return t in this.store},t.Store.prototype.remove=function(t){this.has(t)&&(delete this.store[t],this.length--)},t.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},t.stemmer=function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},e={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",i="[aeiouy]",o=n+"[^aeiouy]*",r=i+"[aeiou]*",s="^("+o+")?"+r+o,a="^("+o+")?"+r+o+"("+r+")?$",h="^("+o+")?"+r+o+r+o,l="^("+o+")?"+i,u=new RegExp(s),c=new RegExp(h),f=new RegExp(a),d=new RegExp(l),p=/^(.+?)(ss|i)es$/,m=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,y=/^(.+?)(ed|ing)$/,g=/.$/,S=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\1$"),x=new RegExp("^"+o+i+"[^aeiouwxy]$"),k=/^(.+?[^aeiou])y$/,b=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,E=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,_=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,F=/^(.+?)(s|t)(ion)$/,O=/^(.+?)e$/,P=/ll$/,N=new RegExp("^"+o+i+"[^aeiouwxy]$"),T=function(n){var i,o,r,s,a,h,l;if(n.length<3)return n;if(r=n.substr(0,1),"y"==r&&(n=r.toUpperCase()+n.substr(1)),s=p,a=m,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=v,a=y,s.test(n)){var T=s.exec(n);s=u,s.test(T[1])&&(s=g,n=n.replace(s,""))}else if(a.test(n)){var T=a.exec(n);i=T[1],a=d,a.test(i)&&(n=i,a=S,h=w,l=x,a.test(n)?n+="e":h.test(n)?(s=g,n=n.replace(s,"")):l.test(n)&&(n+="e"))}if(s=k,s.test(n)){var T=s.exec(n);i=T[1],n=i+"i"}if(s=b,s.test(n)){var T=s.exec(n);i=T[1],o=T[2],s=u,s.test(i)&&(n=i+t[o])}if(s=E,s.test(n)){var T=s.exec(n);i=T[1],o=T[2],s=u,s.test(i)&&(n=i+e[o])}if(s=_,a=F,s.test(n)){var T=s.exec(n);i=T[1],s=c,s.test(i)&&(n=i)}else if(a.test(n)){var T=a.exec(n);i=T[1]+T[2],a=c,a.test(i)&&(n=i)}if(s=O,s.test(n)){var T=s.exec(n);i=T[1],s=c,a=f,h=N,(s.test(i)||a.test(i)&&!h.test(i))&&(n=i)}return s=P,a=c,s.test(n)&&a.test(n)&&(s=g,n=n.replace(s,"")),"y"==r&&(n=r.toLowerCase()+n.substr(1)),n};return T}(),t.Pipeline.registerFunction(t.stemmer,"stemmer"),t.stopWordFilter=function(e){return e&&t.stopWordFilter.stopWords[e]!==e?e:void 0},t.stopWordFilter.stopWords={a:"a",able:"able",about:"about",across:"across",after:"after",all:"all",almost:"almost",also:"also",am:"am",among:"among",an:"an",and:"and",any:"any",are:"are",as:"as",at:"at",be:"be",because:"because",been:"been",but:"but",by:"by",can:"can",cannot:"cannot",could:"could",dear:"dear",did:"did","do":"do",does:"does",either:"either","else":"else",ever:"ever",every:"every","for":"for",from:"from",get:"get",got:"got",had:"had",has:"has",have:"have",he:"he",her:"her",hers:"hers",him:"him",his:"his",how:"how",however:"however",i:"i","if":"if","in":"in",into:"into",is:"is",it:"it",its:"its",just:"just",least:"least",let:"let",like:"like",likely:"likely",may:"may",me:"me",might:"might",most:"most",must:"must",my:"my",neither:"neither",no:"no",nor:"nor",not:"not",of:"of",off:"off",often:"often",on:"on",only:"only",or:"or",other:"other",our:"our",own:"own",rather:"rather",said:"said",say:"say",says:"says",she:"she",should:"should",since:"since",so:"so",some:"some",than:"than",that:"that",the:"the",their:"their",them:"them",then:"then",there:"there",these:"these",they:"they","this":"this",tis:"tis",to:"to",too:"too",twas:"twas",us:"us",wants:"wants",was:"was",we:"we",were:"were",what:"what",when:"when",where:"where",which:"which","while":"while",who:"who",whom:"whom",why:"why",will:"will","with":"with",would:"would",yet:"yet",you:"you",your:"your"},t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter"),t.trimmer=function(t){var e=t.replace(/^\W+/,"").replace(/\W+$/,"");return""===e?void 0:e},t.Pipeline.registerFunction(t.trimmer,"trimmer"),t.TokenStore=function(){this.root={docs:{}},this.length=0},t.TokenStore.load=function(t){var e=new this;return e.root=t.root,e.length=t.length,e},t.TokenStore.prototype.add=function(t,e,n){var n=n||this.root,i=t[0],o=t.slice(1);return i in n||(n[i]={docs:{}}),0===o.length?(n[i].docs[e.ref]=e,void(this.length+=1)):this.add(o,e,n[i])},t.TokenStore.prototype.has=function(t){if(!t)return!1;for(var e=this.root,n=0;n-1||d.indexOf("Trident")>-1)&&(this.ie=!0)}return _createClass(c,[{key:"log",value:function a(b){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"debug",a=this.opt.log;this.opt.debug&&"object"===("undefined"==typeof a?"undefined":_typeof(a))&&"function"==typeof a[c]&&a[c]("mark.js: "+b)}},{key:"escapeStr",value:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createRegExp",value:function(a){return a=this.escapeStr(a),Object.keys(this.opt.synonyms).length&&(a=this.createSynonymsRegExp(a)),this.opt.ignoreJoiners&&(a=this.setupIgnoreJoinersRegExp(a)),this.opt.diacritics&&(a=this.createDiacriticsRegExp(a)),a=this.createMergedBlanksRegExp(a),this.opt.ignoreJoiners&&(a=this.createIgnoreJoinersRegExp(a)),a=this.createAccuracyRegExp(a)}},{key:"createSynonymsRegExp",value:function(a){var b=this.opt.synonyms,c=this.opt.caseSensitive?"":"i";for(var d in b)if(b.hasOwnProperty(d)){var e=b[d],f=this.escapeStr(d),g=this.escapeStr(e);a=a.replace(new RegExp("("+f+"|"+g+")","gm"+c),"("+f+"|"+g+")")}return a}},{key:"setupIgnoreJoinersRegExp",value:function(a){return a.replace(/[^(|)\\]/g,function(a,b,c){var d=c.charAt(b+1);return/[(|)\\]/.test(d)||""===d?a:a+"\0"})}},{key:"createIgnoreJoinersRegExp",value:function(a){return a.split("\0").join("[\\u00ad|\\u200b|\\u200c|\\u200d]?")}},{key:"createDiacriticsRegExp",value:function(a){var b=this.opt.caseSensitive?"":"i",c=this.opt.caseSensitive?["aàáâãäåāąă","AÀÁÂÃÄÅĀĄĂ","cçćč","CÇĆČ","dđď","DĐĎ","eèéêëěēę","EÈÉÊËĚĒĘ","iìíîïī","IÌÍÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóôõöøō","OÒÓÔÕÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúûüůū","UÙÚÛÜŮŪ","yÿý","YŸÝ","zžżź","ZŽŻŹ"]:["aÀÁÂÃÄÅàáâãäåĀāąĄăĂ","cÇçćĆčČ","dđĐďĎ","eÈÉÊËèéêëěĚĒēęĘ","iÌÍÎÏìíîïĪī","lłŁ","nÑñňŇńŃ","oÒÓÔÕÖØòóôõöøŌō","rřŘ","sŠšśŚșȘşŞ","tťŤțȚţŢ","uÙÚÛÜùúûüůŮŪū","yŸÿýÝ","zŽžżŻźŹ"],d=[];return a.split("").forEach(function(e){c.every(function(c){if(c.indexOf(e)!==-1){if(d.indexOf(c)>-1)return!1;a=a.replace(new RegExp("["+c+"]","gm"+b),"["+c+"]"),d.push(c)}return!0})}),a}},{key:"createMergedBlanksRegExp",value:function(a){return a.replace(/[\s]+/gim,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(a){var b=this,c=this.opt.accuracy,d="string"==typeof c?c:c.value,e="string"==typeof c?[]:c.limiters,f="";switch(e.forEach(function(a){f+="|"+b.escapeStr(a)}),d){case"partially":default:return"()("+a+")";case"complementary":return"()([^\\s"+f+"]*"+a+"[^\\s"+f+"]*)";case"exactly":return"(^|\\s"+f+")("+a+")(?=$|\\s"+f+")"}}},{key:"getSeparatedKeywords",value:function(a){var b=this,c=[];return a.forEach(function(a){b.opt.separateWordSearch?a.split(" ").forEach(function(a){a.trim()&&c.indexOf(a)===-1&&c.push(a)}):a.trim()&&c.indexOf(a)===-1&&c.push(a)}),{keywords:c.sort(function(a,b){return b.length-a.length}),length:c.length}}},{key:"getTextNodes",value:function(a){var b=this,c="",d=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,function(a){d.push({start:c.length,end:(c+=a.textContent).length,node:a})},function(a){return b.matchesExclude(a.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},function(){a({value:c,nodes:d})})}},{key:"matchesExclude",value:function(a){return e.matches(a,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(a,c,d){var e=this.opt.element?this.opt.element:"mark",f=a.splitText(c),g=f.splitText(d-c),h=b.createElement(e);return h.setAttribute("data-markjs","true"),this.opt.className&&h.setAttribute("class",this.opt.className),h.textContent=f.textContent,f.parentNode.replaceChild(h,f),g}},{key:"wrapRangeInMappedTextNode",value:function(a,b,c,d,e){var f=this;a.nodes.every(function(g,h){var i=a.nodes[h+1];if("undefined"==typeof i||i.start>b){var j=function(){if(!d(g.node))return{v:!1};var i=b-g.start,j=(c>g.end?g.end:c)-g.start,k=a.value.substr(0,g.start),l=a.value.substr(j+g.start);return g.node=f.wrapRangeInTextNode(g.node,i,j),a.value=k+l,a.nodes.forEach(function(b,c){c>=h&&(a.nodes[c].start>0&&c!==h&&(a.nodes[c].start-=j),a.nodes[c].end-=j)}),c-=j,e(g.node.previousSibling,g.start),c>g.end?void(b=g.end):{v:!1}}();if("object"===("undefined"==typeof j?"undefined":_typeof(j)))return j.v}return!0})}},{key:"wrapMatches",value:function(a,b,c,d,e){var f=this,g=0===b?0:b+1;this.getTextNodes(function(b){b.nodes.forEach(function(b){b=b.node;for(var e=void 0;null!==(e=a.exec(b.textContent))&&""!==e[g];)if(c(e[g],b)){var h=e.index;if(0!==g)for(var i=1;i1&&void 0!==arguments[1])||arguments[1],d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;_classCallCheck(this,a),this.ctx=b,this.iframes=c,this.exclude=d,this.iframesTimeout=e}return _createClass(a,[{key:"getContexts",value:function(){var a=void 0,c=[];return a="undefined"!=typeof this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(b.querySelectorAll(this.ctx)):[this.ctx]:[],a.forEach(function(a){var b=c.filter(function(b){return b.contains(a)}).length>0;c.indexOf(a)!==-1||b||c.push(a)}),c}},{key:"getIframeContents",value:function(a,b){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},d=void 0;try{var e=a.contentWindow;if(d=e.document,!e||!d)throw new Error("iframe inaccessible")}catch(a){c()}d&&b(d)}},{key:"isIframeBlank",value:function(a){var b="about:blank",c=a.getAttribute("src").trim(),d=a.contentWindow.location.href;return d===b&&c!==b&&c}},{key:"observeIframeLoad",value:function(a,b,c){var d=this,e=!1,f=null,g=function g(){if(!e){e=!0,clearTimeout(f);try{d.isIframeBlank(a)||(a.removeEventListener("load",g),d.getIframeContents(a,b,c))}catch(a){c()}}};a.addEventListener("load",g),f=setTimeout(g,this.iframesTimeout)}},{key:"onIframeReady",value:function(a,b,c){try{"complete"===a.contentWindow.document.readyState?this.isIframeBlank(a)?this.observeIframeLoad(a,b,c):this.getIframeContents(a,b,c):this.observeIframeLoad(a,b,c)}catch(a){c()}}},{key:"waitForIframes",value:function(a,b){var c=this,d=0;this.forEachIframe(a,function(){return!0},function(a){d++,c.waitForIframes(a.querySelector("html"),function(){--d||b()})},function(a){a||b()})}},{key:"forEachIframe",value:function(b,c,d){var e=this,f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},g=b.querySelectorAll("iframe"),h=g.length,i=0;g=Array.prototype.slice.call(g);var j=function(){--h<=0&&f(i)};h||j(),g.forEach(function(b){a.matches(b,e.exclude)?j():e.onIframeReady(b,function(a){c(b)&&(i++,d(a)),j()},j)})}},{key:"createIterator",value:function(a,c,d){return b.createNodeIterator(a,c,d,!1)}},{key:"createInstanceOnIframe",value:function(b){return new a(b.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(a,b,c){var d=a.compareDocumentPosition(c),e=Node.DOCUMENT_POSITION_PRECEDING;if(d&e){if(null===b)return!0;var f=b.compareDocumentPosition(c),g=Node.DOCUMENT_POSITION_FOLLOWING;if(f&g)return!0}return!1}},{key:"getIteratorNode",value:function(a){var b=a.previousNode(),c=void 0;return c=null===b?a.nextNode():a.nextNode()&&a.nextNode(),{prevNode:b,node:c}}},{key:"checkIframeFilter",value:function(a,b,c,d){var e=!1,f=!1;return d.forEach(function(a,b){a.val===c&&(e=b,f=a.handled)}),this.compareNodeIframe(a,b,c)?(e!==!1||f?e===!1||f||(d[e].handled=!0):d.push({val:c,handled:!0}),!0):(e===!1&&d.push({val:c,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(a,b,c,d){var e=this;a.forEach(function(a){a.handled||e.getIframeContents(a.val,function(a){e.createInstanceOnIframe(a).forEachNode(b,c,d)})})}},{key:"iterateThroughNodes",value:function(a,b,c,d,e){for(var f=this,g=this.createIterator(b,a,d),h=[],i=[],j=void 0,k=void 0,l=function(){var a=f.getIteratorNode(g);return k=a.prevNode,j=a.node};l();)this.iframes&&this.forEachIframe(b,function(a){return f.checkIframeFilter(j,k,a,h)},function(b){f.createInstanceOnIframe(b).forEachNode(a,c,d)}),i.push(j);i.forEach(function(a){c(a)}),this.iframes&&this.handleOpenIframes(h,a,c,d),e()}},{key:"forEachNode",value:function(a,b,c){var d=this,e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},f=this.getContexts(),g=f.length;g||e(),f.forEach(function(f){var h=function(){d.iterateThroughNodes(a,f,b,c,function(){--g<=0&&e()})};d.iframes?d.waitForIframes(f,h):h()})}}],[{key:"matches",value:function(a,b){var c="string"==typeof b?[b]:b,d=a.matches||a.matchesSelector||a.msMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.webkitMatchesSelector;if(d){var e=!1;return c.every(function(b){return!d.call(a,b)||(e=!0,!1)}),e}return!1}}]),a}();return c.fn.mark=function(a,b){return new d(this.get()).mark(a,b),this},c.fn.markRegExp=function(a,b){return new d(this.get()).markRegExp(a,b),this},c.fn.unmark=function(a){return new d(this.get()).unmark(a),this},c},window,document); \ No newline at end of file diff --git a/docs/assets/gitbook/gitbook-plugin-search-pro/search.css b/docs/assets/gitbook/gitbook-plugin-search-pro/search.css new file mode 100644 index 0000000..22fa24f --- /dev/null +++ b/docs/assets/gitbook/gitbook-plugin-search-pro/search.css @@ -0,0 +1,41 @@ +/* + This CSS only styled the search results section, not the search input + It defines the basic interraction to hide content when displaying results, etc +*/ + #book-search-input { + background: #ffffff; + } + #book-search-results .search-results { + display: none; + } + #book-search-results .search-results ul.search-results-list { + list-style-type: none; + padding-left: 0; + } + #book-search-results .search-results ul.search-results-list li { + margin-bottom: 1.5rem; + padding-bottom: 0.5rem; + /* Highlight results */ + } + #book-search-results .search-results ul.search-results-list li p em { + background-color: rgba(255, 220, 0, 0.4); + font-style: normal; + } + #book-search-results .search-results .no-results { + display: none; + } + #book-search-results.open .search-results { + display: block; + } + #book-search-results.open .search-noresults { + display: none; + } + #book-search-results.no-results .search-results .has-results { + display: none; + } + #book-search-results.no-results .search-results .no-results { + display: block; + } + #book-search-results span.search-highlight-keyword { + background: #ff0; + } diff --git a/docs/assets/gitbook/gitbook-plugin-search-pro/search.js b/docs/assets/gitbook/gitbook-plugin-search-pro/search.js new file mode 100644 index 0000000..4c6f616 --- /dev/null +++ b/docs/assets/gitbook/gitbook-plugin-search-pro/search.js @@ -0,0 +1,280 @@ +require([ + 'gitbook', + 'jquery' +], function(gitbook, $) { + var MAX_DESCRIPTION_SIZE = 500; + var state = gitbook.state; + var INDEX_DATA = {}; + var usePushState = (typeof history.pushState !== 'undefined'); + + // DOM Elements + var $body = $('body'); + var $bookSearchResults; + var $searchList; + var $searchTitle; + var $searchResultsCount; + var $searchQuery; + + // Throttle search + function throttle(fn, wait) { + var timeout; + + return function() { + var ctx = this, + args = arguments; + if (!timeout) { + timeout = setTimeout(function() { + timeout = null; + fn.apply(ctx, args); + }, wait); + } + }; + } + + function displayResults(res) { + $bookSearchResults = $('#book-search-results'); + $searchList = $bookSearchResults.find('.search-results-list'); + $searchTitle = $bookSearchResults.find('.search-results-title'); + $searchResultsCount = $searchTitle.find('.search-results-count'); + $searchQuery = $searchTitle.find('.search-query'); + + $bookSearchResults.addClass('open'); + + var noResults = res.count == 0; + $bookSearchResults.toggleClass('no-results', noResults); + + // Clear old results + $searchList.empty(); + + // Display title for research + $searchResultsCount.text(res.count); + $searchQuery.text(res.query); + + // Create an
  • element for each result + res.results.forEach(function(item) { + var $li = $('
  • ', { + 'class': 'search-results-item' + }); + + var $title = $('

    '); + + var $link = $('', { + 'href': item.url + '?h=' + encodeURIComponent(res.query), + 'text': item.title, + 'data-is-search': 1 + }); + + if ($link[0].href.split('?')[0] === location.href.split('?')[0]) { + $link[0].setAttribute('data-need-reload', 1); + } + + var content = item.body.trim(); + if (content.length > MAX_DESCRIPTION_SIZE) { + content = content + '...'; + } + var $content = $('

    ').html(content); + + $link.appendTo($title); + $title.appendTo($li); + $content.appendTo($li); + $li.appendTo($searchList); + }); + $('.body-inner').scrollTop(0); + } + + function escapeReg(keyword) { + //escape regexp prevserve word + return String(keyword).replace(/([\*\.\?\+\$\^\[\]\(\)\{\}\|\/\\])/g, '\\$1'); + } + + function query(keyword) { + if (keyword == null || keyword.trim() === '') return; + + var results = [], + index = -1; + for (var page in INDEX_DATA) { + if ((index = INDEX_DATA[page].body.toLowerCase().indexOf(keyword.toLowerCase())) !== -1) { + results.push({ + url: page, + title: INDEX_DATA[page].title, + body: INDEX_DATA[page].body.substr(Math.max(0, index - 50), MAX_DESCRIPTION_SIZE).replace(new RegExp('(' + escapeReg(keyword) + ')', 'gi'), '$1') + }); + } + } + displayResults({ + count: results.length, + query: keyword, + results: results + }); + } + + function launchSearch(keyword) { + // Add class for loading + $body.addClass('with-search'); + $body.addClass('search-loading'); + + function doSearch() { + query(keyword); + $body.removeClass('search-loading'); + } + + throttle(doSearch)(); + } + + function closeSearch() { + $body.removeClass('with-search'); + $('#book-search-results').removeClass('open'); + } + + function bindSearch(target) { + // Asynchronously load the index data + { + var url = state.basePath + "/assets/search_plus_index.json"; + $.getJSON(url).then(function(data) { + INDEX_DATA = data; + handleUpdate(); + }); + } + + // Bind DOM + var $body = $('body'); + + // Launch query based on input content + function handleUpdate() { + var $searchInput = $(target); + var keyword = $searchInput.val(); + + if (keyword === undefined || keyword.length == 0) { + closeSearch(); + } else { + launchSearch(keyword); + } + } + + $body.on('keyup', target, function(e) { + if (e.keyCode === 13) { + if (usePushState) { + var uri = updateQueryString('q', $(this).val()); + history.pushState({ + path: uri + }, null, uri); + } + } + handleUpdate(); + }); + + $body.on('click', target, function(e) { + if (Object.keys(INDEX_DATA).length === 0) { + var url = state.basePath + "/assets/search_plus_index.json"; + $.getJSON(url).then(function(data) { + INDEX_DATA = data; + handleUpdate(); + }); + } + }); + + // Push to history on blur + $body.on('blur', target, function(e) { + // Update history state + if (usePushState) { + var uri = updateQueryString('q', $(this).val()); + history.pushState({ + path: uri + }, null, uri); + } + }); + } + + gitbook.events.on('start', function() { + bindSearch('#book-search-input input'); + bindSearch('#book-search-input-inside input'); + + showResult(); + closeSearch(); + }); + + // 高亮文本 + var highLightPageInner = function(keyword) { + $('.page-inner').mark(keyword, { + 'ignoreJoiners': true, + 'acrossElements': true, + 'separateWordSearch': false + }); + + setTimeout(function() { + var mark = $('mark[data-markjs="true"]'); + if (mark.length) { + mark[0].scrollIntoView(); + } + }, 100); + }; + + function showResult() { + var keyword, type; + if (/\b(q|h)=([^&]+)/.test(location.search)) { + type = RegExp.$1; + keyword = decodeURIComponent(RegExp.$2); + if (type === 'q') { + launchSearch(keyword); + } else { + highLightPageInner(keyword); + } + $('#book-search-input input').val(keyword); + $('#book-search-input-inside input').val(keyword); + } + } + + gitbook.events.on('page.change', showResult); + + function getParameterByName(name) { + var url = window.location.href; + name = name.replace(/[\[\]]/g, '\\$&'); + var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)', 'i'), + results = regex.exec(url); + if (!results) return null; + if (!results[2]) return ''; + return decodeURIComponent(results[2].replace(/\+/g, ' ')); + } + + function updateQueryString(key, value) { + value = encodeURIComponent(value); + + var url = window.location.href.replace(/([?&])(?:q|h)=([^&]+)(&|$)/, function(all, pre, value, end) { + if (end === '&') { + return pre; + } + return ''; + }); + var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'), + hash; + + if (re.test(url)) { + if (typeof value !== 'undefined' && value !== null) + return url.replace(re, '$1' + key + '=' + value + '$2$3'); + else { + hash = url.split('#'); + url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, ''); + if (typeof hash[1] !== 'undefined' && hash[1] !== null) + url += '#' + hash[1]; + return url; + } + } else { + if (typeof value !== 'undefined' && value !== null) { + var separator = url.indexOf('?') !== -1 ? '&' : '?'; + hash = url.split('#'); + url = hash[0] + separator + key + '=' + value; + if (typeof hash[1] !== 'undefined' && hash[1] !== null) + url += '#' + hash[1]; + return url; + } else + return url; + } + } + window.addEventListener('click', function(e) { + if (e.target.tagName === 'A' && e.target.getAttribute('data-need-reload')) { + setTimeout(function() { + location.reload(); + }, 100); + } + }, true); +}); \ No newline at end of file diff --git a/docs/assets/gitbook/gitbook-plugin-search/lunr.min.js b/docs/assets/gitbook/gitbook-plugin-search/lunr.min.js new file mode 100644 index 0000000..6aa6bc7 --- /dev/null +++ b/docs/assets/gitbook/gitbook-plugin-search/lunr.min.js @@ -0,0 +1,7 @@ +/** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.5.12 + * Copyright (C) 2015 Oliver Nightingale + * MIT Licensed + * @license + */ +!function(){var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.5.12",t.utils={},t.utils.warn=function(t){return function(e){t.console&&console.warn&&console.warn(e)}}(this),t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=t;if("function"!=typeof e)throw new TypeError("last argument must be a function");n.forEach(function(t){this.hasHandler(t)||(this.events[t]=[]),this.events[t].push(e)},this)},t.EventEmitter.prototype.removeListener=function(t,e){if(this.hasHandler(t)){var n=this.events[t].indexOf(e);this.events[t].splice(n,1),this.events[t].length||delete this.events[t]}},t.EventEmitter.prototype.emit=function(t){if(this.hasHandler(t)){var e=Array.prototype.slice.call(arguments,1);this.events[t].forEach(function(t){t.apply(void 0,e)})}},t.EventEmitter.prototype.hasHandler=function(t){return t in this.events},t.tokenizer=function(t){return arguments.length&&null!=t&&void 0!=t?Array.isArray(t)?t.map(function(t){return t.toLowerCase()}):t.toString().trim().toLowerCase().split(/[\s\-]+/):[]},t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.registeredFunctions[e];if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(e);if(-1==i)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(e);if(-1==i)throw new Error("Cannot find existingFn");this._stack.splice(i,0,n)},t.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);-1!=e&&this._stack.splice(e,1)},t.Pipeline.prototype.run=function(t){for(var e=[],n=t.length,i=this._stack.length,o=0;n>o;o++){for(var r=t[o],s=0;i>s&&(r=this._stack[s](r,o,t),void 0!==r);s++);void 0!==r&&e.push(r)}return e},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},t.Vector.Node=function(t,e,n){this.idx=t,this.val=e,this.next=n},t.Vector.prototype.insert=function(e,n){this._magnitude=void 0;var i=this.list;if(!i)return this.list=new t.Vector.Node(e,n,i),this.length++;if(en.idx?n=n.next:(i+=e.val*n.val,e=e.next,n=n.next);return i},t.Vector.prototype.similarity=function(t){return this.dot(t)/(this.magnitude()*t.magnitude())},t.SortedSet=function(){this.length=0,this.elements=[]},t.SortedSet.load=function(t){var e=new this;return e.elements=t,e.length=t.length,e},t.SortedSet.prototype.add=function(){var t,e;for(t=0;t1;){if(r===t)return o;t>r&&(e=o),r>t&&(n=o),i=n-e,o=e+Math.floor(i/2),r=this.elements[o]}return r===t?o:-1},t.SortedSet.prototype.locationFor=function(t){for(var e=0,n=this.elements.length,i=n-e,o=e+Math.floor(i/2),r=this.elements[o];i>1;)t>r&&(e=o),r>t&&(n=o),i=n-e,o=e+Math.floor(i/2),r=this.elements[o];return r>t?o:t>r?o+1:void 0},t.SortedSet.prototype.intersect=function(e){for(var n=new t.SortedSet,i=0,o=0,r=this.length,s=e.length,a=this.elements,h=e.elements;;){if(i>r-1||o>s-1)break;a[i]!==h[o]?a[i]h[o]&&o++:(n.add(a[i]),i++,o++)}return n},t.SortedSet.prototype.clone=function(){var e=new t.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},t.SortedSet.prototype.union=function(t){var e,n,i;return this.length>=t.length?(e=this,n=t):(e=t,n=this),i=e.clone(),i.add.apply(i,n.toArray()),i},t.SortedSet.prototype.toJSON=function(){return this.toArray()},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.Store,this.tokenStore=new t.TokenStore,this.corpusTokens=new t.SortedSet,this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var t=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,t)},t.Index.prototype.off=function(t,e){return this.eventEmitter.removeListener(t,e)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;return n._fields=e.fields,n._ref=e.ref,n.documentStore=t.Store.load(e.documentStore),n.tokenStore=t.TokenStore.load(e.tokenStore),n.corpusTokens=t.SortedSet.load(e.corpusTokens),n.pipeline=t.Pipeline.load(e.pipeline),n},t.Index.prototype.field=function(t,e){var e=e||{},n={name:t,boost:e.boost||1};return this._fields.push(n),this},t.Index.prototype.ref=function(t){return this._ref=t,this},t.Index.prototype.add=function(e,n){var i={},o=new t.SortedSet,r=e[this._ref],n=void 0===n?!0:n;this._fields.forEach(function(n){var r=this.pipeline.run(t.tokenizer(e[n.name]));i[n.name]=r,t.SortedSet.prototype.add.apply(o,r)},this),this.documentStore.set(r,o),t.SortedSet.prototype.add.apply(this.corpusTokens,o.toArray());for(var s=0;s0&&(i=1+Math.log(this.documentStore.length/n)),this._idfCache[e]=i},t.Index.prototype.search=function(e){var n=this.pipeline.run(t.tokenizer(e)),i=new t.Vector,o=[],r=this._fields.reduce(function(t,e){return t+e.boost},0),s=n.some(function(t){return this.tokenStore.has(t)},this);if(!s)return[];n.forEach(function(e,n,s){var a=1/s.length*this._fields.length*r,h=this,l=this.tokenStore.expand(e).reduce(function(n,o){var r=h.corpusTokens.indexOf(o),s=h.idf(o),l=1,u=new t.SortedSet;if(o!==e){var c=Math.max(3,o.length-e.length);l=1/Math.log(c)}return r>-1&&i.insert(r,a*s*l),Object.keys(h.tokenStore.get(o)).forEach(function(t){u.add(t)}),n.union(u)},new t.SortedSet);o.push(l)},this);var a=o.reduce(function(t,e){return t.intersect(e)});return a.map(function(t){return{ref:t,score:i.similarity(this.documentVector(t))}},this).sort(function(t,e){return e.score-t.score})},t.Index.prototype.documentVector=function(e){for(var n=this.documentStore.get(e),i=n.length,o=new t.Vector,r=0;i>r;r++){var s=n.elements[r],a=this.tokenStore.get(s)[e].tf,h=this.idf(s);o.insert(this.corpusTokens.indexOf(s),a*h)}return o},t.Index.prototype.toJSON=function(){return{version:t.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},t.Index.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},t.Store=function(){this.store={},this.length=0},t.Store.load=function(e){var n=new this;return n.length=e.length,n.store=Object.keys(e.store).reduce(function(n,i){return n[i]=t.SortedSet.load(e.store[i]),n},{}),n},t.Store.prototype.set=function(t,e){this.has(t)||this.length++,this.store[t]=e},t.Store.prototype.get=function(t){return this.store[t]},t.Store.prototype.has=function(t){return t in this.store},t.Store.prototype.remove=function(t){this.has(t)&&(delete this.store[t],this.length--)},t.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},t.stemmer=function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},e={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",i="[aeiouy]",o=n+"[^aeiouy]*",r=i+"[aeiou]*",s="^("+o+")?"+r+o,a="^("+o+")?"+r+o+"("+r+")?$",h="^("+o+")?"+r+o+r+o,l="^("+o+")?"+i,u=new RegExp(s),c=new RegExp(h),f=new RegExp(a),d=new RegExp(l),p=/^(.+?)(ss|i)es$/,m=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,y=/^(.+?)(ed|ing)$/,g=/.$/,S=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\1$"),x=new RegExp("^"+o+i+"[^aeiouwxy]$"),k=/^(.+?[^aeiou])y$/,b=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,E=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,_=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,F=/^(.+?)(s|t)(ion)$/,O=/^(.+?)e$/,P=/ll$/,N=new RegExp("^"+o+i+"[^aeiouwxy]$"),T=function(n){var i,o,r,s,a,h,l;if(n.length<3)return n;if(r=n.substr(0,1),"y"==r&&(n=r.toUpperCase()+n.substr(1)),s=p,a=m,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=v,a=y,s.test(n)){var T=s.exec(n);s=u,s.test(T[1])&&(s=g,n=n.replace(s,""))}else if(a.test(n)){var T=a.exec(n);i=T[1],a=d,a.test(i)&&(n=i,a=S,h=w,l=x,a.test(n)?n+="e":h.test(n)?(s=g,n=n.replace(s,"")):l.test(n)&&(n+="e"))}if(s=k,s.test(n)){var T=s.exec(n);i=T[1],n=i+"i"}if(s=b,s.test(n)){var T=s.exec(n);i=T[1],o=T[2],s=u,s.test(i)&&(n=i+t[o])}if(s=E,s.test(n)){var T=s.exec(n);i=T[1],o=T[2],s=u,s.test(i)&&(n=i+e[o])}if(s=_,a=F,s.test(n)){var T=s.exec(n);i=T[1],s=c,s.test(i)&&(n=i)}else if(a.test(n)){var T=a.exec(n);i=T[1]+T[2],a=c,a.test(i)&&(n=i)}if(s=O,s.test(n)){var T=s.exec(n);i=T[1],s=c,a=f,h=N,(s.test(i)||a.test(i)&&!h.test(i))&&(n=i)}return s=P,a=c,s.test(n)&&a.test(n)&&(s=g,n=n.replace(s,"")),"y"==r&&(n=r.toLowerCase()+n.substr(1)),n};return T}(),t.Pipeline.registerFunction(t.stemmer,"stemmer"),t.stopWordFilter=function(e){return e&&t.stopWordFilter.stopWords[e]!==e?e:void 0},t.stopWordFilter.stopWords={a:"a",able:"able",about:"about",across:"across",after:"after",all:"all",almost:"almost",also:"also",am:"am",among:"among",an:"an",and:"and",any:"any",are:"are",as:"as",at:"at",be:"be",because:"because",been:"been",but:"but",by:"by",can:"can",cannot:"cannot",could:"could",dear:"dear",did:"did","do":"do",does:"does",either:"either","else":"else",ever:"ever",every:"every","for":"for",from:"from",get:"get",got:"got",had:"had",has:"has",have:"have",he:"he",her:"her",hers:"hers",him:"him",his:"his",how:"how",however:"however",i:"i","if":"if","in":"in",into:"into",is:"is",it:"it",its:"its",just:"just",least:"least",let:"let",like:"like",likely:"likely",may:"may",me:"me",might:"might",most:"most",must:"must",my:"my",neither:"neither",no:"no",nor:"nor",not:"not",of:"of",off:"off",often:"often",on:"on",only:"only",or:"or",other:"other",our:"our",own:"own",rather:"rather",said:"said",say:"say",says:"says",she:"she",should:"should",since:"since",so:"so",some:"some",than:"than",that:"that",the:"the",their:"their",them:"them",then:"then",there:"there",these:"these",they:"they","this":"this",tis:"tis",to:"to",too:"too",twas:"twas",us:"us",wants:"wants",was:"was",we:"we",were:"were",what:"what",when:"when",where:"where",which:"which","while":"while",who:"who",whom:"whom",why:"why",will:"will","with":"with",would:"would",yet:"yet",you:"you",your:"your"},t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter"),t.trimmer=function(t){var e=t.replace(/^\W+/,"").replace(/\W+$/,"");return""===e?void 0:e},t.Pipeline.registerFunction(t.trimmer,"trimmer"),t.TokenStore=function(){this.root={docs:{}},this.length=0},t.TokenStore.load=function(t){var e=new this;return e.root=t.root,e.length=t.length,e},t.TokenStore.prototype.add=function(t,e,n){var n=n||this.root,i=t[0],o=t.slice(1);return i in n||(n[i]={docs:{}}),0===o.length?(n[i].docs[e.ref]=e,void(this.length+=1)):this.add(o,e,n[i])},t.TokenStore.prototype.has=function(t){if(!t)return!1;for(var e=this.root,n=0;n element for each result + res.results.forEach(function(res) { + var $li = $('

  • ', { + 'class': 'search-results-item' + }); + + var $title = $('

    '); + + var $link = $('', { + 'href': gitbook.state.basePath + '/' + res.url, + 'text': res.title + }); + + var content = res.body.trim(); + if (content.length > MAX_DESCRIPTION_SIZE) { + content = content.slice(0, MAX_DESCRIPTION_SIZE).trim()+'...'; + } + var $content = $('

    ').html(content); + + $link.appendTo($title); + $title.appendTo($li); + $content.appendTo($li); + $li.appendTo($searchList); + }); + } + + function launchSearch(q) { + // Add class for loading + $body.addClass('with-search'); + $body.addClass('search-loading'); + + // Launch search query + throttle(gitbook.search.query(q, 0, MAX_RESULTS) + .then(function(results) { + displayResults(results); + }) + .always(function() { + $body.removeClass('search-loading'); + }), 1000); + } + + function closeSearch() { + $body.removeClass('with-search'); + $bookSearchResults.removeClass('open'); + } + + function launchSearchFromQueryString() { + var q = getParameterByName('q'); + if (q && q.length > 0) { + // Update search input + $searchInput.val(q); + + // Launch search + launchSearch(q); + } + } + + function bindSearch() { + // Bind DOM + $searchInput = $('#book-search-input input'); + $bookSearchResults = $('#book-search-results'); + $searchList = $bookSearchResults.find('.search-results-list'); + $searchTitle = $bookSearchResults.find('.search-results-title'); + $searchResultsCount = $searchTitle.find('.search-results-count'); + $searchQuery = $searchTitle.find('.search-query'); + + // Launch query based on input content + function handleUpdate() { + var q = $searchInput.val(); + + if (q.length == 0) { + closeSearch(); + } + else { + launchSearch(q); + } + } + + // Detect true content change in search input + // Workaround for IE < 9 + var propertyChangeUnbound = false; + $searchInput.on('propertychange', function(e) { + if (e.originalEvent.propertyName == 'value') { + handleUpdate(); + } + }); + + // HTML5 (IE9 & others) + $searchInput.on('input', function(e) { + // Unbind propertychange event for IE9+ + if (!propertyChangeUnbound) { + $(this).unbind('propertychange'); + propertyChangeUnbound = true; + } + + handleUpdate(); + }); + + // Push to history on blur + $searchInput.on('blur', function(e) { + // Update history state + if (usePushState) { + var uri = updateQueryString('q', $(this).val()); + history.pushState({ path: uri }, null, uri); + } + }); + } + + gitbook.events.on('page.change', function() { + bindSearch(); + closeSearch(); + + // Launch search based on query parameter + if (gitbook.search.isInitialized()) { + launchSearchFromQueryString(); + } + }); + + gitbook.events.on('search.ready', function() { + bindSearch(); + + // Launch search from query param at start + launchSearchFromQueryString(); + }); + + function getParameterByName(name) { + var url = window.location.href; + name = name.replace(/[\[\]]/g, '\\$&'); + var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)', 'i'), + results = regex.exec(url); + if (!results) return null; + if (!results[2]) return ''; + return decodeURIComponent(results[2].replace(/\+/g, ' ')); + } + + function updateQueryString(key, value) { + value = encodeURIComponent(value); + + var url = window.location.href; + var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'), + hash; + + if (re.test(url)) { + if (typeof value !== 'undefined' && value !== null) + return url.replace(re, '$1' + key + '=' + value + '$2$3'); + else { + hash = url.split('#'); + url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, ''); + if (typeof hash[1] !== 'undefined' && hash[1] !== null) + url += '#' + hash[1]; + return url; + } + } + else { + if (typeof value !== 'undefined' && value !== null) { + var separator = url.indexOf('?') !== -1 ? '&' : '?'; + hash = url.split('#'); + url = hash[0] + separator + key + '=' + value; + if (typeof hash[1] !== 'undefined' && hash[1] !== null) + url += '#' + hash[1]; + return url; + } + else + return url; + } + } +}); diff --git a/docs/assets/gitbook/gitbook-plugin-sharing/buttons.js b/docs/assets/gitbook/gitbook-plugin-sharing/buttons.js new file mode 100644 index 0000000..c8f819b --- /dev/null +++ b/docs/assets/gitbook/gitbook-plugin-sharing/buttons.js @@ -0,0 +1,121 @@ +require(['gitbook', 'jquery'], function(gitbook, $) { + var SITES = { + 'facebook': { + 'label': 'Facebook', + 'icon': 'fa fa-facebook', + 'onClick': function(e) { + e.preventDefault(); + window.open('http://www.facebook.com/sharer/sharer.php?s=100&p[url]='+encodeURIComponent(location.href)); + } + }, + 'twitter': { + 'label': 'Twitter', + 'icon': 'fa fa-twitter', + 'onClick': function(e) { + e.preventDefault(); + window.open('http://twitter.com/home?status='+encodeURIComponent(document.title+' '+location.href)); + } + }, + 'github': { + 'label': 'Github', + 'icon': 'fa fa-github', + 'onClick': function(e) { + e.preventDefault(); + window.open('https://github.com'); + } + }, + 'telegram': { + 'label': 'Telegram', + 'icon': 'fa fa-telegram', + 'onClick': function(e) { + e.preventDefault(); + window.open('https://t.me'); + } + }, + 'google': { + 'label': 'Google+', + 'icon': 'fa fa-google-plus', + 'onClick': function(e) { + e.preventDefault(); + window.open('https://plus.google.com/share?url='+encodeURIComponent(location.href)); + } + }, + 'weibo': { + 'label': 'Weibo', + 'icon': 'fa fa-weibo', + 'onClick': function(e) { + e.preventDefault(); + window.open('http://service.weibo.com/share/share.php?content=utf-8&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)); + } + }, + 'instapaper': { + 'label': 'Instapaper', + 'icon': 'fa fa-instapaper', + 'onClick': function(e) { + e.preventDefault(); + window.open('http://www.instapaper.com/text?u='+encodeURIComponent(location.href)); + } + }, + 'vk': { + 'label': 'VK', + 'icon': 'fa fa-vk', + 'onClick': function(e) { + e.preventDefault(); + window.open('http://vkontakte.ru/share.php?url='+encodeURIComponent(location.href)); + } + } + }; + + + + gitbook.events.bind('start', function(e, config) { + var opts = config.sharing; + + // Create dropdown menu + var menu = $.map(opts.all, function(id) { + var site = SITES[id]; + + return { + text: site.label, + onClick: site.onClick + }; + }); + + // Create main button with dropdown + if (menu.length > 0) { + gitbook.toolbar.createButton({ + icon: 'fa fa-share-alt', + label: 'Share', + position: 'right', + dropdown: [menu] + }); + } + + // Direct actions to share + $.each(SITES, function(sideId, site) { + if (!opts[sideId]) return; + + var onClick = site.onClick; + + if (sideId === "github" && opts["github_link"] !== undefined && opts["github_link"] !== "") { + onClick = function(e) { + e.preventDefault(); + window.open(opts["github_link"]); + } + } + if (sideId === "telegram" && opts["telegram_link"] !== undefined && opts["telegram_link"] !== "") { + onClick = function(e) { + e.preventDefault(); + window.open(opts["telegram_link"]); + } + } + + gitbook.toolbar.createButton({ + icon: site.icon, + label: site.text, + position: 'right', + onClick: onClick + }); + }); + }); +}); diff --git a/docs/assets/gitbook/gitbook.js b/docs/assets/gitbook/gitbook.js new file mode 100644 index 0000000..13077b4 --- /dev/null +++ b/docs/assets/gitbook/gitbook.js @@ -0,0 +1,4 @@ +!function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};t[s][0].call(l.exports,function(e){var n=t[s][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s0&&t-1 in e)}function o(e,t,n){return de.isFunction(t)?de.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?de.grep(e,function(e){return e===t!==n}):"string"!=typeof t?de.grep(e,function(e){return se.call(t,e)>-1!==n}):je.test(t)?de.filter(t,e,n):(t=de.filter(t,e),de.grep(e,function(e){return se.call(t,e)>-1!==n&&1===e.nodeType}))}function i(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function s(e){var t={};return de.each(e.match(qe)||[],function(e,n){t[n]=!0}),t}function a(e){return e}function u(e){throw e}function c(e,t,n){var r;try{e&&de.isFunction(r=e.promise)?r.call(e).done(t).fail(n):e&&de.isFunction(r=e.then)?r.call(e,t,n):t.call(void 0,e)}catch(e){n.call(void 0,e)}}function l(){te.removeEventListener("DOMContentLoaded",l),e.removeEventListener("load",l),de.ready()}function f(){this.expando=de.expando+f.uid++}function p(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Ie.test(e)?JSON.parse(e):e)}function h(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Pe,"-$&").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n=p(n)}catch(e){}Re.set(e,t,n)}else n=void 0;return n}function d(e,t,n,r){var o,i=1,s=20,a=r?function(){return r.cur()}:function(){return de.css(e,t,"")},u=a(),c=n&&n[3]||(de.cssNumber[t]?"":"px"),l=(de.cssNumber[t]||"px"!==c&&+u)&&$e.exec(de.css(e,t));if(l&&l[3]!==c){c=c||l[3],n=n||[],l=+u||1;do i=i||".5",l/=i,de.style(e,t,l+c);while(i!==(i=a()/u)&&1!==i&&--s)}return n&&(l=+l||+u||0,o=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=l,r.end=o)),o}function g(e){var t,n=e.ownerDocument,r=e.nodeName,o=Ue[r];return o?o:(t=n.body.appendChild(n.createElement(r)),o=de.css(t,"display"),t.parentNode.removeChild(t),"none"===o&&(o="block"),Ue[r]=o,o)}function m(e,t){for(var n,r,o=[],i=0,s=e.length;i-1)o&&o.push(i);else if(c=de.contains(i.ownerDocument,i),s=v(f.appendChild(i),"script"),c&&y(s),n)for(l=0;i=s[l++];)Ve.test(i.type||"")&&n.push(i);return f}function b(){return!0}function w(){return!1}function T(){try{return te.activeElement}catch(e){}}function C(e,t,n,r,o,i){var s,a;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(a in t)C(e,a,n,r,t[a],i);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),o===!1)o=w;else if(!o)return e;return 1===i&&(s=o,o=function(e){return de().off(e),s.apply(this,arguments)},o.guid=s.guid||(s.guid=de.guid++)),e.each(function(){de.event.add(this,t,o,r,n)})}function j(e,t){return de.nodeName(e,"table")&&de.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e:e}function k(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function E(e){var t=rt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function S(e,t){var n,r,o,i,s,a,u,c;if(1===t.nodeType){if(Fe.hasData(e)&&(i=Fe.access(e),s=Fe.set(t,i),c=i.events)){delete s.handle,s.events={};for(o in c)for(n=0,r=c[o].length;n1&&"string"==typeof d&&!pe.checkClone&&nt.test(d))return e.each(function(n){var i=e.eq(n);g&&(t[0]=d.call(this,n,i.html())),A(i,t,r,o)});if(p&&(i=x(t,e[0].ownerDocument,!1,e,o),s=i.firstChild,1===i.childNodes.length&&(i=s),s||o)){for(a=de.map(v(i,"script"),k),u=a.length;f=0&&nC.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[$]=!0,e}function o(e){var t=L.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function i(e,t){for(var n=e.split("|"),r=n.length;r--;)C.attrHandle[n[r]]=t}function s(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function a(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return function(t){return"form"in t?t.parentNode&&t.disabled===!1?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&je(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var o,i=e([],n.length,t),s=i.length;s--;)n[o=i[s]]&&(n[o]=!(r[o]=n[o]))})})}function f(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function p(){}function h(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function m(e,n,r){for(var o=0,i=n.length;o-1&&(r[c]=!(s[c]=f))}}else x=v(x===s?x.splice(d,x.length):x),i?i(null,s,x,u):K.apply(s,x)})}function x(e){for(var t,n,r,o=e.length,i=C.relative[e[0].type],s=i||C.relative[" "],a=i?1:0,u=d(function(e){return e===t},s,!0),c=d(function(e){return ee(t,e)>-1},s,!0),l=[function(e,n,r){var o=!i&&(r||n!==A)||((t=n).nodeType?u(e,n,r):c(e,n,r));return t=null,o}];a1&&g(l),a>1&&h(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(ae,"$1"),n,a0,i=e.length>0,s=function(r,s,a,u,c){var l,f,p,h=0,d="0",g=r&&[],m=[],y=A,x=r||i&&C.find.TAG("*",c),b=B+=null==y?1:Math.random()||.1,w=x.length;for(c&&(A=s===L||s||c);d!==w&&null!=(l=x[d]);d++){if(i&&l){for(f=0,s||l.ownerDocument===L||(O(l),a=!F);p=e[f++];)if(p(l,s||L,a)){u.push(l);break}c&&(B=b)}o&&((l=!p&&l)&&h--,r&&g.push(l))}if(h+=d,o&&d!==h){for(f=0;p=n[f++];)p(g,m,s,a);if(r){if(h>0)for(;d--;)g[d]||m[d]||(m[d]=Q.call(u));m=v(m)}K.apply(u,m),c&&!r&&m.length>0&&h+n.length>1&&t.uniqueSort(u)}return c&&(B=b,A=y),g};return o?r(s):s}var w,T,C,j,k,E,S,N,A,q,D,O,L,H,F,R,I,P,M,$="sizzle"+1*new Date,W=e.document,B=0,_=0,U=n(),z=n(),X=n(),V=function(e,t){return e===t&&(D=!0),0},G={}.hasOwnProperty,Y=[],Q=Y.pop,J=Y.push,K=Y.push,Z=Y.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),le=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(ie),pe=new RegExp("^"+re+"$"),he={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ie),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},de=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,xe=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),be=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},we=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,Te=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},Ce=function(){O()},je=d(function(e){return e.disabled===!0&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{K.apply(Y=Z.call(W.childNodes),W.childNodes),Y[W.childNodes.length].nodeType}catch(e){K={apply:Y.length?function(e,t){J.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}T=t.support={},k=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},O=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:W;return r!==L&&9===r.nodeType&&r.documentElement?(L=r,H=L.documentElement,F=!k(L),W!==L&&(n=L.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Ce,!1):n.attachEvent&&n.attachEvent("onunload",Ce)),T.attributes=o(function(e){return e.className="i",!e.getAttribute("className")}),T.getElementsByTagName=o(function(e){return e.appendChild(L.createComment("")),!e.getElementsByTagName("*").length}),T.getElementsByClassName=me.test(L.getElementsByClassName),T.getById=o(function(e){return H.appendChild(e).id=$,!L.getElementsByName||!L.getElementsByName($).length}),T.getById?(C.filter.ID=function(e){var t=e.replace(xe,be);return function(e){return e.getAttribute("id")===t}},C.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&F){var n=t.getElementById(e);return n?[n]:[]}}):(C.filter.ID=function(e){var t=e.replace(xe,be);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},C.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&F){var n,r,o,i=t.getElementById(e);if(i){if(n=i.getAttributeNode("id"),n&&n.value===e)return[i];for(o=t.getElementsByName(e),r=0;i=o[r++];)if(n=i.getAttributeNode("id"),n&&n.value===e)return[i]}return[]}}),C.find.TAG=T.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):T.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},C.find.CLASS=T.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&F)return t.getElementsByClassName(e)},I=[],R=[],(T.qsa=me.test(L.querySelectorAll))&&(o(function(e){H.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&R.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||R.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+$+"-]").length||R.push("~="),e.querySelectorAll(":checked").length||R.push(":checked"),e.querySelectorAll("a#"+$+"+*").length||R.push(".#.+[+~]")}),o(function(e){e.innerHTML="";var t=L.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&R.push("name"+ne+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&R.push(":enabled",":disabled"),H.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&R.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),R.push(",.*:")})),(T.matchesSelector=me.test(P=H.matches||H.webkitMatchesSelector||H.mozMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&o(function(e){T.disconnectedMatch=P.call(e,"*"),P.call(e,"[s!='']:x"),I.push("!=",ie)}),R=R.length&&new RegExp(R.join("|")),I=I.length&&new RegExp(I.join("|")),t=me.test(H.compareDocumentPosition),M=t||me.test(H.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},V=t?function(e,t){if(e===t)return D=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!T.sortDetached&&t.compareDocumentPosition(e)===n?e===L||e.ownerDocument===W&&M(W,e)?-1:t===L||t.ownerDocument===W&&M(W,t)?1:q?ee(q,e)-ee(q,t):0:4&n?-1:1)}:function(e,t){if(e===t)return D=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===L?-1:t===L?1:o?-1:i?1:q?ee(q,e)-ee(q,t):0;if(o===i)return s(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?s(a[r],u[r]):a[r]===W?-1:u[r]===W?1:0},L):L},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==L&&O(e),n=n.replace(le,"='$1']"),T.matchesSelector&&F&&!X[n+" "]&&(!I||!I.test(n))&&(!R||!R.test(n)))try{var r=P.call(e,n);if(r||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,L,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==L&&O(e),M(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==L&&O(e);var n=C.attrHandle[t.toLowerCase()],r=n&&G.call(C.attrHandle,t.toLowerCase())?n(e,t,!F):void 0;return void 0!==r?r:T.attributes||!F?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(we,Te)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,o=0;if(D=!T.detectDuplicates,q=!T.sortStable&&e.slice(0),e.sort(V),D){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return q=null,e},j=t.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=j(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=j(t);return n},C=t.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xe,be),e[3]=(e[3]||e[4]||e[5]||"").replace(xe,be),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=E(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(xe,be).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=U[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&U(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(o){var i=t.attr(o,e);return null==i?"!="===n:!n||(i+="","="===n?i===r:"!="===n?i!==r:"^="===n?r&&0===i.indexOf(r):"*="===n?r&&i.indexOf(r)>-1:"$="===n?r&&i.slice(-r.length)===r:"~="===n?(" "+i.replace(se," ")+" ").indexOf(r)>-1:"|="===n&&(i===r||i.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,u){var c,l,f,p,h,d,g=i!==s?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!u&&!a,x=!1;if(m){if(i){for(;g;){for(p=t;p=p[g];)if(a?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[s?m.firstChild:m.lastChild],s&&y){for(p=m,f=p[$]||(p[$]={}),l=f[p.uniqueID]||(f[p.uniqueID]={}),c=l[e]||[],h=c[0]===B&&c[1],x=h&&c[2],p=h&&m.childNodes[h];p=++h&&p&&p[g]||(x=h=0)||d.pop();)if(1===p.nodeType&&++x&&p===t){l[e]=[B,h,x];break}}else if(y&&(p=t,f=p[$]||(p[$]={}),l=f[p.uniqueID]||(f[p.uniqueID]={}),c=l[e]||[],h=c[0]===B&&c[1],x=h),x===!1)for(;(p=++h&&p&&p[g]||(x=h=0)||d.pop())&&((a?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++x||(y&&(f=p[$]||(p[$]={}),l=f[p.uniqueID]||(f[p.uniqueID]={}),l[e]=[B,x]),p!==t)););return x-=o,x===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,n){var o,i=C.pseudos[e]||C.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return i[$]?i(n):i.length>1?(o=[e,e,"",n],C.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,o=i(e,n),s=o.length;s--;)r=ee(e,o[s]),e[r]=!(t[r]=o[s])}):function(e){return i(e,0,o)}):i}},pseudos:{not:r(function(e){var t=[],n=[],o=S(e.replace(ae,"$1"));return o[$]?r(function(e,t,n,r){for(var i,s=o(e,null,r,[]),a=e.length;a--;)(i=s[a])&&(e[a]=!(t[a]=i))}):function(e,r,i){return t[0]=e,o(t,null,i,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){ +return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(xe,be),function(t){return(t.textContent||t.innerText||j(t)).indexOf(e)>-1}}),lang:r(function(e){return pe.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(xe,be).toLowerCase(),function(t){var n;do if(n=F?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===H},focus:function(e){return e===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:c(!1),disabled:c(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return de.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(s=i[0]).type&&9===t.nodeType&&F&&C.relative[i[1].type]){if(t=(C.find.ID(s.matches[0].replace(xe,be),t)||[])[0],!t)return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=he.needsContext.test(e)?0:i.length;o--&&(s=i[o],!C.relative[a=s.type]);)if((u=C.find[a])&&(r=u(s.matches[0].replace(xe,be),ye.test(i[0].type)&&f(t.parentNode)||t))){if(i.splice(o,1),e=r.length&&h(i),!e)return K.apply(n,r),n;break}}return(c||S(e,l))(r,t,!F,n,!t||ye.test(e)&&f(t.parentNode)||t),n},T.sortStable=$.split("").sort(V).join("")===$,T.detectDuplicates=!!D,O(),T.sortDetached=o(function(e){return 1&e.compareDocumentPosition(L.createElement("fieldset"))}),o(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||i("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),T.attributes&&o(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||i("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),o(function(e){return null==e.getAttribute("disabled")})||i(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);de.find=xe,de.expr=xe.selectors,de.expr[":"]=de.expr.pseudos,de.uniqueSort=de.unique=xe.uniqueSort,de.text=xe.getText,de.isXMLDoc=xe.isXML,de.contains=xe.contains,de.escapeSelector=xe.escape;var be=function(e,t,n){for(var r=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&de(e).is(n))break;r.push(e)}return r},we=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},Te=de.expr.match.needsContext,Ce=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,je=/^.[^:#\[\.,]*$/;de.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?de.find.matchesSelector(r,e)?[r]:[]:de.find.matches(e,de.grep(t,function(e){return 1===e.nodeType}))},de.fn.extend({find:function(e){var t,n,r=this.length,o=this;if("string"!=typeof e)return this.pushStack(de(e).filter(function(){for(t=0;t1?de.uniqueSort(n):n},filter:function(e){return this.pushStack(o(this,e||[],!1))},not:function(e){return this.pushStack(o(this,e||[],!0))},is:function(e){return!!o(this,"string"==typeof e&&Te.test(e)?de(e):e||[],!1).length}});var ke,Ee=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,Se=de.fn.init=function(e,t,n){var r,o;if(!e)return this;if(n=n||ke,"string"==typeof e){if(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:Ee.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof de?t[0]:t,de.merge(this,de.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:te,!0)),Ce.test(r[1])&&de.isPlainObject(t))for(r in t)de.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return o=te.getElementById(r[2]),o&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):de.isFunction(e)?void 0!==n.ready?n.ready(e):e(de):de.makeArray(e,this)};Se.prototype=de.fn,ke=de(te);var Ne=/^(?:parents|prev(?:Until|All))/,Ae={children:!0,contents:!0,next:!0,prev:!0};de.fn.extend({has:function(e){var t=de(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&de.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?de.uniqueSort(i):i)},index:function(e){return e?"string"==typeof e?se.call(de(e),this[0]):se.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(de.uniqueSort(de.merge(this.get(),de(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),de.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return be(e,"parentNode")},parentsUntil:function(e,t,n){return be(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return be(e,"nextSibling")},prevAll:function(e){return be(e,"previousSibling")},nextUntil:function(e,t,n){return be(e,"nextSibling",n)},prevUntil:function(e,t,n){return be(e,"previousSibling",n)},siblings:function(e){return we((e.parentNode||{}).firstChild,e)},children:function(e){return we(e.firstChild)},contents:function(e){return e.contentDocument||de.merge([],e.childNodes)}},function(e,t){de.fn[e]=function(n,r){var o=de.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=de.filter(r,o)),this.length>1&&(Ae[e]||de.uniqueSort(o),Ne.test(e)&&o.reverse()),this.pushStack(o)}});var qe=/[^\x20\t\r\n\f]+/g;de.Callbacks=function(e){e="string"==typeof e?s(e):de.extend({},e);var t,n,r,o,i=[],a=[],u=-1,c=function(){for(o=e.once,r=t=!0;a.length;u=-1)for(n=a.shift();++u-1;)i.splice(n,1),n<=u&&u--}),this},has:function(e){return e?de.inArray(e,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=a=[],i=n="",this},disabled:function(){return!i},lock:function(){return o=a=[],n||t||(i=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=n||[],n=[e,n.slice?n.slice():n],a.push(n),t||c()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},de.extend({Deferred:function(t){var n=[["notify","progress",de.Callbacks("memory"),de.Callbacks("memory"),2],["resolve","done",de.Callbacks("once memory"),de.Callbacks("once memory"),0,"resolved"],["reject","fail",de.Callbacks("once memory"),de.Callbacks("once memory"),1,"rejected"]],r="pending",o={state:function(){return r},always:function(){return i.done(arguments).fail(arguments),this},catch:function(e){return o.then(null,e)},pipe:function(){var e=arguments;return de.Deferred(function(t){de.each(n,function(n,r){var o=de.isFunction(e[r[4]])&&e[r[4]];i[r[1]](function(){var e=o&&o.apply(this,arguments);e&&de.isFunction(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,o?[e]:arguments)})}),e=null}).promise()},then:function(t,r,o){function i(t,n,r,o){return function(){var c=this,l=arguments,f=function(){var e,f;if(!(t=s&&(r!==u&&(c=void 0,l=[e]),n.rejectWith(c,l))}};t?p():(de.Deferred.getStackHook&&(p.stackTrace=de.Deferred.getStackHook()),e.setTimeout(p))}}var s=0;return de.Deferred(function(e){n[0][3].add(i(0,e,de.isFunction(o)?o:a,e.notifyWith)),n[1][3].add(i(0,e,de.isFunction(t)?t:a)),n[2][3].add(i(0,e,de.isFunction(r)?r:u))}).promise()},promise:function(e){return null!=e?de.extend(e,o):o}},i={};return de.each(n,function(e,t){var s=t[2],a=t[5];o[t[1]]=s.add,a&&s.add(function(){r=a},n[3-e][2].disable,n[0][2].lock),s.add(t[3].fire),i[t[0]]=function(){return i[t[0]+"With"](this===i?void 0:this,arguments),this},i[t[0]+"With"]=s.fireWith}),o.promise(i),t&&t.call(i,i),i},when:function(e){var t=arguments.length,n=t,r=Array(n),o=re.call(arguments),i=de.Deferred(),s=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?re.call(arguments):n,--t||i.resolveWith(r,o)}};if(t<=1&&(c(e,i.done(s(n)).resolve,i.reject),"pending"===i.state()||de.isFunction(o[n]&&o[n].then)))return i.then();for(;n--;)c(o[n],s(n),i.reject);return i.promise()}});var De=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;de.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&De.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},de.readyException=function(t){e.setTimeout(function(){throw t})};var Oe=de.Deferred();de.fn.ready=function(e){return Oe.then(e).catch(function(e){de.readyException(e)}),this},de.extend({isReady:!1,readyWait:1,holdReady:function(e){e?de.readyWait++:de.ready(!0)},ready:function(e){(e===!0?--de.readyWait:de.isReady)||(de.isReady=!0,e!==!0&&--de.readyWait>0||Oe.resolveWith(te,[de]))}}),de.ready.then=Oe.then,"complete"===te.readyState||"loading"!==te.readyState&&!te.documentElement.doScroll?e.setTimeout(de.ready):(te.addEventListener("DOMContentLoaded",l),e.addEventListener("load",l));var Le=function(e,t,n,r,o,i,s){var a=0,u=e.length,c=null==n;if("object"===de.type(n)){o=!0;for(a in n)Le(e,t,a,n[a],!0,i,s)}else if(void 0!==r&&(o=!0,de.isFunction(r)||(s=!0),c&&(s?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(de(e),n)})),t))for(;a1,null,!0)},removeData:function(e){return this.each(function(){Re.remove(this,e)})}}),de.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Fe.get(e,t),n&&(!r||de.isArray(n)?r=Fe.access(e,t,de.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=de.queue(e,t),r=n.length,o=n.shift(),i=de._queueHooks(e,t),s=function(){de.dequeue(e,t)};"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete i.stop,o.call(e,s,i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Fe.get(e,n)||Fe.access(e,n,{empty:de.Callbacks("once memory").add(function(){Fe.remove(e,[t+"queue",n])})})}}),de.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,Ve=/^$|\/(?:java|ecma)script/i,Ge={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};Ge.optgroup=Ge.option,Ge.tbody=Ge.tfoot=Ge.colgroup=Ge.caption=Ge.thead,Ge.th=Ge.td;var Ye=/<|&#?\w+;/;!function(){var e=te.createDocumentFragment(),t=e.appendChild(te.createElement("div")),n=te.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),pe.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",pe.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Qe=te.documentElement,Je=/^key/,Ke=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ze=/^([^.]*)(?:\.(.+)|)/;de.event={global:{},add:function(e,t,n,r,o){var i,s,a,u,c,l,f,p,h,d,g,m=Fe.get(e);if(m)for(n.handler&&(i=n,n=i.handler,o=i.selector),o&&de.find.matchesSelector(Qe,o),n.guid||(n.guid=de.guid++),(u=m.events)||(u=m.events={}),(s=m.handle)||(s=m.handle=function(t){return"undefined"!=typeof de&&de.event.triggered!==t.type?de.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(qe)||[""],c=t.length;c--;)a=Ze.exec(t[c])||[],h=g=a[1],d=(a[2]||"").split(".").sort(),h&&(f=de.event.special[h]||{},h=(o?f.delegateType:f.bindType)||h,f=de.event.special[h]||{},l=de.extend({type:h,origType:g,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&de.expr.match.needsContext.test(o),namespace:d.join(".")},i),(p=u[h])||(p=u[h]=[],p.delegateCount=0,f.setup&&f.setup.call(e,r,d,s)!==!1||e.addEventListener&&e.addEventListener(h,s)),f.add&&(f.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,l):p.push(l),de.event.global[h]=!0)},remove:function(e,t,n,r,o){var i,s,a,u,c,l,f,p,h,d,g,m=Fe.hasData(e)&&Fe.get(e);if(m&&(u=m.events)){for(t=(t||"").match(qe)||[""],c=t.length;c--;)if(a=Ze.exec(t[c])||[],h=g=a[1],d=(a[2]||"").split(".").sort(),h){for(f=de.event.special[h]||{},h=(r?f.delegateType:f.bindType)||h,p=u[h]||[],a=a[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=i=p.length;i--;)l=p[i],!o&&g!==l.origType||n&&n.guid!==l.guid||a&&!a.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(p.splice(i,1),l.selector&&p.delegateCount--,f.remove&&f.remove.call(e,l));s&&!p.length&&(f.teardown&&f.teardown.call(e,d,m.handle)!==!1||de.removeEvent(e,h,m.handle),delete u[h])}else for(h in u)de.event.remove(e,h+t[c],n,r,!0);de.isEmptyObject(u)&&Fe.remove(e,"handle events")}},dispatch:function(e){var t,n,r,o,i,s,a=de.event.fix(e),u=new Array(arguments.length),c=(Fe.get(this,"events")||{})[a.type]||[],l=de.event.special[a.type]||{};for(u[0]=a,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||c.disabled!==!0)){for(i=[],s={},n=0;n-1:de.find(o,this,null,[c]).length),s[o]&&i.push(r);i.length&&a.push({elem:c,handlers:i})}return c=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,tt=/\s*$/g;de.extend({htmlPrefilter:function(e){return e.replace(et,"<$1>")},clone:function(e,t,n){var r,o,i,s,a=e.cloneNode(!0),u=de.contains(e.ownerDocument,e);if(!(pe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||de.isXMLDoc(e)))for(s=v(a),i=v(e),r=0,o=i.length;r0&&y(s,!u&&v(e,"script")),a},cleanData:function(e){for(var t,n,r,o=de.event.special,i=0;void 0!==(n=e[i]);i++)if(He(n)){if(t=n[Fe.expando]){if(t.events)for(r in t.events)o[r]?de.event.remove(n,r):de.removeEvent(n,r,t.handle);n[Fe.expando]=void 0}n[Re.expando]&&(n[Re.expando]=void 0)}}}),de.fn.extend({detach:function(e){return q(this,e,!0)},remove:function(e){return q(this,e)},text:function(e){return Le(this,function(e){return void 0===e?de.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return A(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=j(this,e);t.appendChild(e)}})},prepend:function(){return A(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=j(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return A(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return A(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(de.cleanData(v(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return de.clone(this,e,t)})},html:function(e){return Le(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!tt.test(e)&&!Ge[(Xe.exec(e)||["",""])[1].toLowerCase()]){e=de.htmlPrefilter(e);try{for(;n1)}}),de.Tween=I,I.prototype={constructor:I,init:function(e,t,n,r,o,i){this.elem=e,this.prop=n,this.easing=o||de.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=i||(de.cssNumber[n]?"":"px")},cur:function(){var e=I.propHooks[this.prop];return e&&e.get?e.get(this):I.propHooks._default.get(this)},run:function(e){var t,n=I.propHooks[this.prop];return this.options.duration?this.pos=t=de.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):I.propHooks._default.set(this),this}},I.prototype.init.prototype=I.prototype,I.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=de.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){de.fx.step[e.prop]?de.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[de.cssProps[e.prop]]&&!de.cssHooks[e.prop]?e.elem[e.prop]=e.now:de.style(e.elem,e.prop,e.now+e.unit)}}},I.propHooks.scrollTop=I.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},de.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},de.fx=I.prototype.init,de.fx.step={};var ht,dt,gt=/^(?:toggle|show|hide)$/,mt=/queueHooks$/;de.Animation=de.extend(U,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return d(n.elem,e,$e.exec(t),n),n}]},tweener:function(e,t){de.isFunction(e)?(t=e,e=["*"]):e=e.match(qe);for(var n,r=0,o=e.length;r1)},removeAttr:function(e){return this.each(function(){de.removeAttr(this,e)})}}),de.extend({attr:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return"undefined"==typeof e.getAttribute?de.prop(e,t,n):(1===i&&de.isXMLDoc(e)||(o=de.attrHooks[t.toLowerCase()]||(de.expr.match.bool.test(t)?vt:void 0)),void 0!==n?null===n?void de.removeAttr(e,t):o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(r=o.get(e,t))?r:(r=de.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!pe.radioValue&&"radio"===t&&de.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,o=t&&t.match(qe);if(o&&1===e.nodeType)for(;n=o[r++];)e.removeAttribute(n)}}),vt={set:function(e,t,n){return t===!1?de.removeAttr(e,n):e.setAttribute(n,n),n}},de.each(de.expr.match.bool.source.match(/\w+/g),function(e,t){var n=yt[t]||de.find.attr;yt[t]=function(e,t,r){var o,i,s=t.toLowerCase();return r||(i=yt[s],yt[s]=o,o=null!=n(e,t,r)?s:null,yt[s]=i),o}});var xt=/^(?:input|select|textarea|button)$/i,bt=/^(?:a|area)$/i;de.fn.extend({prop:function(e,t){return Le(this,de.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[de.propFix[e]||e]})}}),de.extend({prop:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&de.isXMLDoc(e)||(t=de.propFix[t]||t,o=de.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=de.find.attr(e,"tabindex");return t?parseInt(t,10):xt.test(e.nodeName)||bt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),pe.optSelected||(de.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),de.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){de.propFix[this.toLowerCase()]=this}),de.fn.extend({addClass:function(e){var t,n,r,o,i,s,a,u=0;if(de.isFunction(e))return this.each(function(t){de(this).addClass(e.call(this,t,X(this)))});if("string"==typeof e&&e)for(t=e.match(qe)||[];n=this[u++];)if(o=X(n),r=1===n.nodeType&&" "+z(o)+" "){for(s=0;i=t[s++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=z(r),o!==a&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,r,o,i,s,a,u=0;if(de.isFunction(e))return this.each(function(t){de(this).removeClass(e.call(this,t,X(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(qe)||[];n=this[u++];)if(o=X(n),r=1===n.nodeType&&" "+z(o)+" "){for(s=0;i=t[s++];)for(;r.indexOf(" "+i+" ")>-1;)r=r.replace(" "+i+" "," ");a=z(r),o!==a&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):de.isFunction(e)?this.each(function(n){de(this).toggleClass(e.call(this,n,X(this),t),t)}):this.each(function(){var t,r,o,i;if("string"===n)for(r=0,o=de(this),i=e.match(qe)||[];t=i[r++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||(t=X(this),t&&Fe.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":Fe.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+z(X(n))+" ").indexOf(t)>-1)return!0;return!1}});var wt=/\r/g;de.fn.extend({val:function(e){var t,n,r,o=this[0];{if(arguments.length)return r=de.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=r?e.call(this,n,de(this).val()):e,null==o?o="":"number"==typeof o?o+="":de.isArray(o)&&(o=de.map(o,function(e){return null==e?"":e+""})),t=de.valHooks[this.type]||de.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))});if(o)return t=de.valHooks[o.type]||de.valHooks[o.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:(n=o.value,"string"==typeof n?n.replace(wt,""):null==n?"":n)}}}),de.extend({valHooks:{option:{get:function(e){var t=de.find.attr(e,"value");return null!=t?t:z(de.text(e))}},select:{get:function(e){var t,n,r,o=e.options,i=e.selectedIndex,s="select-one"===e.type,a=s?null:[],u=s?i+1:o.length;for(r=i<0?u:s?i:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),de.each(["radio","checkbox"],function(){de.valHooks[this]={set:function(e,t){if(de.isArray(t))return e.checked=de.inArray(de(e).val(),t)>-1}},pe.checkOn||(de.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Tt=/^(?:focusinfocus|focusoutblur)$/;de.extend(de.event,{trigger:function(t,n,r,o){var i,s,a,u,c,l,f,p=[r||te],h=ce.call(t,"type")?t.type:t,d=ce.call(t,"namespace")?t.namespace.split("."):[];if(s=a=r=r||te,3!==r.nodeType&&8!==r.nodeType&&!Tt.test(h+de.event.triggered)&&(h.indexOf(".")>-1&&(d=h.split("."),h=d.shift(),d.sort()),c=h.indexOf(":")<0&&"on"+h,t=t[de.expando]?t:new de.Event(h,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=d.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:de.makeArray(n,[t]),f=de.event.special[h]||{},o||!f.trigger||f.trigger.apply(r,n)!==!1)){if(!o&&!f.noBubble&&!de.isWindow(r)){for(u=f.delegateType||h,Tt.test(u+h)||(s=s.parentNode);s;s=s.parentNode)p.push(s),a=s;a===(r.ownerDocument||te)&&p.push(a.defaultView||a.parentWindow||e)}for(i=0;(s=p[i++])&&!t.isPropagationStopped();)t.type=i>1?u:f.bindType||h,l=(Fe.get(s,"events")||{})[t.type]&&Fe.get(s,"handle"),l&&l.apply(s,n),l=c&&s[c],l&&l.apply&&He(s)&&(t.result=l.apply(s,n),t.result===!1&&t.preventDefault());return t.type=h,o||t.isDefaultPrevented()||f._default&&f._default.apply(p.pop(),n)!==!1||!He(r)||c&&de.isFunction(r[h])&&!de.isWindow(r)&&(a=r[c],a&&(r[c]=null),de.event.triggered=h,r[h](),de.event.triggered=void 0,a&&(r[c]=a)),t.result}},simulate:function(e,t,n){var r=de.extend(new de.Event,n,{type:e,isSimulated:!0});de.event.trigger(r,null,t)}}),de.fn.extend({trigger:function(e,t){return this.each(function(){de.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return de.event.trigger(e,t,n,!0)}}),de.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){de.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),de.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),pe.focusin="onfocusin"in e,pe.focusin||de.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){de.event.simulate(t,e.target,de.event.fix(e))};de.event.special[t]={setup:function(){var r=this.ownerDocument||this,o=Fe.access(r,t);o||r.addEventListener(e,n,!0),Fe.access(r,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this,o=Fe.access(r,t)-1;o?Fe.access(r,t,o):(r.removeEventListener(e,n,!0),Fe.remove(r,t))}}});var Ct=e.location,jt=de.now(),kt=/\?/;de.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||de.error("Invalid XML: "+t),n};var Et=/\[\]$/,St=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;de.param=function(e,t){var n,r=[],o=function(e,t){var n=de.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(de.isArray(e)||e.jquery&&!de.isPlainObject(e))de.each(e,function(){o(this.name,this.value)});else for(n in e)V(n,e[n],t,o);return r.join("&")},de.fn.extend({serialize:function(){return de.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=de.prop(this,"elements");return e?de.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!de(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!ze.test(e))}).map(function(e,t){var n=de(this).val();return null==n?null:de.isArray(n)?de.map(n,function(e){return{name:t.name,value:e.replace(St,"\r\n")}}):{name:t.name,value:n.replace(St,"\r\n")}}).get()}});var qt=/%20/g,Dt=/#.*$/,Ot=/([?&])_=[^&]*/,Lt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ht=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ft=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Pt={},Mt="*/".concat("*"),$t=te.createElement("a");$t.href=Ct.href,de.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Ht.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Mt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":de.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Q(Q(e,de.ajaxSettings),t):Q(de.ajaxSettings,e)},ajaxPrefilter:G(It),ajaxTransport:G(Pt),ajax:function(t,n){function r(t,n,r,a){var c,p,h,b,w,T=n;l||(l=!0,u&&e.clearTimeout(u),o=void 0,s=a||"",C.readyState=t>0?4:0,c=t>=200&&t<300||304===t,r&&(b=J(d,C,r)),b=K(d,b,C,c),c?(d.ifModified&&(w=C.getResponseHeader("Last-Modified"),w&&(de.lastModified[i]=w),w=C.getResponseHeader("etag"),w&&(de.etag[i]=w)),204===t||"HEAD"===d.type?T="nocontent":304===t?T="notmodified":(T=b.state,p=b.data,h=b.error,c=!h)):(h=T,!t&&T||(T="error",t<0&&(t=0))),C.status=t,C.statusText=(n||T)+"",c?v.resolveWith(g,[p,T,C]):v.rejectWith(g,[C,T,h]),C.statusCode(x),x=void 0,f&&m.trigger(c?"ajaxSuccess":"ajaxError",[C,d,c?p:h]),y.fireWith(g,[C,T]),f&&(m.trigger("ajaxComplete",[C,d]),--de.active||de.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var o,i,s,a,u,c,l,f,p,h,d=de.ajaxSetup({},n),g=d.context||d,m=d.context&&(g.nodeType||g.jquery)?de(g):de.event,v=de.Deferred(),y=de.Callbacks("once memory"),x=d.statusCode||{},b={},w={},T="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(l){if(!a)for(a={};t=Lt.exec(s);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return l?s:null},setRequestHeader:function(e,t){return null==l&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==l&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)C.always(e[C.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||T;return o&&o.abort(t),r(0,t),this}};if(v.promise(C),d.url=((t||d.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(qe)||[""],null==d.crossDomain){c=te.createElement("a");try{c.href=d.url,c.href=c.href,d.crossDomain=$t.protocol+"//"+$t.host!=c.protocol+"//"+c.host}catch(e){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=de.param(d.data,d.traditional)),Y(It,d,n,C),l)return C;f=de.event&&d.global,f&&0===de.active++&&de.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Ft.test(d.type),i=d.url.replace(Dt,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(qt,"+")):(h=d.url.slice(i.length),d.data&&(i+=(kt.test(i)?"&":"?")+d.data,delete d.data),d.cache===!1&&(i=i.replace(Ot,"$1"),h=(kt.test(i)?"&":"?")+"_="+jt++ +h),d.url=i+h),d.ifModified&&(de.lastModified[i]&&C.setRequestHeader("If-Modified-Since",de.lastModified[i]),de.etag[i]&&C.setRequestHeader("If-None-Match",de.etag[i])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",d.contentType),C.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Mt+"; q=0.01":""):d.accepts["*"]);for(p in d.headers)C.setRequestHeader(p,d.headers[p]);if(d.beforeSend&&(d.beforeSend.call(g,C,d)===!1||l))return C.abort();if(T="abort",y.add(d.complete),C.done(d.success),C.fail(d.error),o=Y(Pt,d,n,C)){if(C.readyState=1,f&&m.trigger("ajaxSend",[C,d]),l)return C;d.async&&d.timeout>0&&(u=e.setTimeout(function(){C.abort("timeout")},d.timeout));try{l=!1,o.send(b,r)}catch(e){if(l)throw e;r(-1,e)}}else r(-1,"No Transport");return C},getJSON:function(e,t,n){return de.get(e,t,n,"json")},getScript:function(e,t){return de.get(e,void 0,t,"script")}}),de.each(["get","post"],function(e,t){de[t]=function(e,n,r,o){return de.isFunction(n)&&(o=o||r,r=n,n=void 0),de.ajax(de.extend({url:e,type:t,dataType:o,data:n,success:r},de.isPlainObject(e)&&e))}}),de._evalUrl=function(e){return de.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},de.fn.extend({wrapAll:function(e){var t;return this[0]&&(de.isFunction(e)&&(e=e.call(this[0])),t=de(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return de.isFunction(e)?this.each(function(t){de(this).wrapInner(e.call(this,t))}):this.each(function(){var t=de(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=de.isFunction(e);return this.each(function(n){de(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){de(this).replaceWith(this.childNodes)}),this}}),de.expr.pseudos.hidden=function(e){return!de.expr.pseudos.visible(e)},de.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},de.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Wt={0:200,1223:204},Bt=de.ajaxSettings.xhr();pe.cors=!!Bt&&"withCredentials"in Bt,pe.ajax=Bt=!!Bt,de.ajaxTransport(function(t){var n,r;if(pe.cors||Bt&&!t.crossDomain)return{send:function(o,i){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");for(s in o)a.setRequestHeader(s,o[s]);n=function(e){return function(){n&&(n=r=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?i(0,"error"):i(a.status,a.statusText):i(Wt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),r=a.onerror=n("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),de.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),de.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return de.globalEval(e),e}}}),de.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),de.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,o){t=de("