forked from coracle/caravel
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 95f9f0c0bf |
@@ -63,9 +63,9 @@ Tenants are customers of the service, identified by a nostr `pubkey`. Public met
|
||||
|
||||
A relay is a nostr relay owned by a `tenant` and hosted by the attached zooid instance. Relay subdomains MUST be unique.
|
||||
|
||||
- `id` - calculated based on `subdomain` + 8 random hex chars
|
||||
- `id` - a random ID identifying the relay
|
||||
- `tenant` - the tenant's pubkey
|
||||
- `schema` - the relay's db schema (read only, same as `id`)
|
||||
- `schema` - the relay's db schema (read_only, calculated based on `subdomain` + `id`)
|
||||
- `subdomain` - the relay's subdomain
|
||||
- `plan` - the relay's plan
|
||||
- `stripe_subscription_item_id` (nullable) - the Stripe subscription item id. Only set for relays on paid plans.
|
||||
|
||||
+5
-8
@@ -275,6 +275,9 @@ impl Api {
|
||||
return Err(RelayValidationError::PremiumFeature);
|
||||
}
|
||||
|
||||
if relay.schema.is_empty() {
|
||||
relay.schema = format!("{}_{}", relay.subdomain.replace('-', "_"), relay.id);
|
||||
}
|
||||
if relay.status.is_empty() {
|
||||
relay.status = RELAY_STATUS_ACTIVE.to_string();
|
||||
}
|
||||
@@ -751,16 +754,10 @@ async fn create_relay(
|
||||
let auth = state.api.extract_auth_pubkey(&headers)?;
|
||||
state.api.require_admin_or_tenant(&auth, &payload.tenant)?;
|
||||
|
||||
let relay_id = format!(
|
||||
"{}_{}",
|
||||
payload.subdomain.replace('-', "_"),
|
||||
&uuid::Uuid::new_v4().simple().to_string()[..8]
|
||||
);
|
||||
|
||||
let mut relay = Relay {
|
||||
id: relay_id.clone(),
|
||||
id: uuid::Uuid::new_v4().to_string(),
|
||||
tenant: payload.tenant,
|
||||
schema: relay_id.clone(),
|
||||
schema: String::new(),
|
||||
subdomain: payload.subdomain,
|
||||
plan: payload.plan,
|
||||
stripe_subscription_item_id: None,
|
||||
|
||||
@@ -5,9 +5,6 @@ dev:
|
||||
cd frontend && bun dev &
|
||||
wait
|
||||
|
||||
dev-backend:
|
||||
cd backend && onchange src -ik -- bash -c 'RUST_LOG=backend=info cargo run'
|
||||
|
||||
dev-frontend:
|
||||
cd frontend && bun run dev
|
||||
|
||||
@@ -30,7 +27,7 @@ build-backend:
|
||||
cd backend && cargo build
|
||||
|
||||
build-frontend:
|
||||
cd frontend && bun i && bun run build
|
||||
cd frontend && bun run build
|
||||
|
||||
fmt: fmt-backend
|
||||
|
||||
|
||||
Reference in New Issue
Block a user