ergochat / ergo

A modern IRC server (daemon/ircd) written in Go.
https://ergo.chat/
MIT License
2.21k stars 176 forks source link

Config Web Editor #1008

Open DanielOaks opened 4 years ago

DanielOaks commented 4 years ago

One stage of #71 that should be a fairly simple feature. Basically, expose an editor that lets users modify their config file with a web interface.

The basic idea for this proposal is that your config is in one of two states:

In the Text state, your config file is structured in an understandable way, you've got lengthy comments explaining everything, etc. In the Web state, your config file is just a raw yaml dump that's arranged however it exports your config file -- there's no comments in the file, but the web interface gives you that info anyway.

The reason we do this and keep everything in ircd.yaml instead of e.g. saving the config in the database is because we seriously need to make sure there's on source of truth for this. Having the config file as well as random values (or the entire config) being able to be overwritten by the database will make things extremely, crazily complicated for us to debug (when someone comes to us with a problem) and for admins to understand.


image

  1. When you load up the web interface for the first time, you get a text editor with the whole YAML config in it. When you 'save' the config, it gets checked and saved to disk if it's valid. The config file retains all comments and is 100% our standard config.
  2. When you click a button like 'Use Web Config Only', it explains that you'll need to use the web config editor in future and asks you to confirm.
  3. When you confirm, it presents a much nicer interface. The config file retains no comments and is 100% just the exported YAML. At the top of the config file there's a standard THIS FILE IS AUTOGENERATED warning comment and we include a config key like use-web-config-only to indicate to Oragono that this config is now being edited using the web interface, so that when we load the config editor we can default to the nice interface.
DanielOaks commented 4 years ago

note to self: when we mock up the config editor, take another look at bogdomania's mockup, there was some cool stuff in there

poVoq commented 3 years ago

Might be interesting to expose this as a secure API so that other projects with a webinterface like openWRT or OPNSense could just add a basic config feature to run Oragono.