Skip to content

Commit

Permalink
Merge pull request #87 from eyedeekay/settings
Browse files Browse the repository at this point in the history
Settings
  • Loading branch information
eyedeekay authored Mar 18, 2020
2 parents 58dadae + 8d23820 commit e0232fa
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 38 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 36 additions & 2 deletions bookmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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({
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
i2psetproxy.js (0.67-1) UNRELEASED; urgency=low

* Tweak some default settings that should have gone into 65

-- idk <[email protected]> Tue, 17 MAR 2020 22:58:55 -0400

i2psetproxy.js (0.65-1) UNRELEASED; urgency=low

* Initial prototype of certs implementation
Expand Down
11 changes: 7 additions & 4 deletions host.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
46 changes: 17 additions & 29 deletions options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e0232fa

Please sign in to comment.