-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathfederation-service.ts
More file actions
104 lines (91 loc) · 2.79 KB
/
federation-service.ts
File metadata and controls
104 lines (91 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import { generateEd25519RandomSecretKey } from '@rocket.chat/federation-matrix';
import { settingsRegistry } from '../../app/settings/server';
export const createFederationServiceSettings = async (): Promise<void> => {
await settingsRegistry.addGroup('Federation', async function () {
await this.add('Federation_Service_Enabled', false, {
type: 'boolean',
public: true,
enterprise: true,
modules: ['federation'],
invalidValue: false,
alert: 'Federation_Service_Alert',
});
await this.add('Federation_Service_Domain', '', {
type: 'string',
public: false,
enterprise: true,
modules: ['federation'],
invalidValue: '',
alert: 'Federation_Service_Domain_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_Version', '0', {
type: 'string',
public: false,
readonly: true,
enterprise: true,
modules: ['federation'],
invalidValue: '0',
});
const randomKey = generateEd25519RandomSecretKey().toString('base64');
// https://spec.matrix.org/v1.16/appendices/#signing-details
await this.add('Federation_Service_Matrix_Signing_Key', randomKey, {
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,
});
await this.add('Federation_Service_Allow_List', '', {
type: 'string',
i18nLabel: 'Federation_Service_Allow_List',
i18nDescription: 'Federation_Service_Allow_List_Description',
public: false,
});
await this.add('Federation_Service_EDU_Process_Typing', true, {
type: 'boolean',
public: false,
enterprise: true,
modules: ['federation'],
invalidValue: false,
alert: 'Federation_Service_EDU_Process_Typing_Alert',
});
await this.add('Federation_Service_EDU_Process_Presence', false, {
type: 'boolean',
public: false,
enterprise: true,
modules: ['federation'],
invalidValue: false,
alert: 'Federation_Service_EDU_Process_Presence_Alert',
});
await this.add('Federation_Service_Join_Encrypted_Rooms', false, {
type: 'boolean',
public: false,
enterprise: true,
modules: ['federation'],
invalidValue: false,
});
await this.add('Federation_Service_Join_Non_Private_Rooms', false, {
type: 'boolean',
public: false,
enterprise: true,
modules: ['federation'],
invalidValue: false,
});
});
};