Restore matrix user creation
This commit is contained in:
parent
0530ff8a73
commit
f1ae5ddd38
|
@ -86,10 +86,10 @@ function matrix_nginx {
|
||||||
echo ' index index.html;' >> $matrix_nginx_site
|
echo ' index index.html;' >> $matrix_nginx_site
|
||||||
echo '' >> $matrix_nginx_site
|
echo '' >> $matrix_nginx_site
|
||||||
echo ' # Location' >> $matrix_nginx_site
|
echo ' # Location' >> $matrix_nginx_site
|
||||||
echo ' location / {' >> $matrix_nginx_site
|
echo ' location /_matrix {' >> $matrix_nginx_site
|
||||||
function_check nginx_limits
|
function_check nginx_limits
|
||||||
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
|
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
|
||||||
echo " proxy_pass http://localhost:${MATRIX_PORT}/_matrix;" >> $matrix_nginx_site
|
echo ' proxy_pass http://localhost:8008;' >> $matrix_nginx_site
|
||||||
echo ' proxy_set_header X-Forwarded-For $remote_addr;' >> $matrix_nginx_site
|
echo ' proxy_set_header X-Forwarded-For $remote_addr;' >> $matrix_nginx_site
|
||||||
echo ' }' >> $matrix_nginx_site
|
echo ' }' >> $matrix_nginx_site
|
||||||
echo '}' >> $matrix_nginx_site
|
echo '}' >> $matrix_nginx_site
|
||||||
|
@ -116,10 +116,10 @@ function matrix_nginx {
|
||||||
echo ' index index.html;' >> $matrix_nginx_site
|
echo ' index index.html;' >> $matrix_nginx_site
|
||||||
echo '' >> $matrix_nginx_site
|
echo '' >> $matrix_nginx_site
|
||||||
echo ' # Location' >> $matrix_nginx_site
|
echo ' # Location' >> $matrix_nginx_site
|
||||||
echo ' location / {' >> $matrix_nginx_site
|
echo ' location /_matrix {' >> $matrix_nginx_site
|
||||||
function_check nginx_limits
|
function_check nginx_limits
|
||||||
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
|
nginx_limits ${MATRIX_DOMAIN_NAME} '15m'
|
||||||
echo " proxy_pass http://localhost:${MATRIX_ID_PORT};" >> $matrix_nginx_site
|
echo ' proxy_pass http://localhost:8008;' >> $matrix_nginx_site
|
||||||
echo ' proxy_set_header X-Forwarded-For $remote_addr;' >> $matrix_nginx_site
|
echo ' proxy_set_header X-Forwarded-For $remote_addr;' >> $matrix_nginx_site
|
||||||
echo ' }' >> $matrix_nginx_site
|
echo ' }' >> $matrix_nginx_site
|
||||||
echo '}' >> $matrix_nginx_site
|
echo '}' >> $matrix_nginx_site
|
||||||
|
@ -300,13 +300,18 @@ function remove_user_matrix {
|
||||||
function add_user_matrix {
|
function add_user_matrix {
|
||||||
new_username="$1"
|
new_username="$1"
|
||||||
new_user_password="$2"
|
new_user_password="$2"
|
||||||
|
is_admin_user='-a'
|
||||||
|
|
||||||
|
if [[ "$new_username" != "$MY_USERNAME" ]]; then
|
||||||
|
is_admin_user=''
|
||||||
|
fi
|
||||||
|
|
||||||
${PROJECT_NAME}-pass -u $new_username -a matrix -p "$new_user_password"
|
${PROJECT_NAME}-pass -u $new_username -a matrix -p "$new_user_password"
|
||||||
|
|
||||||
if [[ $ONION_ONLY == 'no' ]]; then
|
if [[ $ONION_ONLY == 'no' ]]; then
|
||||||
retval=$(register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" -a https://${MATRIX_DOMAIN_NAME})
|
retval=$(register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" $is_admin_user https://${MATRIX_DOMAIN_NAME})
|
||||||
else
|
else
|
||||||
retval=$(register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" -a http://${MATRIX_DOMAIN_NAME})
|
retval=$(register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" $is_admin_user http://${MATRIX_DOMAIN_NAME})
|
||||||
fi
|
fi
|
||||||
echo "0"
|
echo "0"
|
||||||
}
|
}
|
||||||
|
@ -783,10 +788,10 @@ function install_matrix {
|
||||||
function_check matrix_nginx
|
function_check matrix_nginx
|
||||||
matrix_nginx
|
matrix_nginx
|
||||||
|
|
||||||
#if [[ $(add_user_matrix "${MY_USERNAME}" "${MATRIX_PASSWORD}" | tail -n 1) != "0" ]]; then
|
if [[ $(add_user_matrix "${MY_USERNAME}" "${MATRIX_PASSWORD}" | tail -n 1) != "0" ]]; then
|
||||||
# echo $'Failed to add matrix admin user';
|
echo $'Failed to add matrix admin user';
|
||||||
# exit 879352
|
exit 879352
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
APP_INSTALLED=1
|
APP_INSTALLED=1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue