From c1570930a9be4fa4bccc4b372a7f53dd017a83f3 Mon Sep 17 00:00:00 2001 From: = Date: Mon, 11 Nov 2024 19:23:31 +0530 Subject: [PATCH] docs: added new docs for infisical package installation instructions --- docs/mint.json | 8 ++ .../linux-package/commands-configuration.mdx | 38 +++++++ .../native/linux-package/installation.mdx | 102 ++++++++++++++++++ .../native/linux-package/migration.mdx | 30 ++++++ docs/self-hosting/overview.mdx | 18 +--- 5 files changed, 182 insertions(+), 14 deletions(-) create mode 100644 docs/self-hosting/deployment-options/native/linux-package/commands-configuration.mdx create mode 100644 docs/self-hosting/deployment-options/native/linux-package/installation.mdx create mode 100644 docs/self-hosting/deployment-options/native/linux-package/migration.mdx diff --git a/docs/mint.json b/docs/mint.json index 3ac96f0e3..b4fcb34c5 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -279,6 +279,14 @@ "self-hosting/deployment-options/kubernetes-helm" ] }, + { + "group": "Linux Package", + "pages": [ + "self-hosting/deployment-options/native/linux-package/installation", + "self-hosting/deployment-options/native/linux-package/migration", + "self-hosting/deployment-options/native/linux-package/commands-configuration" + ] + }, "self-hosting/configuration/envars", "self-hosting/configuration/requirements", { diff --git a/docs/self-hosting/deployment-options/native/linux-package/commands-configuration.mdx b/docs/self-hosting/deployment-options/native/linux-package/commands-configuration.mdx new file mode 100644 index 000000000..9746bce13 --- /dev/null +++ b/docs/self-hosting/deployment-options/native/linux-package/commands-configuration.mdx @@ -0,0 +1,38 @@ +--- +title: "Commands and Configuration" +description: "Learn all the available commands and configuration of the linux package." +--- + +## Configuration + +All Infisical configuration is managed from a central file called `infisical.rb` located in the `/etc/infisical` directory. + + After updating the `infisical.rb` file, remember to run `infisical-ctl reconfigure` to apply the changes. + +### Example Configuration + +```ruby +# Important: Replace these values with secure keys in production +infisical_core['ENCRYPTION_KEY'] = '6c1fe4e407b8911c104518103505b218' +infisical_core['AUTH_SECRET'] = '5lrMXKKWCVocS/uerPsl7V+TX/aaUaI7iDkgl3tSmLE=' + +# Database connection strings +infisical_core['DB_CONNECTION_URI'] = 'postgres://infisical:infisical@localhost:5432/infisical' +infisical_core['REDIS_URL'] = 'redis://localhost:6379' +``` + +For a complete list of configuration options, visit our [configuration variables documentation](/self-hosting/configuration/envars). + +## Available Commands + +The `infisical-ctl` command provides several options to manage your Infisical deployment: + +| Command | Description | +| --- | --- | +| `infisical-ctl reconfigure` | Restarts the Infisical services and applies any configuration changes | +| `infisical-ctl tail` | Shows the logs of the Infisical application | +| `infisical-ctl status` | Displays the current running status of the Infisical services | +| `infisical-ctl stop` | Stops the Infisical services | +| `infisical-ctl start` | Starts the Infisical services | + +For database migration-related commands, refer to the [Migrations Guide](/self-hosting/native/linux-package/migration). diff --git a/docs/self-hosting/deployment-options/native/linux-package/installation.mdx b/docs/self-hosting/deployment-options/native/linux-package/installation.mdx new file mode 100644 index 000000000..91a171adf --- /dev/null +++ b/docs/self-hosting/deployment-options/native/linux-package/installation.mdx @@ -0,0 +1,102 @@ +--- +title: "Installation" +description: "Learn how to deploy Infisical using linux package." +--- + +Infisical can be deployed on Linux virtual machines without containers using our Linux packages. Currently, we support Linux systems running on AMD64 architecture (ARM coming soon). + +This standalone deployment uses a "Bring Your Own Database" (BYOD) approach, meaning you'll need to provide your own PostgreSQL and Redis databases for Infisical services. These databases are not included in the package. + +## Prerequisites + +Before beginning the installation, ensure you have: + +- A server running a linux-based operating system (Ubuntu, Debian) or RHEL-based system +- A PostgreSQL database instance +- A Redis database instance + +## Installation Steps + + + +Choose your operating system below to install Infisical: + + + + First, add the Infisical repository: + ```bash + curl -1sLf \ + 'https://dl.cloudsmith.io/public/infisical/infisical-core/setup.deb.sh' \ + | sudo -E bash + ``` + + Then install Infisical: + ```bash + sudo apt-get update && sudo apt-get install -y infisical-core + ``` + + > **Note**: For production environments, we strongly recommend installing a specific version of the package to maintain consistency across reinstalls. View available versions at [Infisical Package Versions](https://cloudsmith.io/~infisical/repos/infisical-core/packages/). + + + + + First, add the Infisical repository: + ```bash + curl -1sLf \ + 'https://dl.cloudsmith.io/public/infisical/infisical-core/setup.rpm.sh' \ + | sudo -E bash + ``` + + Then install Infisical: + ```bash + sudo yum install infisical-core + ``` + + > **Note**: For production environments, we strongly recommend installing a specific version of the package to maintain consistency across reinstalls. View available versions at [Infisical Package Versions](https://cloudsmith.io/~infisical/repos/infisical-core/packages/). + + + + +To verify the installation, run: + +```bash +infisical-ctl help +``` + + + +Create an `infisical.rb` file in the `/etc/infisical` directory. This file will contain your database connections and other configuration settings. + + +```ruby +# Important: Replace these values with secure keys in production +infisical_core['ENCRYPTION_KEY'] = '6c1fe4e407b8911c104518103505b218' +infisical_core['AUTH_SECRET'] = '5lrMXKKWCVocS/uerPsl7V+TX/aaUaI7iDkgl3tSmLE=' + +# Database connection strings +infisical_core['DB_CONNECTION_URI'] = 'postgres://infisical:infisical@localhost:5432/infisical' +infisical_core['REDIS_URL'] = 'redis://localhost:6379' +``` + + +For a complete list of configuration options, visit our [configuration variables documentation](/self-hosting/configuration/envars). + + + +1. Run the following command to start the Infisical server: + ```bash + infisical-ctl reconfigure + ``` + By default, the server will run on port `8080`. You can modify this in the `infisical.rb` configuration file. + +2. Monitor your deployment: + - Check the application status: + ```bash + infisical-ctl status + ``` + - View real-time logs: + ```bash + infisical-ctl tail + ``` + + diff --git a/docs/self-hosting/deployment-options/native/linux-package/migration.mdx b/docs/self-hosting/deployment-options/native/linux-package/migration.mdx new file mode 100644 index 000000000..50dca04af --- /dev/null +++ b/docs/self-hosting/deployment-options/native/linux-package/migration.mdx @@ -0,0 +1,30 @@ +--- +title: "Migration" +description: "Learn how to run migration using Infisical linux package." +--- + +By default, migrations automatically run each time you execute `infisical-ctl reconfigure`. This behavior may not be desirable when deploying with horizontal scaling. + +## Disable Auto Migration + +To disable automatic migrations, add the following configuration to your `infisical.rb` file: + +```ruby +infisical_core['auto_migration'] = false +``` + +## Migration Commands + +`infisical-ctl` provides several commands to manage database migrations. You can run these commands in two ways: + +- Provide the PostgreSQL database connection as an environment variable, or +- Let the system load the connection details from the Infisical application after reconfiguration + +| Command | Description | +| ---------------------------------- | --------------------------------------------------------------------------- | +| `infisical-ctl migration up` | Runs the next migration that hasn't been applied yet | +| `infisical-ctl migration down` | Reverts the most recent migration, undoing its changes | +| `infisical-ctl migration list` | Lists all available migration files without applying them | +| `infisical-ctl migration status` | Displays the status of each migration, showing which have been applied | +| `infisical-ctl migration latest` | Applies all pending migrations to bring the database up to date | +| `infisical-ctl migration rollback` | Reverts all applied migrations, returning the database to its initial state | diff --git a/docs/self-hosting/overview.mdx b/docs/self-hosting/overview.mdx index a7ea50e39..f1bbfe236 100644 --- a/docs/self-hosting/overview.mdx +++ b/docs/self-hosting/overview.mdx @@ -33,21 +33,11 @@ Choose from a number of deployment options listed below to get started. Use our Helm chart to Install Infisical on your Kubernetes cluster. -{/* - - Install Infisical on your Debian-based system without containers using our standalone binary. - - - Install Infisical on your Debian-based instances without containers using our standalone binary with high availability out of the box. - - */} + Install Infisical on your system without containers using our linux package. +