diff --git a/docs/getting-started/introduction.mdx b/docs/getting-started/introduction.mdx index d70d12e1b..a8b3b7c27 100644 --- a/docs/getting-started/introduction.mdx +++ b/docs/getting-started/introduction.mdx @@ -1,42 +1,75 @@ --- title: "Introduction" -description: "What is Infisical?" --- Infisical is an [open-source](https://opensource.com/resources/what-open-source), [end-to-end encrypted](https://en.wikipedia.org/wiki/End-to-end_encryption) secret management platform that enables teams to easily manage and sync their environment variables. Start syncing environment variables with [Infisical Cloud](https://app.infisical.com) or learn how to [host Infisical](/self-hosting/overview) yourself. +## Learn about Infisical + + + Store secrets like API keys, database credentials, environment variables with Infisical + + +## Integrate with Infisical + - Tour Infisical in a few minutes. + Fetch secrets with any programming language on demand - - Install the CLI to inject secrets into apps and infra. + + Inject secrets into any application process/environment - - Install an SDK into your app to fetch secrets. + + Inject secrets into Docker containers - Learn how to configure and deploy Infisical. + Fetch and save secrets as native Kubernetes secrets +## Resources + + + Learn how to configure and deploy Infisical. + + + + Explore integrations for GitHub, Vercel, Netlify, and more. + + - Explore integrations for Docker, AWS, Heroku, etc. + Explore integrations for Next.js, Express, Django, and more. + diff --git a/docs/getting-started/quickstart.mdx b/docs/getting-started/quickstart.mdx index dba032e6e..bcc364262 100644 --- a/docs/getting-started/quickstart.mdx +++ b/docs/getting-started/quickstart.mdx @@ -1,5 +1,5 @@ --- -title: "Quickstart" +title: "Quickstarts" description: "Start managing developer secrets and configs with Infisical in minutes." --- diff --git a/docs/getting-started/quickstarts/cli.mdx b/docs/getting-started/quickstarts/cli.mdx new file mode 100644 index 000000000..0d567514f --- /dev/null +++ b/docs/getting-started/quickstarts/cli.mdx @@ -0,0 +1,128 @@ +--- +title: "CLI" +--- + +The Infisical CLI can be used to inject secrets into any framework like Next.js, Express, Django and more in local development. + +It can also be used to expose secrets from Infisical as environment variables in CI/CD pipelines and [Docker containers](/getting-started/quickstarts/docker) + +Prerequisites: + +- Have a project with secrets ready in [Infisical Cloud](https://app.infisical.com). + +## Installation + +Follow the instructions for your operating system to install the Infisical CLI. + + + + Use [brew](https://brew.sh/) package manager + + ```console + $ brew install infisical/get-cli/infisical + ``` + + + Use [Scoop](https://scoop.sh/) package manager + + ```console + $ scoop bucket add org https://github.com/Infisical/scoop-infisical.git + ``` + + ```console + $ scoop install infisical + ``` + + + Install prerequisite + ```console + $ apk add --no-cache bash sudo + ``` + + Add Infisical repository + ```console + $ curl -1sLf \ + 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.alpine.sh' \ + | bash + ``` + + Then install CLI + ```console + $ apk update && sudo apk add infisical + ``` + + + + Add Infisical repository + ```console + $ curl -1sLf \ + 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.rpm.sh' \ + | sudo -E bash + ``` + + Then install CLI + ```console + $ sudo yum install infisical + ``` + + + + Add Infisical repository + + ```console + $ curl -1sLf \ + 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.deb.sh' \ + | sudo -E bash + ``` + + Then install CLI + ```console + $ sudo apt-get update && sudo apt-get install -y infisical + ``` + + + + Use the `yay` package manager to install from the [Arch User Repository](https://aur.archlinux.org/packages/infisical-bin) + + ```console + $ yay -S infisical-bin + ``` + + + + +## Login + +Authenticate the CLI with the Infisical platform using your email and password. + +```console +$ infisical login +``` + +## Initialization + +Navigate to the root of your project directory and run the `init` command. This step connects your local project to the project on the Infisical platform and creates a `infisical.json` file containing a reference to that latter project. + +```console +$ infisical init +``` + +## Start your app with environment variables injected + +```console +$ infisical run -- +``` + +## Example Start Commands + +```console +$ infisical run -- npm run dev +$ infisical run -- flask run +$ infisical run -- ./your_bash_script.sh +``` + +Your app should now be running with the secrets from Infisical injected as environment variables. + +Resources: + +- [Documentation for the CLI](/cli/overview) \ No newline at end of file diff --git a/docs/getting-started/quickstarts/docker.mdx b/docs/getting-started/quickstarts/docker.mdx new file mode 100644 index 000000000..b9831b296 --- /dev/null +++ b/docs/getting-started/quickstarts/docker.mdx @@ -0,0 +1,185 @@ +--- +title: "Docker" +--- + +The [Infisical CLI](/cli/overview) can be added to Dockerfiles to fetch secrets from Infisical and make them available as environment variables within containers at runtime. + +Prerequisites: + +- Have a project with secrets ready in [Infisical Cloud](https://app.infisical.com). +- Create an [Infisical Token](/getting-started/dashboard/token) scoped to an environment in your project in Infisical. + + + + + + ## Dockerfile Modification + + Follow the instruction for your specific Linux distrubtion to add the Infisical CLI to your Dockerfile. + + + + ```dockerfile + RUN apk add --no-cache bash curl && curl -1sLf \ + 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.alpine.sh' | bash \ + && apk add infisical + ``` + + + + ```dockerfile + RUN curl -1sLf \ + 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.rpm.sh' | sh \ + && yum install -y infisical + ``` + + + ```dockerfile + RUN apt-get update && apt-get install -y bash curl && curl -1sLf \ + 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.deb.sh' | bash \ + && apt-get update && apt-get install -y infisical + ``` + + + + Next, modify the start command of your Dockerfile: + + ```dockerfile + CMD ["infisical", "run", "--", "[your service start command]"] + ``` + + ## Launch + + Spin up your container with the `docker run` command and feed in your Infisical Token. + + ```console + docker run --env INFISICAL_TOKEN= + ``` + + Your containerized application should now be up and running with secrets from Infisical exposed as environment variables within your application's process. + + ## Example Dockerfile + + ```dockerfile + # Select your base image (based on your Linux distribution, e.g., Alpine, Debian, Ubuntu, etc.) + FROM alpine + + # Add the Infisical CLI to your Dockerfile (choose the appropriate block based on your base image) + RUN apk add --no-cache bash curl && curl -1sLf \ + 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.alpine.sh' | bash \ + && apk add infisical + + # Install any additional dependencies or packages your service requires + # RUN + + # Copy your service files to the container + COPY . /app + + # Set the working directory + WORKDIR /app + + # Modify the start command of your Dockerfile + CMD ["infisical", "run", "--", "npm run start"] + ``` + + + + + ## Dockerfile Modifications + + Follow the instruction for your specific Linux distributions to add the Infisical CLI to your Dockerfiles. + + + + ```dockerfile + RUN apk add --no-cache bash curl && curl -1sLf \ + 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.alpine.sh' | bash \ + && apk add infisical + ``` + + + + ```dockerfile + RUN curl -1sLf \ + 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.rpm.sh' | sh \ + && yum install -y infisical + ``` + + + ```dockerfile + RUN apt-get update && apt-get install -y bash curl && curl -1sLf \ + 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.deb.sh' | bash \ + && apt-get update && apt-get install -y infisical + ``` + + + + Next, modify the start commands of your Dockerfiles: + + ```dockerfile + CMD ["infisical", "run", "--", "[your service start command]"] + ``` + + ## Example Dockerfile + + ```dockerfile + # Select your base image (based on your Linux distribution, e.g., Alpine, Debian, Ubuntu, etc.) + FROM alpine + + # Add the Infisical CLI to your Dockerfile (choose the appropriate block based on your base image) + RUN apk add --no-cache bash curl && curl -1sLf \ + 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.alpine.sh' | bash \ + && apk add infisical + + # Install any additional dependencies or packages your service requires + # RUN + + # Copy your service files to the container + COPY . /app + + # Set the working directory + WORKDIR /app + + # Modify the start command of your Dockerfile + CMD ["infisical", "run", "--", "[your service start command]"] + ``` + + ## Docker Compose File Modification + + For each service you want to inject secrets into, set an environment variable called `INFISICAL_TOKEN` equal to a unique identifier variable. For example: + + ```yaml + services: + api: + build: . + image: example-service-2 + environment: + - INFISICAL_TOKEN=${INFISICAL_TOKEN_FOR_API} + ... + ``` + + ## Export shell variables + + Next, set the shell variables you defined in your compose file. Continuing from the previous example: + + ```console + export INFISICAL_TOKEN_FOR_API= + ``` + + ## Launch + + Spin up your containers with the `docker-compose up` command. + + ```console + docker-compose up + ``` + + Your containers should now be running with the secrets from Infisical available inside as environment variables. + + + + +Resources: + +- [Documentation for Docker](/integrations/platforms/docker) +- [Documentation for Docker Compose](/integrations/platforms/docker-compose) \ No newline at end of file diff --git a/docs/getting-started/quickstarts/kubernetes.mdx b/docs/getting-started/quickstarts/kubernetes.mdx new file mode 100644 index 000000000..7865db41b --- /dev/null +++ b/docs/getting-started/quickstarts/kubernetes.mdx @@ -0,0 +1,81 @@ +--- +title: "Kubernetes" +--- + +The Infisical Secrets Operator fetches secrets from Infisical and saves them as Kubernetes secrets using the custom `InfisicalSecret` resource to define authentication and storage methods. +The operator updates secrets continuously and can reload dependent deployments automatically on secret changes. + +Prerequisites: + +- Connected to your cluster via kubectl +- Have a project with secrets ready in [Infisical Cloud](https://app.infisical.com). +- Create an [Infisical Token](/getting-started/dashboard/token) scoped to an environment in your project in Infisical. + +## Installation + +Follow the instructions for either [Helm](https://helm.sh/) or [kubectl](https://github.com/kubernetes/kubectl) to install the Infisical Secrets Operator. + + + + Install the Infisical Helm repository + + ```console + helm repo add infisical-helm-charts 'https://dl.cloudsmith.io/public/infisical/helm-charts/helm/charts/' + + helm repo update + ``` + + Install the Helm chart + ```console + helm install --generate-name infisical-helm-charts/secrets-operator + ``` + + + + The operator will be installed in `infisical-operator-system` namespace + ``` + kubectl apply -f https://raw.githubusercontent.com/Infisical/infisical/main/k8-operator/kubectl-install/install-secrets-operator.yaml + ``` + + + + +## Usage + +**Step 1: Create Kubernetes secret containing service token** + +Once you have generated the service token, create a Kubernetes secret containing the service token you generated by running the command below. + +``` bash +kubectl create secret generic service-token --from-literal=infisicalToken= +``` + +**Step 2: Fill out the InfisicalSecrets CRD and apply it to your cluster** + +```yaml infisical-secrets-config.yaml +apiVersion: secrets.infisical.com/v1alpha1 +kind: InfisicalSecret +metadata: + # Name of of this InfisicalSecret resource + name: infisicalsecret-sample +spec: + # The host that should be used to pull secrets from. If left empty, the value specified in Global configuration will be used + hostAPI: https://app.infisical.com/api + authentication: + serviceToken: + serviceTokenSecretReference: # <-- The secret's namespaced name that holds the project token for authentication in step 1 + secretName: service-token + secretNamespace: option + managedSecretReference: + secretName: managed-secret # <-- the name of kubernetes secret that will be created + secretNamespace: default # <-- in what namespace it will be created in +``` + +``` +kubectl apply -f infisical-secrets-config.yaml +``` + +You should now see a new kubernetes secret automatically created in the namespace you defined in the `managedSecretReference` property above. + +For a comprehensive guide on managing secrets in Kubernetes with Infisical, including all available options of the operator, please refer to this [link](../../integrations/platforms/kubernetes). + diff --git a/docs/getting-started/quickstarts/platform.mdx b/docs/getting-started/quickstarts/platform.mdx new file mode 100644 index 000000000..b6b834acc --- /dev/null +++ b/docs/getting-started/quickstarts/platform.mdx @@ -0,0 +1,57 @@ +--- +title: "Platform" +--- + +Infisical is an [open-source](https://opensource.com/resources/what-open-source), [end-to-end encrypted](https://en.wikipedia.org/wiki/End-to-end_encryption) secret management platform that enables teams to easily store, manage, and sync secrets like API keys, database credentials, and environment variables across their apps and infrastructure. + +This quickstart provides an overview of the functionalities offered by Infisical. + +## Projects + +Projects hold secrets for applications, which are further organized into environments such as development, testing and production. + +### Secrets Overview + +The secrets overview provides a bird's-eye view of all the secrets in a project and is particularly useful for identifying missing secrets across environments. + +![dashboard secrets overview](../../images/dashboard-secrets-overview.png) + +### Secrets Dashboard + +The secrets dashboard lets you manage secrets for a specific environment in a project. +Here, developers can [override secrets](/getting-started/dashboard/project#personal-overrides), [version secrets](/getting-started/dashboard/secret-versioning), [rollback projects to any point in time](/getting-started/dashboard/pit-recovery), and much more. + +![dashboard](../../images/dashboard.png) + +### Integrations + +The integrations page provides native integrations to sync secrets from a project environment to a [host of ever-expanding integrations](/integrations/overview). + + + Depending on your infrastructure setup and compliance requirements, you may or may not prefer to use these native integrations since they break end-to-end encryption (E2EE). + + You will learn about various ways to integrate with Infisical and maintain E2EE in subsequent quickstart sections. + + +![integrations](../../images/integrations.png) + +### Access Control + +The members page lets you add/remove members for a project and provision them access to environments (access levels include `No Access`, `Read Only`, and `Read and Write`). + +![project members](../../images/project-members.png) + +## Organizations + +Organizations house projects and members. + +### Organization Settings + +At the organization-level, you can add/remove members and manage their access to projects. + +![organization name modal open](../../images/dashboard-name-modal-organization.png) +![organization name modal open](../../images/organization.png) + +That's it for the platform quickstart! — We encourage you to continue exploring the documentation to gain a deeper understanding of the extensive features and functionalities that Infisical has to offer. + +Next, head back to [Quickstart > Overview](/getting-started/quickstarts/overview) to explore ways to fetch secrets from Infisical to your apps and infrastructure. \ No newline at end of file diff --git a/docs/getting-started/quickstarts/sdks.mdx b/docs/getting-started/quickstarts/sdks.mdx new file mode 100644 index 000000000..f7dbae6ab --- /dev/null +++ b/docs/getting-started/quickstarts/sdks.mdx @@ -0,0 +1,144 @@ +--- +title: "SDKs" +--- + +From local development to production, Infisical's language-specific SDKs provide the easiest way for your app to fetch back secrets on demand. + +Prerequisites: + +- Have a project with secrets ready in [Infisical Cloud](https://app.infisical.com). +- Create an [Infisical Token](/getting-started/dashboard/token) scoped to an environment in your project in Infisical. + + + + + + ## Installation + + Run `npm` to add [infisical-node](https://github.com/Infisical/infisical-node) to your project. + + ```console + $ npm install infisical-node --save + ``` + + ## Configuration + + Import the SDK and create a client instance with your [Infisical Token](/getting-started/dashboard/token). + + + + ```js + import InfisicalClient from "infisical-node"; + + const client = new InfisicalClient({ + token: "your_infisical_token" + }); + ``` + + + + ```js + const InfisicalClient = require("infisical-node"); + + const client = new InfisicalClient({ + token: "your_infisical_token" + }); + ```` + + + ## Get a Secret + + ```js + const secret = await client.getSecret("API_KEY"); + const value = secret.secretValue; // get its value + ``` + + ## Basic Usage + + ```js + import express from "express"; + import InfisicalClient from "infisical-node"; + const app = express(); + const PORT = 3000; + + const client = new InfisicalClient({ + token: "YOUR_INFISICAL_TOKEN" + }); + + app.get("/", async (req, res) => { + // access value + const name = await client.getSecret("NAME"); + res.send(`Hello! My name is: ${name.secretValue}`); + }); + + app.listen(PORT, async () => { + console.log(`App listening on port ${port}`); + }); + ``` + + This example demonstrates how to use the Infisical Node SDK with an Express application. The application retrieves a secret named "NAME" and responds to requests with a greeting that includes the secret value. + + + + ## Installation + + Run `pip` to add [infisical-python](https://github.com/Astropilot/infisical-python) to your project + + ```console + $ pip install infisical + ``` + + Note: You need Python 3.7+. + + ## Configuration + + Import the SDK and create a client instance with your [Infisical Token](/getting-started/dashboard/token). + + ```py + from infisical import InfisicalClient + + client = InfisicalClient(token="your_infisical_token") + ``` + + ## Get a Secret + + ```py + secret = client.get_secret("API_KEY") + value = secret.secret_value # get its value + ``` + + ## Basic Usage + + ```py + from flask import Flask + from infisical import InfisicalClient + + app = Flask(__name__) + + client = InfisicalClient(token="your_infisical_token") + + @app.route("/") + def hello_world(): + # access value + name = client.get_secret("NAME") + return f"Hello! My name is: {name.secret_value}" + ``` + + This example demonstrates how to use the Infisical Python SDK with a Flask application. The application retrieves a secret named "NAME" and responds to requests with a greeting that includes the secret value. + + + We're currently working on SDKs for other languages. Follow the GitHub issue for your needed language below: + - [Java](https://github.com/Infisical/infisical/issues/434) + - [Ruby](https://github.com/Infisical/infisical/issues/435) + - [Go](https://github.com/Infisical/infisical/issues/436) + - [Rust](https://github.com/Infisical/infisical/issues/437) + - [PHP](https://github.com/Infisical/infisical/issues/531) + + Missing a language? Throw in a [request](https://github.com/Infisical/infisical/issues). + + + +Resources: + +- [Documentation for Node](https://github.com/Infisical/infisical-node) +- [Documentation for Python](https://github.com/Infisical/infisical-python) \ No newline at end of file diff --git a/docs/images/dashboard-secrets-overview.png b/docs/images/dashboard-secrets-overview.png new file mode 100644 index 000000000..68b31de72 Binary files /dev/null and b/docs/images/dashboard-secrets-overview.png differ diff --git a/docs/images/project-members.png b/docs/images/project-members.png new file mode 100644 index 000000000..87b2a7ee4 Binary files /dev/null and b/docs/images/project-members.png differ diff --git a/docs/mint.json b/docs/mint.json index 606c4dc76..05ee74159 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -79,9 +79,17 @@ { "group": "Overview", "pages": [ - "getting-started/introduction", - "getting-started/quickstart", - "getting-started/features" + { + "group": "Getting Started", + "pages": [ + "getting-started/introduction", + "getting-started/quickstarts/platform", + "getting-started/quickstarts/sdks", + "getting-started/quickstarts/cli", + "getting-started/quickstarts/docker", + "getting-started/quickstarts/kubernetes" + ] + } ] }, { @@ -178,13 +186,6 @@ "integrations/platforms/pm2" ] }, - { - "group": "Deployment options", - "pages": [ - "self-hosting/deployments/linux", - "self-hosting/deployments/kubernetes" - ] - }, { "group": "Overview", "pages": [ @@ -199,7 +200,8 @@ "sdks/languages/java", "sdks/languages/ruby", "sdks/languages/go", - "sdks/languages/rust" + "sdks/languages/rust", + "sdks/languages/php" ] }, { @@ -288,7 +290,6 @@ ] } ], - "backgroundImage": "/images/background.png", "integrations": { "intercom": "hsg644ru" } diff --git a/docs/sdks/languages/node.mdx b/docs/sdks/languages/node.mdx index 7f0176f91..055d5eddd 100644 --- a/docs/sdks/languages/node.mdx +++ b/docs/sdks/languages/node.mdx @@ -24,12 +24,11 @@ app.get("/", async (req, res) => { }); app.listen(PORT, async () => { - // initialize client - console.log(`App listening on port ${port}`); + console.log(`App listening on port ${PORT}`); }); ``` -This example demonstrates how to use the Infisical SDK with an Express application. The application retrieves a secret named "NAME" and responds to requests with a greeting that includes the secret value. +This example demonstrates how to use the Infisical Node SDK with an Express application. The application retrieves a secret named "NAME" and responds to requests with a greeting that includes the secret value. We do not recommend hardcoding your [Infisical @@ -47,7 +46,7 @@ $ npm install infisical-node --save ## Configuration -Import the SDK and create a client instance with your Infisical token. +Import the SDK and create a client instance with your [Infisical Token](/getting-started/dashboard/token). @@ -57,8 +56,6 @@ Import the SDK and create a client instance with your Infisical token. const client = new InfisicalClient({ token: "your_infisical_token" }); - - // your app logic ``` @@ -69,8 +66,6 @@ Import the SDK and create a client instance with your Infisical token. const client = new InfisicalClient({ token: "your_infisical_token" }); - - // your app logic ```` diff --git a/docs/sdks/languages/php.mdx b/docs/sdks/languages/php.mdx new file mode 100644 index 000000000..996b95c74 --- /dev/null +++ b/docs/sdks/languages/php.mdx @@ -0,0 +1,8 @@ +--- +title: "PHP" +icon: "php" +--- + +Coming soon. + +Follow this GitHub [issue](https://github.com/Infisical/infisical/issues/531) to stay updated. \ No newline at end of file diff --git a/docs/sdks/languages/python.mdx b/docs/sdks/languages/python.mdx index 27ba41271..d573109bc 100644 --- a/docs/sdks/languages/python.mdx +++ b/docs/sdks/languages/python.mdx @@ -42,7 +42,7 @@ Note: You need Python 3.7+. ## Configuration -Import the SDK and create a client instance with your Infisical token. +Import the SDK and create a client instance with your [Infisical Token](/getting-started/dashboard/token). ```py from infisical import InfisicalClient diff --git a/docs/sdks/overview.mdx b/docs/sdks/overview.mdx index e1d85dae2..8c38498b5 100644 --- a/docs/sdks/overview.mdx +++ b/docs/sdks/overview.mdx @@ -5,11 +5,12 @@ description: "How to use Infisical SDKs to fetch back secrets for your app" Whether it be for local development or production, Infisical SDKs provide the easiest way for your app to fetch back secrets using an [Infisical Token](/getting-started/dashboard/token). -We currently have the [Node SDK](/sdks/languages/node) and [Python SDK](/sdks/languages/python) available with more language SDKs coming out soon: +We currently have the [Node SDK](https://github.com/Infisical/infisical-node) and [Python SDK](https://github.com/Infisical/infisical-python) available with more language SDKs coming out soon: -- [Node](/sdks/languages/node) -- [Python](/sdks/languages/python) +- [Node](https://github.com/Infisical/infisical-node) +- [Python](https://github.com/Infisical/infisical-python) - [Java](/sdks/languages/java) - [Ruby](/sdks/languages/ruby) - [Go](/sdks/languages/go) - [Rust](/sdks/languages/rust) +- [PHP](/sdks/languages/php)