Skip to content

Commit 6e245dc

Browse files
committed
chore(infra): delete legacy share storage (#57548)
1 parent 40c83fa commit 6e245dc

4 files changed

Lines changed: 4 additions & 23 deletions

File tree

‎infra/app.ts‎

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ const DISCORD_SUPPORT_BOT_TOKEN = new sst.Secret("DISCORD_SUPPORT_BOT_TOKEN")
88
const DISCORD_SUPPORT_CHANNEL_ID = new sst.Secret("DISCORD_SUPPORT_CHANNEL_ID")
99
const FEISHU_APP_ID = new sst.Secret("FEISHU_APP_ID")
1010
const FEISHU_APP_SECRET = new sst.Secret("FEISHU_APP_SECRET")
11-
const bucket = new sst.cloudflare.Bucket("Bucket")
1211

1312
export const api = new sst.cloudflare.Worker("Api", {
1413
domain: `api.${domain}`,
1514
handler: "packages/function/src/api.ts",
1615
url: true,
1716
link: [
18-
bucket,
1917
GITHUB_APP_ID,
2018
GITHUB_APP_PRIVATE_KEY,
2119
ADMIN_SECRET,
@@ -28,19 +26,11 @@ export const api = new sst.cloudflare.Worker("Api", {
2826
worker: (args) => {
2927
args.logpush = true
3028
if ($app.stage === "vimtor" || $app.stage === "adam") return
31-
args.bindings = $resolve(args.bindings).apply((bindings) => [
32-
...bindings,
33-
{
34-
name: "SYNC_SERVER",
35-
type: "durable_object_namespace",
36-
className: "SyncServer",
37-
},
38-
])
29+
// Deleting the class erases every SyncServer Durable Object and its stored share data.
3930
args.migrations = {
40-
// Note: when releasing the next tag, make sure all stages use tag v2
41-
oldTag: $app.stage === "production" || $app.stage === "thdxr" ? "" : "v1",
42-
newTag: $app.stage === "production" || $app.stage === "thdxr" ? "" : "v1",
43-
//newSqliteClasses: ["SyncServer"],
31+
oldTag: $app.stage === "production" || $app.stage === "thdxr" ? undefined : "v1",
32+
newTag: "v2",
33+
deletedClasses: ["SyncServer"],
4434
}
4535
},
4636
},

‎infra/share.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import { shortDomain } from "./stage"
22

3-
// Retains existing share data until it is deleted separately.
4-
new sst.cloudflare.Bucket("EnterpriseStorage")
5-
63
// The Share worker takes over the hostname of the retired Teams worker. Cloudflare rejects a second custom domain for
74
// the same hostname, so adopt the Teams domain and replace it, deleting the old one first.
85
$transform(cloudflare.WorkersCustomDomain, (_args, opts, name) => {

‎packages/function/src/api.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
import { Hono } from "hono"
2-
import { DurableObject } from "cloudflare:workers"
32
import { jwtVerify, createRemoteJWKSet } from "jose"
43
import { createAppAuth } from "@octokit/auth-app"
54
import { Octokit } from "@octokit/rest"
65
import { Resource } from "sst"
76
import { parseRepositoryClaim } from "./github"
87

9-
// Inert: the SYNC_SERVER binding and existing Durable Objects still reference this class, so it must stay exported.
10-
export class SyncServer extends DurableObject {}
11-
128
export default new Hono()
139
.get("/", (c) => c.text("Hello, world!"))
1410
.post("/feishu", async (c) => {

‎sst-env.d.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ declare module "sst" {
1919
"value": string
2020
}
2121
"Api": import("@cloudflare/workers-types").Service
22-
"Bucket": import("@cloudflare/workers-types").R2Bucket
2322
"Console": {
2423
"type": "sst.cloudflare.SolidStart"
2524
"url": string
@@ -36,7 +35,6 @@ declare module "sst" {
3635
"type": "sst.sst.Secret"
3736
"value": string
3837
}
39-
"EnterpriseStorage": import("@cloudflare/workers-types").R2Bucket
4038
"FEISHU_APP_ID": {
4139
"type": "sst.sst.Secret"
4240
"value": string

0 commit comments

Comments
 (0)