-
Notifications
You must be signed in to change notification settings - Fork 911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lightningd/jsonrpc.c: Set JSON-RPC socket permissions by command line. #3437
Conversation
Changelog-Added: Can now set the permissions on the JSON-RPC socket by `--rpc-file-mode`.
A comment: JSON, technically speaking, disallows encoding octal in the JSON stream, and the only numbers that can start with 0 are 0 and floating-point numbers that have only 0 before the |
The implementation looks good to me, however the reason I was reluctant to add a CLI flag was that it'd also get us to Then again, I see the point of restoring a known good state on each startup, which is what I think @rustyrussell aimed to do by recreating every time. Just wanted to discuss this briefly before merging. What do you think @rustyrussell @ZmnSCPxj? |
I intend to set up my own rpc-file in a Ownership and groupship are generally handled by running daemons in their own unique UID and GID, e.g. Tor is typically run in |
Sounds compelling. Would you suggest we change the file mask to allow groups then? It's something that several projects have bumped against, and I like your "add them to the |
ACK 5c28d1f |
This command-line argument allows you to set this...? Just pass in |
It has been possible to set JSON-RPC socket permissions since ElementsProject/lightning#3437. This commit makes the clightning JSON-RPC socket group readable and writeable, runs lightning-charge under its own user with clightning membership, and removes related warnings. I haven't figured out a good way to migrate an existing lightning-charge.db to the right ownership and permissions. I thought about removing the lightning-cli option, but I think it's actually not a good idea to run lightning-cli with another user anyway, I ask for feedback on this.
It has been possible to set JSON-RPC socket permissions since ElementsProject/lightning#3437. This commit makes the clightning JSON-RPC socket group readable and writeable, runs lightning-charge under its own user with clightning membership, and removes related warnings. I haven't figured out a good way to migrate an existing lightning-charge.db to the right ownership and permissions. I thought about removing the lightning-cli option, but I think it's actually not a good idea to run lightning-cli with another user anyway, I ask for feedback on this.
It has been possible to set JSON-RPC socket permissions since ElementsProject/lightning#3437. This commit makes the clightning JSON-RPC socket group readable and writeable, runs lightning-charge under its own user with clightning membership, and removes related warnings. I haven't figured out a good way to migrate an existing lightning-charge.db to the right ownership and permissions. I thought about removing the lightning-cli option, but I think it's actually not a good idea to run lightning-cli with another user anyway, I ask for feedback on this.
It has been possible to set JSON-RPC socket permissions since ElementsProject/lightning#3437. This commit makes the clightning JSON-RPC socket group readable and writeable, runs lightning-charge under its own user with clightning membership, and removes related warnings. I thought about removing the lightning-cli option, but I think it's actually not a good idea to run lightning-cli with another user anyway, I ask for feedback on this.
It has been possible to set JSON-RPC socket permissions since ElementsProject/lightning#3437. This commit makes the clightning JSON-RPC socket group readable and writeable, runs lightning-charge under its own user with clightning membership, and removes related warnings. I thought about removing the lightning-cli option, but I think it's actually not a good idea to run lightning-cli with another user anyway, I ask for feedback on this.
It has been possible to set JSON-RPC socket permissions since ElementsProject/lightning#3437. This commit makes the clightning JSON-RPC socket group readable and writeable, runs lightning-charge under its own user with clightning membership, and removes related warnings. I thought about removing the lightning-cli option, but I think it's actually not a good idea to run lightning-cli with another user anyway, I ask for feedback on this.
It has been possible to set JSON-RPC socket permissions since ElementsProject/lightning#3437. This commit makes the clightning JSON-RPC socket group readable and writeable, runs lightning-charge under its own user with clightning membership, and removes related warnings. I thought about removing the lightning-cli option, but I think it's actually not a good idea to run lightning-cli with another user anyway, I ask for feedback on this.
It has been possible to set JSON-RPC socket permissions since ElementsProject/lightning#3437. This commit makes the clightning JSON-RPC socket group readable and writeable, runs lightning-charge under its own user with clightning membership, and removes related warnings. I thought about removing the lightning-cli option, but I think it's actually not a good idea to run lightning-cli with another user anyway, I ask for feedback on this.
It has been possible to set JSON-RPC socket permissions since ElementsProject/lightning#3437. This commit makes the clightning JSON-RPC socket group readable and writeable, runs lightning-charge under its own user with clightning membership, and removes related warnings. I thought about removing the lightning-cli option, but I think it's actually not a good idea to run lightning-cli with another user anyway, I ask for feedback on this. clightning module: remove conditional in postStart @jonasnick fixup clightning module: g+X -> g+x in postStart @jonasnick fixup lightning-charge: remove unnecessary clightning-datadir option lightning-charge module: move lightning-charge.db to own dataDir @jonasnick fixup lightning-charge module: Add todo @jonasnick fixup
Fixes: #1366
Arguably also works for #3394. It is probably more sensible to set permissions via this patch and
--rpc-file-mode
, since this will work in a new install or if you place the RPC file in atmpfs
(which might make more sense as well, so that at startup the rpc file does not exist yet, so you can wait on the file existing to determine if you can now connect to it and the correct lightningd already is listening).