2018-09-20 14:03:23 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
HOST="${DOMAIN}"
|
|
|
|
[ "${PORT}" != "443" ] && HOST="${DOMAIN}:${PORT}"
|
2018-12-04 20:19:29 +01:00
|
|
|
sed -i "s|\(^\s\+\"backend_url\": \).*|\1\"https://ush.${HOST}/platform\",|" /srv/ushahidi/conf/config.json
|
2018-09-20 14:03:23 +02:00
|
|
|
API_URL="\"https:\\\/\\\/ush.${HOST}\\\/platform\\\/api\\\/v3\\\/config\\\/data-provider\""
|
|
|
|
QUERY="UPDATE \`config\` SET \`config_value\` = '${API_URL}' WHERE \`group_name\` LIKE 'data-provider' AND \`config_key\` LIKE 'url'"
|
|
|
|
lxc-attach mariadb -- mysql -e "${QUERY}" ushahidi
|
|
|
|
|
|
|
|
JSON="{\"incoming_type\":\"IMAP\",\"incoming_server\":\"localhost\",\"incoming_port\":143,\"incoming_security\":\"None\",\"incoming_username\":\"${EMAIL}\",\"incoming_password\":\"password\",\"outgoing_type\":\"SMTP\",\"outgoing_server\":\"host\",\"outgoing_port\":25,\"outgoing_security\":\"None\",\"outgoing_username\":\"${EMAIL}\",\"outgoing_password\":\"password\",\"from\":\"${EMAIL}\",\"from_name\":\"Ushahidi\"}"
|
|
|
|
QUERY="UPDATE \`config\` SET \`config_value\` = '${JSON}' WHERE \`group_name\` LIKE 'data-provider' AND \`config_key\` LIKE 'email'"
|
|
|
|
lxc-attach mariadb -- mysql -e "${QUERY}" ushahidi
|
|
|
|
QUERY="UPDATE \`config\` SET \`config_value\` = '\"${EMAIL}\"' WHERE \`group_name\` LIKE 'site' AND \`config_key\` LIKE 'email'"
|
|
|
|
lxc-attach mariadb -- mysql -e "${QUERY}" ushahidi
|
|
|
|
sed -i "s|\(^\s\+\"google_analytics_id\": \).*|\1\"${GMAPS_API_KEY}\"|" /srv/ushahidi/conf/config.json
|