1
0
Fork 0
out-of-your-element-fork-th.../matrix/read-registration.js

15 lines
558 B
JavaScript
Raw Normal View History

2023-05-01 05:05:47 +00:00
// @ts-check
2023-04-30 12:57:30 +00:00
const fs = require("fs")
2023-08-23 12:27:51 +00:00
const assert = require("assert").strict
2023-04-30 12:57:30 +00:00
const yaml = require("js-yaml")
/** @ts-ignore @type {import("../types").AppServiceRegistrationConfig} */
const reg = yaml.load(fs.readFileSync("registration.yaml", "utf8"))
reg["ooye"].invite = (reg.ooye.invite || []).filter(mxid => mxid.endsWith(`:${reg.ooye.server_name}`)) // one day I will understand why typescript disagrees with dot notation on this line
2023-08-23 12:27:51 +00:00
assert(reg.ooye.max_file_size)
assert(reg.ooye.namespace_prefix)
assert(reg.ooye.server_name)
2023-08-23 12:27:51 +00:00
module.exports = reg