#513 prosodyctl config edit

Reporter Zash
Owner Zash
Created
Updated
Stars (0)
Tags
  • Priority-Medium
  • Status-Accepted
  • Type-Enhancement
  1. Zash on

    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.

  2. Zash on

    Changes
    • owner Zash
    • tag Status-Started
  3. 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
    • tag Milestone-0.10
  4. Zash on

    Changes
    • tags Status-Blocked
  5. MattJ on

    Bumping milestone.

    Changes
    • tags Milestone-0.11
  6. 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
  7. MattJ on

    Bumping feature to 0.12

    Changes
    • tags Milestone-0.11 Milestone-0.12
  8. Zash on

    Don't think I'll be finishing this for 0.12 in the original shape I had in mind. See comment 6.

    Changes
    • tags Milestone-0.12

New comment

Not published. Used for spam prevention and optional update notifications.