|
|
@ -89,33 +89,45 @@ pushd /var/www/html/wp-content/uploads/civicrm/
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
popd
|
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
|
|
if [[ -n "${OPEN_ID_CLIENT_ID}" ]]; then
|
|
|
|
OPEN_ID_CLIENT_ID="${OPEN_ID_CLIENT_ID:-unused}"
|
|
|
|
|
|
|
|
if [ "$OPEN_ID_CLIENT_ID" != "unused" ]; then
|
|
|
|
# install OpenID Connect Generic plugin
|
|
|
|
# install OpenID Connect Generic plugin
|
|
|
|
if ! su civicrm -c "wp plugin is-installed daggerhart-openid-connect-generic"; then
|
|
|
|
if ! su civicrm -c "wp plugin is-installed daggerhart-openid-connect-generic"; then
|
|
|
|
echo "============ Running OpenId Connect Install ============"
|
|
|
|
echo "============ Running OpenId Connect Install ============"
|
|
|
|
su civicrm -c "wp plugin install daggerhart-openid-connect-generic --activate"
|
|
|
|
su civicrm -c "wp plugin install daggerhart-openid-connect-generic --activate"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
echo "OpenID Connect Generic Plugin already installed"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# if openid connect hasn't been configured, insert default settings
|
|
|
|
# if openid connect hasn't been configured, insert default settings
|
|
|
|
if ! su civicrm -c "wp option get openid_connect_generic_settings"; then
|
|
|
|
if ! su civicrm -c "wp option get openid_connect_generic_settings"; then
|
|
|
|
|
|
|
|
echo "Configuring OpenId Connect Plugin default settings"
|
|
|
|
su civicrm -c "wp option add openid_connect_generic_settings --format=json < /usr/local/etc/civicrm/openid_settings.json"
|
|
|
|
su civicrm -c "wp option add openid_connect_generic_settings --format=json < /usr/local/etc/civicrm/openid_settings.json"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
echo "OpenId Connect Plugin default settings already present"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "============ Configuring OpenId Connect ============"
|
|
|
|
echo "============ Configuring OpenId Connect ============"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings client_id $OPEN_ID_CLIENT_ID"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings client_id $OPEN_ID_CLIENT_ID"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings client_secret $OPEN_ID_CLIENT_SECRET"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings client_secret $OPEN_ID_CLIENT_SECRET"
|
|
|
|
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings link_existing_users 1"
|
|
|
|
|
|
|
|
|
|
|
|
if [[ -n "${AUTHENTIK_DOMAIN}" ]]; then
|
|
|
|
AUTHENTIK_DOMAIN="${AUTHENTIK_DOMAIN:-unused}"
|
|
|
|
|
|
|
|
if [ "$AUTHENTIK_DOMAIN" != "unused" ]; then
|
|
|
|
|
|
|
|
echo "============ Configuring Authentik ============"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_login https://$AUTHENTIK_DOMAIN/application/o/authorize/"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_login https://$AUTHENTIK_DOMAIN/application/o/authorize/"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_userinfo https://$AUTHENTIK_DOMAIN/application/o/userinfo/"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_userinfo https://$AUTHENTIK_DOMAIN/application/o/userinfo/"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_token https://$AUTHENTIK_DOMAIN/application/o/token/"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_token https://$AUTHENTIK_DOMAIN/application/o/token/"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_end_session https://$AUTHENTIK_DOMAIN/application/o/wordpress/end-session/"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_end_session https://$AUTHENTIK_DOMAIN/application/o/wordpress/end-session/"
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
echo "============ Configuring Generic OpenId Provider ============"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_login $OPEN_ID_PROVIDER_LOGIN_URL"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_login $OPEN_ID_PROVIDER_LOGIN_URL"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_userinfo $OPEN_ID_USERINFO_URL"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_userinfo $OPEN_ID_USERINFO_URL"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_token $OPEN_ID_TOKEN_ENDPOINT_URL"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_token $OPEN_ID_TOKEN_ENDPOINT_URL"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_end_session $OPEN_ID_END_SESSION_URL"
|
|
|
|
su civicrm -c "wp option patch update openid_connect_generic_settings endpoint_end_session $OPEN_ID_END_SESSION_URL"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
echo "not using OpenIdConnect"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "============ Setting up cron ============"
|
|
|
|
echo "============ Setting up cron ============"
|
|
|
|