Migrate backend to Node.js for self-signed certs#32
Open
t1m0thyj wants to merge 6 commits intojohnholbrook:mainfrom
Open
Migrate backend to Node.js for self-signed certs#32t1m0thyj wants to merge 6 commits intojohnholbrook:mainfrom
t1m0thyj wants to merge 6 commits intojohnholbrook:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:rejectUnauthorizedflag 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)".sendMessagecommand has been deprecated and now the StreamDeck SDK is the recommended way to handle logging.XmlHttpRequestAPI did not return helpful error messages, making it difficult to diagnose Pi-hole connection errors. The Node.jshttp/httpslibraries improve this situation.timers.jsis no longer needed because Node.js runtime has more accurate timers.Additionally this PR makes the following changes:
exitevent, I've opted to store session IDs in global settings and reuse them if still valid when plugin is relaunched.