diff --git a/client/src/SignalFirebase.ts b/client/src/SignalFirebase.ts index 5266a64..c51b716 100644 --- a/client/src/SignalFirebase.ts +++ b/client/src/SignalFirebase.ts @@ -1,32 +1,31 @@ -import { getDatabase, onValue, ref, set, remove, goOffline } from "firebase/database"; +import { + getDatabase, + onValue, + ref, + set, + remove, + goOffline, +} from "firebase/database"; // import "firebase-config"; import { v4 as uuid } from "uuid"; import { Answer } from "./RTCTransport"; -import { browserLocalPersistence, getAuth, setPersistence, signInWithEmailAndPassword } from "firebase/auth"; - +import { getAuth } from "firebase/auth"; export async function signalSwarm(offer: string): Promise { let id = uuid(); const db = getDatabase(); let reff = ref(db, `/swarm/${id}`); - set(reff, offer); - - - return new Promise((resolve, reject) => { - - onValue(reff, (snapshot) => { const text = snapshot.val(); - if (!text) - return; + if (!text) return; let data = JSON.parse(text); - console.log(data); + console.log("<", data); if (data.error) { reject(new Error(data.error)); @@ -37,26 +36,18 @@ export async function signalSwarm(offer: string): Promise { resolve(data); }); - }); } export async function signalAccount(offer: string): Promise { - let auth = getAuth(); - if (!auth.currentUser) - throw new Error("not signed in"); - + if (!auth.currentUser) throw new Error("not signed in"); const db = getDatabase(); let peer = ref(db, `/peers/${auth.currentUser!.uid}`); - - - set(peer, offer); return new Promise((resolve, reject) => { - onValue(peer, async (snapshot) => { const str = snapshot.val(); if (str) { @@ -65,9 +56,8 @@ export async function signalAccount(offer: string): Promise { remove(peer); resolve(data); goOffline(db); - } } }); }); -} \ No newline at end of file +} diff --git a/frontend/index.html b/frontend/index.html index 5691d93..11cab63 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1,19 +1,18 @@ + + + + + + + + - - - - - - - - - - - - -
- - - \ No newline at end of file + +
+ + diff --git a/frontend/package.json b/frontend/package.json index c109924..1e14346 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -18,16 +18,17 @@ "@iconify-icons/ic": "^1.2.13", "@iconify-icons/maki": "^1.2.18", "@iconify/svelte": "^3.1.4", + "@mercuryworkshop/bare-client-custom": "workspace:*", "@rollup/browser": "^3.28.0", "@sveltejs/vite-plugin-svelte": "^2.4.5", "autoprefixer": "^10.4.15", - "@mercuryworkshop/bare-client-custom": "workspace:*", "client": "workspace:*", "corium": "file:../corium", "esbuild": "^0.19.1", "esbuild-plugin-inline-import": "^1.0.1", "firebase": "^10.1.0", "m3-svelte": "^2.0.3", + "micromatch": "^4.0.5", "postcss": "^8.4.27", "postcss-load-config": "^4.0.1", "protocol": "workspace:*", @@ -37,7 +38,6 @@ "tracker-list": "workspace:*", "typescript": "^5.1.6", "uuid": "^9.0.0", - "vite": "^4.4.9", - "vite-plugin-svelte": "^3.0.1" + "vite": "^4.4.9" } } diff --git a/frontend/src/logo.png b/frontend/public/logo.png similarity index 100% rename from frontend/src/logo.png rename to frontend/public/logo.png diff --git a/frontend/src/AccountCreation.svelte b/frontend/src/AccountCreation.svelte deleted file mode 100644 index 96d002d..0000000 --- a/frontend/src/AccountCreation.svelte +++ /dev/null @@ -1,9 +0,0 @@ - - -
- -

Step 1

-
-
diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index 42f4807..4a42d00 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -1,165 +1,61 @@ -{#if state == ReadyState.Connected} + + Adrift + + +{#if state == UIState.Connected} -{:else if state == ReadyState.Connecting} -
+{:else if state == UIState.Connecting} +
-
+
-
-

- {connectionState} -

+

{stateStr}

-
-

+

Adrift is routing you to a server available to take your requests.
The initial connection may take several minutes depending on server load

-{:else if !import.meta.env.VITE_ADRIFT_DEV} -
-
- - -
-
- -
-

Surf the web, Adrift

-

- A fast and modern decentralized proxy network -

-
-
- - {#if !import.meta.env.VITE_ADRIFT_SINGLEFILE} - - {/if} -
-
-
-
- -

Select a Tracker

-

Trackers allow you to connect to Adrift

-
- {#each Object.keys(TrackerList) as tracker} - - - - {/each} -
-
-
- {#if chosenTracker} - - - {/if} -
- - -

- TLS has not currently been implemented for the Adrift Swarm. It - will later, but until then your data will not be private, and you - should not enter any sensitive information on any page -

-
- - -
- - - -
- - - -
- - -
-
- - - - -

- Note: to be able to connect, you'll need to download an exit node - and run it on a computer with an uncensored internet connection -

- -
- -
- -
-
- - -
-
-{:else} -
- -
-

Adrift DEV

-
- - -
+{:else if import.meta.env.VITE_ADRIFT_DEV} +
+ +

Adrift DEV

+
+ +
+{:else} +
+
+ +

Adrift

+
+ +

Surf the web, Adrift

+

A fast and modern decentralized proxy network

+
+ + {#if !import.meta.env.VITE_ADRIFT_SINGLEFILE} + + {/if} +
+
+ + + +
+ {/if} - diff --git a/frontend/src/Connection.svelte b/frontend/src/Connection.svelte new file mode 100644 index 0000000..12ea522 --- /dev/null +++ b/frontend/src/Connection.svelte @@ -0,0 +1,234 @@ + + + +
+ {#each Object.entries(trackerList) as [trackerId, tracker], i} + {#if i != 0} + + {/if} + + + + + + {/each} +
+

+ Your data is not end-to-end encrypted, and will not be private. While TLS + will be implemented later, for now do not enter any private information. + Click connect again to continue. +

+ + + + + +
+ +
+ + +
+ + + + + +
+ + + diff --git a/frontend/src/Proxy.svelte b/frontend/src/Proxy.svelte index 355fd4e..0f4b18b 100644 --- a/frontend/src/Proxy.svelte +++ b/frontend/src/Proxy.svelte @@ -3,9 +3,6 @@ import { Win, openWindow } from "../../corium"; import Icon from "@iconify/svelte"; - let selectedProxy = "ultraviolet"; - - let url: string = "http://google.com"; import { onMount } from "svelte"; import { Dialog, @@ -14,10 +11,14 @@ TextField, } from "m3-svelte"; + let url = "http://google.com"; + let proxyIframe: HTMLIFrameElement; let settingsenabled: boolean = false; + let selectedProxy = "ultraviolet"; + let searchengine = "https://google.com/search?q="; function frameLoad() { @@ -59,96 +60,92 @@ }); -
+
-
+ + + +
-
- - -
- - { - if (e.key === "Enter") { - visitURL(url); - } - }} - /> -
- - + } + }} + />
- - {#if !import.meta.env.VITE_ADRIFT_SINGLEFILE} -
- - - Ultraviolet - - Dynamic - -
-
- - - {/if} -
+