A command that behaves like sudo -e, that is
1. Create temporary copy of config file
2. Invoke editor, preferably not as root. Possibly ship syntax hilighting rules.
3. When editor is closed, check if there were any changes (maybe display a patch)
4. If the file is changed, attempt to load it to perform syntax validation
5. If loading failed, display the error and ask the user if they would like to continue editing (goto 2) or abort (goto 9) .
6. Copy back changes.
7. Send SIGHUP to prosody (if running)
8. Delete temporary file.
Zash
on
Changes
ownerZash
tagStatus-Started
Zash
on
This will be tricky to implement with prosodyctl dropping root privileges pretty early (see #530) and with most setups not allowing the prosody user write access to the config file.
Changes
tagMilestone-0.10
Zash
on
Changes
tags Status-Blocked
MattJ
on
Bumping milestone.
Changes
tags Milestone-0.11
Zash
on
This should be doable with the new --root flag.
Might still be tricky to do nicely.
Eg should the editor be run as the user or as prosody?
One would basically have to fork a process that drops root and invokes the editor, and then the parent would do stuff once the editor and the child process exits.
It might be enough to point the user at sudo -e / sudoedit and adding a check+reload command?
Changes
tags Status-Accepted
MattJ
on
Bumping feature to 0.12
Changes
tagsMilestone-0.11 Milestone-0.12
Zash
on
Don't think I'll be finishing this for 0.12 in the original shape I had in mind. See comment 6.
A command that behaves like sudo -e, that is 1. Create temporary copy of config file 2. Invoke editor, preferably not as root. Possibly ship syntax hilighting rules. 3. When editor is closed, check if there were any changes (maybe display a patch) 4. If the file is changed, attempt to load it to perform syntax validation 5. If loading failed, display the error and ask the user if they would like to continue editing (goto 2) or abort (goto 9) . 6. Copy back changes. 7. Send SIGHUP to prosody (if running) 8. Delete temporary file.
This will be tricky to implement with prosodyctl dropping root privileges pretty early (see #530) and with most setups not allowing the prosody user write access to the config file.
ChangesBumping milestone.
ChangesThis should be doable with the new --root flag. Might still be tricky to do nicely. Eg should the editor be run as the user or as prosody? One would basically have to fork a process that drops root and invokes the editor, and then the parent would do stuff once the editor and the child process exits. It might be enough to point the user at sudo -e / sudoedit and adding a check+reload command?
ChangesBumping feature to 0.12
ChangesMilestone-0.11Milestone-0.12Don't think I'll be finishing this for 0.12 in the original shape I had in mind. See comment 6.
ChangesMilestone-0.12