inhabitat:kaunas:day03:details
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| inhabitat:kaunas:day03:details [2026/05/28 08:38] – created jan.sonntag | inhabitat:kaunas:day03:details [2026/05/28 11:51] (current) – jan.sonntag | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| <WRAP center round tip 80%> | <WRAP center round tip 80%> | ||
| **You are not expected to copy this 1:1.** \\ | **You are not expected to copy this 1:1.** \\ | ||
| - | The multi-instance, | + | The multi-instance, |
| </ | </ | ||
| All scripts, configs and the Node-RED management flow shown below live in our public repository: | All scripts, configs and the Node-RED management flow shown below live in our public repository: | ||
| - | * **Repository: | + | * **Repository: |
| ===== Architecture overview ===== | ===== Architecture overview ===== | ||
| Line 380: | Line 380: | ||
| Login uses the '' | Login uses the '' | ||
| - | ===== Running | + | ===== Running |
| - | If you want to play with the stack on your own machine | + | You don't need the reverse proxy to use this repo. The NGINX layer only exists to give many users clean public URLs on one server |
| ==== Minimum requirements ==== | ==== Minimum requirements ==== | ||
| Line 388: | Line 388: | ||
| * Docker | * Docker | ||
| * Docker Compose | * Docker Compose | ||
| + | * Python 3 (used by '' | ||
| - | ==== A minimal local compose.yml | + | ==== Steps ==== |
| - | Drop the following into an empty folder. It is a stripped-down version of the workshop '' | + | Clone the repo and enter it: |
| - | < | + | < |
| - | services: | + | git clone https:// |
| - | node-red: | + | cd nig-workshop-stack |
| - | image: nodered/node-red:4.1.10-22 | + | </code> |
| - | | + | |
| - | ports: | + | |
| - | | + | |
| - | | + | |
| - | TZ: " | + | |
| - | INFLUXDB_HOST: | + | |
| - | INFLUXDB_PORT: | + | |
| - | INFLUXDB_DB: | + | |
| - | INFLUXDB_USER: | + | |
| - | INFLUXDB_USER_PASSWORD: | + | |
| - | volumes: | + | |
| - | - node_red_data:/ | + | |
| - | depends_on: | + | |
| - | - influxdb | + | |
| - | influxdb: | + | Edit '' |
| - | image: influxdb:1.12.4 | + | |
| - | restart: unless-stopped | + | |
| - | environment: | + | |
| - | INFLUXDB_DB: | + | |
| - | INFLUXDB_HTTP_AUTH_ENABLED: | + | |
| - | INFLUXDB_ADMIN_USER: | + | |
| - | INFLUXDB_ADMIN_PASSWORD: | + | |
| - | INFLUXDB_USER: | + | |
| - | INFLUXDB_USER_PASSWORD: | + | |
| - | volumes: | + | |
| - | - influxdb_data:/ | + | |
| - | grafana: | + | <code csv inventory.csv> |
| - | image: grafana/ | + | USER_NAME, |
| - | restart: unless-stopped | + | me, |
| - | ports: | + | |
| - | - " | + | |
| - | environment: | + | |
| - | GF_SECURITY_ADMIN_USER: | + | |
| - | GF_SECURITY_ADMIN_PASSWORD: | + | |
| - | GF_USERS_ALLOW_SIGN_UP: | + | |
| - | volumes: | + | |
| - | - grafana_data:/ | + | |
| - | depends_on: | + | |
| - | - influxdb | + | |
| - | + | ||
| - | volumes: | + | |
| - | node_red_data: | + | |
| - | | + | |
| - | | + | |
| </ | </ | ||
| - | Start it: | + | Bring it up with the deploy script (**not** raw '' |
| <code bash> | <code bash> | ||
| - | docker compose | + | ./ |
| </ | </ | ||
| - | And open: | + | Then open: |
| ^ Service ^ URL ^ | ^ Service ^ URL ^ | ||
| - | | Node-RED | http:// | + | | Node-RED | '' |
| - | | Grafana | http://localhost: | + | | Grafana |
| - | | InfluxDB | + | |
| - | ==== What is different from the workshop | + | Log in with the '' |
| + | |||
| + | <WRAP center round tip 80%> | ||
| + | The ''/ | ||
| + | </ | ||
| + | |||
| + | ==== The "extra port": inside vs. outside the container ==== | ||
| + | |||
| + | A container port and the host port you reach it on are **two different | ||
| + | |||
| + | <code yaml> | ||
| + | ports: | ||
| + | - " | ||
| + | </ | ||
| + | |||
| + | Read this as '' | ||
| + | |||
| + | * **Inside** the container, anything you bind always listens on **1881**. That number never changes — your flows, a broker, an HTTP listener, all use '' | ||
| + | * **Outside**, | ||
| + | |||
| + | This is exactly why the inventory needs a separate '' | ||
| + | |||
| + | ==== Hosting your own MQTT broker with Node-RED Aedes ==== | ||
| + | |||
| + | For testing you often want an MQTT broker without installing one separately. The [[https:// | ||
| + | |||
| + | - In the Node-RED editor, install '' | ||
| + | - Drop an **aedes broker** node onto a flow and set its port to **1881** — the container-internal extra port. | ||
| + | - Point an **mqtt-broker** config (used by '' | ||
| + | - To publish/ | ||
| + | |||
| + | This gives every workshop | ||
| + | |||
| + | ==== This setup is not hardened ==== | ||
| + | |||
| + | <WRAP center round important 80%> | ||
| + | This stack is built for **workshops and local experimentation**, | ||
| + | </ | ||
| - | In case you want to upgrade your local setup later, here is what is //missing// compared to the production workshop stack, and why each piece exists there: | + | If you want to take any of this further than a workshop, harden |
| - | * **No Node-RED | + | * **Node-RED** |
| - | * **No HTTP root prefix.** Without a reverse proxy you don't need ''/student1/node-red/''; | + | * **Grafana** — Grafana's [[https://grafana.com/ |
| - | * **No Grafana sub-path or root URL.** Same reason. | + | * **InfluxDB** — consider moving off the unmaintained 1.x line to a supported InfluxDB release; review the relevant version' |
| - | * **No Grafana datasource provisioning.** You can paste the same '' | + | * **Docker** — apply the general [[https:// |
| - | * **No bcrypt hashing dance.** No '' | + | * **Secrets** — replace the plain '' |
| - | * **No per-user isolation.** Everyone using your laptop shares the same stack — which is exactly what you want when " | + | |
| ===== Further reading ===== | ===== Further reading ===== | ||
| * Original lab wiki page this stack is based on: < | * Original lab wiki page this stack is based on: < | ||
| - | * Repository: | + | * Repository: |
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
inhabitat/kaunas/day03/details.1779950289.txt.gz · Last modified: 2026/05/28 08:38 by jan.sonntag