-
Notifications
You must be signed in to change notification settings - Fork 0
/
sst.config.ts
37 lines (33 loc) · 1.12 KB
/
sst.config.ts
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
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: 'plus-plus',
removal: input?.stage === 'production' ? 'retain' : 'remove',
home: 'cloudflare',
};
},
async run() {
const clientId = new sst.Secret('SlackClientId');
const clientSecret = new sst.Secret('SlackClientSecret');
const signingSecret = new sst.Secret('SlackSigningSecret');
const installationsKv = new sst.cloudflare.Kv('PlusPlusInstallations');
const oauthStates = new sst.cloudflare.Kv('PlusPlusOAuthStates');
const db = new sst.cloudflare.D1('PlusPlus');
const worker = new sst.cloudflare.Worker('PlusPlusBot', {
handler: './src/index.ts',
link: [installationsKv, oauthStates, db],
url: true,
domain: $app.stage === 'production' ? 'app.plusplus.bot' : 'dev.plusplus.bot',
environment: {
SLACK_SIGNING_SECRET: signingSecret.value,
SLACK_CLIENT_ID: clientId.value,
SLACK_CLIENT_SECRET: clientSecret.value,
SLACK_BOT_SCOPES: 'chat:write,chat:write.public,app_mentions:read,users:read,commands,channels:history',
},
});
return {
url: worker.url,
};
},
});