Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Revamp contributing development docs
Tuan Dang3341b08b2290
diff --git a/.env.example b/.env.exampleindex dea42a19c5..169e6db0d0 100644--- a/.env.example+++ b/.env.example@@ -1,13 +1,13 @@# Keys# Required key for platform encryption/decryption ops-ENCRYPTION_KEY=replace_with_lengthy_secure_hex+ENCRYPTION_KEY=6c1fe4e407b8911c104518103505b218# JWT# Required secrets to sign JWT tokens-JWT_SIGNUP_SECRET=replace_with_lengthy_secure_hex-JWT_REFRESH_SECRET=replace_with_lengthy_secure_hex-JWT_AUTH_SECRET=replace_with_lengthy_secure_hex-JWT_SERVICE_SECRET=replace_with_lengthy_secure_hex+JWT_SIGNUP_SECRET=3679e04ca949f914c03332aaaeba805a+JWT_REFRESH_SECRET=5f2f3c8f0159068dc2bbb3a652a716ff+JWT_AUTH_SECRET=4be6ba5602e0fa0ac6ac05c3cd4d247f+JWT_SERVICE_SECRET=f32f716d70a42c5703f4656015e76200# JWT lifetime# Optional lifetimes for JWT tokens expressed in seconds or a string@@ -34,15 +34,12 @@ MONGO_PASSWORD=exampleSITE_URL=http://localhost:8080# Mail/SMTP-# Required to send emails-# By default, SMTP_HOST is set to smtp.gmail.com, SMTP_PORT is set to 587, SMTP_TLS is set to false, and SMTP_FROM_NAME is set to Infisical-SMTP_HOST=smtp.gmail.com-# If STARTTLS is supported, the connection will be upgraded to TLS when SMTP_SECURE is set to false-SMTP_USERNAME=-SMTP_PASSWORD=+SMTP_HOST= # required+SMTP_USERNAME= # required+SMTP_PASSWORD= # requiredSMTP_PORT=587SMTP_SECURE=false-SMTP_FROM_ADDRESS=+SMTP_FROM_ADDRESS= # requiredSMTP_FROM_NAME=Infisical# Integrationdiff --git a/backend/src/config/index.ts b/backend/src/config/index.tsindex 6953f75278..ec83fde6f8 100644--- a/backend/src/config/index.ts+++ b/backend/src/config/index.ts@@ -25,7 +25,7 @@ const POSTHOG_PROJECT_API_KEY ='phc_nSin8j5q2zdhpFDI1ETmFNUIuTG4DwKVyIigrY10XiE';const SENTRY_DSN = process.env.SENTRY_DSN!;const SITE_URL = process.env.SITE_URL!;-const SMTP_HOST = process.env.SMTP_HOST! || 'smtp.gmail.com';+const SMTP_HOST = process.env.SMTP_HOST!;const SMTP_SECURE = process.env.SMTP_SECURE! === 'true' || false;const SMTP_PORT = process.env.SMTP_PORT! || 587;const SMTP_USERNAME = process.env.SMTP_USERNAME!;diff --git a/docs/contributing/FAQ.mdx b/docs/contributing/FAQ.mdxdeleted file mode 100644index 9f4f7aee90..0000000000--- a/docs/contributing/FAQ.mdx+++ /dev/null@@ -1,18 +0,0 @@-----title: 'Frequently Asked Questions'-description: 'Have any questions? [Join our Slack community](https://join.slack.com/t/infisical-users/shared_invite/zt-1kdbk07ro-RtoyEt_9E~fyzGo_xQYP6g).'------## Problem with SMTP--If you opt for actual SMTP server (not the local MailHog), you have to have the right environment variables set.--You can normally populate `SMTP_USERNAME` and `SMTP_PASSWORD` with your usual login and password (you could also create a 'burner' email). Sometimes, there still are problems.--You can go to your Gmail account settings > security and enable “less secure apps”. This would allow Infisical to use your Gmail to send emails.--If it still doesn't work, [this](https://stackoverflow.com/questions/72547853/unable-to-send-email-in-c-sharp-less-secure-app-access-not-longer-available/72553362#72553362) should help.--## `MONGO_URL` issues--Your `MONGO_URL` should be something like `mongodb://root:example@mongo:27017/?authSource=admin`. If you want to change it (not recommended), you should make sure that you keep this URL in line with `MONGO_USERNAME=root` and `MONGO_PASSWORD=example`.diff --git a/docs/contributing/developing.mdx b/docs/contributing/developing.mdxindex 812025dbc2..423b83da24 100644--- a/docs/contributing/developing.mdx+++ b/docs/contributing/developing.mdx@@ -16,53 +16,43 @@ cd infisical## Set up environment variables-Start by creating a .env file at the root of the Infisical directory+Start by creating a .env file at the root of the Infisical directory. It's best to start with the provided [`.env.example`](https://github.com/Infisical/infisical/blob/main/.env.example) template containing the necessary envars to fill out your .env file — you only have to modify the SMTP parameters.-<Tip>- Reference the [environment variable list](https://infisical.com/docs/self-hosting/configuration/envars) and provided [`.env.example`](https://raw.githubusercontent.com/Infisical/infisical/main/.env.example) template to fill out your .env file.-</Tip>--### Keys--`ENCRYPTION_KEY`, `JWT_SIGNUP_SECRET`, `JWT_REFRESH_SECRET`, `JWT_AUTH_SECRET`, `JWT_SERVICE_SECRET` values can be generated with this [32-byte random hex generator](https://www.browserling.com/tools/random-hex).--### Database--Use to the following `MONGO_URL`, `MONGO_USERNAME`, `MONGO_PASSWORD`, `SITE_URL` values:+<Warning>+ The pre-populated environment variable values in the `.env.example` file are meant to be used in development only.+ You'll want to fill in your own values in production, especially concerning encryption keys, secrets, and SMTP parameters.+</Warning>-```-MONGO_URL=mongodb://root:example@mongo:27017/?authSource=admin-MONGO_USERNAME=root-MONGO_PASSWORD=example+Refer to the [environment variable list](https://infisical.com/docs/self-hosting/configuration/envars) for guidance on each envar.-SITE_URL=http://localhost:8080-```+### Helpful tips for developing with Infisical:-<Info>- If you decide to use your own `MONGO_USERNAME` and `MONGO_PASSWORD`, you'll have to modify `MONGO_URL` to take the form: `mongodb://[MONGO_USERNAME]:[MONGO_PASSWORD]@mongo:27017/?authSource=admin`.-</Info>+<Tip>+Use the `ENCRYPTION_KEY`, JWT-secret envars, `MONGO_URL`, `MONGO_USERNAME`, `MONGO_PASSWORD` provided in the `.env.example` file.-### Mailing+If setting your own values:-Option 1: Bring your own SMTP server and credentials by filling in `SMTP_HOST`, `SMTP_FROM_ADDRESS`, `SMTP_FROM_NAME`, `SMTP_USERNAME`, and `SMTP_PASSWORD`.-<Info>- `SMTP_HOST` is set to `smtp.gmail.com` by default. For `SMTP_USERNAME` and `SMTP_PASSWORD`, you'll need an email with 2-step-verification and an [app password](https://support.google.com/mail/answer/185833?hl=en) for it.-</Info>+- `ENCRYPTION_KEY` should be a [32-byte random hex](https://www.browserling.com/tools/random-hex)+- `MONGO_URL` should take the form: `mongodb://[MONGO_USERNAME]:[MONGO_PASSWORD]@mongo:27017/?authSource=admin`.+</Tip>+<Tip>+Bring and configure your own SMTP server by following our [email configuration guide](https://infisical.com/docs/self-hosting/configuration/email) (we recommend using either SendGrid or Mailgun).-Option 2: Use the provided (Mailhog) SMTP server and browse emails sent by the backend on `http://localhost:8025`. To use this option, set the following `SMTP_HOST`, `SMTP_PORT`, `SMTP_FROM_NAME`, `SMTP_USERNAME`, `SMTP_PASSWORD` values:+Alternatively, you can use the provided development (Mailhog) SMTP server to send and browse emails sent by the backend on http://localhost:8025; to use this option, set the following `SMTP_HOST`, `SMTP_PORT`, `SMTP_FROM_NAME`, `SMTP_USERNAME`, `SMTP_PASSWORD` below.+</Tip>```SMTP_HOST=smtp-serverSMTP_PORT=1025-SMTP_FROM_NAME=[whatever you like]+SMTP_FROM_NAME=InfisicalSMTP_PASSWORD=```<Warning>- Make sure to leave the `SMTP_PASSWORD` blank so the backend can connect to MailHog.+ If using Mailhog, make sure to leave the `SMTP_PASSWORD` blank so the backend can connect to MailHog.</Warning>## Docker for developmentdiff --git a/docs/mint.json b/docs/mint.jsonindex f12a2c2e41..c94b9131a9 100644--- a/docs/mint.json+++ b/docs/mint.json@@ -102,21 +102,21 @@{"group": "Self-hosting","pages": [- "self-hosting/overview",- {- "group": "Deployments options",- "pages": [- "self-hosting/deployments/linux",- "self-hosting/deployments/kubernetes"- ]- },- {- "group": "Configuration",- "pages": [- "self-hosting/configuration/envars",- "self-hosting/configuration/email"- ]- }+ "self-hosting/overview"+ ]+ },+ {+ "group": "Deployment options",+ "pages": [+ "self-hosting/deployments/linux",+ "self-hosting/deployments/kubernetes"+ ]+ },+ {+ "group": "Configuration",+ "pages": [+ "self-hosting/configuration/envars",+ "self-hosting/configuration/email"]},{@@ -180,8 +180,7 @@"pages": ["contributing/overview","contributing/code-of-conduct",- "contributing/developing",- "contributing/FAQ"+ "contributing/developing"]}],diff --git a/docs/self-hosting/configuration/email.mdx b/docs/self-hosting/configuration/email.mdxindex 99ab387c7c..b1e911fb67 100644--- a/docs/self-hosting/configuration/email.mdx+++ b/docs/self-hosting/configuration/email.mdx@@ -1,5 +1,5 @@----title: "Email Configuration"+title: "Email"description: ""---diff --git a/docs/self-hosting/configuration/envars.mdx b/docs/self-hosting/configuration/envars.mdxindex a66f641fc8..90222a4248 100644--- a/docs/self-hosting/configuration/envars.mdx+++ b/docs/self-hosting/configuration/envars.mdx@@ -3,7 +3,7 @@ title: "Environment Variables"description: ""----Configuring Infisical requires setting some environment variables. There is a file called `.env.example` at the root directory of our main repo that you can use to create a `.env` file before you start the server.+Configuring Infisical requires setting some environment variables. There is a file called [`.env.example`](https://github.com/Infisical/infisical/blob/main/.env.example) at the root directory of our main repo that you can use to create a `.env` file before you start the server.| Variable | Description | Default Value || ---------------------------- | ----------------------------------------------------------------------------------------------------------- | ---------------- |