diff --git a/buildstatic.sh b/buildstatic.sh index 40472b4..5edf465 100755 --- a/buildstatic.sh +++ b/buildstatic.sh @@ -11,3 +11,4 @@ cp -r assets/ $DST/assets cp -r dist/ $DST/scram cp -r static/* $DST +echo 'let _CONFIG = { wispurl: "wss://puter.cafe/", bareurl: "https://aluu.xyz/bare/" }' > $DST/config.js diff --git a/static/config.js b/static/config.js new file mode 100644 index 0000000..e69de29 diff --git a/static/index.html b/static/index.html index e4a1835..bccde16 100644 --- a/static/index.html +++ b/static/index.html @@ -35,6 +35,7 @@ + diff --git a/static/ui.js b/static/ui.js index 9ab3099..8514e12 100644 --- a/static/ui.js +++ b/static/ui.js @@ -10,22 +10,6 @@ const scramjet = new ScramjetController({ scramjet.init("./sw.js"); -// navigator.serviceWorker.ready.then((reg) => { -// for (let i = 0; i < 20; i++) { -// const thread = new SharedWorker($scramjet.config.thread, { -// name: "thread" + i, -// }); -// -// reg.active.postMessage( -// { -// scramjet$type: "add", -// handle: thread.port, -// }, -// [thread.port] -// ); -// } -// }); - const connection = new BareMux.BareMuxConnection("/baremux/worker.js"); const flex = css` display: flex; @@ -38,15 +22,17 @@ const store = $store( { url: "https://google.com", wispurl: + _CONFIG?.wispurl || (location.protocol === "https:" ? "wss" : "ws") + - "://" + - location.host + - "/wisp/", + "://" + + location.host + + "/wisp/", bareurl: + _CONFIG?.bareurl || (location.protocol === "https:" ? "https" : "http") + - "://" + - location.host + - "/bare/", + "://" + + location.host + + "/bare/", proxy: "", }, { ident: "settings", backing: "localstorage", autosave: "auto" }