Add additional config
This commit is contained in:
@@ -1,8 +1,28 @@
|
||||
import { ApiConfiguration, ClientConfiguration, DefaultsConfiguration, EndpointConfiguration, GeneralConfiguration, GifConfiguration, GuildConfiguration, KafkaConfiguration, LimitsConfiguration, LoginConfiguration, MetricsConfiguration, RabbitMQConfiguration, RegionConfiguration, RegisterConfiguration, SecurityConfiguration, SentryConfiguration, TemplateConfiguration } from "../config";
|
||||
import {
|
||||
ApiConfiguration,
|
||||
CdnConfiguration,
|
||||
ClientConfiguration,
|
||||
DefaultsConfiguration,
|
||||
EndpointConfiguration,
|
||||
ExternalTokensConfiguration,
|
||||
GeneralConfiguration,
|
||||
GifConfiguration,
|
||||
GuildConfiguration,
|
||||
KafkaConfiguration,
|
||||
LimitsConfiguration,
|
||||
LoginConfiguration,
|
||||
MetricsConfiguration,
|
||||
RabbitMQConfiguration,
|
||||
RegionConfiguration,
|
||||
RegisterConfiguration,
|
||||
SecurityConfiguration,
|
||||
SentryConfiguration,
|
||||
TemplateConfiguration
|
||||
} from "../config";
|
||||
|
||||
export class ConfigValue {
|
||||
gateway: EndpointConfiguration = new EndpointConfiguration();
|
||||
cdn: EndpointConfiguration = new EndpointConfiguration();
|
||||
cdn: CdnConfiguration = new CdnConfiguration();
|
||||
api: ApiConfiguration = new ApiConfiguration();
|
||||
general: GeneralConfiguration = new GeneralConfiguration();
|
||||
limits: LimitsConfiguration = new LimitsConfiguration();
|
||||
@@ -19,4 +39,5 @@ export class ConfigValue {
|
||||
metrics: MetricsConfiguration = new MetricsConfiguration();
|
||||
sentry: SentryConfiguration = new SentryConfiguration();
|
||||
defaults: DefaultsConfiguration = new DefaultsConfiguration();
|
||||
external: ExternalTokensConfiguration = new ExternalTokensConfiguration();
|
||||
}
|
||||
@@ -1,2 +1,2 @@
|
||||
export * from "./Config";
|
||||
export * from "./types/index";
|
||||
export * from "./types";
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { EndpointConfiguration } from "./EndpointConfiguration";
|
||||
|
||||
export class CdnConfiguration extends EndpointConfiguration {
|
||||
resizeHeightMax: number = 1000;
|
||||
resizeWidthMax: number = 1000;
|
||||
imagorServerUrl: string | null = null;
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
import { ClientReleaseConfiguration } from ".";
|
||||
|
||||
export class ClientConfiguration {
|
||||
//classes
|
||||
releases: ClientReleaseConfiguration = new ClientReleaseConfiguration();
|
||||
//base types
|
||||
useTestClient: boolean = true;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export class ExternalTokensConfiguration {
|
||||
twitter: string | null = null;
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Snowflake } from "../../util";
|
||||
import { Snowflake } from "@fosscord/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";
|
||||
correspondenceEmail: string | null = null;
|
||||
correspondenceUserID: string | null = null;
|
||||
image: string | null = null;
|
||||
instanceId: string = Snowflake.generate();
|
||||
|
||||
@@ -3,4 +3,5 @@ import { DiscoveryConfiguration, AutoJoinConfiguration } from ".";
|
||||
export class GuildConfiguration {
|
||||
discovery: DiscoveryConfiguration = new DiscoveryConfiguration();
|
||||
autoJoin: AutoJoinConfiguration = new AutoJoinConfiguration();
|
||||
defaultFeatures: string[] = [];
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
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;
|
||||
@@ -14,5 +12,5 @@ export class RegisterConfiguration {
|
||||
allowMultipleAccounts: boolean = true;
|
||||
blockProxies: boolean = true;
|
||||
incrementingDiscriminators: boolean = false; // random otherwise
|
||||
defaultRights: string = "0";
|
||||
defaultRights: string = "30644591655940"; // See `npm run generate:rights`
|
||||
}
|
||||
|
||||
@@ -2,10 +2,8 @@ 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");
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
export * from "./ApiConfiguration";
|
||||
export * from "./CdnConfiguration";
|
||||
export * from "./ClientConfiguration";
|
||||
export * from "./DefaultsConfiguration";
|
||||
export * from "./EndpointConfiguration";
|
||||
export * from "./ExternalTokensConfiguration";
|
||||
export * from "./GeneralConfiguration";
|
||||
export * from "./GifConfiguration";
|
||||
export * from "./GuildConfiguration";
|
||||
@@ -15,4 +17,4 @@ export * from "./RegisterConfiguration";
|
||||
export * from "./SecurityConfiguration";
|
||||
export * from "./SentryConfiguration";
|
||||
export * from "./TemplateConfiguration";
|
||||
export * from "./subconfigurations/index";
|
||||
export * from "./subconfigurations";
|
||||
@@ -1,8 +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";
|
||||
export * from "./client";
|
||||
export * from "./defaults";
|
||||
export * from "./guild";
|
||||
export * from "./kafka";
|
||||
export * from "./limits";
|
||||
export * from "./region";
|
||||
export * from "./register";
|
||||
export * from "./security";
|
||||
|
||||
@@ -344,7 +344,7 @@ export class User extends BaseClass {
|
||||
disabled: false,
|
||||
deleted: false,
|
||||
email: email,
|
||||
rights: Config.get().security.defaultRights,
|
||||
rights: Config.get().register.defaultRights,
|
||||
nsfw_allowed: true, // TODO: depending on age
|
||||
public_flags: 0,
|
||||
flags: "0", // TODO: generate
|
||||
|
||||
@@ -6,3 +6,4 @@ export * from "./entities/index";
|
||||
export * from "./dtos/index";
|
||||
export * from "./schemas";
|
||||
export * from "./imports";
|
||||
export * from "./config"
|
||||
Reference in New Issue
Block a user