@live-change/peer-connection-frontend 0.8.33 → 0.8.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-stats/ssr-srcentryserverjs-outDir-distserver.html +4842 -0
- package/build-stats/ssrManifest-outDir-distclient.html +4842 -0
- package/front/components.d.ts +20 -0
- package/front/public/images/cameraAccess/en.png +0 -0
- package/front/src/App.vue +42 -77
- package/front/src/components/Debugger.vue +68 -177
- package/front/src/components/DevicesSelect.vue +393 -0
- package/front/src/components/Peer.js +167 -252
- package/front/src/components/PeerConnection.js +296 -312
- package/front/src/components/PermissionsDialog.vue +146 -0
- package/front/src/components/mediaStreamsTracks.js +60 -0
- package/front/src/components/userMedia.js +2 -2
- package/front/src/entry-client.js +4 -22
- package/front/src/entry-server.js +5 -4
- package/front/src/router.js +6 -1
- package/front/vite.config.js +8 -107
- package/package-deps.json +41 -0
- package/package.json +24 -23
- package/server/app.config.js +114 -0
- package/server/init.js +10 -2
- package/server/security.config.js +53 -0
- package/server/services.list.js +50 -0
- package/server/start.js +37 -0
- package/server/services.config.js +0 -25
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import lcp from "@live-change/pattern"
|
|
2
|
+
|
|
3
|
+
const clientKeys = (client) => [
|
|
4
|
+
{ key: 'user', value: client.user },
|
|
5
|
+
{ key: 'session', value: client.session },
|
|
6
|
+
{ key: 'ip', value: client.ip }
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
const failedAuthCodes = lcp.chain([
|
|
10
|
+
{ type: "wrong-secret-code", id: "1st-failed-secret-code" },
|
|
11
|
+
{ eq: "ip", expire: "10m" },
|
|
12
|
+
{ type: "wrong-secret-code", id: "2nd-failed-secret-code" },
|
|
13
|
+
{ eq: "ip", expire: "10m" },
|
|
14
|
+
{ type: "wrong-secret-code", id: "3rd-failed-secret-code",
|
|
15
|
+
actions: [
|
|
16
|
+
{ type: 'ban', keys: ['ip'], ban: { type: 'captcha', actions: ['checkSecretCode'], expire: "30m" } }
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
]).model
|
|
20
|
+
|
|
21
|
+
const patterns = lcp.mergeModels(
|
|
22
|
+
//failedAuthCodes
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
const counters = [
|
|
26
|
+
{
|
|
27
|
+
id: 'wrong-codes-captcha',
|
|
28
|
+
match: ['wrong-secret-code'],
|
|
29
|
+
keys: ['ip'],
|
|
30
|
+
max: 2,
|
|
31
|
+
duration: '1m',
|
|
32
|
+
actions: [
|
|
33
|
+
{ type: 'ban', keys: ['ip'], ban: { type: 'captcha', actions: ['checkSecretCode'], expire: "30m" } }
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 'wrong-codes-ban',
|
|
38
|
+
visible: true,
|
|
39
|
+
match: ['wrong-secret-code'],
|
|
40
|
+
keys: ['ip'],
|
|
41
|
+
max: 5,
|
|
42
|
+
duration: '10m',
|
|
43
|
+
actions: [
|
|
44
|
+
{ type: 'ban', keys: ['ip'], ban: { type: 'block', actions: ['checkSecretCode'], expire: "2m" } }
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
export default {
|
|
50
|
+
clientKeys,
|
|
51
|
+
patterns,
|
|
52
|
+
counters
|
|
53
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import timer from "@live-change/timer-service"
|
|
2
|
+
import session from "@live-change/session-service"
|
|
3
|
+
import user from '@live-change/user-service'
|
|
4
|
+
import email from '@live-change/email-service'
|
|
5
|
+
import phone from '@live-change/phone-service'
|
|
6
|
+
import passwordAuthentication from '@live-change/password-authentication-service'
|
|
7
|
+
import userIdentification from '@live-change/user-identification-service'
|
|
8
|
+
import identicon from '@live-change/identicon-service'
|
|
9
|
+
import localeSettings from '@live-change/locale-settings-service'
|
|
10
|
+
import security from '@live-change/security-service'
|
|
11
|
+
import notification from '@live-change/notification-service'
|
|
12
|
+
import upload from '@live-change/upload-service'
|
|
13
|
+
import image from '@live-change/image-service'
|
|
14
|
+
import secretCode from '@live-change/secret-code-service'
|
|
15
|
+
import secretLink from '@live-change/secret-link-service'
|
|
16
|
+
import messageAuthentication from '@live-change/message-authentication-service'
|
|
17
|
+
import googleAuthentication from '@live-change/google-authentication-service'
|
|
18
|
+
import online from "@live-change/online-service"
|
|
19
|
+
import accessControl from "@live-change/access-control-service"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
timer,
|
|
24
|
+
session,
|
|
25
|
+
user,
|
|
26
|
+
email,
|
|
27
|
+
phone,
|
|
28
|
+
passwordAuthentication,
|
|
29
|
+
userIdentification,
|
|
30
|
+
identicon,
|
|
31
|
+
security,
|
|
32
|
+
notification,
|
|
33
|
+
upload,
|
|
34
|
+
image,
|
|
35
|
+
secretCode,
|
|
36
|
+
secretLink,
|
|
37
|
+
messageAuthentication,
|
|
38
|
+
googleAuthentication,
|
|
39
|
+
localeSettings,
|
|
40
|
+
online,
|
|
41
|
+
accessControl
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
import peerConnection from "@live-change/peer-connection-service"
|
|
45
|
+
import init from './init.js'
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
peerConnection,
|
|
49
|
+
init
|
|
50
|
+
}
|
package/server/start.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import appConfig from './app.config.js'
|
|
2
|
+
|
|
3
|
+
import * as services from './services.list.js'
|
|
4
|
+
for(const serviceConfig of appConfig.services) {
|
|
5
|
+
serviceConfig.module = services[serviceConfig.name]
|
|
6
|
+
}
|
|
7
|
+
appConfig.init = services['init']
|
|
8
|
+
|
|
9
|
+
import { starter } from '@live-change/cli'
|
|
10
|
+
|
|
11
|
+
starter(appConfig)
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
import os from 'os'
|
|
15
|
+
const formatMemoryUsage = (data) => `${Math.round(data / 1024 / 1024 * 100) / 100} MB`;
|
|
16
|
+
const formatUptime = (data) => // dd:hh:mm:ss
|
|
17
|
+
`${Math.floor(data / 86400)}:`
|
|
18
|
+
+`${Math.floor(data % 86400 / 3600)}:${Math.floor(data % 3600 / 60)}:${Math.floor(data % 60)}`
|
|
19
|
+
setInterval(() => {
|
|
20
|
+
const memoryData = process.memoryUsage()
|
|
21
|
+
if(typeof gc != 'undefined') {
|
|
22
|
+
console.log("Running GC!")
|
|
23
|
+
gc()
|
|
24
|
+
}
|
|
25
|
+
console.log(`Memory usage:`)
|
|
26
|
+
console.log(` rss: ${formatMemoryUsage(memoryData.rss)}`)
|
|
27
|
+
console.log(` heapTotal: ${formatMemoryUsage(memoryData.heapTotal)}`)
|
|
28
|
+
console.log(` heapUsed: ${formatMemoryUsage(memoryData.heapUsed)}`)
|
|
29
|
+
console.log(` external: ${formatMemoryUsage(memoryData.external)}`)
|
|
30
|
+
console.log(` arrayBuffers: ${formatMemoryUsage(memoryData.arrayBuffers)}`)
|
|
31
|
+
console.log(` os total: ${formatMemoryUsage(os.totalmem())}`)
|
|
32
|
+
console.log(` os free: ${formatMemoryUsage(os.freemem())}`)
|
|
33
|
+
console.log(` os uptime: ${formatUptime(os.uptime())}`)
|
|
34
|
+
console.log(`---------------------------------`)
|
|
35
|
+
}, 5000)
|
|
36
|
+
//*/
|
|
37
|
+
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
services: [
|
|
3
|
-
{
|
|
4
|
-
name: 'timer',
|
|
5
|
-
path: '@live-change/timer-service'
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
name: 'session',
|
|
9
|
-
path: '@live-change/session-service',
|
|
10
|
-
createSessionOnUpdate: true
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: 'online',
|
|
14
|
-
path: '@live-change/online-service',
|
|
15
|
-
createSessionOnUpdate: true
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
name: 'peerConnection',
|
|
19
|
-
path: '@live-change/peer-connection-service',
|
|
20
|
-
turn: {
|
|
21
|
-
urls: 'turn:turn1.xaos.ninja:4433;turn:turn2.xaos.ninja:4433'
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
}
|