Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudflare R2 migration #109

Merged
merged 6 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
- `MongoDB`: The MongoDB connection string (default: `mongodb://localhost:27017`)
- `ClientId`: The bot's Discord ID
- `DatabaseName`: The name of the MongoDB database
- `CollectionName`: The collection name of the MongoDB database
- `MaxBadges`: The maximum badges a user can have (default: `5`)
- `ExtraBoostBadges`: The amount of badges added to booster's allowance (default: `5`)
- `PromptChannel`: The channel to send the badge requests to
- `VerifierRole`: The role ID of people who can approve requests
- `Domains`: An array of whitelisted domains for badges
- `BucketEndpoint`: The URL to upload to the bucket
- `BucketPort`: The port to upload to the bucket. (default: `443`)
- `BucketAccessKey`: The bucket's access key
- `BucketSecretKey`: The bucket's secret key
- `BucketName`: The bucket's name
- `BucketDomain`: The bucket's public facing URL
5. Install packages using a node package manager (I suggest [PNPM](https://pnpm.io/)): `pnpm i`
6. Build: `pnpm build`
7. Run: `pnpm start`
13 changes: 10 additions & 3 deletions config/config.example.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"DiscordToken": "BotToken",
"MongoDB": "mongodb://localhost:27017",
"ClientId": "Bot ID",
"DatabaseName": "GlobalBadges",
"ClientID": "Bot ID",
"DatabaseName": "wehDB",
"CollectionName": "database",
"MaxBadges": 5,
"ExtraBoostBadges": 5,
Expand All @@ -12,5 +12,12 @@
"media.discordapp.net",
"cdn.discordapp.com",
"tenor.com"
]
],
"BucketEndpoint": "weh.r2.dev",
"BucketPort": 443,
"BucketSSL": true,
"BucketAccessKey": "SuperCoolKey",
"BucketSecretKey": "SuperSecretKey",
"BucketName": "WehBucket",
"BucketDomain": "https://bucket.weh.com"
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"dev": "tsx src/index.ts",
"start": "node dist/src/index.js",
"build": "tsc",
"lint": "eslint -c .eslintrc.json src config/*"
"lint": "eslint -c .eslintrc.json \"**/*.ts\""
},
"devDependencies": {
"@types/node": "^20.11.5",
"@types/node": "^20.11.10",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"eslint": "^8.56.0",
Expand All @@ -16,6 +16,7 @@
"dependencies": {
"@discordjs/rest": "^2.2.0",
"discord.js": "^14.14.1",
"minio": "^7.1.3",
"mongodb": "^6.3.0"
},
"optionalDependencies": {
Expand Down
Loading
Loading