Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

apt update/upgrade Configuration file '/etc/matrix-synapse/homeserver.yaml' ==> Modified (by you or by a script) since installation. #11238

Closed
Jieiku opened this issue Nov 2, 2021 · 5 comments · Fixed by #11281

Comments

@Jieiku
Copy link

Jieiku commented Nov 2, 2021

Description:
would it be possible to support a local configuration, eg:
homeserver.yaml.local

the values defined in .local would overwrite anything specificed in the main homeserver.yaml

This way I can leave homeserver.yaml untouched and will not be prompted what to do when updating the server.
(or if there is another way to accomplish the same result, please let me know, thank you.)

when I perform an apt update of my synapse install.
I am always prompted:

Setting up matrix-synapse-py3 (1.46.0+focal1) ...

Configuration file '/etc/matrix-synapse/homeserver.yaml'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** homeserver.yaml (Y/I/N/O/D/Z) [default=N] ?
@reivilibre
Copy link
Contributor

reivilibre commented Nov 4, 2021

There is already such a place: the whole directory /etc/matrix-synapse/conf.d/ will have configuration files loaded.
You'll notice that, after setting up, there will already be one file in there which contains your server's name. You're free to add more files there so you can avoid changing the main configuration file.

(You only need to write out the configuration values that you want to change)

@reivilibre
Copy link
Contributor

Closing because I think this answers your question, otherwise can re-open

@Jieiku
Copy link
Author

Jieiku commented Nov 8, 2021

OK! I finally figure this out, nobody likes to reinvent the wheel, so when I install new software I check the official documentation and wiki for said product, and when that is missing or insufficient I check google.

In this case I installed matrix-synapse originally using a google guide.
unfortunately when you search google: "matrix-synapse-py3" "registration_shared_secret"
LITERALLY all the guides have you editing the main homeserver.yaml file. (went 3 pages deep on google)

The only values I changed in the initial homeserver.yaml file are:

registration_shared_secret:
listeners:
    ...
    bind_addresses: ['::1', '0.0.0.0']

nobody ever mentions not editing the main homeserver.yaml file.
the solution was to first backup the old config and install the unmodified yaml config:

mv /etc/matrix-synapse/homeserver.yaml /etc/matrix-synapse/homeserver.yaml.old
apt-get -o DPkg::options::=--force-confmiss --reinstall install matrix-synapse-py3

next create a config file under conf.d for any values we wish to change.
nano /etc/matrix-synapse/conf.d/config.yaml

registration_shared_secret: "ExampleExampleExampleExampleExampleExample"

listeners:
  - port: 8008
    tls: false
    type: http
    x_forwarded: true
    bind_addresses: ['::1', '0.0.0.0']

    resources:
      - names: [client, federation]
        compress: false

then reboot, now in the future I wont edit the homeserver.yaml, I will instead edit the conf.d/config.yaml to overwrite values in homeserver.yaml

Thanks again for your help!

@reivilibre
Copy link
Contributor

LITERALLY all the guides have you editing the main homeserver.yaml file

That's a pity. In some ways, this is because the Debian/Ubuntu package is a little special in that you benefit a lot by splitting out the configuration so the original file is left untouched, but if you install any other way then you probably don't care much about that.

Thanks for writing it up! I'm sure others will find that information useful.

@richvdh
Copy link
Member

richvdh commented Nov 9, 2021

this is a duplicate of #8159.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants