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

How to add welcome message in k8s environment #56

Open
erezo9 opened this issue Aug 6, 2020 · 2 comments · May be fixed by #126
Open

How to add welcome message in k8s environment #56

erezo9 opened this issue Aug 6, 2020 · 2 comments · May be fixed by #126
Labels
Type/Question Further information is requested

Comments

@erezo9
Copy link

erezo9 commented Aug 6, 2020

Hi,
How can i add a welcome message in a k8s environment?
I can control the plugin using mattermost cli, but the config.json management is a bit of an issue to edit cause it will not save in the db

@levb levb added Type/Enhancement New feature or improvement of existing feature Type/Question Further information is requested and removed Type/Enhancement New feature or improvement of existing feature labels Aug 18, 2020
@nicolas-goudry
Copy link

@erezo9 I’m using the operator and had to setup the welcome bot directly in database.

First, get the current configuration from database (you’ll need mysql client and jq):

$ mysql -h [host] -u [user] -p -N -B [database] -e "SELECT Value FROM Configurations WHERE Active = 1;" | sed 's/\\n//g' | jq . > mm-config.json

Edit the configuration file to setup the welcome bot as you wish, then save back the JSON as a one-liner to be saved in db:

$ cat mm-config.json | sed -z 's/\n/\\n/g;s/"/\\"/g;s/\\n$//' > mm-config-oneline.json

Finally, update configuration in database:

mysql -h [host] -u [user] -p -N -B [database] -e "UPDATE Configurations SET Active = NULL WHERE Active = 1;INSERT INTO Configurations (Id, Value, CreateAt, Active) VALUES (\"`uuidgen | base32 | cut -c 1-26 | tr '[:upper:]' '[:lower:]'`\", \"`cat mm-config-oneline.json`\", `date +%s%N`, 1);"

It’s not ideal, but it works (or seems to).

@Kshitij-Katiyar
Copy link
Contributor

@erezo9 @nicolas-goudry We have an open PR to add the plugin configuration for the welcome bot plugin outside the server config.json file and through the plugin configuration. So I think that should solve the issue you are having.
#126
cc: @mickmister We can close this issue after merging this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type/Question Further information is requested
Projects
None yet
4 participants