From 8a6d11594fc09018fc80c09b4572be5aa28b18b3 Mon Sep 17 00:00:00 2001 From: idk Date: Wed, 18 Mar 2020 00:03:35 -0400 Subject: [PATCH 1/2] fix some settings that needed to be better --- host.js | 11 +++++++---- options/options.js | 46 +++++++++++++++++----------------------------- proxy.js | 2 +- 3 files changed, 25 insertions(+), 34 deletions(-) diff --git a/host.js b/host.js index 5274869..ca0c4a7 100644 --- a/host.js +++ b/host.js @@ -8,7 +8,7 @@ function proxyHost(url) { if (hostname == "proxy.i2p") { return true; } - if (hostname == "7egf7fmpbewl35qvxxyff7k62ijgfm47nfmbyy3fa7epsaflyxiq.b32.i2p") { + if (hostname == "c6lilt4cr5x7jifxridpkesf2zgfwqfchtp6laihr4pdqomq25iq.b32.i2p") { return true; } return false; @@ -100,16 +100,19 @@ function routerHost(url) { path = url.replace(hostname + "/", ""); } if (hostname === control_host + ":" + control_port) { - //console.log("(hostcheck) router console found on configured ports"); return pathcheck(path); } if (hostname === "localhost" + ":" + control_port) { - //console.log("(hostcheck) router console found on configured ports"); return pathcheck(path); } if (hostname === "127.0.0.1" + ":" + control_port) { return pathcheck(path); } - + if (hostname === "localhost" + ":" + 7070) { + return pathcheck(path); + } + if (hostname === "127.0.0.1" + ":" + 7070) { + return pathcheck(path); + } return false; } diff --git a/options/options.js b/options/options.js index 1458560..53df2a8 100644 --- a/options/options.js +++ b/options/options.js @@ -319,36 +319,24 @@ function onError(e) { } function storeSettings() { - let proxy_scheme = getScheme(); - let proxy_host = getHost(); - let proxy_port = getPort(); - let control_host = getControlHost(); - let control_port = getControlPort(); - let rpc_host = getRPCHost(); - let rpc_port = getRPCPort(); - let rpc_path = getRPCPath(); - let rpc_pass = getRPCPass(); - let bt_rpc_host = getBTRPCHost(); - let bt_rpc_port = getBTRPCPort(); - let bt_rpc_path = getBTRPCPath(); - let bt_rpc_pass = getBTRPCPass(); - let base_url = + let storableSettings = {} + storableSettings["proxy_scheme"] = getScheme(); + storableSettings["proxy_host"] = getHost(); + storableSettings["proxy_port"] = getPort(); + storableSettings["control_host"] = getControlHost(); + storableSettings["control_port"] = getControlPort(); + storableSettings["rpc_host"] = getRPCHost(); + storableSettings["rpc_port"] = getRPCPort(); + storableSettings["rpc_path"] = getRPCPath(); + storableSettings["rpc_pass"] = getRPCPass(); + storableSettings["bt_rpc_host"] = getBTRPCHost(); + storableSettings["bt_rpc_port"] = getBTRPCPort(); + storableSettings["bt_rpc_path"] = getBTRPCPath(); + storableSettings["bt_rpc_pass"] = getBTRPCPass(); + storableSettings["base_url"] = "http://" + bt_rpc_host + ":" + bt_rpc_port + "/" + bt_rpc_path; - chrome.storage.local.set({ - proxy_scheme, - proxy_host, - proxy_port, - control_host, - control_port, - rpc_host, - rpc_port, - rpc_path, - rpc_pass, - bt_rpc_host, - bt_rpc_port, - bt_rpc_path, - bt_rpc_pass - }); + console.log("storing", storableSettings); + chrome.storage.local.set(storableSettings); } function updateUI(restoredSettings) { diff --git a/proxy.js b/proxy.js index 23425cb..8bc773f 100644 --- a/proxy.js +++ b/proxy.js @@ -12,7 +12,7 @@ chrome.privacy.network.networkPredictionEnabled.set({ value: false }); chrome.privacy.network.webRTCIPHandlingPolicy.set({ - value: "disable_non_proxied_udp" + value: "proxy_only" }); function shouldProxyRequest(requestInfo) { From 8d23820c65b34580e64c4b803e22d136ab9a9c3a Mon Sep 17 00:00:00 2001 From: idk Date: Wed, 18 Mar 2020 00:15:46 -0400 Subject: [PATCH 2/2] Also add a console bookmark --- Makefile | 4 ++-- bookmarks.js | 38 ++++++++++++++++++++++++++++++++++++-- debian/changelog | 6 ++++++ 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 73dd76b..228b98e 100644 --- a/Makefile +++ b/Makefile @@ -37,8 +37,8 @@ clean: rc clean-artifacts ## EVEN RELEASES are AMO RELEASES ## ODD RELEASES are SELFHOSTED RELEASES -MOZ_VERSION=0.66 -VERSION=0.65 +MOZ_VERSION=0.68 +VERSION=0.67 ## INCREMENT THIS EVERY TIME YOU DO A RELEASE LAST_VERSION=0.63 diff --git a/bookmarks.js b/bookmarks.js index 562ebea..232c999 100644 --- a/bookmarks.js +++ b/bookmarks.js @@ -10,14 +10,14 @@ gettingInfo.then(got => { if (port == "7644") { let createRhizomeBookmark = browser.bookmarks.create({ url: "about:I2p", - title: "I2P Home Page", + title: "Home Page", parentId: bookmarkToolbar[0].id }); createRhizomeBookmark.then(onCreated); } else { let createBookmark = browser.bookmarks.create({ url: browser.runtime.getURL("home.html"), - title: "I2P Home Page", + title: "Home Page", parentId: bookmarkToolbar[0].id }); createBookmark.then(onCreated); @@ -59,6 +59,34 @@ gettingInfo.then(got => { gettingProxyInfo.then(gotProxyInfo); } } + function bookConsole(bookmarkItems) { + if (!bookmarkItems.length) { + function gotProxyInfo(info) { + let port = info.value.http.split(":")[1]; + if (port == "7644") { + let createBookmark = browser.bookmarks.create({ + url: "http://localhost:7657/home", + title: "I2P Console", + parentId: bookmarkToolbar[0].id + }); + createBookmark.then(onCreated); + } else { + let createRhizomeBookmark = browser.bookmarks.create({ + url: + "http://" + control_host + ":" + control_port + "/home", + title: "I2P Console", + parentId: bookmarkToolbar[0].id + }); + createRhizomeBookmark.then(onCreated); + } + } + console.log( + "(bookmarks) checking if we're running in an I2P Browser" + ); + let gettingProxyInfo = browser.proxy.settings.get({}); + gettingProxyInfo.then(gotProxyInfo); + } + } function bookMail(bookmarkItems) { if (!bookmarkItems.length) { function gotProxyInfo(info) { @@ -143,6 +171,12 @@ gettingInfo.then(got => { title: "Web Mail" }); b3.then(bookMail, onRejected); + + var b4 = browser.bookmarks.search({ + title: "I2P Console" + }); + b4.then(bookConsole, onRejected); + } var bt = browser.bookmarks.search({ diff --git a/debian/changelog b/debian/changelog index e1a9786..da3181f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +i2psetproxy.js (0.67-1) UNRELEASED; urgency=low + + * Tweak some default settings that should have gone into 65 + + -- idk Tue, 17 MAR 2020 22:58:55 -0400 + i2psetproxy.js (0.65-1) UNRELEASED; urgency=low * Initial prototype of certs implementation