summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--package.json2
-rw-r--r--src/models/User.ts5
-rw-r--r--src/util/Config.ts4
3 files changed, 8 insertions, 3 deletions
diff --git a/package.json b/package.json

index 7e3b6963..4d903c59 100644 --- a/package.json +++ b/package.json
@@ -20,7 +20,7 @@ "discord-open-source" ], "author": "Fosscord", - "license": "ISC", + "license": "GPLV3", "bugs": { "url": "https://github.com/fosscord/fosscord-server-util/issues" }, diff --git a/src/models/User.ts b/src/models/User.ts
index e4586088..ff7a3854 100644 --- a/src/models/User.ts +++ b/src/models/User.ts
@@ -11,6 +11,7 @@ export const PublicUserProjection = { public_flags: true, avatar: true, }; + export interface User { id: string; username: string; // username max length 32, min 2 @@ -22,6 +23,7 @@ export interface User { premium: boolean; // if user bought nitro premium_type: number; // nitro level bot: boolean; // if user is bot + bio: string; // short description of the user (max 190 chars) system: boolean; // shouldn't be used, the api sents this field type true, if the genetaed message comes from a system generated author nsfw_allowed: boolean; // if the user is older than 18 (resp. Config) mfa_enabled: boolean; // if multi factor authentication is enabled @@ -42,7 +44,7 @@ export interface User { }; } -// Privat user data: +// Private user data: export interface UserData { valid_tokens_since: Date; // all tokens with a previous issue date are invalid relationships: Relationship[]; @@ -138,6 +140,7 @@ export const UserSchema = new Schema({ premium: Boolean, premium_type: Number, bot: Boolean, + bio: String, system: Boolean, nsfw_allowed: Boolean, mfa_enabled: Boolean, diff --git a/src/util/Config.ts b/src/util/Config.ts
index a0d44a2d..ca6daa16 100644 --- a/src/util/Config.ts +++ b/src/util/Config.ts
@@ -79,6 +79,7 @@ export interface DefaultOptions { }; }; security: { + requestSignature: string; jwtSecret: string; forwadedFor: string | null; // header to get the real user ip address captcha: { @@ -93,7 +94,7 @@ export interface DefaultOptions { }; register: { email: { - necessary: boolean; + necessary: boolean; // we have to use necessary instead of required as the cli tool uses json schema and can't use required allowlist: boolean; blocklist: boolean; domains: string[]; @@ -164,6 +165,7 @@ export const DefaultOptions: DefaultOptions = { }, }, security: { + requestSignature: crypto.randomBytes(32).toString("base64"), jwtSecret: crypto.randomBytes(256).toString("base64"), forwadedFor: null, // forwadedFor: "X-Forwarded-For" // nginx/reverse proxy