Echo Speaks Local Network Logon/Cookie Authorization Server to replace Heroku

Blockquote Vi is possibly the most user hostile text editor of all time! Nano is a much better text editor.

I was just the other day marveling how the muscle memory I built up from using vi 30 yrs ago is still active!

1 Like

That’s impressive. I never liked it and therefore don’t recall the commands.

I was reaching out (Echo Speaks V4 thread, Post #103) to see if NodeJS in "windows 10 always on" would be more efficient than Docker via Synology NAS. I think you answered my question. What's your thoughts and could you provide guidance.

RE: "I may add instructions for doing it on NodeJS in windows as well, IMO it is less complicated than docker and less overhead as well since this app does not NEED linux to run."

I actually found out it is MORE complicated than Docker, especially with the new official docker package totones7 put together being super simple. The worst part about doing it straight on NodeJS is you have to setup some way for it to run when the PC boots or logs in, and if you want it to run as a system service its not simple for Windows. I would say Docker is the way to go unless you really need to squeeze every ounce of Ram and CPU out of that PC.

I just fired it up using the official container and here is the CPU and RAM after it launched and settled down


I did also find out there is a "vmmem" process that sucks up a bunch of Ram to reserve it for virtual machines. Thats the one drawback of using Docker, but I did find you can create a config file to limit how much Ram it will use.

Thanks for you response!!- I'll pursue docker on the NAS first and see how things go. I'm limited on ram there so if it bogs down any, I'll try one of the "always-on" desktops where there's more cpu and ram.

@lados Many of the users here have asked about using Windows to host the app. I created a video on my channel today that goes into great depth as to how this is done. Virtually, Virtually Virtual - YouTube

2 Likes

@lados There's always the lighter-weight non-Docker solution for your Synology NAS using node.js and pm2 but you can see that I still haven't overcome the pm2 restart issue on that box. Are you running DSM 6 (like me) or upgraded to DSM 7?

Yes- Currently DSM 6 but migrating from a DS214+ to a DS220+. Will install DSM 7 and let this Echo Speaks be part of the migration too.

So, would the non-Docker solution be more efficient than going thru Synology Docker? I'll look through the threads for the node.js on the synology. I'm sure the pm2 issue will get resolved.

Thanks for the help. This is all new to me so always looking for options and best practices.

I inferred from the discussions above that node.js running natively under DSM would be more lightweight (and efficient?) than the Docker solution, but @vmsman could tell us for sure. Plus I already had two other Docker containers running unrelated services, so I chose the alternative approach described by him at Echo Speaks Local Cookie Authorization Server - ScottiByte's Discussion Forum . I can't say whether the instructions would differ if you were to do the installation under DSM 7.

@lados @steve.hoge As far as efficiency is concerned, you probably take a small disk space hit and very little CPU overhead to run the server in a docker container. Since the node.js implementation runs directly, it's overhead is minimal.


In the above screenshot, I am running my ES Authorization/Cookie server as a node.js implementation inside of a LXD container which is super lean in comparison to a virtual machine. Note that in my example in running inside of a LXD Ubuntu container I am using 390MB for the OS+application and about 1.2GB in disk space. So, if you have a way to run Docker or a LXD container in DSM, then that's what you can expect for overhead.

Several other users here have asked me what is involved in running the app inside of Windows. So, I created a video on my channel which is a step by step on creating an Ubuntu VM inside of Windows 10/11 and adding a LXD instance to that VM. If you have a Windows machine up 24/7, this adds not only the ability to run this app but also many others. In my case, I have at least 5 application servers externally called by my HE. So, that might be something you want to explore.

Go Check out my new video on the subject. Virtually, Virtually Virtual - YouTube

1 Like

Stop being kind.... Edlin was almost as bad as my ex-wife...

1 Like

Thanks for taking time to provide the information. Surely makes me want to explore all the different options just to experience the differences, I'll check it out for sure.

The Echo Speaks local logon/Authorization server is not the only one that requires an external server instance on your network. Think about great applications like a CATT server to integrate with the CATT Director HE app if you have any Chromecast devices and the Harmony API if you own any Logictech Harmony Hubs which offers device level control and not just activity switches from your HE. Hey, this is an addiction and remote servers are climbing in popularity. Another great one is the "camera motion capture" custom device type which captures a sequence of still frames from a camera and stores them on an external web server for a time based playback history.

I have edited dockerfile to 8092, but cannot figure out how to create the container with the edited dockerfile. Is there to edit the tonesto7/echo speaks server2 container with the moded dockerfile. I have downloaded the docker image with my moded dockerfile which should work but do not know how to create the container. This stuff is not my specialty but is cool to be able to do. I know I need to create another echo speaks on hubitat.
Thanks

I’ve installed the container using Portainer on my RPi4. After deploying the container it immediately exits with this error line in the log:

exec /usr/local/bin/docker-entrypoint.sh: exec format error

I’m using the docker image that tonesto7 just posted. Any ideas as to what I’m doing wrong?

1 Like

@hunt.darren Follow my guide Echo Speaks Local Cookie Authorization Server - ScottiByte's Discussion Forum

1 Like

Running into an issue following the instructions at Echo Speaks Local Cookie Authorization Server - ScottiByte's Discussion Forum

Rpi 3B+ Bullseye, 5.15.76-v7+ #1597 fully updated

Error is shown below. Any Ideas?

pi@raspberrypi:~ $ cd echo-speaks-server-docker-enablement/docker
pi@raspberrypi:~/echo-speaks-server-docker-enablement/docker $ sudo su
root@raspberrypi:/home/pi/echo-speaks-server-docker-enablement/docker# docker-compose build
ERROR: The Compose file './docker-compose.yaml' is invalid because:
Unsupported config option for services: 'echo-speaks-server'
root@raspberrypi:/home/pi/echo-speaks-server-docker-enablement/docker# 
root@raspberrypi:/home/pi/echo-speaks-server-docker-enablement/docker# 
root@raspberrypi:/home/pi/echo-speaks-server-docker-enablement/docker# ls
data		     env.echo-speaks-server	  README.md
docker-compose.yaml  env.echo-speaks-server.dist  start.sh
root@raspberrypi:/home/pi/echo-speaks-server-docker-enablement/docker# 

docker-compose.yaml

  GNU nano 5.4                     docker-compose.yaml                               
services:
  echo-speaks-server:
    image: echo-speaks-server:2.7.2
    build:
      context: ../
    container_name: echo-speaks-server
    restart: always

    ports:
      - "8091:8091"
    env_file:
      - './env.echo-speaks-server'
    volumes:
      # Data persistency
      - ./data:/mnt/es-data

@tinker3433 Edit the docker-compose.yml. On the line before the "services" line, add:

version: "3"

Align it with "services" horizontally and try the build again.

Thanks!
That worked
Server is up and running

@tinker3433 I have seen others have that issue with Docker on Debian Buster. My server instance was Ubuntu Jammy and I had not seen that. In any event, due to the popularity of this subject, I updated my Discourse article on my server to reflect your finding. Echo Speaks Local Cookie Authorization Server - ScottiByte's Discussion Forum

1 Like