m1k1o / neko

A self hosted virtual browser that runs in docker and uses WebRTC.
https://neko.m1k1o.net/
Apache License 2.0
5.95k stars 449 forks source link

Restart neko #313

Closed grbfst closed 9 months ago

grbfst commented 1 year ago

Is there a way to restart Neko so it reads the ENV variables again? Sometimes I need to change the user password (before logging in). Neko stop or the likes don't work.

m1k1o commented 1 year ago

Docker doesn't offer this feature, see: https://stackoverflow.com/questions/27812548/how-to-set-an-environment-variable-in-a-running-docker-container

But you could move your configuration to yaml file and you can change it anytime, just restart neko binary to reread it. https://neko.m1k1o.net/#/getting-started/configuration?id=config-file

grbfst commented 1 year ago

Check, how do I restart the binary?

m1k1o commented 1 year ago

You can restart the whole container or just run supervisorctl restart neko inside the container.

Or kill neko binary process inside container. It will be automatically restarted.

grbfst commented 1 year ago

Thanks, I'm not running in Docker. To restart separate processes I found out you have to run supervisor in a different way: I added below to the supervisord.conf:

[unix_http_server] file=/var/run/supervisor.sock ; (the path to the socket file) chmod=0700 ; sockef file mode (default 0700) [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface [supervisorctl] serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket

to the supervisor startup command I added "-n": ["/usr/bin/supervisord", "-n", "-c", "/etc/neko/supervisord.conf"]

So it runs in the foreground (I can of course change nodaemon=true in the config)

Now I can restart Chrome or Neko separately with supervisorctl restart [program name]