Repository navigation
Add a Firebase-free GoDesk SMS self-hosted slice - #2
Conversation
Serve local email/password auth, optional OIDC, and an httpsms-shaped send and webhook API that talks to SMS Gateway for Android on the LAN. Ship Postgres migrations, a Traefik compose file, and a small dashboard. Co-authored-by: Admin <GoDeskio@users.noreply.github.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Summary
Adds a self-hosted GoDesk SMS vertical slice that does not use Firebase or any other Google service.
Architecture choice is Option B, local server mode, documented in
docs/godesk-sms-architecture.md.api.sms-gate.appand FCM, uses MariaDB, and speaks the SMSGate API. It does not meet the no-Firebase rule.This PR is against
mainand does not include the Android release-APK work in #1. The existing httpSMS API and Nuxt app stay in the tree for the current Firebase deployment.docker-compose.selfhosted.ymldoes not start them.What works
docker-compose.selfhosted.yml: Traefik publishes only 80 and 443. Postgres 16 and the API have no host ports. Traefik labels routeGODESK_HOST..env.examplehas placeholders only (change-me,godesk.localhost). No private hostnames or secrets.x-api-key). Optional OIDC authorization-code + PKCE whenOIDC_ISSUERis set (Authentik-compatible).sms:received|sent|delivered|failedwebhooks on the phone.POST /v1/messages/sendwithfrom,to,contentandx-api-keyselects the matching device and POSTs to the phone.POST /v1/gateway/events/{token}stores an inbound SMS and fans out a CloudEventsmessage.phone.receivedwebhook (X-Event-Type, optional Bearer JWT). Duplicate gateway message ids are not delivered twice.fromselects the phone. Postgres migrations run on startup./for signup, login, devices, send, and webhooks.Test plan
cd selfhosted && go test ./...(in-memory store, auth, gateway client, URL checks, HTTP vertical slice)DATABASE_URL=postgres://godesk:godesk@127.0.0.1:5432/godesk?sslmode=disable go test ./internal/store/pgagainst local PostgreSQL 16 (migrations, user create)docker compose -f docker-compose.selfhosted.yml up— Docker is not available in this environment/and asserting the HTML contains "GoDesk SMS"Secrets and manual steps
cp .env.example .envand replacePOSTGRES_PASSWORDandJWT_SECRET(at least 32 characters). OptionalCREDENTIALS_KEYseals device passwords; otherwiseJWT_SECRETis used.PUBLIC_URLandGODESK_HOSTto the LAN name phones and browsers will use.http://godesk.localhostis only a generic default.http://127.0.0.1. Other phones need HTTPS. Traefik's 443 listener currently uses Traefik's default certificate. Install a trusted cert on the phone, or bring your own TLS (still remaining work).PUBLIC_URL.OIDC_ISSUER,OIDC_CLIENT_ID,OIDC_CLIENT_SECRET, andOIDC_REDIRECT_URL. New OIDC users get a random password, so password login is not available for those accounts..env, keystores, or certificates.Remaining work
web/off Firebase and onto this login, and retire the small dashboard.