makemkv asks for key when run outside bash

The place to discuss linux version of MakeMKV
Post Reply
hudsonator72
Posts: 2
Joined: Tue May 26, 2026 10:29 pm

makemkv asks for key when run outside bash

Post by hudsonator72 »

Hi, I just got makemkv set up with the beta key, and I made a web ui with openresty to run in a Debian 12 container on my proxmox server off of a old tower with a dvd drive in my living room. Trying to add the key with makemkvcon reg but I couldn't get it working so I manually added it in the settings.conf file and now I can run makemkvcon from bash. However, when I try to run makemkvcon from openresty, it says its too old/doesn't have a key. I've tried having openresty run makemkvcon through bash but it still doesn't work. Because it's in proxmox on my home LAN I just have everything running as root and haven't set up proper users. I have the sr* and sg* both passed through, it works through bash but not openresty
tomty89
Posts: 101
Joined: Sun Dec 13, 2020 8:48 am

Re: makemkv asks for key when run outside bash

Post by tomty89 »

No idea what's "openresty" but sounds like to me it's just that makemkvcon would be run as another user in that case and therefore reads a different .MakeMKV/setting from a different HOME (which is not /root).
hudsonator72
Posts: 2
Joined: Tue May 26, 2026 10:29 pm

Re: makemkv asks for key when run outside bash

Post by hudsonator72 »

Openresty is nginx with la scripting, which means that you can send a request and then that request can call a lua function, which can start a program. It's also not a user thing as openresty is set to run as root, and when running whoami from the lua it returns root, so it's not a users thing. The only other thing that I can think of is if its an environment vars thing, running bash from ssh or wherever has the correct env vars but maybe resty.shell sets them wrong or doesn't set all of them
tomty89
Posts: 101
Joined: Sun Dec 13, 2020 8:48 am

Re: makemkv asks for key when run outside bash

Post by tomty89 »

Well as I already mentioned, obviously you need HOME properly set to /root (assuming that's where you have .MakeMKV/settings.conf put).

As per https://nginx.org/en/docs/ngx_core_module.html#env and https://ketzacoatl.github.io/posts/2017 ... vvars.html, apparently nginx/openresty will not pass on most env vars. To retain / set one you need the env directive. Depending on how you get nginx/openresty running (e.g. systemd service), it might not have inherited any HOME anyway. Therefore you might need something like:

Code: Select all

env HOME=/root;
instead of:

Code: Select all

env HOME;
Assuming https://github.com/openresty/lua-resty-shell (I suppose it is what you are using?) would pass on the env vars to what it runs, then it should work. (I don't think you need anything like the os.getenv() in the example. I don't see any setting options for this module in particular regarding env vars.)

In fact you may even just pass:

Code: Select all

export HOME=/root; makemkvcon ...
or

Code: Select all

HOME=/root makemkvcon ...
to shell.run() instead, given that apparently what you pass to it would be passed to a /bin/sh through -c.
Post Reply