-
Notifications
You must be signed in to change notification settings - Fork 13k
chore: organize federation settings #36991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b133df5
9939828
e80ff9f
43e3707
e5d58b7
0aee067
c056235
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,4 +60,5 @@ registration.yaml | |
| storybook-static | ||
| development/tempo-data/ | ||
|
|
||
| homeserver | ||
| homeserver | ||
| .env | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,158 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import crypto from 'crypto'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { v4 as uuidv4 } from 'uuid'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { settings, settingsRegistry } from '../../../app/settings/server'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export const addMatrixBridgeFederationSettings = async (): Promise<void> => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.add('Federation_Matrix_enabled', false, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: 'boolean', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Matrix_enabled', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Matrix_enabled_desc', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| alert: 'Old_Federation_Alert', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: 'Federation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| section: 'Matrix Bridge', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.add('Federation_Matrix_serve_well_known', true, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: 'boolean', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Matrix_serve_well_known', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| alert: 'Federation_Matrix_serve_well_known_Alert', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: 'Federation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| section: 'Matrix Bridge', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.add('Federation_Matrix_enable_ephemeral_events', false, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: 'boolean', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Matrix_enable_ephemeral_events', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Matrix_enable_ephemeral_events_desc', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| alert: 'Federation_Matrix_enable_ephemeral_events_Alert', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: 'Federation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| section: 'Matrix Bridge', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const uniqueId = settings.get('uniqueID') || uuidv4().slice(0, 15).replace(new RegExp('-', 'g'), '_'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const homeserverToken = crypto.createHash('sha256').update(`hs_${uniqueId}`).digest('hex'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const applicationServiceToken = crypto.createHash('sha256').update(`as_${uniqueId}`).digest('hex'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const siteUrl = settings.get<string>('Site_Url'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.add('Federation_Matrix_id', `rocketchat_${uniqueId}`, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: 'string', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Matrix_id', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Matrix_id_desc', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: 'Federation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| section: 'Matrix Bridge', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.add('Federation_Matrix_hs_token', homeserverToken, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: 'string', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Matrix_hs_token', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Matrix_hs_token_desc', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: 'Federation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| section: 'Matrix Bridge', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.add('Federation_Matrix_as_token', applicationServiceToken, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: 'string', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Matrix_as_token', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Matrix_as_token_desc', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: 'Federation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| section: 'Matrix Bridge', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+54
to
+70
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Treat Matrix tokens as secrets (use password type)
await settingsRegistry.add('Federation_Matrix_hs_token', homeserverToken, {
- readonly: true,
- type: 'string',
+ readonly: true,
+ type: 'password',
@@
});
await settingsRegistry.add('Federation_Matrix_as_token', applicationServiceToken, {
- readonly: true,
- type: 'string',
+ readonly: true,
+ type: 'password',
@@
});📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.add('Federation_Matrix_homeserver_url', 'http://localhost:8008', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: 'string', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Matrix_homeserver_url', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Matrix_homeserver_url_desc', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| alert: 'Federation_Matrix_homeserver_url_alert', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: 'Federation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| section: 'Matrix Bridge', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.add('Federation_Matrix_homeserver_domain', siteUrl, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: 'string', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Matrix_homeserver_domain', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Matrix_homeserver_domain_desc', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| alert: 'Federation_Matrix_homeserver_domain_alert', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: 'Federation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| section: 'Matrix Bridge', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.add('Federation_Matrix_bridge_url', 'http://localhost:3300', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: 'string', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Matrix_bridge_url', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Matrix_bridge_url_desc', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: 'Federation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| section: 'Matrix Bridge', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.add('Federation_Matrix_bridge_localpart', 'rocket.cat', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: 'string', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Matrix_bridge_localpart', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Matrix_bridge_localpart_desc', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: 'Federation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| section: 'Matrix Bridge', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.add('Federation_Matrix_registration_file', '', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: 'code', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Matrix_registration_file', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Matrix_registration_file_desc', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| alert: 'Federation_Matrix_registration_file_Alert', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: 'Federation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| section: 'Matrix Bridge', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.add('Federation_Matrix_max_size_of_public_rooms_users', 100, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: 'int', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Matrix_max_size_of_public_rooms_users', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Matrix_max_size_of_public_rooms_users_desc', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| alert: 'Federation_Matrix_max_size_of_public_rooms_users_Alert', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| modules: ['federation'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enterprise: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| invalidValue: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: 'Federation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| section: 'Matrix Bridge', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+120
to
+132
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Type mismatch: await settingsRegistry.add('Federation_Matrix_max_size_of_public_rooms_users', 100, {
readonly: true,
type: 'int',
@@
- invalidValue: false,
+ invalidValue: 100,
+ min: 1,
+ max: 100000,📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.add('Federation_Matrix_configuration_status', 'Invalid', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hidden: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: 'string', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Matrix_configuration_status', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Matrix_configuration_status_desc', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enterprise: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| invalidValue: '', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: 'Federation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| section: 'Matrix Bridge', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.add('Federation_Matrix_check_configuration_button', 'checkFederationConfiguration', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hidden: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: 'action', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| actionText: 'Federation_Matrix_check_configuration', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enterprise: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| invalidValue: '', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: 'Federation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| section: 'Matrix Bridge', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,28 +1,50 @@ | ||||||||||||||||||||||||||||||||||||||||
| import { settingsRegistry } from '../../app/settings/server'; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| export const createFederationServiceSettings = async (): Promise<void> => { | ||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.addGroup('Federation Service', async function () { | ||||||||||||||||||||||||||||||||||||||||
| await settingsRegistry.addGroup('Federation', async function () { | ||||||||||||||||||||||||||||||||||||||||
rodrigok marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||
| await this.add('Federation_Service_Enabled', false, { | ||||||||||||||||||||||||||||||||||||||||
| type: 'boolean', | ||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Service_Enabled', | ||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Service_Enabled_Description', | ||||||||||||||||||||||||||||||||||||||||
| public: true, | ||||||||||||||||||||||||||||||||||||||||
| enterprise: true, | ||||||||||||||||||||||||||||||||||||||||
| modules: ['federation'], | ||||||||||||||||||||||||||||||||||||||||
| invalidValue: false, | ||||||||||||||||||||||||||||||||||||||||
| alert: 'Federation_Service_Alert', | ||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
5
to
12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Legacy service toggle should be read‑only per PR goal. await this.add('Federation_Service_Enabled', false, {
type: 'boolean',
public: true,
+ readonly: true,
enterprise: true,
modules: ['federation'],
invalidValue: false,
alert: 'Federation_Service_Alert',
});📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| await this.add('Federation_Service_Matrix_Port', 3000, { | ||||||||||||||||||||||||||||||||||||||||
| type: 'int', | ||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Service_Matrix_Port', | ||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Service_Matrix_Port_Description', | ||||||||||||||||||||||||||||||||||||||||
| public: true, | ||||||||||||||||||||||||||||||||||||||||
| alert: 'Federation_Service_Matrix_Port_Alert', | ||||||||||||||||||||||||||||||||||||||||
| await this.add('Federation_Service_Matrix_Signing_Algorithm', 'ed25519', { | ||||||||||||||||||||||||||||||||||||||||
| type: 'select', | ||||||||||||||||||||||||||||||||||||||||
| public: false, | ||||||||||||||||||||||||||||||||||||||||
| values: [{ key: 'ed25519', i18nLabel: 'ed25519' }], | ||||||||||||||||||||||||||||||||||||||||
| enterprise: true, | ||||||||||||||||||||||||||||||||||||||||
| modules: ['federation'], | ||||||||||||||||||||||||||||||||||||||||
| invalidValue: 'ed25519', | ||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| await this.add('Federation_Service_Matrix_Signing_Key', '', { | ||||||||||||||||||||||||||||||||||||||||
| await this.add('Federation_Service_Matrix_Signing_Version', '0', { | ||||||||||||||||||||||||||||||||||||||||
| type: 'string', | ||||||||||||||||||||||||||||||||||||||||
| i18nLabel: 'Federation_Service_Matrix_Signing_Key', | ||||||||||||||||||||||||||||||||||||||||
| i18nDescription: 'Federation_Service_Matrix_Signing_Key_Description', | ||||||||||||||||||||||||||||||||||||||||
| public: false, | ||||||||||||||||||||||||||||||||||||||||
| readonly: true, | ||||||||||||||||||||||||||||||||||||||||
| enterprise: true, | ||||||||||||||||||||||||||||||||||||||||
| modules: ['federation'], | ||||||||||||||||||||||||||||||||||||||||
| invalidValue: '0', | ||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| // https://spec.matrix.org/v1.16/appendices/#signing-details | ||||||||||||||||||||||||||||||||||||||||
| await this.add('Federation_Service_Matrix_Signing_Key', '', { | ||||||||||||||||||||||||||||||||||||||||
| type: 'password', | ||||||||||||||||||||||||||||||||||||||||
| public: false, | ||||||||||||||||||||||||||||||||||||||||
| enterprise: true, | ||||||||||||||||||||||||||||||||||||||||
| modules: ['federation'], | ||||||||||||||||||||||||||||||||||||||||
| invalidValue: '', | ||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| await this.add('Federation_Service_max_allowed_size_of_public_rooms_to_join', 100, { | ||||||||||||||||||||||||||||||||||||||||
| type: 'int', | ||||||||||||||||||||||||||||||||||||||||
| public: false, | ||||||||||||||||||||||||||||||||||||||||
| alert: 'Federation_Service_max_allowed_size_of_public_rooms_to_join_Alert', | ||||||||||||||||||||||||||||||||||||||||
| enterprise: true, | ||||||||||||||||||||||||||||||||||||||||
| modules: ['federation'], | ||||||||||||||||||||||||||||||||||||||||
| invalidValue: false, | ||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+41
to
48
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Type mismatch: invalidValue should be a number, not boolean. Add bounds.
- await this.add('Federation_Service_max_allowed_size_of_public_rooms_to_join', 100, {
+ await this.add('Federation_Service_max_allowed_size_of_public_rooms_to_join', 100, {
type: 'int',
public: false,
alert: 'Federation_Service_max_allowed_size_of_public_rooms_to_join_Alert',
enterprise: true,
modules: ['federation'],
- invalidValue: false,
+ invalidValue: 100,
+ min: 1,
+ max: 100000, // adjust if you have a known upper bound
+ enableQuery: { _id: 'Federation_Service_Enabled', value: true },
});📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| await this.add('Federation_Service_Allow_List', '', { | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generate cryptographically random tokens; don’t derive from uniqueId
Hashing a truncated/guessable identifier does not provide secrecy. Use crypto‑strong randomness so tokens are non‑derivable and rotation‑friendly.
Apply:
Note: settingsRegistry.add should preserve existing values; random generation will be used only on first initialization.
📝 Committable suggestion
🤖 Prompt for AI Agents