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

Apt upgrade resets config #9111

Closed
sualko opened this issue Apr 16, 2020 · 16 comments
Closed

Apt upgrade resets config #9111

sualko opened this issue Apr 16, 2020 · 16 comments

Comments

@sualko
Copy link
Contributor

sualko commented Apr 16, 2020

Describe the bug
After installing the latest patches (2.2.3 -> 2.2.5) via apt, all some of my custom configuration (like TURN server, default presentation, ...) is gone.

I discovered the following changes:

  • TURN/STUN config reset
  • /var/www/bigbluebutton-default/default.pdf overwritten

To Reproduce
Steps to reproduce the behavior:

  1. Install via package manager
  2. Make some modifications to stun/turn server config
  3. Update package

Expected behavior
Config is not overwritten.

Actual behavior
Config is overwritten.

Additional context
I'm not sure if this is the right place, but I didn't find a package repo.

@ffdixon
Copy link
Member

ffdixon commented Apr 16, 2020

To prevent your changes from being overwritten, see

http://docs.bigbluebutton.org/2.2/customize.html#automatically-apply-configuration-changes-on-restart

@sualko
Copy link
Contributor Author

sualko commented Apr 16, 2020

That's a crazy workaround. Where is the usual "the source file was modified" dialog during upgrade?

Maybe #9085 would be a good idea.

@KimBrodowski
Copy link

KimBrodowski commented Apr 16, 2020

For this to work you'd need to specify the presentation as a config file in the Debian package bbb-config. Alternatively you can make the post install script copy the file to its final destination under certain conditions such as a matching checksum.

Unfortunately BBB isn't really great about respecting the Unix directory structure (log files in /usr/share etc.) or Debian Policy at this moment. I hope we'll see some improvements there in the future. I'm really happy with many other aspects of BBB.

@sualko
Copy link
Contributor Author

sualko commented Apr 16, 2020

Unfortunately BBB isn't really great about respecting the Unix directory structure (log files in /usr/share etc.) or Debian Policy at this moment. I hope we'll see some improvements there in the future. I'm really happy with many other aspects of BBB.

I would like to help, but I have no clue where to begin.

@ichdasich
Copy link

As apparently not all configuration options are affected by this, would it be possible to get an exhaustive list of what is and is not affected?

@ffdixon
Copy link
Member

ffdixon commented Apr 16, 2020

@sualko Guilty as charged!

The whole directory structure for BigBlueButton has evolved over the past 10 years of development. We need to do a Great Cleanup at some point, which we'll probably do a bit in BigBlueButton 2.3 (which will be on Ubuntu 18.04).

@sualko
Copy link
Contributor Author

sualko commented Apr 16, 2020

As apparently not all configuration options are affected by this, would it be possible to get an exhaustive list of what is and is not affected?

I can't provide such a list, because I didn't change all values, but the above link to the documentation should give a good first impression. We would have more insides if we could look at the packaging, but I'm not expert in this field.

The whole directory structure for BigBlueButton has evolved over the past 10 years of development.

I understand this and I think the same happend to the repository structure. Would love to see multiple repos, instead one giant mono repo, but I understand that this doesn't have priority.

@basisbit
Copy link
Collaborator

basisbit commented Apr 16, 2020

as a suggestion: the apply-config.sh script should contain all the non-default configuration of bbb and bbb related software. This way, after an apt upgrade you only have to run bbb-config --restart and your system should/might be ready to go again. This is a ridiculously error prone approach, but currently the best we got. We can't see what config files got replaced by the package upgrade and also weren't asked by apt to compare and decide for apt what to do.
Sadly, the bbb deb package build config seems to be kind of a business secret of the main developers, so there is no way for us to help improve the packaging.

Here some samples of the apply-config.sh which I use:

sed -i 's/appLogLevel=.*/appLogLevel=Error/g' /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
sed -i 's/defaultWelcomeMessage=.*/defaultWelcomeMessage=Welcome to <b>%%CONFNAME%%<\/b>!<br>some sample text <a href="event:http:\/\/www.bigbluebutton.org\/html5"><u>link text<\/u><\/a>.<br><br>Other stuff/g' /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
sed -i 's/defaultWelcomeMessageFooter=.*/defaultWelcomeMessageFooter=This server runs on muffins! <a href="https:\/\/your-website.tld\/" target="_blank"><u>your website name<\/u><\/a>./g' /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
sed -i 's/defaultMaxUsers=.*/defaultMaxUsers=100/g' /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
sed -i 's/defaultMeetingDuration=.*/defaultMeetingDuration=720/g' /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
sed -i 's/maxInactivityTimeoutMinutes=.*/maxInactivityTimeoutMinutes=35/g' /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
sed -i 's/warnMinutesBeforeMax=.*/warnMinutesBeforeMax=5/g' /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
sed -i 's/meetingExpireIfNoUserJoinedInMinutes=.*/meetingExpireIfNoUserJoinedInMinutes=5/g' /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
sed -i 's/meetingExpireWhenLastUserLeftInMinutes=.*/meetingExpireWhenLastUserLeftInMinutes=1/g' /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
sed -i 's/userInactivityThresholdInMinutes=.*/userInactivityThresholdInMinutes=30/g' /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
sed -i 's/userActivitySignResponseDelayInMinutes=.*/userActivitySignResponseDelayInMinutes=0/g' /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
sed -i 's/disableRecordingDefault=.*/disableRecordingDefault=true/g' /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
sed -i 's/keepEvents=.*/keepEvents=false/g' /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
sed -i 's/breakoutRoomsRecord=.*/breakoutRoomsRecord=false/g' /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
yq w -i /usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml public.kurento.cameraProfiles.[0].name 'Low'
yq w -i /usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml public.kurento.cameraProfiles.[1].name 'Normal'
yq w -i /usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml public.kurento.cameraProfiles.[2].name 'High (only participants)'
yq w -i /usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml public.kurento.cameraProfiles.[3].name 'High (only presenters)'
cp /var/www/bigbluebutton-default/index_modified.html /var/www/bigbluebutton-default/index.html
cp /var/www/bigbluebutton-default/default_modified.pdf /var/www/bigbluebutton-default/default.pdf
cp /var/www/bigbluebutton-default/default_modified.pptx /var/www/bigbluebutton-default/default.pptx
cp /var/www/bigbluebutton-default/images/favicon_modified.ico /var/www/bigbluebutton-default/images/favicon.ico
sed -i 's/stun:stun.freeswitch.org/stun:stun.t-online.de/g' /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml

@sualko
Copy link
Contributor Author

sualko commented Apr 17, 2020

Because I always forget the exact path of most config files, I created some hard links inside /etc and with the help of etckeeper, I think I can recover my changes the next time.

#!/bin/sh

mkdir /etc/bigbluebutton/general
cd /etc/bigbluebutton/general
ln /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml .
ln /usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml meteor-settings.yml
ln /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties .
ln  /opt/freeswitch/etc/freeswitch/autoload_configs/conference.conf.xml .

Of course this only works if everything is on one partition.

@sualko
Copy link
Contributor Author

sualko commented Apr 27, 2020

Ok, the hard link approach didn't work, because the config was deleted (new inode number)...

@alexanderjackson
Copy link

@ffdixon Is it really necessary to silently overwrite /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml?

Current post install settings from bbb-web_XXX_amd64.deb:

cat postinst
[...]
        #
        # Propagate settings for TURN server
        if [ -f /tmp/turn-stun-servers.xml ]; then
                cp /tmp/turn-stun-servers.xml $SERVLET_DIR/WEB-INF/classes/sping 
                mv /tmp/turn-stun-servers.xml /tmp/turn-stun-servers.xml_
        fi
[...]

Maybe changing it like this could solve the issue:

[...]
        #
        # Propagate settings for TURN server
        if [ ! -f $SERVLET_DIR/WEB-INF/classes/spring/turn-stun-servers.xml ]; then
                if [ -f /tmp/turn-stun-servers.xml ]; then
                        cp /tmp/turn-stun-servers.xml $SERVLET_DIR/WEB-INF/classes/sping 
                        mv /tmp/turn-stun-servers.xml /tmp/turn-stun-servers.xml_
                fi
        fi
[...]

I haven't tested this. If my assumption is correct, this would check if $SERVLET_DIR/WEB-INF/classes/spring/turn-stun-servers.xml exists. If it does, it skips copying the shipped turn-stun-servers.xml and leaves the custom/existing turn config in place.

Also it seems like there is a typo in the original sources at cp /tmp/turn-stun-servers.xml $SERVLET_DIR/WEB-INF/classes/sping. Shouldn't it be cp /tmp/turn-stun-servers.xml $SERVLET_DIR/WEB-INF/classes/spring/ instead?

The file at /usr/share/bbb-web/WEB-INF/classes/sping seems to be a copy of our previous (custom) turn-stun-servers.xml which is overwritten at /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml. This seems odd..

@matiasilva
Copy link
Collaborator

No new activity for two months. Is there still interest in this? The 2.3 beta is expected to come out later this summer, which as mentioned above might address this issue. Another suggestion I can give is to use Ansible to customize your installation. This way, you not only have a record of all the custom tweaks you have made, but it also overwrites and installs BBB exactly the way you want it over and over again, reliably.

@basisbit
Copy link
Collaborator

Does an issue exist for publicly tracking the work on BBB packaging? If yes, please link that issue here and close this one.

@matiasilva
Copy link
Collaborator

See #8978 which has links to other related issues. Adding this unofficial repo too for reference: https://github.com/bbb-pkg

@ffdixon
Copy link
Member

ffdixon commented Jun 15, 2020

We made an update to the packaging recently to back/restore turn-stun-servers.xml. If you update to a latest release 2.2.x, this file should not get overwritten.

@ffdixon
Copy link
Member

ffdixon commented Oct 22, 2020

Also it seems like there is a typo in the original sources at cp /tmp/turn-stun-servers.xml $SERVLET_DIR/WEB-INF/classes/sping. Shouldn't it be cp /tmp/turn-stun-servers.xml $SERVLET_DIR/WEB-INF/classes/spring/ in
stead?

After the commend in #10698 we took a second look and found the above bug. Fixed it for 2.2.29.

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

No branches or pull requests

7 participants