Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support different local port #79

Open
dufferzafar opened this issue Nov 7, 2021 · 6 comments
Open

Support different local port #79

dufferzafar opened this issue Nov 7, 2021 · 6 comments

Comments

@dufferzafar
Copy link

Currently, the extension only sends data to port 5600.

I have two activitywatch servers running on my system for two different users (on port 5600 and port 5700)

And I want this watcher to send my data to port 5700!

It was mentioned in this comment that editing the IP address will not be supported, which is understandable!

But, can we add support for editing local port? That doesn't seem too big of a security threat to me.

@dufferzafar
Copy link
Author

I cloned the code, replaced 5600 to 5700, this is what the diff came out to be:

Submodule aw-client-js contains modified content
diff --git a/aw-client-js/src/aw-client.ts b/aw-client-js/src/aw-client.ts
index 4b5e6ce..fa90d68 100644
--- a/aw-client-js/src/aw-client.ts
+++ b/aw-client-js/src/aw-client.ts
@@ -58,7 +58,7 @@ export class AWClient {
         this.clientname = clientname;
         this.testing = options.testing || false;
         if (typeof options.baseURL === "undefined") {
-            const port = !options.testing ? 5600 : 5666;
+            const port = !options.testing ? 5700 : 5666;
             this.baseURL = `http://localhost:${port}`;
         } else {
           this.baseURL = options.baseURL;
diff --git a/manifest.json b/manifest.json
index caebc22..aea1528 100644
--- a/manifest.json
+++ b/manifest.json
@@ -33,7 +33,7 @@
     "notifications",
     "activeTab",
     "storage",
-    "http://localhost:5600/api/*",
+    "http://localhost:5700/api/*",
     "http://localhost:5666/api/*"
  ]
 }
diff --git a/static/popup.html b/static/popup.html
index 4eb32ad..dd84041 100644
--- a/static/popup.html
+++ b/static/popup.html
@@ -19,7 +19,7 @@
   </div>
 
   <div>
-    <a id="webui-link" href="http://localhost:5600/" target="_blank">
+    <a id="webui-link" href="http://localhost:5700/" target="_blank">
       <span class="button">
         <b>Open web UI</b>
       </span>

Then built the extension via make build, but can't use it on my Firefox because the zip is unsigned.

Need to install Developer edition or Nightly just to be able to use this. Such a sorry state of affairs.

@ErikBjare
Copy link
Member

ErikBjare commented Nov 11, 2021

@dufferzafar You can install unsigned extensions temporarily at about:debugging#/runtime/this-firefox, however, they'll be disabled when you restart:

image

There seems to be a way around that however: https://wiringbits.net/browser-extensions/2020/11/27/installing-unsigned-extensions-permanently-to-firefox.html

@dufferzafar
Copy link
Author

There seems to be a way around that however: wiringbits.net/browser-extensions/2020/11/27/installing-unsigned-extensions-permanently-to-firefox.html

This page mentions Step 5 as:

Go to about:config, change xpinstall.signatures.required to true. That’s it, you have installed an unsigned extension permanently.

This will ONLY work in Firefox Developer Edition or Nightly!

https://support.mozilla.org/en-US/kb/add-on-signing-in-firefox

@ErikBjare
Copy link
Member

ErikBjare commented Nov 11, 2021 via email

@Mouad-Ouazin
Copy link

Mouad-Ouazin commented Jun 22, 2024

Ah... help, I have the same problem, :(
can't I just enter the config and type something like localhost:5700

@Mouad-Ouazin
Copy link

if I changed the proxy in my network will it work I use nm-applet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants