Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

choose server_name at installation #92

Closed
Thatoo opened this issue Dec 17, 2018 · 13 comments
Closed

choose server_name at installation #92

Thatoo opened this issue Dec 17, 2018 · 13 comments

Comments

@Thatoo
Copy link

Thatoo commented Dec 17, 2018

I was reading synapse documentation and I discovered that the server_name could be different than the real address of the server. It is explain here : https://github.com/matrix-org/synapse#setting-up-federation
So we can run a server at synapse.example.com, but have our Matrix user-ids look like @user:example.com instead of @user:synapse.example.com .
It could be pretty cool for yunohost admin to be able to choose the server_name before install and then when the install is finish, to get the correct SRV record to put in the DNS record of his/her registrar's interface. and also the homeserver.yaml being already set with the desired server_name.

I know I would have loved that!
Now, I don't dare to make the change of my homeserver.yaml because of that sentence : "If you've already started Synapse and a database has been created, you will have to recreate the database."
I'm afraid all users loose their data. I don't know what imply to recreate the database. Will users loose their data? the ID and key device check (for encryption...)?
And first of all, I don't know how to recreate this database.

I guess, this would be a very welcomed enhancement.

@Thatoo
Copy link
Author

Thatoo commented Dec 18, 2018

Does anyone know how we could change the server_name after install on a prod server of yunohost?
Is it even possible or way to risky and better keep the @user:synapse.domaine.tld and forget about the nicer @user:domaine.tld ?

@Thatoo
Copy link
Author

Thatoo commented Dec 20, 2018

I tried to understand what would need to change in files to take in account the choice of server_name at install and I've made some modifications. As I'm new, I hope I didn't make mistakes and what I did is understandable.
If I'm on the good track or completely wrong or something in between, don't hesitate to tell me. I just want to try to help.

@gnouts
Copy link

gnouts commented Feb 22, 2019

I would have been interested in that, too.

@Thatoo From what I've been told, it's not possible to change this parameter, unless you do a complete reinstall and loose data and federation. So it's basically a start from crash.

Adding a server_name parameter (with short description of what it implies) at installation doesn't seem too complicated.
Changing server_name at install here , and in config here, seems enough. I'll try to setup a test server to confirm this, if time is gentle with me...

@Josue-T
Copy link

Josue-T commented Feb 22, 2019

You can do it if you want...

@Thatoo
Copy link
Author

Thatoo commented Feb 22, 2019

I had this same understanding too so I decided to keep on with what I have already.
I tried to look into the code to see what needed to change for fun but I guess it's out of my computing abilities as I don't know much about coding. You can have a look at what I did in here if you know how to display differences between my fork and the original (I don't even know how to do that :-) : https://github.com/Thatoo/synapse_ynh
I remember I had found more than two things to be changed... and as I was not sure what I was doing and if it was enough, I didn't say anything.

I found how to make comparisons. Here they are :
master...Thatoo:patch-1
and
master...Thatoo:patch-2

@Thatoo
Copy link
Author

Thatoo commented May 3, 2019

@gnouts did you succeed to make it working. If it's set before matrix 1.0, it might be an idea to make a reinstall when 1.0 releases.

@Thatoo
Copy link
Author

Thatoo commented May 4, 2019

@Josue-T did you have time to glance what I did. I'd like to know if I was on the good track or if I was doing nonsense.

@Josue-T
Copy link

Josue-T commented May 4, 2019

@Thatoo , maybe you can create one PR with your patch. Because, as I see it's not bad, but some other change are also needed... and with a PR it' more easy to discuss about some part of code.

Sorry but I quite busy these time...

@gnouts
Copy link

gnouts commented May 4, 2019

@Thatoo I did some hack and managed to get a working synapse install with my account being @nouts:test.com while having synapse installed on matrix.test.com. Though I didn't tested if federation was actually working and I don't kown how it impact upgrade/backup/restore.
I'll do a PR if someone want to try it.
Also I don't really know how to test federation as I use fake domain on a virtual network in a VM... (or actually, I know but it's a heavy setup for testing ^^' )

@Thatoo
Copy link
Author

Thatoo commented May 6, 2019

gnouts wrote the PR faster than me.

@Thatoo Thatoo mentioned this issue Jul 11, 2019
8 tasks
@Thatoo
Copy link
Author

Thatoo commented Jul 25, 2019

I have a problem with the update script : #136

@Thatoo
Copy link
Author

Thatoo commented Jul 30, 2019

Withe the PR of @gnouts, #119 and mine, #136, it is possible to have this server_name option at install.
With the .well-known solution, it is working out of the box, without any need of registering any SRV record into DNS.
Once our PR merged, this comment could be closed.
Thank you @gnouts for starting the job.

@Josue-T
Copy link

Josue-T commented Oct 31, 2019

Closed by #119

@Josue-T Josue-T closed this as completed Oct 31, 2019
@Josue-T Josue-T mentioned this issue Dec 1, 2019
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants