chore(infra): delete legacy share storage (#57548)

This commit is contained in:
Dax
2026-10-20 18:39:48 -04:00
committed by GitHub
Unverified
parent 552f86716f
commit f2a34141b3
4 changed files with 4 additions and 23 deletions
+4 -14
View File
@@ -8,14 +8,12 @@ const DISCORD_SUPPORT_BOT_TOKEN = new sst.Secret("DISCORD_SUPPORT_BOT_TOKEN")
const DISCORD_SUPPORT_CHANNEL_ID = new sst.Secret("DISCORD_SUPPORT_CHANNEL_ID")
const FEISHU_APP_ID = new sst.Secret("FEISHU_APP_ID")
const FEISHU_APP_SECRET = new sst.Secret("FEISHU_APP_SECRET")
const bucket = new sst.cloudflare.Bucket("Bucket")
export const api = new sst.cloudflare.Worker("Api", {
domain: `api.${domain}`,
handler: "packages/function/src/api.ts",
url: true,
link: [
bucket,
GITHUB_APP_ID,
GITHUB_APP_PRIVATE_KEY,
ADMIN_SECRET,
@@ -28,19 +26,11 @@ export const api = new sst.cloudflare.Worker("Api", {
worker: (args) => {
args.logpush = true
if ($app.stage === "vimtor" || $app.stage === "adam") return
args.bindings = $resolve(args.bindings).apply((bindings) => [
...bindings,
{
name: "SYNC_SERVER",
type: "durable_object_namespace",
className: "SyncServer",
},
])
// Deleting the class erases every SyncServer Durable Object and its stored share data.
args.migrations = {
// Note: when releasing the next tag, make sure all stages use tag v2
oldTag: $app.stage === "production" || $app.stage === "thdxr" ? "" : "v1",
newTag: $app.stage === "production" || $app.stage === "thdxr" ? "" : "v1",
//newSqliteClasses: ["SyncServer"],
oldTag: $app.stage === "production" || $app.stage === "thdxr" ? undefined : "v1",
newTag: "v2",
deletedClasses: ["SyncServer"],
}
},
},
-3
View File
@@ -1,8 +1,5 @@
import { shortDomain } from "./stage"
// Retains existing share data until it is deleted separately.
new sst.cloudflare.Bucket("EnterpriseStorage")
// The Share worker takes over the hostname of the retired Teams worker. Cloudflare rejects a second custom domain for
// the same hostname, so adopt the Teams domain and replace it, deleting the old one first.
$transform(cloudflare.WorkersCustomDomain, (_args, opts, name) => {
-4
View File
@@ -1,14 +1,10 @@
import { Hono } from "hono"
import { DurableObject } from "cloudflare:workers"
import { jwtVerify, createRemoteJWKSet } from "jose"
import { createAppAuth } from "@octokit/auth-app"
import { Octokit } from "@octokit/rest"
import { Resource } from "sst"
import { parseRepositoryClaim } from "./github"
// Inert: the SYNC_SERVER binding and existing Durable Objects still reference this class, so it must stay exported.
export class SyncServer extends DurableObject {}
export default new Hono()
.get("/", (c) => c.text("Hello, world!"))
.post("/feishu", async (c) => {
-2
View File
@@ -19,7 +19,6 @@ declare module "sst" {
"value": string
}
"Api": import("@cloudflare/workers-types").Service
"Bucket": import("@cloudflare/workers-types").R2Bucket
"Console": {
"type": "sst.cloudflare.SolidStart"
"url": string
@@ -36,7 +35,6 @@ declare module "sst" {
"type": "sst.sst.Secret"
"value": string
}
"EnterpriseStorage": import("@cloudflare/workers-types").R2Bucket
"FEISHU_APP_ID": {
"type": "sst.sst.Secret"
"value": string