Skip to content

Instantly share code, notes, and snippets.

@Paraphraser
Last active July 14, 2023 03:35
Show Gist options
  • Save Paraphraser/70d67113a979d5e8dc8a6ad5f89ea2c2 to your computer and use it in GitHub Desktop.
Save Paraphraser/70d67113a979d5e8dc8a6ad5f89ea2c2 to your computer and use it in GitHub Desktop.
Recipe for installing Node-RED Midnight-red theme under IOTstack

IOTstack Recipe: Node-RED Midnight-red theme

Reference

node-red-contrib-themes/midnight-red

Assumptions

  1. Your IOTstack is running.

Recipe

Open a shell into the nodered container and install the package:

$ docker exec -it nodered bash
# cd /data
# npm install @node-red-contrib-themes/midnight-red /data
# exit
$

Switch to the Node-Red data directory:

$ cd ~/IOTstack/volumes/nodered/data

Make a backup of your settings.js:

$ sudo cp settings.js settings.js.bak 

Open settings.js in your favourite text editor. My first encounter with Unix was circa 1984 so I use VI out of very-deeply-ingrained habit 🤯:

$ sudo vi settings.js 

Search for this (it is at the end of the file):

    // Customising the editor
    editorTheme: {
        projects: {
            // To enable the Projects feature, set this value to true
            enabled: false
        }
    }

Make it look like this:

    // Customising the editor
    editorTheme: {
        projects: {
            // To enable the Projects feature, set this value to true
            enabled: false
        },
        page: {
            css: "/data/node_modules/@node-red-contrib-themes/midnight-red/theme.css"
        }

    }

Before you save your work, double-check:

  1. That you have added a comma after the "}" in the "projects" grouping.
  2. That you replaced <HOME>/.node-red (from the instructions) with /data

Save your work.

Restart Node-Red:

$ cd ~/IOTstack
$ docker-compose restart nodered

Check the Node-Red log for signs of problems (you are mainly looking for complaints about syntax errors in your settings.js):

$ docker logs nodered

If all seems well, reload your Node-Red browser page. Enjoy!

@dalklein
Copy link

dalklein commented Dec 8, 2020

Worked just now, easier on the eyes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment