-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Allow non-interactive config generation from dpkg config snippets #13669
Conversation
Signed-off-by: Jörg Behrmann <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm failing to understand your ultimate goal here. It seems you want to get away from including a homeserver.yaml
in the debian package (and, presumably, you want to stop the package generating /etc/matrix-synapse/conf.d/server_name.yaml
etc), but why is this an improvement?
report_stats_file = cls.pop_config_by_name( | ||
config_files, "report_stats.yaml" | ||
) | ||
if report_stats_file: | ||
with open(report_stats_file) as f: | ||
config_args.report_stats = yaml.safe_load(f)["report_stats"] | ||
else: | ||
parser.error( | ||
"Please specify either --report-stats=yes or --report-stats=no\n\n" | ||
+ MISSING_REPORT_STATS_SPIEL | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting aside for now the fact that we're hardcoding some very debian-package-specific magic into the main code here:
It's worth noting that, at present, you can dpkg-reconfigure matrix-synapse-py3
and change the report_stats
setting. That will be written back to /etc/matrix-synapse/conf.d/report_stats.yaml
so that it is picked up by synapse on the next restart.
It looks to me as if this change will put the report_stats
setting into /etc/matrix-synapse/homeserver.yaml
on first run, where it will never be changed thereafter - so users can no longer dpkg-reconfigure
this setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point, I'll think about how to address this.
I think you might be misunderstanding what #13615 does (and this might explain my confusion about your comments on that PR). Even with #13615 in place, Synapse will not create a top-level |
Agreed. Looking at #13615, I see that I misunderstood it. I just tried a slightly changed service file with
leaving the The goal I'd like to work towards is to get synapse to be able to come up with the minimum required information, which I gather is basically the server name and the report stats setting, because that is what is currently used to generate the default config. Since synapse can generate all the default information into a config file itself, I think it would be nice to have synapse in charge of generating its config. Currently the Debian These, of course, are all things that could be fixed for the Debian packaging, but I think that everybody would win if this work were not necessary (no extra work, less subtle differences between what the Debian package installs and what would be the result of a manual install, also other distros could use it for free).
I'm somewhat fine with Does this sound ok? |
Honestly, I am not a huge fan of the output of
It kindof is, in that https://github.com/matrix-org/synapse/blob/develop/debian/build_virtualenv#L87-L111 builds the
Personally, I find I just don't really think this is a terribly useful direction, I'm afraid. |
Sure. I'm not really a partisan for which one is better. My thrust is more in the direction of not having - in my opinion - needless differences. I think the default config should look as similar as possible between all the possible ways of deploying synapse.
I think I didn't formulate that very clearly. I'd like synapse as much in charge as possible without, e.g. the intermediary of the packaging, i.e. if synapse can generate it's config from some seed information, I'd prefer not shipping it. This comes from the above-mentioned goal of having default configs look as similar as possible between different ways of deploying synapse. Also I'd like for this to be able to happen without user interaction when possible.
About this one I somewhat agree. I don't see a reason to embed the server name in the filename either, but again, from my point of view there's fewer reasons to call this file by default I do see a good point in not calling that file
I'll close this one for now, because in the current form this can't work this way, but I'll tinker some more on the general idea. Thanks for the feedback, though! :) |
I'd support a PR which removed SERVERNAME from the name generated by |
Pull Request Checklist
Somehow I couldn't get #13615 to work for me without specifying the server name or whether to report stats, but at least in the Debian installation they are already there, so this does a little trick to look into those special files (and to put them to some use, because on my machines they were mostly superfluous).
This isn't done yet, probably, because this should allow to drop shipping the example config in the Debian installation, but I haven't tried this yet. I did want to gather feedback on this, though.
EventStore
toEventWorkerStore
.".code blocks
.(run the linters)