Switch MUC domain to kosmos.chat #99

Closed
opened 2019-09-18 09:44:29 +00:00 by raucao · 8 comments
Owner

We were finally able to register the domain kosmos.chat. So we can use it as MUC domain now.

And perhaps we should also deploy a nice static page to it, explaining things to users that end up on it. Or at least a redirect to a wiki page I guess.

We were finally able to register the domain `kosmos.chat`. So we can use it as MUC domain now. And perhaps we should also deploy a nice static page to it, explaining things to users that end up on it. Or at least a redirect to a wiki page I guess.
greg self-assigned this 2019-09-18 16:38:59 +00:00
Owner

I was able to try this in a VM and found a way to migrate the room data (options and affiliations) to the new host:

$ sudo su - ejabberd
$ psql
ejabberd=> update muc_room set host = 'kosmos.chat' where host = 'chat.kosmos.org';

We don't have so many rooms for now, so I think using commands like these after the migration to invite users to the rooms they were in will be manageable:

https://docs.ejabberd.im/admin/ejabberdctl/muc-admin/#invite-several-users-to-a-muc-room

I have set up a DNS entry for kosmos.chat leading to andromeda's IP.

I think we can do the migration tomorrow, what do you think?

I was able to try this in a VM and found a way to migrate the room data (options and affiliations) to the new host: ```bash $ sudo su - ejabberd $ psql ejabberd=> update muc_room set host = 'kosmos.chat' where host = 'chat.kosmos.org'; ``` We don't have so many rooms for now, so I think using commands like these after the migration to invite users to the rooms they were in will be manageable: https://docs.ejabberd.im/admin/ejabberdctl/muc-admin/#invite-several-users-to-a-muc-room I have set up a DNS entry for kosmos.chat leading to andromeda's IP. I think we can do the migration tomorrow, what do you think?
Author
Owner

Sounds good to me.

Sounds good to me.
Owner

I have added the kosmos.chat domain to the Let's Encrypt cert, so there should not be anything to do for TLS for the migration:

$ sudo su -
# /usr/bin/certbot certonly --manual --preferred-challenges dns --manual-public-ip-logging-ok --agree-tos --manual-auth-hook "/root/gandi_dns_certbot_hook.sh auth" --manual-cleanup-hook "/root/gandi_dns_certbot_hook.sh cleanup" --deploy-hook "/etc/letsencrypt/renewal-hooks/post/ejabberd" --email ops@kosmos.org -d kosmos.org -d xmpp.kosmos.org -d chat.kosmos.org -d kosmos.chat -n
--expand

Migration checklist:

  • Edit /opt/ejabberd/conf/ejabberd.yml, change line 271 from host: "chat.@HOST@" to host: "kosmos.chat"
  • sudo systemctl disable ejabberd.service to avoid systemd restarting the service
  • sudo /opt/ejabberd-19.02/bin/ejabberdctl stop_kindly 120 "The server will stop in 2 minutes to switch the rooms to the kosmos.chat domain."
  • Migrate the room configs in the database:
$ sudo su - ejabberd
$ psql
ejabberd=> update muc_room set host = 'kosmos.chat' where host = 'chat.kosmos.org';
  • sudo systemctl enable ejabberd.service; sudo systemctl start ejabberd.service to start the service again
  • Run the PR (feature/99-kosmos_chat_muc branch) on andromeda for the ejabberd config and on barnard to get the hubots to join the rooms on the new domain
  • Invite users to the channels on the new host
    [..]
  • Migrate the MAM history for the rooms: ```
    $ sudo su - ejabberd
    $ psql
    ejabberd=> update archive set username = 'test@kosmos.chat' where username='test@chat.kosmos.org';`
I have added the kosmos.chat domain to the Let's Encrypt cert, so there should not be anything to do for TLS for the migration: ``` $ sudo su - # /usr/bin/certbot certonly --manual --preferred-challenges dns --manual-public-ip-logging-ok --agree-tos --manual-auth-hook "/root/gandi_dns_certbot_hook.sh auth" --manual-cleanup-hook "/root/gandi_dns_certbot_hook.sh cleanup" --deploy-hook "/etc/letsencrypt/renewal-hooks/post/ejabberd" --email ops@kosmos.org -d kosmos.org -d xmpp.kosmos.org -d chat.kosmos.org -d kosmos.chat -n --expand ``` Migration checklist: * [x] Edit `/opt/ejabberd/conf/ejabberd.yml`, change line 271 from `host: "chat.@HOST@"` to `host: "kosmos.chat"` * [x] `sudo systemctl disable ejabberd.service` to avoid systemd restarting the service * [x] `sudo /opt/ejabberd-19.02/bin/ejabberdctl stop_kindly 120 "The server will stop in 2 minutes to switch the rooms to the kosmos.chat domain."` * [x] Migrate the room configs in the database: ```bash $ sudo su - ejabberd $ psql ejabberd=> update muc_room set host = 'kosmos.chat' where host = 'chat.kosmos.org'; ``` * [x] `sudo systemctl enable ejabberd.service; sudo systemctl start ejabberd.service` to start the service again * [x] Run the PR (feature/99-kosmos_chat_muc branch) on andromeda for the ejabberd config and on barnard to get the hubots to join the rooms on the new domain * [x] Invite users to the channels on the new host [..] * [x] Migrate the MAM history for the rooms: ``` $ sudo su - ejabberd $ psql ejabberd=> update archive set username = 'test@kosmos.chat' where username='test@chat.kosmos.org';`
Author
Owner

Not sure where the invitation lists are from, but they're definitely not complete. Also, this is a public repo. Please don't post JIDs to public repos. Especially not of private rooms (and also in public rooms, they're only visible to mods by default).

Not sure where the invitation lists are from, but they're definitely not complete. Also, this is a public repo. Please don't post JIDs to public repos. Especially not of private rooms (and also in public rooms, they're only visible to mods by default).
Author
Owner

Update: I edited your comment to remove the JIDs.

Update: I edited your comment to remove the JIDs.
galfert was assigned by greg 2019-09-26 13:04:16 +00:00
Owner

Migration is all done.

Migration is all done.
Author
Owner

I think we need a notice that actually explains to users why their chat rooms are all inactive and how to rejoin. Invitations aren't synced across devices. I had to manually re-add all rooms on my desktop for example.

I think we need a notice that actually explains to users why their chat rooms are all inactive and how to rejoin. Invitations aren't synced across devices. I had to manually re-add all rooms on my desktop for example.
raucao reopened this issue 2019-09-26 16:58:02 +00:00
Author
Owner

Doing this manually.

Doing this manually.
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kosmos/chef#99
No description provided.