User stuff, config structure changes, web panel start, versioncheck fix, api start, recaptcha support for web panel
This commit is contained in:
@@ -41,13 +41,19 @@ type SecretConfiguration = {
|
||||
authSecret: string
|
||||
}
|
||||
|
||||
type RecaptchaConfiguration = {
|
||||
sitekey: string,
|
||||
secret: string
|
||||
}
|
||||
|
||||
export type GalvanicConfiguration = {
|
||||
redis: RedisConfiguration,
|
||||
web: WebConfiguration,
|
||||
public: PublicConfiguration,
|
||||
logging: LoggingConfiguration,
|
||||
discord: DiscordConfiguration,
|
||||
secrets: SecretConfiguration
|
||||
discord: DiscordConfiguration | null,
|
||||
secrets: SecretConfiguration,
|
||||
recaptcha: RecaptchaConfiguration | null
|
||||
}
|
||||
|
||||
export const defaultConfig: GalvanicConfiguration = {
|
||||
@@ -75,14 +81,11 @@ export const defaultConfig: GalvanicConfiguration = {
|
||||
debug: false,
|
||||
network: false
|
||||
},
|
||||
discord: {
|
||||
token: "replace-me",
|
||||
guildId: "replace-me",
|
||||
clientId: "replace-me"
|
||||
},
|
||||
discord: null,
|
||||
secrets: {
|
||||
authSecret: "CHANGE-ME-PLEASE"
|
||||
}
|
||||
},
|
||||
recaptcha: null
|
||||
}
|
||||
|
||||
/** The current configuration. Read and parsed only during startup. */
|
||||
@@ -100,7 +103,7 @@ export function configurationExists() {
|
||||
return fs.existsSync('./config.json');
|
||||
}
|
||||
|
||||
/** Place the default configuration in the current directory. */
|
||||
/** Place [or overwrite] the [existing] default configuration in the current directory */
|
||||
export function generateDefaultConfig() {
|
||||
fs.writeFileSync('./config.json', JSON.stringify(defaultConfig, undefined, ' '));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user