Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Add paywall for PIT and redirect paywall to contact sales in self-hosted

Tuan Dang1dfd18e779cd
diff --git a/backend/src/ee/services/EELicenseService.ts b/backend/src/ee/services/EELicenseService.ts
index d6fce3c7f7..9e34165831 100644
--- a/backend/src/ee/services/EELicenseService.ts
+++ b/backend/src/ee/services/EELicenseService.ts
@@ -55,7 +55,7 @@ class EELicenseService {
environmentLimit: null,
environmentsUsed: 0,
secretVersioning: true,
- pitRecovery: true,
+ pitRecovery: false,
rbac: true,
customRateLimits: true,
customAlerts: true,
diff --git a/frontend/src/components/v2/UpgradePlanModal/UpgradePlanModal.tsx b/frontend/src/components/v2/UpgradePlanModal/UpgradePlanModal.tsx
index 7b97777830..293376b9d2 100644
--- a/frontend/src/components/v2/UpgradePlanModal/UpgradePlanModal.tsx
+++ b/frontend/src/components/v2/UpgradePlanModal/UpgradePlanModal.tsx
@@ -1,5 +1,5 @@
import Link from "next/link";
-
+import { useSubscription } from "@app/context";
import { Button } from "../Button";
import { Modal, ModalClose, ModalContent } from "../Modal";
@@ -9,28 +9,35 @@ type Props = {
text: string;
};
-export const UpgradePlanModal = ({ text, isOpen, onOpenChange }: Props): JSX.Element => (
- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>
- <ModalContent
- title="Unleash Infisical's Full Power"
- footerContent={[
- <Link
- href={`/settings/billing/${localStorage.getItem("projectData.id") as string}`}
- key="upgrade-plan"
- >
- <Button className="mr-4 ml-2 mb-2">Upgrade Plan</Button>
- </Link>,
- <ModalClose asChild key="upgrade-plan-cancel">
- <Button colorSchema="secondary" variant="plain">
- Cancel
- </Button>
- </ModalClose>
- ]}
- >
- <p className="mb-2 text-bunker-300">{text}</p>
- <p className="text-bunker-300">
- Upgrade and get access to this, as well as to other powerful enhancements.
- </p>
- </ModalContent>
- </Modal>
-);
+export const UpgradePlanModal = ({ text, isOpen, onOpenChange }: Props): JSX.Element => {
+ const { subscription } = useSubscription();
+ const link = (subscription && subscription.slug !== null)
+ ? `/settings/billing/${localStorage.getItem("projectData.id") as string}`
+ : "https://infisical.com/scheduledemo";
+
+ return (
+ <Modal isOpen={isOpen} onOpenChange={onOpenChange}>
+ <ModalContent
+ title="Unleash Infisical's Full Power"
+ footerContent={[
+ <Link
+ href={link}
+ key="upgrade-plan"
+ >
+ <Button className="mr-4 ml-2 mb-2">Upgrade Plan</Button>
+ </Link>,
+ <ModalClose asChild key="upgrade-plan-cancel">
+ <Button colorSchema="secondary" variant="plain">
+ Cancel
+ </Button>
+ </ModalClose>
+ ]}
+ >
+ <p className="mb-2 text-bunker-300">{text}</p>
+ <p className="text-bunker-300">
+ Upgrade and get access to this, as well as to other powerful enhancements.
+ </p>
+ </ModalContent>
+ </Modal>
+ )
+}
\ No newline at end of file
diff --git a/frontend/src/pages/activity/[id].tsx b/frontend/src/pages/activity/[id].tsx
index 7fad294210..1f7b7b75a2 100644
--- a/frontend/src/pages/activity/[id].tsx
+++ b/frontend/src/pages/activity/[id].tsx
@@ -184,11 +184,13 @@ export default function Activity() {
/>
</div>
</div>
- <UpgradePlanModal
- isOpen={popUp.upgradePlan.isOpen}
- onOpenChange={() => handlePopUpClose("upgradePlan")}
- text="You can see more logs if you switch to Infisical's Business/Professional Plan."
- />
+ {subscription && (
+ <UpgradePlanModal
+ isOpen={popUp.upgradePlan.isOpen}
+ onOpenChange={() => handlePopUpClose("upgradePlan")}
+ text={subscription.slug === null ? "You can see more logs under an Enterprise license" : "You can see more logs if you switch to Infisical's Business/Professional Plan."}
+ />
+ )}
</div>
);
}
diff --git a/frontend/src/views/DashboardPage/DashboardPage.tsx b/frontend/src/views/DashboardPage/DashboardPage.tsx
index a3e3028e47..b226c145bc 100644
--- a/frontend/src/views/DashboardPage/DashboardPage.tsx
+++ b/frontend/src/views/DashboardPage/DashboardPage.tsx
@@ -32,10 +32,11 @@ import {
PopoverTrigger,
TableContainer,
Tag,
- Tooltip
+ Tooltip,
+ UpgradePlanModal
} from "@app/components/v2";
import { leaveConfirmDefaultMessage } from "@app/const";
-import { useWorkspace } from "@app/context";
+import { useWorkspace, useSubscription } from "@app/context";
import { useLeaveConfirm, usePopUp, useToggle } from "@app/hooks";
import {
useBatchSecretsOp,
@@ -97,6 +98,8 @@ const USER_ACTION_PUSH = "first_time_secrets_pushed";
* They will get it back
*/
export const DashboardPage = ({ envFromTop }: { envFromTop: string }) => {
+ const { subscription } = useSubscription();
+ console.log('dashboard sub: ', subscription);
const { t } = useTranslation();
const router = useRouter();
const { createNotification } = useNotificationContext();
@@ -110,7 +113,8 @@ export const DashboardPage = ({ envFromTop }: { envFromTop: string }) => {
"uploadedSecOpts",
"compareSecrets",
"folderForm",
- "deleteFolder"
+ "deleteFolder",
+ "upgradePlan"
] as const);
const [isSecretValueHidden, setIsSecretValueHidden] = useToggle(true);
const [searchFilter, setSearchFilter] = useState("");
@@ -624,7 +628,14 @@ export const DashboardPage = ({ envFromTop }: { envFromTop: string }) => {
<div className="hidden xl:block">
<Button
variant="outline_bg"
- onClick={() => handlePopUpOpen("secretSnapshots")}
+ onClick={() => {
+ if (subscription && subscription.pitRecovery) {
+ handlePopUpOpen("secretSnapshots");
+ return;
+ }
+
+ handlePopUpOpen("upgradePlan");
+ }}
leftIcon={<FontAwesomeIcon icon={faCodeCommit} />}
isLoading={isLoadingSnapshotCount}
isDisabled={!canDoRollback}
@@ -886,6 +897,13 @@ export const DashboardPage = ({ envFromTop }: { envFromTop: string }) => {
</ModalContent>
</Modal>
</FormProvider>
+ {subscription && (
+ <UpgradePlanModal
+ isOpen={popUp.upgradePlan.isOpen}
+ onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}
+ text={subscription.slug === null ? "You can perform point-in-time recovery under an Enterprise license" : "You can perform point-in-time recovery if you switch to Infisical's Team plan"}
+ />
+ )}
</div>
);
};
diff --git a/frontend/src/views/Settings/OrgSettingsPage/OrgSettingsPage.tsx b/frontend/src/views/Settings/OrgSettingsPage/OrgSettingsPage.tsx
index d51d31f39e..70722315f5 100644
--- a/frontend/src/views/Settings/OrgSettingsPage/OrgSettingsPage.tsx
+++ b/frontend/src/views/Settings/OrgSettingsPage/OrgSettingsPage.tsx
@@ -31,8 +31,6 @@ import {
} from "./components";
export const OrgSettingsPage = () => {
- const host = window.location.origin;
-
const { t } = useTranslation();
const { currentOrg } = useOrganization();
const { currentWorkspace } = useWorkspace();