User stuff, config structure changes, web panel start, versioncheck fix, api start, recaptcha support for web panel

This commit is contained in:
2025-02-08 21:19:25 -05:00
parent bc3443b1dc
commit 73e9b72ad4
36 changed files with 5526 additions and 87 deletions

View File

@@ -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, ' '));
}