A backend service to gatekeep Pubky Homeserver signups.
The Pubky social media app uses Homegate to gatekeep signups. Check out https://pubky.app/onboarding/human (use a private browser window if you have an active session).
This service depends on
See .env.example for a description of which values you need to put in a .env file.
Then:
cargo run
This code generates a secret which is written to local disk at /.homegate/pepper.txt.
If this value is lost then you lose the ability to match phone numbers which have been already verified to phone numbers of new verification requests - this is turn means that the verification limits will not be enforced.
We use Prelude for SMS verification. Keep in mind that each phone number:
- Has a maximum of 10 verifications.
- Has a single pending verification at a time. Multiple
send_codecalls reuse the existing session.
We use phoenixd for Lightning Payment verifications.
Tests require a PostgreSQL connection string for database integration tests:
# Run all tests
DATABASE_URL=postgres://postgres:postgres@localhost:5432/pubky_homegate?pubky-test=true cargo test
# Run only E2E HTTP tests
DATABASE_URL=postgres://postgres:postgres@localhost:5432/pubky_homegate?pubky-test=true cargo test --lib e2e::- Unit Tests: IP extraction logic (
src/http_server/routes/sms_verification.rs) - Service Tests: Business logic and database operations (
src/sms_verification/tests.rs) - E2E Tests: Full HTTP integration tests (
src/e2e/)