Skip to content

Commit 42e50d5

Browse files
chore(web): Remove cloud plans (#867)
1 parent 46e9f86 commit 42e50d5

File tree

16 files changed

+33
-189
lines changed

16 files changed

+33
-189
lines changed

.env.development

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,3 @@ SOURCEBOT_TELEMETRY_DISABLED=true # Disables telemetry collection
7676
# CONFIG_MAX_REPOS_NO_TOKEN=
7777
NODE_ENV=development
7878
# SOURCEBOT_TENANCY_MODE=single
79-
80-
# NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT=

.github/workflows/_gcp-deploy.yml

Lines changed: 0 additions & 87 deletions
This file was deleted.

.github/workflows/deploy-demo.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
# @see: https://docs.docker.com/build/building/variables/#scoping
1010

1111
ARG NEXT_PUBLIC_SENTRY_ENVIRONMENT
12-
ARG NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT
1312
ARG NEXT_PUBLIC_SENTRY_WEBAPP_DSN
1413
ARG NEXT_PUBLIC_SENTRY_BACKEND_DSN
1514
ARG NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY
@@ -52,8 +51,6 @@ ENV SKIP_ENV_VALIDATION=1
5251
# -----------
5352
ARG NEXT_PUBLIC_SENTRY_ENVIRONMENT
5453
ENV NEXT_PUBLIC_SENTRY_ENVIRONMENT=$NEXT_PUBLIC_SENTRY_ENVIRONMENT
55-
ARG NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT
56-
ENV NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT=$NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT
5754
ARG NEXT_PUBLIC_SENTRY_WEBAPP_DSN
5855
ENV NEXT_PUBLIC_SENTRY_WEBAPP_DSN=$NEXT_PUBLIC_SENTRY_WEBAPP_DSN
5956
ARG NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY

packages/shared/src/constants.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ import { ConfigSettings } from "./types.js";
22

33
export const SOURCEBOT_SUPPORT_EMAIL = 'team@sourcebot.dev';
44

5-
export const SOURCEBOT_CLOUD_ENVIRONMENT = [
6-
"dev",
7-
"demo",
8-
"staging",
9-
"prod",
10-
] as const;
11-
125
export const SOURCEBOT_UNLIMITED_SEATS = -1;
136

147
/**

packages/shared/src/entitlements.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { base64Decode } from "./utils.js";
22
import { z } from "zod";
33
import { createLogger } from "./logger.js";
44
import { env } from "./env.server.js";
5-
import { env as clientEnv } from "./env.client.js";
65
import { SOURCEBOT_SUPPORT_EMAIL, SOURCEBOT_UNLIMITED_SEATS } from "./constants.js";
76
import { verifySignature } from "./crypto.js";
87

@@ -23,8 +22,6 @@ type LicenseKeyPayload = z.infer<typeof eeLicenseKeyPayloadSchema>;
2322
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2423
const planLabels = {
2524
oss: "OSS",
26-
"cloud:team": "Team",
27-
"cloud:demo": "Demo",
2825
"self-hosted:enterprise": "Enterprise (Self-Hosted)",
2926
"self-hosted:enterprise-unlimited": "Enterprise (Self-Hosted) Unlimited",
3027
} as const;
@@ -49,12 +46,6 @@ const entitlementsByPlan: Record<Plan, Entitlement[]> = {
4946
oss: [
5047
"anonymous-access"
5148
],
52-
"cloud:team": [
53-
"billing",
54-
"multi-tenancy",
55-
"sso",
56-
"code-nav"
57-
],
5849
"self-hosted:enterprise": [
5950
"search-contexts",
6051
"sso",
@@ -74,12 +65,6 @@ const entitlementsByPlan: Record<Plan, Entitlement[]> = {
7465
"github-app",
7566
"anonymous-access"
7667
],
77-
// Special entitlement for https://demo.sourcebot.dev
78-
"cloud:demo": [
79-
"anonymous-access",
80-
"code-nav",
81-
"search-contexts"
82-
],
8368
} as const;
8469

8570

@@ -118,14 +103,6 @@ export const getLicenseKey = (): LicenseKeyPayload | null => {
118103
}
119104

120105
export const getPlan = (): Plan => {
121-
if (clientEnv.NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT) {
122-
if (clientEnv.NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT === "demo") {
123-
return "cloud:demo";
124-
}
125-
126-
return "cloud:team";
127-
}
128-
129106
const licenseKey = getLicenseKey();
130107
if (licenseKey) {
131108
const expiryDate = new Date(licenseKey.expiryDate);

packages/shared/src/env.client.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
import { createEnv } from "@t3-oss/env-core";
22
import { z } from "zod";
3-
import { SOURCEBOT_CLOUD_ENVIRONMENT } from "./constants.js";
43

54
export const env = createEnv({
65
clientPrefix: "NEXT_PUBLIC_",
76
client: {
8-
NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT: z.enum(SOURCEBOT_CLOUD_ENVIRONMENT).optional(),
97
NEXT_PUBLIC_SENTRY_BACKEND_DSN: z.string().optional(),
108
NEXT_PUBLIC_SENTRY_ENVIRONMENT: z.string().optional(),
119
NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY: z.string().optional(),
1210
NEXT_PUBLIC_LANGFUSE_BASE_URL: z.string().optional()
1311
},
1412
runtimeEnvStrict: {
15-
NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT: process.env.NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT,
1613
NEXT_PUBLIC_SENTRY_BACKEND_DSN: process.env.NEXT_PUBLIC_SENTRY_BACKEND_DSN,
1714
NEXT_PUBLIC_SENTRY_ENVIRONMENT: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
1815
NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY: process.env.NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY,

packages/shared/src/env.server.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ export const env = createEnv({
169169
// Misc
170170
CONFIG_MAX_REPOS_NO_TOKEN: numberSchema.default(Number.MAX_SAFE_INTEGER),
171171
NODE_ENV: z.enum(["development", "test", "production"]),
172-
SOURCEBOT_TELEMETRY_DISABLED: booleanSchema.default('false'),
173172
// @note: this is also declared in the Dockerfile.
174173
POSTHOG_PAPIK: z.string().default("phc_lLPuFFi5LH6c94eFJcqvYVFwiJffVcV6HD8U4a1OnRW"),
175174

@@ -274,6 +273,22 @@ export const env = createEnv({
274273
// A comma separated list of glob patterns that shwould always be indexed regardless of their size.
275274
ALWAYS_INDEX_FILE_PATTERNS: z.string().optional(),
276275

276+
/**
277+
* Configure whether to send telemetry events.
278+
* By default, all events are anonymized and do not contain PII data,
279+
* unless SOURCEBOT_TELEMETRY_PII_COLLECTION_ENABLED is set to true.
280+
*/
281+
SOURCEBOT_TELEMETRY_DISABLED: booleanSchema.default('false'),
282+
283+
/**
284+
* Configure whether to collect PII data in telemetry events.
285+
* If SOURCEBOT_TELEMETRY_DISABLED is true, this setting is
286+
* ignored.
287+
*/
288+
SOURCEBOT_TELEMETRY_PII_COLLECTION_ENABLED: booleanSchema.default('false'),
289+
290+
//// DEPRECATED ////
291+
277292
/**
278293
* @deprecated This setting is deprecated. Please use the `identityProviders` section of the config file instead.
279294
*/

packages/web/src/app/[domain]/components/repositoryCarousel.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,6 @@ export function RepositoryCarousel({
8585
))}
8686
</CarouselContent>
8787
</Carousel>
88-
{process.env.NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT === "demo" && (
89-
<p className="text-sm text-muted-foreground text-center">
90-
Interested in using Sourcebot on your code? Check out our{' '}
91-
<a
92-
href="https://docs.sourcebot.dev/docs/overview"
93-
target="_blank"
94-
rel="noopener noreferrer"
95-
className="text-primary hover:underline"
96-
onClick={() => captureEvent('wa_demo_docs_link_pressed', {})}
97-
>
98-
docs
99-
</a>
100-
</p>
101-
)}
10288
</div>
10389
)
10490
}

packages/web/src/app/[domain]/settings/layout.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { ServiceErrorException } from "@/lib/serviceError";
1111
import { getOrgFromDomain } from "@/data/org";
1212
import { OrgRole } from "@prisma/client";
1313
import { hasEntitlement } from "@sourcebot/shared";
14-
import { env } from "@sourcebot/shared/client";
1514

1615
interface LayoutProps {
1716
children: React.ReactNode;
@@ -115,12 +114,10 @@ export default async function SettingsLayout(
115114
href: `/${domain}/settings/permission-syncing`,
116115
}
117116
] : []),
118-
...(env.NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT === undefined ? [
119-
{
120-
title: "License",
121-
href: `/${domain}/settings/license`,
122-
}
123-
] : []),
117+
{
118+
title: "License",
119+
href: `/${domain}/settings/license`,
120+
}
124121
]
125122

126123
return (

0 commit comments

Comments
 (0)