Tenant Setup Guide
How to create and configure a new SlopDrop tenant. Use the admin dashboard at admin.slopdrop.dev for tenant creation and visibility management. WAF and Access app configuration is still manual.
Step 1: Create Tenant
Option A: Admin dashboard (preferred)
- Go to
admin.slopdrop.dev/tenants/new - Enter slug, name, plan
- Submit
Option B: D1 directly
cd packages/api
npx wrangler d1 execute slopdrop --remote --command \
"INSERT INTO tenants (id, slug, name, plan, created_at) \
VALUES ('tenant_<slug>', '<slug>', '<Display Name>', 'free', datetime('now'))"
Replace <slug> with the tenant identifier (lowercase, alphanumeric, hyphens). This becomes the subdomain: <slug>.slopdrop.dev.
Verify:
npx wrangler d1 execute slopdrop --remote --command \
"SELECT slug, name, plan FROM tenants"
Step 2: Add to WAF Allowlist
The WAF custom rule blocks all subdomains not in the allowlist. Add the new tenant:
- Cloudflare Dashboard → Security → WAF → Custom Rules
- Edit the "Block unknown subdomains" rule
- Add:
AND Hostname does not equal {slug}.slopdrop.dev - Save
Without this step, requests to {slug}.slopdrop.dev are blocked at the WAF layer and never reach the Worker.
Step 3: Configure Cloudflare Access
Each tenant subdomain needs a Cloudflare Access application to control who can view rendered documents.
- Go to Cloudflare Zero Trust Dashboard
- Access → Applications → Add an application
- Type: Self-hosted
- Application name:
SlopDrop - <Tenant Name> - Subdomain:
<slug>.slopdrop.dev - Session duration: 24 hours (or your preference)
Access Policy
Add an Allow policy with rules for who can access:
| Rule Type | Value | Use Case |
|---|---|---|
user@example.com |
Specific person | |
| Emails ending in | @company.com |
Whole domain |
| Access Group | Group name | Reusable group |
Authentication Method
Recommended: Google OAuth (any Google account, not limited to Workspace).
Setup:
- GCP Console → APIs & Credentials → Create OAuth Client ID (Web application)
- Redirect URI:
https://<team>.cloudflareaccess.com/cdn-cgi/access/callback - Cloudflare Zero Trust → Settings → Authentication → Add Google → paste Client ID + Secret
Alternative: One-time PIN (less secure — codes can be shared).
Step 4: Set Visibility
By default, tenants are private — they require a valid Cloudflare Access JWT. The Worker verifies this cryptographically.
To make a tenant public (e.g. for documentation):
- Go to
admin.slopdrop.dev/tenants - Click the visibility toggle for the tenant
Or via D1:
npx wrangler d1 execute slopdrop --remote --command \
"UPDATE tenants SET is_public = 1 WHERE slug = '<slug>'"
Step 5: User Login
Once the tenant and Access policy exist, users authenticate via the CLI:
slop login --tenant <slug>
This opens the browser, goes through Cloudflare Access authentication, and stores a local API token.
Step 6: Configure Global Watch (Optional)
Add the tenant to ~/.slop/global.yaml for automatic file syncing:
projects:
- tenant: <slug>
project: <project-name>
ignore: ["node_modules/**", ".git/**"]
sources:
- path: ~/path/to/docs
patterns: ["**/*.md"]
Then: slop watch --global --initial-sync
Automation Roadmap
The manual steps above will be replaced with:
slop admin create-tenant <slug> \
--name "Display Name" \
--emails "admin@company.com" \
--domain "@company.com"
This would:
- Insert tenant into D1
- Create Cloudflare Access application via API
- Configure Access policy with specified emails/domains
- Output the tenant URL and next steps