Skip to content

Migrate backend to Node.js for self-signed certs#32

Open
t1m0thyj wants to merge 6 commits intojohnholbrook:mainfrom
t1m0thyj:feat/allow-insecure-https
Open

Migrate backend to Node.js for self-signed certs#32
t1m0thyj wants to merge 6 commits intojohnholbrook:mainfrom
t1m0thyj:feat/allow-insecure-https

Conversation

@t1m0thyj
Copy link
Copy Markdown
Contributor

@t1m0thyj t1m0thyj commented Dec 16, 2025

Resolves #28 and #31

This PR is a significant rework of the backend, migrating it from a Chrome-based webworker (code.js) to a Node.js process (src/plugin.js). This involves pulling in the Elgato StreamDeck SDK as a dependency and bundling it with ESBuild (bin/plugin.js). There are several reasons for the migration:

  • When running in the context of a browser there was no way to allow self-signed certificates. Now running with Node.js allows the rejectUnauthorized flag to be set on the HTTPS agent. I've split the HTTPS protocol option into 2 separate options: "HTTPS (strict)" (which will be enabled if HTTPS was enabled in previous versions) and "HTTPS (allow self-signed certs)".
  • Logging was broken in the browser-based version of the plugin. It seems the sendMessage command has been deprecated and now the StreamDeck SDK is the recommended way to handle logging.
  • The XmlHttpRequest API did not return helpful error messages, making it difficult to diagnose Pi-hole connection errors. The Node.js http/https libraries improve this situation.
  • The timer patch in timers.js is no longer needed because Node.js runtime has more accurate timers.

Additionally this PR makes the following changes:

  • Added connection status indicator at bottom of property inspector page with error details or success message. This should help new users to troubleshoot connection issues.
  • Fixed missing caret SVG on dropdowns.
  • Fixed Pi-hole auth sessions not being ended before plug-in terminates, which could cause max session limit to be exceeded. Since the StreamDeck SDK doesn't offer an exit event, I've opted to store session IDs in global settings and reuse them if still valid when plugin is relaunched.
image image

@t1m0thyj t1m0thyj marked this pull request as ready for review December 18, 2025 04:11
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

Successfully merging this pull request may close these issues.

Solution if you want to run it with the new API

1 participant