summary refs log tree commit diff
path: root/src/util/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/config')
-rw-r--r--src/util/config/Config.ts46
-rw-r--r--src/util/config/index.ts2
-rw-r--r--src/util/config/types/ApiConfiguration.ts5
-rw-r--r--src/util/config/types/ClientConfiguration.ts8
-rw-r--r--src/util/config/types/DefaultsConfiguration.ts6
-rw-r--r--src/util/config/types/EndpointConfiguration.ts4
-rw-r--r--src/util/config/types/GeneralConfiguration.ts12
-rw-r--r--src/util/config/types/GifConfiguration.ts5
-rw-r--r--src/util/config/types/GuildConfiguration.ts6
-rw-r--r--src/util/config/types/KafkaConfiguration.ts5
-rw-r--r--src/util/config/types/LimitConfigurations.ts9
-rw-r--r--src/util/config/types/LoginConfiguration.ts3
-rw-r--r--src/util/config/types/MetricsConfiguration.ts3
-rw-r--r--src/util/config/types/RabbitMQConfiguration.ts3
-rw-r--r--src/util/config/types/RegionConfiguration.ts16
-rw-r--r--src/util/config/types/RegisterConfiguration.ts19
-rw-r--r--src/util/config/types/SecurityConfiguration.ts19
-rw-r--r--src/util/config/types/SentryConfiguration.ts8
-rw-r--r--src/util/config/types/TemplateConfiguration.ts6
-rw-r--r--src/util/config/types/index.ts18
-rw-r--r--src/util/config/types/subconfigurations/client/ClientReleaseConfiguration.ts4
-rw-r--r--src/util/config/types/subconfigurations/client/index.ts1
-rw-r--r--src/util/config/types/subconfigurations/defaults/GuildDefaults.ts8
-rw-r--r--src/util/config/types/subconfigurations/defaults/UserDefaults.ts5
-rw-r--r--src/util/config/types/subconfigurations/defaults/index.ts2
-rw-r--r--src/util/config/types/subconfigurations/guild/AutoJoin.ts5
-rw-r--r--src/util/config/types/subconfigurations/guild/Discovery.ts6
-rw-r--r--src/util/config/types/subconfigurations/guild/index.ts2
-rw-r--r--src/util/config/types/subconfigurations/index.ts8
-rw-r--r--src/util/config/types/subconfigurations/kafka/KafkaBroker.ts4
-rw-r--r--src/util/config/types/subconfigurations/kafka/index.ts1
-rw-r--r--src/util/config/types/subconfigurations/limits/ChannelLimits.ts5
-rw-r--r--src/util/config/types/subconfigurations/limits/GuildLimits.ts8
-rw-r--r--src/util/config/types/subconfigurations/limits/MessageLimits.ts8
-rw-r--r--src/util/config/types/subconfigurations/limits/RateLimits.ts18
-rw-r--r--src/util/config/types/subconfigurations/limits/UserLimits.ts5
-rw-r--r--src/util/config/types/subconfigurations/limits/index.ts6
-rw-r--r--src/util/config/types/subconfigurations/limits/ratelimits/Auth.ts12
-rw-r--r--src/util/config/types/subconfigurations/limits/ratelimits/RateLimitOptions.ts6
-rw-r--r--src/util/config/types/subconfigurations/limits/ratelimits/Route.ts19
-rw-r--r--src/util/config/types/subconfigurations/limits/ratelimits/index.ts3
-rw-r--r--src/util/config/types/subconfigurations/region/Region.ts12
-rw-r--r--src/util/config/types/subconfigurations/region/index.ts1
-rw-r--r--src/util/config/types/subconfigurations/register/DateOfBirth.ts4
-rw-r--r--src/util/config/types/subconfigurations/register/Email.ts7
-rw-r--r--src/util/config/types/subconfigurations/register/Password.ts7
-rw-r--r--src/util/config/types/subconfigurations/register/index.ts3
-rw-r--r--src/util/config/types/subconfigurations/security/Captcha.ts6
-rw-r--r--src/util/config/types/subconfigurations/security/TwoFactor.ts3
-rw-r--r--src/util/config/types/subconfigurations/security/index.ts2
50 files changed, 384 insertions, 0 deletions
diff --git a/src/util/config/Config.ts b/src/util/config/Config.ts
new file mode 100644
index 00000000..36c4509d
--- /dev/null
+++ b/src/util/config/Config.ts
@@ -0,0 +1,46 @@
+import {
+	ApiConfiguration,
+	ClientConfiguration,
+	DefaultsConfiguration,
+	EndpointConfiguration,
+	GeneralConfiguration,
+	GifConfiguration,
+	GuildConfiguration,
+	KafkaConfiguration,
+	LimitsConfiguration,
+	LoginConfiguration,
+	MetricsConfiguration,
+	RabbitMQConfiguration,
+	RegionConfiguration,
+	RegisterConfiguration,
+	SecurityConfiguration,
+	SentryConfiguration,
+	TemplateConfiguration
+} from ".";
+
+export class ConfigValue {
+	gateway: EndpointConfiguration = {
+		endpointPublic: '${location.protocol === "https:" ? "wss://" : "ws://"}${location.host}',
+		endpointPrivate: `ws://localhost:3001`
+	};
+	cdn: EndpointConfiguration = {
+		endpointPublic: "${location.host}",
+		endpointPrivate: `http://localhost:3001`
+	};
+	api: ApiConfiguration = new ApiConfiguration();
+	general: GeneralConfiguration = new GeneralConfiguration();
+	limits: LimitsConfiguration = new LimitsConfiguration();
+	security: SecurityConfiguration = new SecurityConfiguration();
+	login: LoginConfiguration = new LoginConfiguration();
+	register: RegisterConfiguration = new RegisterConfiguration();
+	regions: RegionConfiguration = new RegionConfiguration();
+	guild: GuildConfiguration = new GuildConfiguration();
+	gif: GifConfiguration = new GifConfiguration();
+	rabbitmq: RabbitMQConfiguration = new RabbitMQConfiguration();
+	kafka: KafkaConfiguration = new KafkaConfiguration();
+	templates: TemplateConfiguration = new TemplateConfiguration();
+	client: ClientConfiguration = new ClientConfiguration();
+	metrics: MetricsConfiguration = new MetricsConfiguration();
+	sentry: SentryConfiguration = new SentryConfiguration();
+	defaults: DefaultsConfiguration = new DefaultsConfiguration();
+}
diff --git a/src/util/config/index.ts b/src/util/config/index.ts
new file mode 100644
index 00000000..0a9b58ae
--- /dev/null
+++ b/src/util/config/index.ts
@@ -0,0 +1,2 @@
+export * from "./Config";
+export * from "./types/index";
diff --git a/src/util/config/types/ApiConfiguration.ts b/src/util/config/types/ApiConfiguration.ts
new file mode 100644
index 00000000..442a5986
--- /dev/null
+++ b/src/util/config/types/ApiConfiguration.ts
@@ -0,0 +1,5 @@
+export class ApiConfiguration {
+	defaultVersion: string = "9";
+	activeVersions: string[] = ["6", "7", "8", "9"];
+	useFosscordEnhancements: boolean = true;
+}
diff --git a/src/util/config/types/ClientConfiguration.ts b/src/util/config/types/ClientConfiguration.ts
new file mode 100644
index 00000000..44704404
--- /dev/null
+++ b/src/util/config/types/ClientConfiguration.ts
@@ -0,0 +1,8 @@
+import { ClientReleaseConfiguration } from ".";
+
+export class ClientConfiguration {
+	//classes
+	releases: ClientReleaseConfiguration = new ClientReleaseConfiguration();
+	//base types
+	useTestClient: boolean = true;
+}
diff --git a/src/util/config/types/DefaultsConfiguration.ts b/src/util/config/types/DefaultsConfiguration.ts
new file mode 100644
index 00000000..d5ee39e7
--- /dev/null
+++ b/src/util/config/types/DefaultsConfiguration.ts
@@ -0,0 +1,6 @@
+import { GuildDefaults, UserDefaults } from ".";
+
+export class DefaultsConfiguration {
+	guild: GuildDefaults = new GuildDefaults();
+	user: UserDefaults = new UserDefaults();
+}
diff --git a/src/util/config/types/EndpointConfiguration.ts b/src/util/config/types/EndpointConfiguration.ts
new file mode 100644
index 00000000..26f3106f
--- /dev/null
+++ b/src/util/config/types/EndpointConfiguration.ts
@@ -0,0 +1,4 @@
+export class EndpointConfiguration {
+	endpointPrivate: string | null = null;
+	endpointPublic: string | null = null;
+}
diff --git a/src/util/config/types/GeneralConfiguration.ts b/src/util/config/types/GeneralConfiguration.ts
new file mode 100644
index 00000000..5cb8df89
--- /dev/null
+++ b/src/util/config/types/GeneralConfiguration.ts
@@ -0,0 +1,12 @@
+import { Snowflake } from "../../util";
+
+export class GeneralConfiguration {
+	instanceName: string = "Fosscord Instance";
+	instanceDescription: string | null = "This is a Fosscord instance made in the pre-release days";
+	frontPage: string | null = null;
+	tosPage: string | null = null;
+	correspondenceEmail: string | null = "noreply@localhost.local";
+	correspondenceUserID: string | null = null;
+	image: string | null = null;
+	instanceId: string = Snowflake.generate();
+}
diff --git a/src/util/config/types/GifConfiguration.ts b/src/util/config/types/GifConfiguration.ts
new file mode 100644
index 00000000..565c2ac0
--- /dev/null
+++ b/src/util/config/types/GifConfiguration.ts
@@ -0,0 +1,5 @@
+export class GifConfiguration {
+	enabled: boolean = true;
+	provider: "tenor" = "tenor"; // more coming soon
+	apiKey?: string = "LIVDSRZULELA";
+}
diff --git a/src/util/config/types/GuildConfiguration.ts b/src/util/config/types/GuildConfiguration.ts
new file mode 100644
index 00000000..ebc1b442
--- /dev/null
+++ b/src/util/config/types/GuildConfiguration.ts
@@ -0,0 +1,6 @@
+import { AutoJoinConfiguration, DiscoveryConfiguration } from ".";
+
+export class GuildConfiguration {
+	discovery: DiscoveryConfiguration = new DiscoveryConfiguration();
+	autoJoin: AutoJoinConfiguration = new AutoJoinConfiguration();
+}
diff --git a/src/util/config/types/KafkaConfiguration.ts b/src/util/config/types/KafkaConfiguration.ts
new file mode 100644
index 00000000..a3aa8058
--- /dev/null
+++ b/src/util/config/types/KafkaConfiguration.ts
@@ -0,0 +1,5 @@
+import { KafkaBroker } from ".";
+
+export class KafkaConfiguration {
+	brokers: KafkaBroker[] | null = null;
+}
diff --git a/src/util/config/types/LimitConfigurations.ts b/src/util/config/types/LimitConfigurations.ts
new file mode 100644
index 00000000..a3a52cf5
--- /dev/null
+++ b/src/util/config/types/LimitConfigurations.ts
@@ -0,0 +1,9 @@
+import { ChannelLimits, GuildLimits, MessageLimits, RateLimits, UserLimits } from ".";
+
+export class LimitsConfiguration {
+	user: UserLimits = new UserLimits();
+	guild: GuildLimits = new GuildLimits();
+	message: MessageLimits = new MessageLimits();
+	channel: ChannelLimits = new ChannelLimits();
+	rate: RateLimits = new RateLimits();
+}
diff --git a/src/util/config/types/LoginConfiguration.ts b/src/util/config/types/LoginConfiguration.ts
new file mode 100644
index 00000000..d8b737b9
--- /dev/null
+++ b/src/util/config/types/LoginConfiguration.ts
@@ -0,0 +1,3 @@
+export class LoginConfiguration {
+	requireCaptcha: boolean = false;
+}
diff --git a/src/util/config/types/MetricsConfiguration.ts b/src/util/config/types/MetricsConfiguration.ts
new file mode 100644
index 00000000..f6b1d8e6
--- /dev/null
+++ b/src/util/config/types/MetricsConfiguration.ts
@@ -0,0 +1,3 @@
+export class MetricsConfiguration {
+	timeout: number = 30000;
+}
diff --git a/src/util/config/types/RabbitMQConfiguration.ts b/src/util/config/types/RabbitMQConfiguration.ts
new file mode 100644
index 00000000..bd4b6ca3
--- /dev/null
+++ b/src/util/config/types/RabbitMQConfiguration.ts
@@ -0,0 +1,3 @@
+export class RabbitMQConfiguration {
+	host: string | null = null;
+}
diff --git a/src/util/config/types/RegionConfiguration.ts b/src/util/config/types/RegionConfiguration.ts
new file mode 100644
index 00000000..b4b8c4a3
--- /dev/null
+++ b/src/util/config/types/RegionConfiguration.ts
@@ -0,0 +1,16 @@
+import { Region } from ".";
+
+export class RegionConfiguration {
+	default: string = "fosscord";
+	useDefaultAsOptimal: boolean = true;
+	available: Region[] = [
+		{
+			id: "fosscord",
+			name: "Fosscord",
+			endpoint: "127.0.0.1:3004",
+			vip: false,
+			custom: false,
+			deprecated: false
+		}
+	];
+}
diff --git a/src/util/config/types/RegisterConfiguration.ts b/src/util/config/types/RegisterConfiguration.ts
new file mode 100644
index 00000000..68946272
--- /dev/null
+++ b/src/util/config/types/RegisterConfiguration.ts
@@ -0,0 +1,19 @@
+import { DateOfBirthConfiguration, EmailConfiguration, PasswordConfiguration } from ".";
+
+export class RegisterConfiguration {
+	//classes
+	email: EmailConfiguration = new EmailConfiguration();
+	dateOfBirth: DateOfBirthConfiguration = new DateOfBirthConfiguration();
+	password: PasswordConfiguration = new PasswordConfiguration();
+	//base types
+	disabled: boolean = false;
+	requireCaptcha: boolean = true;
+	requireInvite: boolean = false;
+	allowGuests: boolean = true;
+	guestsRequireInvite: boolean = true;
+	allowNewRegistration: boolean = true;
+	allowMultipleAccounts: boolean = true;
+	blockProxies: boolean = true;
+	incrementingDiscriminators: boolean = false; // random otherwise
+	defaultRights: string = "0";
+}
diff --git a/src/util/config/types/SecurityConfiguration.ts b/src/util/config/types/SecurityConfiguration.ts
new file mode 100644
index 00000000..a2cebbd3
--- /dev/null
+++ b/src/util/config/types/SecurityConfiguration.ts
@@ -0,0 +1,19 @@
+import crypto from "crypto";
+import { CaptchaConfiguration, TwoFactorConfiguration } from ".";
+
+export class SecurityConfiguration {
+	//classes
+	captcha: CaptchaConfiguration = new CaptchaConfiguration();
+	twoFactor: TwoFactorConfiguration = new TwoFactorConfiguration();
+	//base types
+	autoUpdate: boolean | number = true;
+	requestSignature: string = crypto.randomBytes(32).toString("base64");
+	jwtSecret: string = crypto.randomBytes(256).toString("base64");
+	// header to get the real user ip address
+	// X-Forwarded-For for nginx/reverse proxies
+	// CF-Connecting-IP for cloudflare
+	forwadedFor: string | null = null;
+	ipdataApiKey: string | null = "eca677b284b3bac29eb72f5e496aa9047f26543605efe99ff2ce35c9";
+	mfaBackupCodeCount: number = 10;
+	mfaBackupCodeBytes: number = 4;
+}
diff --git a/src/util/config/types/SentryConfiguration.ts b/src/util/config/types/SentryConfiguration.ts
new file mode 100644
index 00000000..d50f5f4c
--- /dev/null
+++ b/src/util/config/types/SentryConfiguration.ts
@@ -0,0 +1,8 @@
+import { hostname } from "os";
+
+export class SentryConfiguration {
+	enabled: boolean = false;
+	endpoint: string = "https://05e8e3d005f34b7d97e920ae5870a5e5@sentry.thearcanebrony.net/6";
+	traceSampleRate: number = 1.0;
+	environment: string = hostname();
+}
diff --git a/src/util/config/types/TemplateConfiguration.ts b/src/util/config/types/TemplateConfiguration.ts
new file mode 100644
index 00000000..aade2934
--- /dev/null
+++ b/src/util/config/types/TemplateConfiguration.ts
@@ -0,0 +1,6 @@
+export class TemplateConfiguration {
+	enabled: boolean = true;
+	allowTemplateCreation: boolean = true;
+	allowDiscordTemplates: boolean = true;
+	allowRaws: boolean = true;
+}
diff --git a/src/util/config/types/index.ts b/src/util/config/types/index.ts
new file mode 100644
index 00000000..a8cdff4c
--- /dev/null
+++ b/src/util/config/types/index.ts
@@ -0,0 +1,18 @@
+export * from "./ApiConfiguration";
+export * from "./ClientConfiguration";
+export * from "./DefaultsConfiguration";
+export * from "./EndpointConfiguration";
+export * from "./GeneralConfiguration";
+export * from "./GifConfiguration";
+export * from "./GuildConfiguration";
+export * from "./KafkaConfiguration";
+export * from "./LimitConfigurations";
+export * from "./LoginConfiguration";
+export * from "./MetricsConfiguration";
+export * from "./RabbitMQConfiguration";
+export * from "./RegionConfiguration";
+export * from "./RegisterConfiguration";
+export * from "./SecurityConfiguration";
+export * from "./SentryConfiguration";
+export * from "./subconfigurations/index";
+export * from "./TemplateConfiguration";
diff --git a/src/util/config/types/subconfigurations/client/ClientReleaseConfiguration.ts b/src/util/config/types/subconfigurations/client/ClientReleaseConfiguration.ts
new file mode 100644
index 00000000..b082b711
--- /dev/null
+++ b/src/util/config/types/subconfigurations/client/ClientReleaseConfiguration.ts
@@ -0,0 +1,4 @@
+export class ClientReleaseConfiguration {
+	useLocalRelease: boolean = true; //TODO
+	upstreamVersion: string = "0.0.264";
+}
diff --git a/src/util/config/types/subconfigurations/client/index.ts b/src/util/config/types/subconfigurations/client/index.ts
new file mode 100644
index 00000000..96bbb0ca
--- /dev/null
+++ b/src/util/config/types/subconfigurations/client/index.ts
@@ -0,0 +1 @@
+export * from "./ClientReleaseConfiguration";
diff --git a/src/util/config/types/subconfigurations/defaults/GuildDefaults.ts b/src/util/config/types/subconfigurations/defaults/GuildDefaults.ts
new file mode 100644
index 00000000..435ae06c
--- /dev/null
+++ b/src/util/config/types/subconfigurations/defaults/GuildDefaults.ts
@@ -0,0 +1,8 @@
+export class GuildDefaults {
+	maxPresences: number = 250000;
+	maxVideoChannelUsers: number = 200;
+	afkTimeout: number = 300;
+	defaultMessageNotifications: number = 1;
+	explicitContentFilter: number = 0;
+	test: number = 123;
+}
diff --git a/src/util/config/types/subconfigurations/defaults/UserDefaults.ts b/src/util/config/types/subconfigurations/defaults/UserDefaults.ts
new file mode 100644
index 00000000..cc56be36
--- /dev/null
+++ b/src/util/config/types/subconfigurations/defaults/UserDefaults.ts
@@ -0,0 +1,5 @@
+export class UserDefaults {
+	premium: boolean = false;
+	premium_type: number = 2;
+	verified: boolean = true;
+}
diff --git a/src/util/config/types/subconfigurations/defaults/index.ts b/src/util/config/types/subconfigurations/defaults/index.ts
new file mode 100644
index 00000000..50258d1c
--- /dev/null
+++ b/src/util/config/types/subconfigurations/defaults/index.ts
@@ -0,0 +1,2 @@
+export * from "./GuildDefaults";
+export * from "./UserDefaults";
diff --git a/src/util/config/types/subconfigurations/guild/AutoJoin.ts b/src/util/config/types/subconfigurations/guild/AutoJoin.ts
new file mode 100644
index 00000000..4d7af352
--- /dev/null
+++ b/src/util/config/types/subconfigurations/guild/AutoJoin.ts
@@ -0,0 +1,5 @@
+export class AutoJoinConfiguration {
+	enabled: boolean = true;
+	guilds: string[] = [];
+	canLeave: boolean = true;
+}
diff --git a/src/util/config/types/subconfigurations/guild/Discovery.ts b/src/util/config/types/subconfigurations/guild/Discovery.ts
new file mode 100644
index 00000000..a7cb81db
--- /dev/null
+++ b/src/util/config/types/subconfigurations/guild/Discovery.ts
@@ -0,0 +1,6 @@
+export class DiscoveryConfiguration {
+	showAllGuilds: boolean = false;
+	useRecommendation: boolean = false; // TODO: Recommendation, privacy concern?
+	offset: number = 0;
+	limit: number = 24;
+}
diff --git a/src/util/config/types/subconfigurations/guild/index.ts b/src/util/config/types/subconfigurations/guild/index.ts
new file mode 100644
index 00000000..e9614856
--- /dev/null
+++ b/src/util/config/types/subconfigurations/guild/index.ts
@@ -0,0 +1,2 @@
+export * from "./AutoJoin";
+export * from "./Discovery";
diff --git a/src/util/config/types/subconfigurations/index.ts b/src/util/config/types/subconfigurations/index.ts
new file mode 100644
index 00000000..bfbadc92
--- /dev/null
+++ b/src/util/config/types/subconfigurations/index.ts
@@ -0,0 +1,8 @@
+export * from "./client/index";
+export * from "./defaults/index";
+export * from "./guild/index";
+export * from "./kafka/index";
+export * from "./limits/index";
+export * from "./region/index";
+export * from "./register/index";
+export * from "./security/index";
diff --git a/src/util/config/types/subconfigurations/kafka/KafkaBroker.ts b/src/util/config/types/subconfigurations/kafka/KafkaBroker.ts
new file mode 100644
index 00000000..f7dc1cf7
--- /dev/null
+++ b/src/util/config/types/subconfigurations/kafka/KafkaBroker.ts
@@ -0,0 +1,4 @@
+export interface KafkaBroker {
+	ip: string;
+	port: number;
+}
diff --git a/src/util/config/types/subconfigurations/kafka/index.ts b/src/util/config/types/subconfigurations/kafka/index.ts
new file mode 100644
index 00000000..2c633950
--- /dev/null
+++ b/src/util/config/types/subconfigurations/kafka/index.ts
@@ -0,0 +1 @@
+export * from "./KafkaBroker";
diff --git a/src/util/config/types/subconfigurations/limits/ChannelLimits.ts b/src/util/config/types/subconfigurations/limits/ChannelLimits.ts
new file mode 100644
index 00000000..76eeeb41
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/ChannelLimits.ts
@@ -0,0 +1,5 @@
+export class ChannelLimits {
+	maxPins: number = 500;
+	maxTopic: number = 1024;
+	maxWebhooks: number = 100;
+}
diff --git a/src/util/config/types/subconfigurations/limits/GuildLimits.ts b/src/util/config/types/subconfigurations/limits/GuildLimits.ts
new file mode 100644
index 00000000..015654cb
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/GuildLimits.ts
@@ -0,0 +1,8 @@
+export class GuildLimits {
+	maxRoles: number = 1000;
+	maxEmojis: number = 2000;
+	maxMembers: number = 25000000;
+	maxChannels: number = 65535;
+	maxChannelsInCategory: number = 65535;
+	hideOfflineMember: number = 3;
+}
diff --git a/src/util/config/types/subconfigurations/limits/MessageLimits.ts b/src/util/config/types/subconfigurations/limits/MessageLimits.ts
new file mode 100644
index 00000000..684a5057
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/MessageLimits.ts
@@ -0,0 +1,8 @@
+export class MessageLimits {
+	maxCharacters: number = 1048576;
+	maxTTSCharacters: number = 160;
+	maxReactions: number = 2048;
+	maxAttachmentSize: number = 1024 * 1024 * 1024;
+	maxBulkDelete: number = 1000;
+	maxEmbedDownloadSize: number = 1024 * 1024 * 5;
+}
diff --git a/src/util/config/types/subconfigurations/limits/RateLimits.ts b/src/util/config/types/subconfigurations/limits/RateLimits.ts
new file mode 100644
index 00000000..764acdd6
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/RateLimits.ts
@@ -0,0 +1,18 @@
+import { RateLimitOptions, RouteRateLimit } from ".";
+
+export class RateLimits {
+	disabled: boolean = true;
+	ip: Omit<RateLimitOptions, "bot_count"> = {
+		count: 500,
+		window: 5
+	};
+	global: RateLimitOptions = {
+		count: 250,
+		window: 5
+	};
+	error: RateLimitOptions = {
+		count: 10,
+		window: 5
+	};
+	routes: RouteRateLimit = new RouteRateLimit();
+}
diff --git a/src/util/config/types/subconfigurations/limits/UserLimits.ts b/src/util/config/types/subconfigurations/limits/UserLimits.ts
new file mode 100644
index 00000000..b8bdcb2d
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/UserLimits.ts
@@ -0,0 +1,5 @@
+export class UserLimits {
+	maxGuilds: number = 1048576;
+	maxUsername: number = 127;
+	maxFriends: number = 5000;
+}
diff --git a/src/util/config/types/subconfigurations/limits/index.ts b/src/util/config/types/subconfigurations/limits/index.ts
new file mode 100644
index 00000000..a4911542
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/index.ts
@@ -0,0 +1,6 @@
+export * from "./ChannelLimits";
+export * from "./GuildLimits";
+export * from "./MessageLimits";
+export * from "./RateLimits";
+export * from "./ratelimits/index";
+export * from "./UserLimits";
diff --git a/src/util/config/types/subconfigurations/limits/ratelimits/Auth.ts b/src/util/config/types/subconfigurations/limits/ratelimits/Auth.ts
new file mode 100644
index 00000000..0f363e7f
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/ratelimits/Auth.ts
@@ -0,0 +1,12 @@
+import { RateLimitOptions } from "./RateLimitOptions";
+
+export class AuthRateLimit {
+	login: RateLimitOptions = {
+		count: 5,
+		window: 60
+	};
+	register: RateLimitOptions = {
+		count: 2,
+		window: 60 * 60 * 12
+	};
+}
diff --git a/src/util/config/types/subconfigurations/limits/ratelimits/RateLimitOptions.ts b/src/util/config/types/subconfigurations/limits/ratelimits/RateLimitOptions.ts
new file mode 100644
index 00000000..829813fb
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/ratelimits/RateLimitOptions.ts
@@ -0,0 +1,6 @@
+export interface RateLimitOptions {
+	bot?: number;
+	count: number;
+	window: number;
+	onyIp?: boolean;
+}
diff --git a/src/util/config/types/subconfigurations/limits/ratelimits/Route.ts b/src/util/config/types/subconfigurations/limits/ratelimits/Route.ts
new file mode 100644
index 00000000..6890699e
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/ratelimits/Route.ts
@@ -0,0 +1,19 @@
+import { AuthRateLimit } from "./Auth";
+import { RateLimitOptions } from "./RateLimitOptions";
+
+export class RouteRateLimit {
+	guild: RateLimitOptions = {
+		count: 5,
+		window: 5
+	};
+	webhook: RateLimitOptions = {
+		count: 10,
+		window: 5
+	};
+	channel: RateLimitOptions = {
+		count: 10,
+		window: 5
+	};
+	auth: AuthRateLimit = new AuthRateLimit();
+	// TODO: rate limit configuration for all routes
+}
diff --git a/src/util/config/types/subconfigurations/limits/ratelimits/index.ts b/src/util/config/types/subconfigurations/limits/ratelimits/index.ts
new file mode 100644
index 00000000..432eb601
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/ratelimits/index.ts
@@ -0,0 +1,3 @@
+export * from "./Auth";
+export * from "./RateLimitOptions";
+export * from "./Route";
diff --git a/src/util/config/types/subconfigurations/region/Region.ts b/src/util/config/types/subconfigurations/region/Region.ts
new file mode 100644
index 00000000..c1bcfd01
--- /dev/null
+++ b/src/util/config/types/subconfigurations/region/Region.ts
@@ -0,0 +1,12 @@
+export interface Region {
+	id: string;
+	name: string;
+	endpoint: string;
+	location?: {
+		latitude: number;
+		longitude: number;
+	};
+	vip: boolean;
+	custom: boolean;
+	deprecated: boolean;
+}
diff --git a/src/util/config/types/subconfigurations/region/index.ts b/src/util/config/types/subconfigurations/region/index.ts
new file mode 100644
index 00000000..2beb8de7
--- /dev/null
+++ b/src/util/config/types/subconfigurations/region/index.ts
@@ -0,0 +1 @@
+export * from "./Region";
diff --git a/src/util/config/types/subconfigurations/register/DateOfBirth.ts b/src/util/config/types/subconfigurations/register/DateOfBirth.ts
new file mode 100644
index 00000000..4831a4b7
--- /dev/null
+++ b/src/util/config/types/subconfigurations/register/DateOfBirth.ts
@@ -0,0 +1,4 @@
+export class DateOfBirthConfiguration {
+	required: boolean = true;
+	minimum: number = 13; // in years
+}
diff --git a/src/util/config/types/subconfigurations/register/Email.ts b/src/util/config/types/subconfigurations/register/Email.ts
new file mode 100644
index 00000000..7f54faa7
--- /dev/null
+++ b/src/util/config/types/subconfigurations/register/Email.ts
@@ -0,0 +1,7 @@
+export class EmailConfiguration {
+	required: boolean = false;
+	allowlist: boolean = false;
+	blocklist: boolean = true;
+	domains: string[] = []; // TODO: efficiently save domain blocklist in database
+	// domains: fs.readFileSync(__dirname + "/blockedEmailDomains.txt", { encoding: "utf8" }).split("\n"),
+}
diff --git a/src/util/config/types/subconfigurations/register/Password.ts b/src/util/config/types/subconfigurations/register/Password.ts
new file mode 100644
index 00000000..383bdcfa
--- /dev/null
+++ b/src/util/config/types/subconfigurations/register/Password.ts
@@ -0,0 +1,7 @@
+export class PasswordConfiguration {
+	required: boolean = false;
+	minLength: number = 8;
+	minNumbers: number = 2;
+	minUpperCase: number = 2;
+	minSymbols: number = 0;
+}
diff --git a/src/util/config/types/subconfigurations/register/index.ts b/src/util/config/types/subconfigurations/register/index.ts
new file mode 100644
index 00000000..d9738120
--- /dev/null
+++ b/src/util/config/types/subconfigurations/register/index.ts
@@ -0,0 +1,3 @@
+export * from "./DateOfBirth";
+export * from "./Email";
+export * from "./Password";
diff --git a/src/util/config/types/subconfigurations/security/Captcha.ts b/src/util/config/types/subconfigurations/security/Captcha.ts
new file mode 100644
index 00000000..21c4ef44
--- /dev/null
+++ b/src/util/config/types/subconfigurations/security/Captcha.ts
@@ -0,0 +1,6 @@
+export class CaptchaConfiguration {
+	enabled: boolean = false;
+	service: "recaptcha" | "hcaptcha" | null = null; // TODO: hcaptcha, custom
+	sitekey: string | null = null;
+	secret: string | null = null;
+}
diff --git a/src/util/config/types/subconfigurations/security/TwoFactor.ts b/src/util/config/types/subconfigurations/security/TwoFactor.ts
new file mode 100644
index 00000000..20d2f9ab
--- /dev/null
+++ b/src/util/config/types/subconfigurations/security/TwoFactor.ts
@@ -0,0 +1,3 @@
+export class TwoFactorConfiguration {
+	generateBackupCodes: boolean = true;
+}
diff --git a/src/util/config/types/subconfigurations/security/index.ts b/src/util/config/types/subconfigurations/security/index.ts
new file mode 100644
index 00000000..17619589
--- /dev/null
+++ b/src/util/config/types/subconfigurations/security/index.ts
@@ -0,0 +1,2 @@
+export * from "./Captcha";
+export * from "./TwoFactor";