1
0

feat: require a special registration word in registration reason (#2)

A crude way to prune out people who don't read the rules. The hint is in
the bottom of the rules generally.
This commit is contained in:
Leafus
2025-05-19 16:33:28 +00:00
committed by Bluey Heeler
parent 06ff35a89f
commit df322ebadc
9 changed files with 185 additions and 80 deletions
@@ -39,6 +39,14 @@ export const meta = {
type: 'boolean',
optional: false, nullable: false,
},
registrationWord: {
type: 'string',
optional: false, nullable: true,
},
regWordRequired: {
type: 'boolean',
optional: false, nullable: false,
},
enableHcaptcha: {
type: 'boolean',
optional: false, nullable: false,
@@ -657,6 +665,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
disableRegistration: instance.disableRegistration,
emailRequiredForSignup: instance.emailRequiredForSignup,
approvalRequiredForSignup: instance.approvalRequiredForSignup,
registrationWord: instance.registrationWord,
regWordRequired: instance.regWordRequired,
enableHcaptcha: instance.enableHcaptcha,
hcaptchaSiteKey: instance.hcaptchaSiteKey,
enableMcaptcha: instance.enableMcaptcha,
@@ -74,6 +74,8 @@ export const paramDef = {
cacheRemoteSensitiveFiles: { type: 'boolean' },
emailRequiredForSignup: { type: 'boolean' },
approvalRequiredForSignup: { type: 'boolean' },
regWordRequired: { type: 'boolean', nullable: false },
registrationWord: { type: 'string', nullable: true },
enableHcaptcha: { type: 'boolean' },
hcaptchaSiteKey: { type: 'string', nullable: true },
hcaptchaSecretKey: { type: 'string', nullable: true },
@@ -357,6 +359,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.approvalRequiredForSignup = ps.approvalRequiredForSignup;
}
if (ps.registrationWord !== undefined) {
set.registrationWord = ps.registrationWord;
}
if (ps.regWordRequired !== undefined) {
set.regWordRequired = ps.regWordRequired;
}
if (ps.enableHcaptcha !== undefined) {
set.enableHcaptcha = ps.enableHcaptcha;
}