Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Refactor local SSO testing guide to use real domain example.com (#6667)

Artur Pata6a9e3f06462c
diff --git a/Makefile b/Makefile
index ca8037a3a5..6e103cfc70 100644
--- a/Makefile
+++ b/Makefile
@@ -67,14 +67,15 @@ minio: ## Start a transient container with a recent version of minio (s3)
minio-stop: ## Stop and remove the minio container
docker stop plausible_minio
+sso: server_url ?= http://localhost:8000
sso:
$(call require, integration_id)
- @echo "Setting up local IdP service..."
+ @echo "Setting up local IdP service for Plausible running at $(server_url)..."
@docker run --name=idp \
-p 8080:8080 \
- -e SIMPLESAMLPHP_SP_ENTITY_ID=http://localhost:8000/sso/$(integration_id) \
- -e SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE=http://localhost:8000/sso/saml/consume/$(integration_id) \
- -v $$PWD/extra/fixture/authsources.php:/var/www/simplesamlphp/config/authsources.php -d kenchan0130/simplesamlphp
+ -e SIMPLESAMLPHP_SP_ENTITY_ID=$(server_url)/sso/$(integration_id) \
+ -e SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE=$(server_url)/sso/saml/consume/$(integration_id) \
+ -v $$PWD/extra/fixture/authsources.php:/var/www/simplesamlphp/config/authsources.php:ro -d kenchan0130/simplesamlphp
@sleep 2
@@ -89,15 +90,15 @@ sso:
@echo ""
@echo ""
@echo "Following accounts are configured:"
- @echo "- [email protected] / plausible"
- @echo "- [email protected] / plausible"
- @echo "- [email protected] / plausible"
+ @echo "- [email protected] / plausible"
+ @echo "- [email protected] / plausible"
+ @echo "- [email protected] / plausible"
@echo ""
- @echo "Run plausible application server with ALLOW_RESERVED_IPS=true"
+ @echo "Add 'example.com' as the SSO domain, then verify it with:"
+ @echo " make mock-dns domain_id=<identifier shown next to the domain>"
sso-stop:
- docker stop idp
- docker remove idp
+ docker stop idp && docker rm idp
generate-corefile:
$(call require, domain_id)
diff --git a/extra/fixture/Corefile.template b/extra/fixture/Corefile.template
index 361d96bb70..f910169cac 100644
--- a/extra/fixture/Corefile.template
+++ b/extra/fixture/Corefile.template
@@ -1,6 +1,6 @@
. {
bind 0.0.0.0
- template IN TXT plausible.test {
+ template IN TXT example.com {
answer "{{ .Name }} 60 IN TXT \"plausible-sso-verification=${domain_id}\""
fallthrough
}
diff --git a/extra/fixture/authsources.php b/extra/fixture/authsources.php
index 35d8649e1b..e5801b7bdb 100644
--- a/extra/fixture/authsources.php
+++ b/extra/fixture/authsources.php
@@ -6,18 +6,18 @@ $config = [
],
'example-userpass' => [
'exampleauth:UserPass',
- '[email protected]:plausible' => [
- 'email' => '[email protected]',
+ '[email protected]:plausible' => [
+ 'email' => '[email protected]',
'first_name' => 'Jane',
'last_name' => 'Smith'
],
- '[email protected]:plausible' => [
- 'email' => '[email protected]',
+ '[email protected]:plausible' => [
+ 'email' => '[email protected]',
'first_name' => 'Lenny',
'last_name' => 'Carr'
],
- '[email protected]:plausible' => [
- 'email' => '[email protected]',
+ '[email protected]:plausible' => [
+ 'email' => '[email protected]',
'first_name' => 'Jane',
'last_name' => 'Doorwell'
],