SetCloudMode enables cloud mode with the shared sidecar secret(s). Accepts a comma-separated list of secrets for rotation support: "new-key,old-key" — both are accepted for INBOUND calls from pad-cloud. The OUTBOUND direction (pad → pad-cloud, see SetCloudSidecar) is configured separately via PAD_CL
(secret string)
| 591 | // configured separately via PAD_CLOUD_OUTBOUND_SECRET or derived from the |
| 592 | // last entry of this list — see cmd/pad/main.go for the resolution order. |
| 593 | func (s *Server) SetCloudMode(secret string) { |
| 594 | s.cloudMode = true |
| 595 | for _, k := range strings.Split(secret, ",") { |
| 596 | k = strings.TrimSpace(k) |
| 597 | if k != "" { |
| 598 | s.cloudSecrets = append(s.cloudSecrets, k) |
| 599 | } |
| 600 | } |
| 601 | // Propagate to the email sender so transactional emails carry the |
| 602 | // getpad.dev marketing footer (docs/brand.md §7) on Cloud installs. |
| 603 | // Self-hosted deployments leave cloudMode false on the sender, keeping |
| 604 | // outgoing mail neutral so operators can ship under their own brand. |
| 605 | if s.email != nil { |
| 606 | s.email.SetCloudMode(true) |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | // CloudSidecar is the reverse pad → pad-cloud client interface. Concrete |
| 611 | // implementation lives in internal/billing so server has no direct Stripe |
no outgoing calls