Discourse_docker: discourse-setup makes sed parse SMTP password

At least mostly. Here’s what read_config looks like now. The sed replacement mostly fixes up stuff that needs to be escaped.

read_config() {
  config_line=`egrep "^  #?$1:" $web_file`
  read_config_result=`echo $config_line | awk  --field-separator=":" '{print $2}'`
  read_config_result=`echo $read_config_result | sed "s/^\([\"']\)\(.*\)\1\$/\2/g"`
}

I think it now works at least with characters likely to be in a password. I don’t think I’ve seen any complaints about wonky passwords breaking discourse-setup in a long while.

I don’t consider this much of a security issue, as it would require either the sysadmin of the Discourse server or the sysadmin of the mail server to be malicious.

2 лайка