Skip to content

Commit 77c04bc

Browse files
configured presets (working public websocket server)
1 parent 6836460 commit 77c04bc

5 files changed

Lines changed: 14 additions & 28 deletions

File tree

packages/secured-react-redux-yjs/features/SecuredYProvider.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ export function SecuredYProvider({children, store}: PropsWithChildren<Props>) {
2020
websocket: {url: securityState.syncServerSessionWebsocket.settings.url}}},
2121
{store, slice: 'schema', logging: true, // TODO
2222
providers: {webrtc: {options: {signaling: ['wss://yjs.winzlieb.eu'],
23-
password: 'TODO1'}},
24-
websocket: {url: 'ws://localhost:1234'}}},
23+
password: 'TODO'}},
24+
websocket: {url: 'wss://mqtt.afg.mission-lifeline.de'}}},
2525
{store, slice: 'keys', logging: true,
2626
providers: {webrtc: {options: {signaling: ['wss://yjs.winzlieb.eu'],
27-
password: 'TODO2'}},
28-
websocket: {url: 'ws://localhost:1234'}}},
27+
password: 'TODO'}},
28+
websocket: {url: 'wss://mqtt.afg.mission-lifeline.de'}}},
2929
{store, slice: 'cryptedData', logging: true,
3030
providers: {webrtc: {options: {signaling: ['wss://yjs.winzlieb.eu'],
31-
password: 'TODO3'}},
32-
websocket: {url: 'ws://localhost:1234'}}} ]}
31+
password: 'TODO'}},
32+
websocket: {url: 'wss://mqtt.afg.mission-lifeline.de'}}} ]}
3333

3434
return (
3535
<YProvider initialYState={initialYState}>

packages/security-state/features/attackVectors/syncServerWebrtc/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { deriveState } from './deriveState';
55
import { SECURITY_LEVEL } from '../..//model';
66

77
const defaultPolicy = SECURITY_LEVEL.dubious; // TODO
8-
const defaultPreset = syncServerWebrtcPresets[3];
8+
const defaultPreset = syncServerWebrtcPresets[2];
99

1010
export function defaultSyncState(userSettings: Partial<SyncServerWebrtcSettings>) {
1111
return deriveState(syncThreatModel, defaultPolicy, defaultPreset, userSettings)

packages/security-state/features/attackVectors/syncServerWebrtc/presets.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,10 @@ export const syncServerWebrtcPresets: SyncServerWebrtcPreset[] = [
2020
body: <>You will have to start the server yourself with the following command: <i>`./node_modules/y-webrtc/bin/server.js`</i></>
2121
}
2222
},
23-
{ env: SERVER.local,
24-
settings: { signaling: ['ws://localhost:5555'] },
25-
_ui: { icon: Computer,
26-
title: 'Local signaling',
27-
subtitle: 'Port 5555, without tls',
28-
body: <>You will have to start the server yourself with the following command: <i>`PORT=5555 ./node_modules/y-webrtc/bin/server.js`</i></>
29-
}
30-
},
31-
{ env: SERVER.limited,
32-
settings: { signaling: ['wss://yjs.winzlieb.eu'] }, // TODO a working server
23+
{ env: SERVER.trusted,
24+
settings: { signaling: ['wss://yjs.winzlieb.eu'] },
3325
_ui: { title: 'Public signaling',
34-
subtitle: 'Y-Webrtc servers',
26+
subtitle: 'with tls',
3527
icon: Cloud,
3628
body: <>No additional effort required.</>
3729
}

packages/security-state/features/attackVectors/syncServerWebsocket/presets.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,11 @@ export const syncServerWebsocketPresets: SyncServerWebsocketPreset[] = [
2121
}
2222
},
2323
{ env: SERVER.limited,
24-
settings: { url: 'wss://yjs-websocket.winzlieb.eu' }, // TODO a working server
24+
settings: { url: 'wss://mqtt.afg.mission-lifeline.de' },
2525
_ui: { title: 'Public Websocket',
2626
subtitle: 'with tls',
2727
icon: Cloud,
2828
body: <>No additional effort required.</>
2929
}
30-
},
31-
{ env: SERVER.untrusted,
32-
settings: { url: 'ws://yjs-websocket.winzlieb.eu:1234' }, // TODO delete after test&demo
33-
_ui: { title: 'Public Websocket',
34-
subtitle: 'without tls',
35-
icon: Cloud,
36-
body: <>Insecure! For testing only!!!</>
37-
}
3830
}
3931
];

packages/security-state/features/react/SecurityIndicator.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ import { useSecurityStateContext } from './SecurityStateProvider';
1010
type OnClick = (event: React.MouseEvent<HTMLElement>) => void
1111

1212
export function SecurityIndicator({fakeLevel, onClick}: {fakeLevel?: SECURITY_LEVEL, onClick?: OnClick}) {
13-
const { assessment } = useSecurityStateContext()?.syncServerSessionWebrtc || {}; // TODO minimum
13+
const securityContext = useSecurityStateContext()
14+
const { assessment } = useSecurityStateContext()?.syncServerSessionWebsocket || {}; // TODO minimum
1415
const level = fakeLevel || assessment;
1516
var icon;
17+
console.log({assessment, securityContext})
1618
switch(level) {
1719
case SECURITY_LEVEL.advanced:
1820
icon = <EnhancedEncryptionIcon sx={{backgroundColor: SECURITY_INDICATOR.advanced, color: 'white'}}/>;

0 commit comments

Comments
 (0)