fix: harden WebRTC transfers for v0.0.1

Require mutual fingerprint confirmation before sharing metadata or files.
Validate incoming messages, bound buffering, and confirm receipt before
reporting success. Add direct-to-disk saving and explicit TURN opt-in.

Fix reset and retry handling, clean up cancelled connections, and preserve
completed Firefox downloads when the sender disconnects.

Update dependencies, clarify security assumptions, and add protocol and
cross-browser regression tests. Set version 0.0.1 and document the release
in CHANGELOG.md, linked from the README.

BREAKING CHANGE: both peers must use signaling and transfer protocol v2;
older connection codes are no longer accepted.
This commit is contained in:
Schluffe committed 2026-10-09 12:11:14 +02:00
1 parent d198332c92
commit 752d0cf3af
16 files changed
+1352 -603

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
<script setup>
import { STUN_PROVIDERS } from '../lib/webrtc.js';
const settings = defineModel({ required: true });
defineProps({ disabled: Boolean });
</script>
<template>
<fieldset :disabled="disabled" class="network-settings">
<legend>Connection settings</legend>
<label for="stun-provider">STUN provider</label>
<select id="stun-provider" v-model="settings.stunChoice" class="stun-select">
<option v-for="provider in STUN_PROVIDERS" :key="provider.id" :value="provider.id">{{ provider.label }}</option>
<option value="custom">Custom…</option>
</select>
<input v-if="settings.stunChoice === 'custom'" v-model="settings.customStun" class="stun-input" aria-label="Custom STUN address" placeholder="stun:your.domain:3478" />
<p class="status">STUN helps discover a reachable address. Its operator sees your public IP and request timing, but does not carry your file. Direct connections may fail on restrictive networks.</p>
<label class="checkbox"><input type="checkbox" v-model="settings.allowTurn" /> Allow a TURN relay for this connection (opt-in)</label>
<template v-if="settings.allowTurn">
<p class="status">Both people must opt in. Your browser may contact this relay and route encrypted file traffic through it. The operator sees addresses, timing and traffic volume, and may charge for bandwidth. Use credentials you are authorized to use; they remain in this tab.</p>
<input v-model="settings.turnUrl" class="stun-input" aria-label="TURN address" placeholder="turns:relay.example:5349?transport=tcp" autocomplete="off" />
<input v-model="settings.username" class="stun-input" aria-label="TURN username" placeholder="TURN username" autocomplete="off" />
<input v-model="settings.credential" class="stun-input" type="password" aria-label="TURN password" placeholder="TURN password" autocomplete="off" />
</template>
</fieldset>
</template>