4092 Commits

Author SHA1 Message Date
Puyodead1
9347a3ec6f
Merge pull request #1305 from ZaneH/feat/handle-github-webhook
Implement GitHub-compatible webhook
2025-07-12 12:56:00 -04:00
Rory&
d58414c9c5 Modern pins endpoints 2025-07-08 22:45:57 +02:00
dank074
5437dab688 fix unbundled startup for webrtc, and enable eslint 2025-07-07 22:13:39 +02:00
Rory&
cb0443821e Add emoji source endpoint 2025-07-07 21:59:25 +02:00
Rory&
5205ccecd5 Add endpoint to get account standing 2025-07-07 20:40:38 +02:00
Rory&
5ff2267cd1 Add staff_only flag in guild create schema 2025-07-07 19:54:33 +02:00
Rory&
479b428a2d Make time relative, oops 2025-07-06 22:24:09 +02:00
Rory&
971fc4a84f Log more identify timings 2025-07-06 22:22:30 +02:00
Rory&
f2427e66f0 Add intent to event map as per discord docs 2025-07-06 20:53:30 +02:00
Rory&
a68153ab86 Add map of privileged intents 2025-07-06 20:18:22 +02:00
Rory&
5feebe7672 Use binary flags for default intents in identify 2025-07-06 20:17:27 +02:00
Rory&
a3e597cafe Move erkinalp intents out 2025-07-06 20:17:02 +02:00
Rory&
997bdbc634 Use discord names for intents 2025-07-06 20:16:29 +02:00
Rory&
441dd3ddcd Add bitfield for discords privileged intents 2025-07-06 19:47:28 +02:00
Rory&
02efa17a04 Log gateway handling time 2025-07-06 19:14:27 +02:00
Rory&
1ee84431e4 Silence duplicate url/path errors when signature objects are passed in 2025-07-06 18:03:17 +02:00
Rory&
dae26ded20 Make CDN signature logging opt-in, log stack when both path and url are provided 2025-07-06 18:03:17 +02:00
Rory&
4bcb65ddc4 Fix CDN log prefix when fixing attachments 2025-07-06 18:03:17 +02:00
Rory&
b590482bfb Prettier 2025-07-06 18:03:17 +02:00
Rory&
199a518092 Resolve eslint errors 2025-07-06 18:03:17 +02:00
Rory&
9e4a769d69 Fix forgotten function signature changes 2025-07-06 18:03:17 +02:00
Rory&
2e196573ea Make IP/user-agent validation in CDN work 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
8bf45dcdc1 use prototype when signing message 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
9756ed227b sign urls in gateway 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
4395648c5b dont duplicate urls 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
c2497808dc include rest of attachment when signing 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
0fcdbd2831 sign attachment on sending message 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
387cef269a Sign media per user 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
8922ca1518 Add ip? 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
d6a5504e55 More logging 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
f18c85a6b6 log signed ip addr 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
0be56adcf4 Log signing errors 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
0e0da6d722 Add options to erquire IP or User Agent to access CDN 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
6fa604efd1 Set trusted proxies in CDN 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
d2015f06be Consistent request logging 2025-07-06 18:03:17 +02:00
Rory&
253bc2f255 Fix opcode 8 2025-07-06 17:41:50 +02:00
Emma [it/its]@Rory&
3e549dae28 Fix typeorm queries no longer allowing empty where clauses 2025-07-06 09:18:22 +02:00
Emma [it/its]@Rory&
fca7953a51 Update some dependencies, fix nix 2025-07-02 15:54:23 +02:00
MathMan05
6ab26cb3ff Fix the fix
this should actually be what's intended
2025-07-02 09:21:24 +10:00
MathMan05
76857bdcfb Check for old password when setting new
Checks for password
2025-07-02 09:21:24 +10:00
Zane Helton
ed85ba3dc2 Proxy avatar URL + adjust event logic
I've proxied the URLs with `getProxyUrl` specifying the size as 80x80.

I've also adjusted the event logic so that unstarring doesn't trigger an
alert and I've disabled the 'watch' event because Discord doesn't use
it either.
2025-06-29 12:17:24 -04:00
Zane Helton
590331518c Make tsc happy when using strings as Date in embed
Validation on embeds has interesting behavior. Embeds have a `timestamp`
property that is of type `Date`. However when providing a Date,
`WebhookExecuteSchema` silently ends the operation.

The resolution was to use strings and to annotate them with `//
@ts-expect-error`. This was not my first choice, but it was the best
option I saw.

The other option is to allow `Embeds` to pass strings as a timestamp but
I'd want a second opinion before making that change.
2025-06-29 11:34:57 -04:00
Zane Helton
9143c1d408 Refactor /github endpoint into it's own file 2025-06-29 10:46:16 -04:00
Zane Helton
82642d0e97 Capitalize ref_type when using in embed
The GitHub API provides `ref_type` as lowercase. For consistency, this
adds a utility function and makes use of it when formatting the `create`
event from GitHub.

tag => Tag
branch => Branch
2025-06-29 03:56:01 -04:00
Zane Helton
77dd481742 Implement webhook handler for GitHub
I've created a middleware that runs when `/github` is appended to the
webhook URL. The middleware parses the GitHub webhook and turns it into
usable embeds.
2025-06-29 03:18:43 -04:00
Zane Helton
33fde3bc4a Fix the creation of guilds from templates
The biggest hold-up was missing fields (`premium_tier`,
`welcome_screen`, etc.) but it looks like someone has provided a
helpful function called `createGuild(...)` to provide sensible default
values.

This commit fixes the errors related to creating a guild from a
template. I've also refactored the code to include roles and channels in
the template.

To make sure that the @everyone role is cloned correctly, when
creating the guild from a template, we check if the role's ID
matches the template's `source_guild_id`. If it does, we set the
@everyone role to the new guild's ID.
2025-06-29 13:27:14 +10:00
Zane Helton
eec2a8ba85 Set premium_tier to 0 when creating guild from template
I think we'll need to discuss the proper way to provide default values
here. `premium_tier` for example should never be provided from the
template so it's fine going after the spread operator.

This commit still doesn't allow guilds to be created from template
because the next error is that `welcome_screen` doesn't exist. Our
options:

1. Provide default values in the ORM
2. Provide default values in the guild creation process
3. Throw an error if the template is missing values

Resolves: #1283 but creates a new issue
2025-06-29 13:27:14 +10:00
Zane Helton
ff692c19b7 Await guild creation to fix a race condition
`Promise.all(...)` runs these simultaneously, yet role depends on the
guild to be created first. This can lead to a race condition. I've
awaited role creation too because the call to `Member.addToGuild(...)`
relies on the role to be created.
2025-06-29 13:27:14 +10:00
Zane Helton
4772731a17 Fix PATCH Template route implementation
The previous PATCH implementation was creating a new template rather
than editing the existing template. This resulted in all requests
failing because it was missing more than one required field.

Resolves: #1281
2025-06-29 13:25:22 +10:00
Zane Helton
0166bbf12a Make ban reason nullable
Resolves: #1276
2025-06-29 13:24:26 +10:00