Merge branch 'v3.0-beta3'
This commit is contained in:
commit
0e6e5e61e4
3 changed files with 14 additions and 9 deletions
|
@ -105,7 +105,8 @@ async function validateHomeserverOrigin(serverUrlPrompt, url) {
|
||||||
const serverNameResponse = await prompt({
|
const serverNameResponse = await prompt({
|
||||||
type: "input",
|
type: "input",
|
||||||
name: "server_name",
|
name: "server_name",
|
||||||
message: "Homeserver name"
|
message: "Homeserver name",
|
||||||
|
validate: serverName => !!serverName.match(/[a-z][a-z.]+[a-z]/)
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log("What is the URL of your homeserver?")
|
console.log("What is the URL of your homeserver?")
|
||||||
|
@ -176,7 +177,7 @@ async function validateHomeserverOrigin(serverUrlPrompt, url) {
|
||||||
message: "Client secret"
|
message: "Client secret"
|
||||||
})
|
})
|
||||||
|
|
||||||
const template = getTemplateRegistration()
|
const template = getTemplateRegistration(serverNameResponse.server_name)
|
||||||
reg = {
|
reg = {
|
||||||
...template,
|
...template,
|
||||||
url: bridgeOriginResponse.bridge_origin,
|
url: bridgeOriginResponse.bridge_origin,
|
||||||
|
|
|
@ -24,8 +24,12 @@ function writeRegistration(reg) {
|
||||||
fs.writeFileSync(registrationFilePath, JSON.stringify(reg, null, 2))
|
fs.writeFileSync(registrationFilePath, JSON.stringify(reg, null, 2))
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {import("../types").InitialAppServiceRegistrationConfig} reg */
|
/**
|
||||||
function getTemplateRegistration() {
|
* @param {string} serverName
|
||||||
|
* @returns {import("../types").InitialAppServiceRegistrationConfig} reg
|
||||||
|
*/
|
||||||
|
function getTemplateRegistration(serverName) {
|
||||||
|
const namespace_prefix = "_ooye_"
|
||||||
return {
|
return {
|
||||||
id: "ooye",
|
id: "ooye",
|
||||||
as_token: crypto.randomBytes(32).toString("hex"),
|
as_token: crypto.randomBytes(32).toString("hex"),
|
||||||
|
@ -33,21 +37,21 @@ function getTemplateRegistration() {
|
||||||
namespaces: {
|
namespaces: {
|
||||||
users: [{
|
users: [{
|
||||||
exclusive: true,
|
exclusive: true,
|
||||||
regex: "@_ooye_.*:cadence.moe"
|
regex: `@${namespace_prefix}.*:${serverName}`
|
||||||
}],
|
}],
|
||||||
aliases: [{
|
aliases: [{
|
||||||
exclusive: true,
|
exclusive: true,
|
||||||
regex: "#_ooye_.*:cadence.moe"
|
regex: `#${namespace_prefix}.*:${serverName}`
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
protocols: [
|
protocols: [
|
||||||
"discord"
|
"discord"
|
||||||
],
|
],
|
||||||
sender_localpart: "_ooye_bot",
|
sender_localpart: `${namespace_prefix}bot`,
|
||||||
rate_limited: false,
|
rate_limited: false,
|
||||||
socket: 6693,
|
socket: 6693,
|
||||||
ooye: {
|
ooye: {
|
||||||
namespace_prefix: "_ooye_",
|
namespace_prefix,
|
||||||
max_file_size: 5000000,
|
max_file_size: 5000000,
|
||||||
content_length_workaround: false,
|
content_length_workaround: false,
|
||||||
include_user_id_in_mxid: false,
|
include_user_id_in_mxid: false,
|
||||||
|
|
|
@ -136,7 +136,7 @@ block body
|
||||||
form.d-flex.ai-center.g8
|
form.d-flex.ai-center.g8
|
||||||
label.s-label.fl-grow1(for="autocreate")
|
label.s-label.fl-grow1(for="autocreate")
|
||||||
| Create new Matrix rooms automatically
|
| Create new Matrix rooms automatically
|
||||||
p.s-description If you want, OOYE can automatically create new Matrix rooms and link them when a new Discord channel is spoken in.
|
p.s-description If you want, OOYE can automatically create new Matrix rooms and link them when an unlinked Discord channel is spoken in.
|
||||||
- let value = select("guild_active", "autocreate", {guild_id}).pluck().get()
|
- let value = select("guild_active", "autocreate", {guild_id}).pluck().get()
|
||||||
input(type="hidden" name="guild_id" value=guild_id)
|
input(type="hidden" name="guild_id" value=guild_id)
|
||||||
input.s-toggle-switch.order-last#autocreate(name="autocreate" type="checkbox" hx-post="/api/autocreate" hx-indicator="#autocreate-loading" hx-disabled-elt="this" hx-swap="none" checked=value)
|
input.s-toggle-switch.order-last#autocreate(name="autocreate" type="checkbox" hx-post="/api/autocreate" hx-indicator="#autocreate-loading" hx-disabled-elt="this" hx-swap="none" checked=value)
|
||||||
|
|
Loading…
Reference in a new issue