GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — opencode/infra/console.ts at dev · Maklu/opencode Expand file tree/ Copy pathconsole.tsMore file actions 259 lines (241 loc) · 7.56 KB / Copy pathconsole.tsFile metadata and controls259 lines (241 loc) · 7.56 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 import { domain } from "./stage" import { EMAILOCTOPUS_API_KEY } from "./app" //////////////// // DATABASE //////////////// const cluster = planetscale.getDatabaseOutput({ name: "opencode", organization: "anomalyco", }) const branch = $app.stage === "production" ? planetscale.getBranchOutput({ name: "production", organization: cluster.organization, database: cluster.name, }) : new planetscale.Branch("DatabaseBranch", { database: cluster.name, organization: cluster.organization, name: $app.stage, parentBranch: "production", }) const password = new planetscale.Password("DatabasePassword", { name: $app.stage, database: cluster.name, organization: cluster.organization, branch: branch.name, }) export const database = new sst.Linkable("Database", { properties: { host: password.accessHostUrl, database: cluster.name, username: password.username, password: password.plaintext, port: 3306, }, }) new sst.x.DevCommand("Studio", { link: [database], dev: { command: "bun db studio", directory: "packages/console/core", autostart: true, }, }) //////////////// // AUTH //////////////// const GITHUB_CLIENT_ID_CONSOLE = new sst.Secret("GITHUB_CLIENT_ID_CONSOLE") const GITHUB_CLIENT_SECRET_CONSOLE = new sst.Secret("GITHUB_CLIENT_SECRET_CONSOLE") const GOOGLE_CLIENT_ID = new sst.Secret("GOOGLE_CLIENT_ID") const authStorage = new sst.cloudflare.Kv("AuthStorage") export const auth = new sst.cloudflare.Worker("AuthApi", { domain: `auth.${domain}`, handler: "packages/console/function/src/auth.ts", url: true, link: [database, authStorage, GITHUB_CLIENT_ID_CONSOLE, GITHUB_CLIENT_SECRET_CONSOLE, GOOGLE_CLIENT_ID], }) //////////////// // GATEWAY //////////////// export const stripeWebhook = new stripe.WebhookEndpoint("StripeWebhookEndpoint", { url: $interpolate`https://${domain}/stripe/webhook`, enabledEvents: [ "checkout.session.async_payment_failed", "checkout.session.async_payment_succeeded", "checkout.session.completed", "checkout.session.expired", "charge.refunded", "invoice.payment_succeeded", "invoice.payment_failed", "invoice.payment_action_required", "customer.created", "customer.deleted", "customer.updated", "customer.discount.created", "customer.discount.deleted", "customer.discount.updated", "customer.source.created", "customer.source.deleted", "customer.source.expiring", "customer.source.updated", "customer.subscription.created", "customer.subscription.deleted", "customer.subscription.paused", "customer.subscription.pending_update_applied", "customer.subscription.pending_update_expired", "customer.subscription.resumed", "customer.subscription.trial_will_end", "customer.subscription.updated", ], }) const zenLiteProduct = new stripe.Product("ZenLite", { name: "OpenCode Go", }) const zenLiteCouponFirstMonth50 = new stripe.Coupon("ZenLiteCouponFirstMonth50", { name: "First month 50% off", percentOff: 50, appliesToProducts: [zenLiteProduct.id], duration: "once", }) const zenLitePrice = new stripe.Price("ZenLitePrice", { product: zenLiteProduct.id, currency: "usd", recurring: { interval: "month", intervalCount: 1, }, unitAmount: 1000, }) const ZEN_LITE_PRICE = new sst.Linkable("ZEN_LITE_PRICE", { properties: { product: zenLiteProduct.id, price: zenLitePrice.id, priceInr: 92900, firstMonth50Coupon: zenLiteCouponFirstMonth50.id, }, }) const zenBlackProduct = new stripe.Product("ZenBlack", { name: "OpenCode Black", }) const zenBlackPriceProps = { product: zenBlackProduct.id, currency: "usd", recurring: { interval: "month", intervalCount: 1, }, } const zenBlackPrice200 = new stripe.Price("ZenBlackPrice", { ...zenBlackPriceProps, unitAmount: 20000 }) const zenBlackPrice100 = new stripe.Price("ZenBlack100Price", { ...zenBlackPriceProps, unitAmount: 10000 }) const zenBlackPrice20 = new stripe.Price("ZenBlack20Price", { ...zenBlackPriceProps, unitAmount: 2000 }) const ZEN_BLACK_PRICE = new sst.Linkable("ZEN_BLACK_PRICE", { properties: { product: zenBlackProduct.id, plan200: zenBlackPrice200.id, plan100: zenBlackPrice100.id, plan20: zenBlackPrice20.id, }, }) const ZEN_MODELS = [ new sst.Secret("ZEN_MODELS1"), new sst.Secret("ZEN_MODELS2"), new sst.Secret("ZEN_MODELS3"), new sst.Secret("ZEN_MODELS4"), new sst.Secret("ZEN_MODELS5"), new sst.Secret("ZEN_MODELS6"), new sst.Secret("ZEN_MODELS7"), new sst.Secret("ZEN_MODELS8"), new sst.Secret("ZEN_MODELS9"), new sst.Secret("ZEN_MODELS10"), new sst.Secret("ZEN_MODELS11"), new sst.Secret("ZEN_MODELS12"), new sst.Secret("ZEN_MODELS13"), new sst.Secret("ZEN_MODELS14"), new sst.Secret("ZEN_MODELS15"), new sst.Secret("ZEN_MODELS16"), new sst.Secret("ZEN_MODELS17"), new sst.Secret("ZEN_MODELS18"), new sst.Secret("ZEN_MODELS19"), new sst.Secret("ZEN_MODELS20"), new sst.Secret("ZEN_MODELS21"), new sst.Secret("ZEN_MODELS22"), new sst.Secret("ZEN_MODELS23"), new sst.Secret("ZEN_MODELS24"), new sst.Secret("ZEN_MODELS25"), new sst.Secret("ZEN_MODELS26"), new sst.Secret("ZEN_MODELS27"), new sst.Secret("ZEN_MODELS28"), new sst.Secret("ZEN_MODELS29"), new sst.Secret("ZEN_MODELS30"), ] const STRIPE_SECRET_KEY = new sst.Secret("STRIPE_SECRET_KEY") const STRIPE_PUBLISHABLE_KEY = new sst.Secret("STRIPE_PUBLISHABLE_KEY") const AUTH_API_URL = new sst.Linkable("AUTH_API_URL", { properties: { value: auth.url.apply((url) => url!) }, }) const STRIPE_WEBHOOK_SECRET = new sst.Linkable("STRIPE_WEBHOOK_SECRET", { properties: { value: stripeWebhook.secret }, }) const gatewayKv = new sst.cloudflare.Kv("GatewayKv") //////////////// // CONSOLE //////////////// const bucket = new sst.cloudflare.Bucket("ZenData") const bucketNew = new sst.cloudflare.Bucket("ZenDataNew") const AWS_SES_ACCESS_KEY_ID = new sst.Secret("AWS_SES_ACCESS_KEY_ID") const AWS_SES_SECRET_ACCESS_KEY = new sst.Secret("AWS_SES_SECRET_ACCESS_KEY") const SALESFORCE_CLIENT_ID = new sst.Secret("SALESFORCE_CLIENT_ID") const SALESFORCE_CLIENT_SECRET = new sst.Secret("SALESFORCE_CLIENT_SECRET") const SALESFORCE_INSTANCE_URL = new sst.Secret("SALESFORCE_INSTANCE_URL") const logProcessor = new sst.cloudflare.Worker("LogProcessor", { handler: "packages/console/function/src/log-processor.ts", link: [new sst.Secret("HONEYCOMB_API_KEY")], }) new sst.cloudflare.x.SolidStart("Console", { domain, path: "packages/console/app", link: [ bucket, bucketNew, database, AUTH_API_URL, STRIPE_WEBHOOK_SECRET, STRIPE_SECRET_KEY, EMAILOCTOPUS_API_KEY, AWS_SES_ACCESS_KEY_ID, AWS_SES_SECRET_ACCESS_KEY, SALESFORCE_CLIENT_ID, SALESFORCE_CLIENT_SECRET, SALESFORCE_INSTANCE_URL, ZEN_BLACK_PRICE, ZEN_LITE_PRICE, new sst.Secret("ZEN_LIMITS"), new sst.Secret("ZEN_SESSION_SECRET"), ...ZEN_MODELS, ...($dev ? [ new sst.Secret("CLOUDFLARE_DEFAULT_ACCOUNT_ID", process.env.CLOUDFLARE_DEFAULT_ACCOUNT_ID!), new sst.Secret("CLOUDFLARE_API_TOKEN", process.env.CLOUDFLARE_API_TOKEN!), ] : []), gatewayKv, ], environment: { //VITE_DOCS_URL: web.url.apply((url) => url!), //VITE_API_URL: gateway.url.apply((url) => url!), VITE_AUTH_URL: auth.url.apply((url) => url!), VITE_STRIPE_PUBLISHABLE_KEY: STRIPE_PUBLISHABLE_KEY.value, }, transform: { server: { placement: { region: "aws:us-east-1" }, transform: { worker: { tailConsumers: [{ service: logProcessor.nodes.worker.scriptName }], }, }, }, }, }) |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |