mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 19:28:16 +00:00
Merge branch 'main' of https://github.com/Infisical/infisical into main
This commit is contained in:
@@ -0,0 +1,36 @@
|
|||||||
|
name: Release Charts
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
|
||||||
|
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Configure Git
|
||||||
|
run: |
|
||||||
|
git config user.name "$GITHUB_ACTOR"
|
||||||
|
git config user.email "[email protected]"
|
||||||
|
|
||||||
|
- name: Install Helm
|
||||||
|
uses: azure/setup-helm@v3
|
||||||
|
with:
|
||||||
|
version: v3.10.0
|
||||||
|
|
||||||
|
- name: Run chart-releaser
|
||||||
|
uses: helm/[email protected]
|
||||||
|
with:
|
||||||
|
charts_dir: helm-charts
|
||||||
|
env:
|
||||||
|
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
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
|
||||||
|
|
||||||
|
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`.
|
||||||
+2
-1
@@ -162,7 +162,8 @@
|
|||||||
"pages": [
|
"pages": [
|
||||||
"contributing/overview",
|
"contributing/overview",
|
||||||
"contributing/code-of-conduct",
|
"contributing/code-of-conduct",
|
||||||
"contributing/developing"
|
"contributing/developing",
|
||||||
|
"contributing/FAQ"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const AddServiceTokenDialog = ({
|
|||||||
const [serviceTokenCopied, setServiceTokenCopied] = useState(false);
|
const [serviceTokenCopied, setServiceTokenCopied] = useState(false);
|
||||||
|
|
||||||
const generateServiceToken = async () => {
|
const generateServiceToken = async () => {
|
||||||
const latestFileKey = await getLatestFileKey(workspaceId);
|
const latestFileKey = await getLatestFileKey({ workspaceId });
|
||||||
|
|
||||||
const key = decryptAssymmetric({
|
const key = decryptAssymmetric({
|
||||||
ciphertext: latestFileKey.latestKey.encryptedKey,
|
ciphertext: latestFileKey.latestKey.encryptedKey,
|
||||||
|
|||||||
@@ -56,10 +56,10 @@ export default function Layout({ children }) {
|
|||||||
const workspaces = await getWorkspaces();
|
const workspaces = await getWorkspaces();
|
||||||
const currentWorkspaces = workspaces.map((workspace) => workspace.name);
|
const currentWorkspaces = workspaces.map((workspace) => workspace.name);
|
||||||
if (!currentWorkspaces.includes(workspaceName)) {
|
if (!currentWorkspaces.includes(workspaceName)) {
|
||||||
const newWorkspace = await createWorkspace(
|
const newWorkspace = await createWorkspace({
|
||||||
workspaceName,
|
workspaceName,
|
||||||
localStorage.getItem("orgData.id")
|
organizationId: localStorage.getItem("orgData.id")
|
||||||
);
|
});
|
||||||
let newWorkspaceId;
|
let newWorkspaceId;
|
||||||
try {
|
try {
|
||||||
newWorkspaceId = newWorkspace._id;
|
newWorkspaceId = newWorkspace._id;
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ const UserTable = ({
|
|||||||
}, [userData, myUser]);
|
}, [userData, myUser]);
|
||||||
|
|
||||||
const grantAccess = async (id, publicKey) => {
|
const grantAccess = async (id, publicKey) => {
|
||||||
let result = await getLatestFileKey(router.query.id);
|
let result = await getLatestFileKey({workspaceId: router.query.id});
|
||||||
|
|
||||||
const PRIVATE_KEY = localStorage.getItem("PRIVATE_KEY");
|
const PRIVATE_KEY = localStorage.getItem("PRIVATE_KEY");
|
||||||
|
|
||||||
|
|||||||
@@ -25,12 +25,12 @@ export default function NavHeader({ pageName, isProjectRelated } : { pageName: s
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
const orgId = localStorage.getItem("orgData.id")
|
const orgId = localStorage.getItem("orgData.id")
|
||||||
let org = await getOrganization({
|
const org = await getOrganization({
|
||||||
orgId: orgId ? orgId : "",
|
orgId: orgId ? orgId : "",
|
||||||
});
|
});
|
||||||
setOrgName(org.name);
|
setOrgName(org.name);
|
||||||
|
|
||||||
let workspace = await getProjectInfo({
|
const workspace = await getProjectInfo({
|
||||||
projectId: String(router.query.id),
|
projectId: String(router.query.id),
|
||||||
});
|
});
|
||||||
setWorkspaceName(workspace.name);
|
setWorkspaceName(workspace.name);
|
||||||
|
|||||||
+19
-9
@@ -7,20 +7,30 @@ import { envMapping } from "../../../public/data/frequentConstants";
|
|||||||
const crypto = require("crypto");
|
const crypto = require("crypto");
|
||||||
const {
|
const {
|
||||||
decryptAssymmetric,
|
decryptAssymmetric,
|
||||||
decryptSymmetric,
|
|
||||||
encryptSymmetric,
|
encryptSymmetric,
|
||||||
encryptAssymmetric,
|
encryptAssymmetric,
|
||||||
} = require("../cryptography/crypto");
|
} = require("../cryptography/crypto");
|
||||||
const nacl = require("tweetnacl");
|
const nacl = require("tweetnacl");
|
||||||
nacl.util = require("tweetnacl-util");
|
nacl.util = require("tweetnacl-util");
|
||||||
|
|
||||||
|
export interface IK {
|
||||||
|
publicKey: string;
|
||||||
|
userId: string;
|
||||||
|
}
|
||||||
|
|
||||||
const pushKeys = async (obj, workspaceId, env) => {
|
/**
|
||||||
let sharedKey = await getLatestFileKey(workspaceId);
|
* This function pushes the keys to the database after decrypting them end-to-end
|
||||||
|
* @param {object} obj
|
||||||
|
* @param {object} obj.obj - object with all the key pairs
|
||||||
|
* @param {object} obj.workspaceId - the id of a project to which a user is pushing
|
||||||
|
* @param {object} obj.env - which environment a user is pushing to
|
||||||
|
*/
|
||||||
|
const pushKeys = async({ obj, workspaceId, env }: { obj: object; workspaceId: string; env: string; }) => {
|
||||||
|
const sharedKey = await getLatestFileKey({ workspaceId });
|
||||||
|
|
||||||
const PRIVATE_KEY = localStorage.getItem("PRIVATE_KEY");
|
const PRIVATE_KEY = localStorage.getItem("PRIVATE_KEY");
|
||||||
|
|
||||||
let randomBytes;
|
let randomBytes: string;
|
||||||
if (Object.keys(sharedKey).length > 0) {
|
if (Object.keys(sharedKey).length > 0) {
|
||||||
// case: a (shared) key exists for the workspace
|
// case: a (shared) key exists for the workspace
|
||||||
randomBytes = decryptAssymmetric({
|
randomBytes = decryptAssymmetric({
|
||||||
@@ -51,11 +61,11 @@ const pushKeys = async (obj, workspaceId, env) => {
|
|||||||
iv: ivValue,
|
iv: ivValue,
|
||||||
tag: tagValue,
|
tag: tagValue,
|
||||||
} = encryptSymmetric({
|
} = encryptSymmetric({
|
||||||
plaintext: obj[key][0],
|
plaintext: obj[key as keyof typeof obj][0],
|
||||||
key: randomBytes,
|
key: randomBytes,
|
||||||
});
|
});
|
||||||
|
|
||||||
const visibility = obj[key][1] != null ? obj[key][1] : "personal";
|
const visibility = obj[key as keyof typeof obj][1] != null ? obj[key as keyof typeof obj][1] : "personal";
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ciphertextKey,
|
ciphertextKey,
|
||||||
@@ -65,7 +75,7 @@ const pushKeys = async (obj, workspaceId, env) => {
|
|||||||
ciphertextValue,
|
ciphertextValue,
|
||||||
ivValue,
|
ivValue,
|
||||||
tagValue,
|
tagValue,
|
||||||
hashValue: crypto.createHash("sha256").update(obj[key][0]).digest("hex"),
|
hashValue: crypto.createHash("sha256").update(obj[key as keyof typeof obj][0]).digest("hex"),
|
||||||
type: visibility,
|
type: visibility,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -76,7 +86,7 @@ const pushKeys = async (obj, workspaceId, env) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// assymmetrically encrypt key with each receiver public keys
|
// assymmetrically encrypt key with each receiver public keys
|
||||||
const keys = publicKeys.map((k) => {
|
const keys = publicKeys.map((k: IK) => {
|
||||||
const { ciphertext, nonce } = encryptAssymmetric({
|
const { ciphertext, nonce } = encryptAssymmetric({
|
||||||
plaintext: randomBytes,
|
plaintext: randomBytes,
|
||||||
publicKey: k.publicKey,
|
publicKey: k.publicKey,
|
||||||
@@ -95,7 +105,7 @@ const pushKeys = async (obj, workspaceId, env) => {
|
|||||||
workspaceId,
|
workspaceId,
|
||||||
secrets,
|
secrets,
|
||||||
keys,
|
keys,
|
||||||
environment: envMapping[env],
|
environment: envMapping[env as keyof typeof envMapping],
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
+2
-2
@@ -6,7 +6,7 @@ import SecurityClient from "~/utilities/SecurityClient";
|
|||||||
* @param {string} obj.orgId - organization Id
|
* @param {string} obj.orgId - organization Id
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const getOrganizationUsers = ({ orgId }) => {
|
const getOrganizationUsers = ({ orgId }: { orgId: string; }) => {
|
||||||
return SecurityClient.fetchCall(
|
return SecurityClient.fetchCall(
|
||||||
"/api/v1/organization/" + orgId + "/users",
|
"/api/v1/organization/" + orgId + "/users",
|
||||||
{
|
{
|
||||||
@@ -16,7 +16,7 @@ const getOrganizationUsers = ({ orgId }) => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
).then(async (res) => {
|
).then(async (res) => {
|
||||||
if (res.status == 200) {
|
if (res?.status == 200) {
|
||||||
return (await res.json()).users;
|
return (await res.json()).users;
|
||||||
} else {
|
} else {
|
||||||
console.log("Failed to get org users");
|
console.log("Failed to get org users");
|
||||||
+5
-4
@@ -1,11 +1,12 @@
|
|||||||
import SecurityClient from "~/utilities/SecurityClient";
|
import SecurityClient from "~/utilities/SecurityClient";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This route creates a new workspace for a user.
|
* This route creates a new workspace for a user within a certain organization.
|
||||||
* @param {*} workspaceName
|
* @param {string} workspaceName - project Name
|
||||||
|
* @param {string} organizationId - org ID
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const createWorkspace = (workspaceName, organizationId) => {
|
const createWorkspace = ( { workspaceName, organizationId }: { workspaceName: string; organizationId: string; }) => {
|
||||||
return SecurityClient.fetchCall("/api/v1/workspace", {
|
return SecurityClient.fetchCall("/api/v1/workspace", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
@@ -16,7 +17,7 @@ const createWorkspace = (workspaceName, organizationId) => {
|
|||||||
organizationId: organizationId,
|
organizationId: organizationId,
|
||||||
}),
|
}),
|
||||||
}).then(async (res) => {
|
}).then(async (res) => {
|
||||||
if (res.status == 200) {
|
if (res?.status == 200) {
|
||||||
return (await res.json()).workspace;
|
return (await res.json()).workspace;
|
||||||
} else {
|
} else {
|
||||||
console.log("Failed to create a project");
|
console.log("Failed to create a project");
|
||||||
+3
-3
@@ -2,10 +2,10 @@ import SecurityClient from "~/utilities/SecurityClient";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the latest key pairs from a certain workspace
|
* Get the latest key pairs from a certain workspace
|
||||||
* @param {*} workspaceId
|
* @param {string} workspaceId
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const getLatestFileKey = (workspaceId) => {
|
const getLatestFileKey = ({ workspaceId } : { workspaceId: string; }) => {
|
||||||
return SecurityClient.fetchCall(
|
return SecurityClient.fetchCall(
|
||||||
"/api/v1/key/" + workspaceId + "/latest",
|
"/api/v1/key/" + workspaceId + "/latest",
|
||||||
{
|
{
|
||||||
@@ -15,7 +15,7 @@ const getLatestFileKey = (workspaceId) => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
).then(async (res) => {
|
).then(async (res) => {
|
||||||
if (res.status == 200) {
|
if (res?.status == 200) {
|
||||||
return await res.json();
|
return await res.json();
|
||||||
} else {
|
} else {
|
||||||
console.log("Failed to get the latest key pairs for a certain project");
|
console.log("Failed to get the latest key pairs for a certain project");
|
||||||
+4
-5
@@ -2,13 +2,12 @@ import SecurityClient from "~/utilities/SecurityClient";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This route lets us get the public keys of everyone in your workspace.
|
* This route lets us get the public keys of everyone in your workspace.
|
||||||
* @param {*} req
|
* @param {string} workspaceId
|
||||||
* @param {*} res
|
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const getWorkspaceKeys = (req, res) => {
|
const getWorkspaceKeys = ({ workspaceId }: { workspaceId: string; }) => {
|
||||||
return SecurityClient.fetchCall(
|
return SecurityClient.fetchCall(
|
||||||
"/api/v1/workspace/" + req.workspaceId + "/keys",
|
"/api/v1/workspace/" + workspaceId + "/keys",
|
||||||
{
|
{
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
@@ -16,7 +15,7 @@ const getWorkspaceKeys = (req, res) => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
).then(async (res) => {
|
).then(async (res) => {
|
||||||
if (res.status == 200) {
|
if (res?.status == 200) {
|
||||||
return (await res.json()).publicKeys;
|
return (await res.json()).publicKeys;
|
||||||
} else {
|
} else {
|
||||||
console.log("Failed to get the public keys of everyone in the workspace");
|
console.log("Failed to get the public keys of everyone in the workspace");
|
||||||
+4
-5
@@ -2,13 +2,12 @@ import SecurityClient from "~/utilities/SecurityClient";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This route lets us get all the users in the workspace.
|
* This route lets us get all the users in the workspace.
|
||||||
* @param {*} req
|
* @param {string} workspaceId - workspace ID
|
||||||
* @param {*} res
|
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const getWorkspaceUsers = (req, res) => {
|
const getWorkspaceUsers = ({ workspaceId }: { workspaceId: string; }) => {
|
||||||
return SecurityClient.fetchCall(
|
return SecurityClient.fetchCall(
|
||||||
"/api/v1/workspace/" + req.workspaceId + "/users",
|
"/api/v1/workspace/" + workspaceId + "/users",
|
||||||
{
|
{
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
@@ -16,7 +15,7 @@ const getWorkspaceUsers = (req, res) => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
).then(async (res) => {
|
).then(async (res) => {
|
||||||
if (res.status == 200) {
|
if (res?.status == 200) {
|
||||||
return (await res.json()).users;
|
return (await res.json()).users;
|
||||||
} else {
|
} else {
|
||||||
console.log("Failed to get Project Users");
|
console.log("Failed to get Project Users");
|
||||||
+3
-5
@@ -1,19 +1,17 @@
|
|||||||
import SecurityClient from "~/utilities/SecurityClient";
|
import SecurityClient from "~/utilities/SecurityClient";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This route lets us get the public keys of everyone in your workspace.
|
* This route lets us get the workspaces of a certain user
|
||||||
* @param {*} req
|
|
||||||
* @param {*} res
|
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const getWorkspaces = (req, res) => {
|
const getWorkspaces = () => {
|
||||||
return SecurityClient.fetchCall("/api/v1/workspace", {
|
return SecurityClient.fetchCall("/api/v1/workspace", {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
}).then(async (res) => {
|
}).then(async (res) => {
|
||||||
if (res.status == 200) {
|
if (res?.status == 200) {
|
||||||
return (await res.json()).workspaces;
|
return (await res.json()).workspaces;
|
||||||
} else {
|
} else {
|
||||||
console.log("Failed to get projects");
|
console.log("Failed to get projects");
|
||||||
@@ -378,9 +378,9 @@ export default function Dashboard() {
|
|||||||
} else if (duplicatesExist) {
|
} else if (duplicatesExist) {
|
||||||
console.log("Remove the duplicated entries first!");
|
console.log("Remove the duplicated entries first!");
|
||||||
} else {
|
} else {
|
||||||
// Once "Save changed is clicked", disable that button
|
// Once "Save changes is clicked", disable that button
|
||||||
setButtonReady(false);
|
setButtonReady(false);
|
||||||
pushKeys(obj, router.query.id, env);
|
pushKeys({obj, workspaceId: router.query.id, env});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check which integrations are active for this project and environment
|
* Check which integrations are active for this project and environment
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
## Usage
|
||||||
|
|
||||||
|
[Helm](https://helm.sh) must be installed to use the charts. Please refer to
|
||||||
|
Helm's [documentation](https://helm.sh/docs) to get started.
|
||||||
|
|
||||||
|
Once Helm has been set up correctly, add the repo as follows:
|
||||||
|
|
||||||
|
```
|
||||||
|
helm repo add <alias> https://infisical.github.io/helm-charts
|
||||||
|
```
|
||||||
|
|
||||||
|
If you had already added this repo earlier, run `helm repo update` to retrieve
|
||||||
|
the latest versions of the packages. You can then run `helm search repo
|
||||||
|
<alias>` to see the charts.
|
||||||
|
|
||||||
|
To install the <chart-name> chart:
|
||||||
|
|
||||||
|
helm install my-<chart-name> <alias>/<chart-name>
|
||||||
|
|
||||||
|
To uninstall the chart:
|
||||||
|
|
||||||
|
helm delete my-<chart-name>
|
||||||
Reference in New Issue
Block a user